diff options
47 files changed, 28250 insertions, 18405 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(©, {5, 10, 15, 20}); + original.extractSubset(©, {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(©, {5, 10, 15, 20}); + original.extractSubset(©, {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 ## . ## diff --git a/site/user/api/SkAutoCanvasRestore_Reference.md b/site/user/api/SkAutoCanvasRestore_Reference.md index 834518353b..cd8cd129e2 100644 --- a/site/user/api/SkAutoCanvasRestore_Reference.md +++ b/site/user/api/SkAutoCanvasRestore_Reference.md @@ -1,56 +1,83 @@ SkAutoCanvasRestore Reference === -# <a name="Automatic_Canvas_Restore"></a> Automatic Canvas Restore +# <a name='Automatic_Canvas_Restore'>Automatic Canvas Restore</a> -## <a name="Overview"></a> Overview +# <a name='SkAutoCanvasRestore'>Class SkAutoCanvasRestore</a> +Stack helper class calls <a href='SkCanvas_Reference#SkCanvas_restoreToCount'>SkCanvas::restoreToCount</a> when <a href='#SkAutoCanvasRestore'>SkAutoCanvasRestore</a> +goes out of scope. Use this to guarantee that the canvas is restored to a known +state. -## <a name="Overview_Subtopic"></a> Overview Subtopic +## Overview -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkAutoCanvasRestore">SkAutoCanvasRestore</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkAutoCanvasRestore'>SkAutoCanvasRestore</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> +</table> -# <a name="SkAutoCanvasRestore"></a> Class SkAutoCanvasRestore -Stack helper class calls <a href="SkCanvas_Reference#SkCanvas_restoreToCount">SkCanvas::restoreToCount</a> when <a href="#SkAutoCanvasRestore">SkAutoCanvasRestore</a> -goes out of scope. Use this to guarantee that the canvas is restored to a known -state. -## <a name="Constructor"></a> Constructor +## <a name='Constructor'>Constructor</a> -| name | description | -| --- | --- | -| <a href="#SkAutoCanvasRestore_SkCanvas_star">SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)</a> | preserves <a href="SkCanvas_Reference#Canvas">Canvas</a> save count | -| <a href="#SkAutoCanvasRestore_destructor">~SkAutoCanvasRestore()</a> | restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state | -## <a name="Member_Function"></a> Member Function +SkAutoCanvasRestore can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAutoCanvasRestore_SkCanvas_star'>SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preserves <a href='SkCanvas_Reference#Canvas'>Canvas</a> save count</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAutoCanvasRestore_destructor'>~SkAutoCanvasRestore()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>restores <a href='SkCanvas_Reference#Canvas'>Canvas</a> to saved state</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + -| name | description | -| --- | --- | -| <a href="#SkAutoCanvasRestore_restore">restore</a> | restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state | +SkAutoCanvasRestore member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAutoCanvasRestore_restore'>restore</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>restores <a href='SkCanvas_Reference#Canvas'>Canvas</a> to saved state</td> + </tr> +</table> -<a name="SkAutoCanvasRestore_SkCanvas_star"></a> + +<a name='SkAutoCanvasRestore_SkCanvas_star'></a> ## SkAutoCanvasRestore -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkAutoCanvasRestore(SkCanvas* canvas, bool doSave) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkAutoCanvasRestore'>SkAutoCanvasRestore</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* canvas, bool doSave) </pre> -Preserves <a href="SkCanvas_Reference#Canvas">Canvas</a> save count. Optionally saves <a href="SkCanvas_Reference#Clip">Canvas Clip</a> and <a href="SkCanvas_Reference#Matrix">Canvas Matrix</a>. +Preserves <a href='SkCanvas_Reference#Canvas'>Canvas</a> save count. Optionally saves <a href='SkCanvas_Reference#Clip'>Canvas Clip</a> and <a href='SkCanvas_Reference#Matrix'>Canvas Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkAutoCanvasRestore_SkCanvas_star_canvas"> <code><strong>canvas </strong></code> </a></td> <td> -<a href="SkCanvas_Reference#Canvas">Canvas</a> to guard</td> - </tr> <tr> <td><a name="SkAutoCanvasRestore_SkCanvas_star_doSave"> <code><strong>doSave </strong></code> </a></td> <td> -call <a href="SkCanvas_Reference#SkCanvas_save">SkCanvas::save()</a></td> +<table> <tr> <td><a name='SkAutoCanvasRestore_SkCanvas_star_canvas'><code><strong>canvas</strong></code></a></td> + <td><a href='SkCanvas_Reference#Canvas'>Canvas</a> to guard</td> + </tr> + <tr> <td><a name='SkAutoCanvasRestore_SkCanvas_star_doSave'><code><strong>doSave</strong></code></a></td> + <td>call <a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save()</a></td> </tr> </table> ### Return Value -utility to restore <a href="SkCanvas_Reference#Canvas">Canvas</a> state on destructor +utility to restore <a href='SkCanvas_Reference#Canvas'>Canvas</a> state on destructor ### Example @@ -58,35 +85,35 @@ utility to restore <a href="SkCanvas_Reference#Canvas">Canvas</a> state on destr ### See Also -<a href="SkCanvas_Reference#SkCanvas_save">SkCanvas::save</a> <a href="SkCanvas_Reference#SkCanvas_restore">SkCanvas::restore</a> +<a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save</a> <a href='SkCanvas_Reference#SkCanvas_restore'>SkCanvas::restore</a> --- -<a name="SkAutoCanvasRestore_destructor"></a> +<a name='SkAutoCanvasRestore_destructor'></a> ## ~SkAutoCanvasRestore -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -~SkAutoCanvasRestore() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkAutoCanvasRestore_destructor'>~SkAutoCanvasRestore</a>() </pre> -Restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state. Destructor is called when container goes out of +Restores <a href='SkCanvas_Reference#Canvas'>Canvas</a> to saved state. Destructor is called when container goes out of scope. ### See Also -<a href="SkCanvas_Reference#SkCanvas_save">SkCanvas::save</a> <a href="SkCanvas_Reference#SkCanvas_restore">SkCanvas::restore</a> +<a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save</a> <a href='SkCanvas_Reference#SkCanvas_restore'>SkCanvas::restore</a> --- -<a name="SkAutoCanvasRestore_restore"></a> +<a name='SkAutoCanvasRestore_restore'></a> ## restore -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void restore() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkAutoCanvasRestore_restore'>restore</a>() </pre> -Restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state immediately. Subsequent calls and -<a href="#SkAutoCanvasRestore_destructor">~SkAutoCanvasRestore</a> have no effect. +Restores <a href='SkCanvas_Reference#Canvas'>Canvas</a> to saved state immediately. Subsequent calls and +<a href='#SkAutoCanvasRestore_destructor'>~SkAutoCanvasRestore</a> have no effect. ### Example @@ -110,7 +137,7 @@ final count: 1 ### See Also -<a href="SkCanvas_Reference#SkCanvas_save">SkCanvas::save</a> <a href="SkCanvas_Reference#SkCanvas_restore">SkCanvas::restore</a> +<a href='SkCanvas_Reference#SkCanvas_save'>SkCanvas::save</a> <a href='SkCanvas_Reference#SkCanvas_restore'>SkCanvas::restore</a> --- diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 601ab104b6..08898bce08 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -1,231 +1,556 @@ SkBitmap Reference === -# <a name="Bitmap"></a> Bitmap +# <a name='Bitmap'>Bitmap</a> -## <a name="Overview"></a> Overview +# <a name='SkBitmap'>Class SkBitmap</a> +<a href='#Bitmap'>Bitmap</a> describes a two-dimensional raster pixel array. <a href='#Bitmap'>Bitmap</a> is built on +<a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, containing integer width and height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> +describing the pixel format, and <a href='undocumented#Color_Space'>Color Space</a> describing the range of colors. +<a href='#Bitmap'>Bitmap</a> points to <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, which describes the physical array of pixels. +<a href='SkImageInfo_Reference#Image_Info'>Image Info</a> bounds may be located anywhere fully inside <a href='undocumented#Pixel_Ref'>Pixel Ref</a> bounds. -## <a name="Overview_Subtopic"></a> Overview Subtopic +<a href='#Bitmap'>Bitmap</a> can be drawn using <a href='SkCanvas_Reference#Canvas'>Canvas</a>. <a href='#Bitmap'>Bitmap</a> can be a drawing destination for <a href='SkCanvas_Reference#Canvas'>Canvas</a> +draw member functionss. <a href='#Bitmap'>Bitmap</a> flexibility as a pixel container limits some +optimizations available to the target platform. -| name | description | -| --- | --- | -| <a href="#Class_or_Struct">Class or Struct</a> | embedded struct and class members | -| <a href="#Constant">Constant</a> | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkBitmap">SkBitmap</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | +If pixel array is primarily read-only, use <a href='SkImage_Reference#Image'>Image</a> for better performance. +If pixel array is primarily written to, use <a href='SkSurface_Reference#Surface'>Surface</a> for better performance. -# <a name="SkBitmap"></a> Class SkBitmap -<a href="#Bitmap">Bitmap</a> describes a two-dimensional raster pixel array. <a href="#Bitmap">Bitmap</a> is built on -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>, containing integer width and height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> -describing the pixel format, and <a href="undocumented#Color_Space">Color Space</a> describing the range of colors. -<a href="#Bitmap">Bitmap</a> points to <a href="undocumented#Pixel_Ref">Pixel Ref</a>, which describes the physical array of pixels. -<a href="SkImageInfo_Reference#Image_Info">Image Info</a> bounds may be located anywhere fully inside <a href="undocumented#Pixel_Ref">Pixel Ref</a> bounds. +Declaring <a href='#SkBitmap'>SkBitmap</a> const prevents altering <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>: the <a href='#Bitmap'>Bitmap</a> height, width, +and so on cannot change. It does not affect <a href='undocumented#Pixel_Ref'>Pixel Ref</a>: a caller may write its +pixels. Declaring <a href='#SkBitmap'>SkBitmap</a> const affects <a href='#Bitmap'>Bitmap</a> configuration, not its contents. -<a href="#Bitmap">Bitmap</a> can be drawn using <a href="SkCanvas_Reference#Canvas">Canvas</a>. <a href="#Bitmap">Bitmap</a> can be a drawing destination for <a href="SkCanvas_Reference#Canvas">Canvas</a> -draw methods. <a href="#Bitmap">Bitmap</a> flexibility as a pixel container limits some optimizations -available to the target platform. +<a href='#Bitmap'>Bitmap</a> is not thread safe. Each thread must have its own copy of <a href='#Bitmap'>Bitmap</a> fields, +although threads may share the underlying pixel array. -If pixel array is primarily read-only, use <a href="SkImage_Reference#Image">Image</a> for better performance. -If pixel array is primarily written to, use <a href="SkSurface_Reference#Surface">Surface</a> for better performance. +## <a name='Row_Bytes'>Row Bytes</a> -Declaring <a href="#SkBitmap">SkBitmap</a> const prevents altering <a href="SkImageInfo_Reference#Image_Info">Image Info</a>: the <a href="#Bitmap">Bitmap</a> height, width, -and so on cannot change. It does not affect <a href="undocumented#Pixel_Ref">Pixel Ref</a>: a caller may write its -pixels. Declaring <a href="#SkBitmap">SkBitmap</a> const affects <a href="#Bitmap">Bitmap</a> configuration, not its contents. +<a href='#Bitmap'>Bitmap</a> pixels may be contiguous, or may have a gap at the end of each row. +<a href='#Row_Bytes'>Row Bytes</a> is the interval from one row to the next. <a href='#Row_Bytes'>Row Bytes</a> may be specified; +sometimes passing zero will compute the <a href='#Row_Bytes'>Row Bytes</a> from the row width and the +number of bytes in a pixel. <a href='#Row_Bytes'>Row Bytes</a> may be larger than the row requires. This +is useful to position one or more <a href='#Bitmap'>Bitmaps</a> within a shared pixel array. -<a href="#Bitmap">Bitmap</a> is not thread safe. Each thread must have its own copy of <a href="#Bitmap">Bitmap</a> fields, -although threads may share the underlying pixel array. +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Class'>Class Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded class members</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkBitmap'>SkBitmap</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkBitmap global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Allocate'>Allocate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates storage for pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw'>Draw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets pixels to <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Pixels'>Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>read and write pixel values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>metrics and attributes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Row_Bytes'>Row Bytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>interval from one row to the next</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>updates values and attributes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> +</table> + + +## <a name='Constant'>Constant</a> + + +SkBitmap related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_AllocFlags'>AllocFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>zero pixel memory</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>zero pixel memory</td> + </tr> +</table> + + +## <a name='Class'>Class</a> + + +SkBitmap uses C++ classes to declare the public data structures and interfaces. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_Allocator'>Allocator</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>abstract subclass of <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_HeapAllocator'>HeapAllocator</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixel memory from heap</td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkBitmap can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_empty_constructor'>SkBitmap()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_move_SkBitmap'>SkBitmap(SkBitmap&& src)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>takes ownership of pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_copy_const_SkBitmap'>SkBitmap(const SkBitmap& src)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>shares ownership of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractAlpha'>extractAlpha</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Bitmap'>Bitmap</a> containing <a href='SkColor_Reference#Alpha'>Alpha</a> of pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractAlpha'>extractAlpha(SkBitmap* dst)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractAlpha_2'>extractAlpha(SkBitmap* dst, const SkPaint* paint, SkIPoint* offset)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractAlpha_3'>extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator, SkIPoint* offset)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractSubset'>extractSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Bitmap'>Bitmap</a>, sharing pixels if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to default values, releases pixel ownership</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_destructor'>~SkBitmap()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>releases ownership of pixels</td> + </tr> +</table> + + +## <a name='Operator'>Operator</a> + + +SkBitmap operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_move_operator'>operator=(SkBitmap&& src)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>takes ownership of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_copy_operator'>operator=(const SkBitmap& src)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>shares ownership of pixels</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkBitmap member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_ComputeIsOpaque'>ComputeIsOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if all pixels are opaque</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocN32Pixels'>allocN32Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates compatible <a href='SkColor_Reference#ARGB'>Color ARGB</a> pixels, or aborts</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixels'>allocPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, or aborts</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> with options, or aborts</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> as Rectangle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of bytes in pixel based on <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_computeByteSize'>computeByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns size required for pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_dimensions'>dimensions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_drawsNothing'>drawsNothing</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no <a href='#SkBitmap_width'>width</a>, no <a href='#SkBitmap_height'>height</a>, or no <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_empty'>empty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> has zero <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_erase'>erase</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to rectangle of pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_eraseARGB'>eraseARGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_eraseColor'>eraseColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractAlpha'>extractAlpha</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Bitmap'>Bitmap</a> containing <a href='SkColor_Reference#Alpha'>Alpha</a> of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_extractSubset'>extractSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Bitmap'>Bitmap</a>, sharing pixels if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr'>getAddr</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as void pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr16'>getAddr16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 16-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr32'>getAddr32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 32-bit pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr8'>getAddr8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 8-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds'>getBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> as Rectangle</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getColor'>getColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one pixel as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getGenerationID'>getGenerationID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getPixels'>getPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns address of pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getSubset'>getSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds offset by origin</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns Mip_Map support present; Android only</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_info'>info</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_installPixels'>installPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, with optional release function</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isImmutable'>isImmutable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels will not change</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isNull'>isNull</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> describes opaque pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isVolatile'>isVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels should not be cached</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_notifyPixelsChanged'>notifyPixelsChanged</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks pixels as changed, altering the unique ID</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRef'>pixelRef</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, or nullptr</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns offset within <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixmap'>pixmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readyToDraw'>readyToDraw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if address of pixels is not nullptr</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_refColorSpace'>refColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to default values, releases pixel ownership</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytes'>rowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in bytes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setAlphaType'>setAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of shared pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setHasHardwareMipMap'>setHasHardwareMipMap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets Mip_Map support present; Android only</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setImmutable'>setImmutable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks that pixels will not change</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setInfo'>setInfo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets height, width, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and so on, releasing pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setIsVolatile'>setIsVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks if pixels should not be cached</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setPixelRef'>setPixelRef</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> and offset</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setPixels'>setPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> without an offset</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_swap'>swap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Bitmap'>Bitmap</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Bitmap'>Bitmap</a> to machine readable form</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocN32Pixels'>tryAllocN32Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates compatible <a href='SkColor_Reference#ARGB'>Color ARGB</a> pixels if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> with options if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_validate'>validate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Bitmap'>Bitmap</a> is invalid (debug only)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_writePixels'>writePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> +</table> + + +# <a name='SkBitmap_Allocator'>Class SkBitmap::Allocator</a> + +## <a name='Member_Function'>Member_Function</a> + + +SkBitmap member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> -## <a name="Row_Bytes"></a> Row Bytes - -<a href="#Bitmap">Bitmap</a> pixels may be contiguous, or may have a gap at the end of each row. -<a href="#Row_Bytes">Row Bytes</a> is the interval from one row to the next. <a href="#Row_Bytes">Row Bytes</a> may be specified; -sometimes passing zero will compute the <a href="#Row_Bytes">Row Bytes</a> from the row width and the -number of bytes in a pixel. <a href="#Row_Bytes">Row Bytes</a> may be larger than the row requires. This -is useful to position one or more <a href="#Bitmap">Bitmaps</a> within a shared pixel array. - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Allocate">Allocate</a> | allocates storage for pixels | -| <a href="#Draw">Draw</a> | set pixels to <a href="SkColor_Reference#Color">Color</a> | -| <a href="#Pixels">Pixels</a> | read and write pixel values | -| <a href="#Property">Property</a> | metrics and attributes | -| <a href="#Row_Bytes">Row Bytes</a> | interval from one row to the next | -| <a href="#Set">Set</a> | updates values and attributes | -| <a href="#Utility">Utility</a> | rarely called management functions | - -## <a name="Constant"></a> Constant - -| name | description | -| --- | --- | -| <a href="#SkBitmap_AllocFlags">AllocFlags</a> | zero pixel memory | - -## <a name="Class_or_Struct"></a> Class or Struct - -| name | description | -| --- | --- | -| <a href="#SkBitmap_Allocator">Allocator</a> | abstract subclass of <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> | -| <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> | allocates pixel memory from heap | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkBitmap_empty_constructor">SkBitmap()</a> | constructs with default values | -| <a href="#SkBitmap_move_SkBitmap">SkBitmap(SkBitmap&& src)</a> | takes ownership of pixels | -| <a href="#SkBitmap_copy_const_SkBitmap">SkBitmap(const SkBitmap& src)</a> | shares ownership of pixels | -| <a href="#SkBitmap_extractAlpha">extractAlpha</a> | creates <a href="#Bitmap">Bitmap</a> containing <a href="SkColor_Reference#Alpha">Alpha</a> of pixels | -| | <a href="#SkBitmap_extractAlpha">extractAlpha(SkBitmap* dst)</a> const | -| | <a href="#SkBitmap_extractAlpha_2">extractAlpha(SkBitmap* dst, const SkPaint* paint, SkIPoint* offset)</a> const | -| | <a href="#SkBitmap_extractAlpha_3">extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator, SkIPoint* offset)</a> const | -| <a href="#SkBitmap_extractSubset">extractSubset</a> | creates <a href="#Bitmap">Bitmap</a>, sharing pixels if possible | -| <a href="#SkBitmap_reset">reset</a> | sets to default values, releases pixel ownership | -| <a href="#SkBitmap_destructor">~SkBitmap()</a> | releases ownership of pixels | - -## <a name="Operator"></a> Operator - -| name | description | -| --- | --- | -| <a href="#SkBitmap_move_operator">operator=(SkBitmap&& src)</a> | takes ownership of pixels | -| <a href="#SkBitmap_copy_operator">operator=(const SkBitmap& src)</a> | shares ownership of pixels | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkBitmap_ComputeIsOpaque">ComputeIsOpaque</a> | returns true if all pixels are opaque | -| <a href="#SkBitmap_allocN32Pixels">allocN32Pixels</a> | allocates compatible <a href="SkColor_Reference#ARGB">Color ARGB</a> pixels, or aborts | -| <a href="#SkBitmap_allocPixels">allocPixels</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, or aborts | -| <a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> with options, or aborts | -| <a href="#SkBitmap_alphaType">alphaType</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> | -| <a href="#SkBitmap_bounds">bounds</a> | returns <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> as Rectangle | -| <a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> | returns number of bytes in pixel based on <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkBitmap_colorSpace">colorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkBitmap_colorType">colorType</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkBitmap_computeByteSize">computeByteSize</a> | returns size required for pixels | -| <a href="#SkBitmap_dimensions">dimensions</a> | returns <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> | -| <a href="#SkBitmap_drawsNothing">drawsNothing</a> | returns true if no <a href="#SkBitmap_width">width</a>, no <a href="#SkBitmap_height">height</a>, or no <a href="undocumented#Pixel_Ref">Pixel Ref</a> | -| <a href="#SkBitmap_empty">empty</a> | returns true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> has zero <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> | -| <a href="#SkBitmap_erase">erase</a> | writes <a href="SkColor_Reference#Color">Color</a> to rectangle of pixels | -| <a href="#SkBitmap_eraseARGB">eraseARGB</a> | writes <a href="SkColor_Reference#Color">Color</a> to pixels | -| <a href="#SkBitmap_eraseColor">eraseColor</a> | writes <a href="SkColor_Reference#Color">Color</a> to pixels | -| <a href="#SkBitmap_extractAlpha">extractAlpha</a> | creates <a href="#Bitmap">Bitmap</a> containing <a href="SkColor_Reference#Alpha">Alpha</a> of pixels | -| <a href="#SkBitmap_extractSubset">extractSubset</a> | creates <a href="#Bitmap">Bitmap</a>, sharing pixels if possible | -| <a href="#SkBitmap_getAddr">getAddr</a> | returns readable pixel address as void pointer | -| <a href="#SkBitmap_getAddr16">getAddr16</a> | returns readable pixel address as 16-bit pointer | -| <a href="#SkBitmap_getAddr32">getAddr32</a> | returns readable pixel address as 32-bit pointer | -| <a href="#SkBitmap_getAddr8">getAddr8</a> | returns readable pixel address as 8-bit pointer | -| <a href="#SkBitmap_getBounds">getBounds</a> | returns <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> as Rectangle | -| <a href="#SkBitmap_getColor">getColor</a> | returns one pixel as <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> | -| <a href="#SkBitmap_getGenerationID">getGenerationID</a> | returns unique ID | -| <a href="#SkBitmap_getPixels">getPixels</a> | returns address of pixels | -| <a href="#SkBitmap_getSubset">getSubset</a> | returns bounds offset by origin | -| <a href="#SkBitmap_hasHardwareMipMap">hasHardwareMipMap</a> | returns Mip_Map support present; Android only | -| <a href="#SkBitmap_height">height</a> | returns pixel row count | -| <a href="#SkBitmap_info">info</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> | -| <a href="#SkBitmap_installPixels">installPixels</a> | creates <a href="undocumented#Pixel_Ref">Pixel Ref</a>, with optional release function | -| <a href="#SkBitmap_isImmutable">isImmutable</a> | returns true if pixels will not change | -| <a href="#SkBitmap_isNull">isNull</a> | returns true if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr | -| <a href="#SkBitmap_isOpaque">isOpaque</a> | returns true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> describes opaque pixels | -| <a href="#SkBitmap_isVolatile">isVolatile</a> | returns true if pixels should not be cached | -| <a href="#SkBitmap_notifyPixelsChanged">notifyPixelsChanged</a> | marks pixels as changed, altering the unique ID | -| <a href="#SkBitmap_peekPixels">peekPixels</a> | returns <a href="SkPixmap_Reference#Pixmap">Pixmap</a> if possible | -| <a href="#SkBitmap_pixelRef">pixelRef</a> | returns <a href="undocumented#Pixel_Ref">Pixel Ref</a>, or nullptr | -| <a href="#SkBitmap_pixelRefOrigin">pixelRefOrigin</a> | returns offset within <a href="undocumented#Pixel_Ref">Pixel Ref</a> | -| <a href="#SkBitmap_pixmap">pixmap</a> | returns <a href="SkPixmap_Reference#Pixmap">Pixmap</a> | -| <a href="#SkBitmap_readPixels">readPixels</a> | copies and converts pixels | -| <a href="#SkBitmap_readyToDraw">readyToDraw</a> | returns true if address of pixels is not nullptr | -| <a href="#SkBitmap_refColorSpace">refColorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkBitmap_reset">reset</a> | sets to default values, releases pixel ownership | -| <a href="#SkBitmap_rowBytes">rowBytes</a> | returns interval between rows in bytes | -| <a href="#SkBitmap_rowBytesAsPixels">rowBytesAsPixels</a> | returns interval between rows in pixels | -| <a href="#SkBitmap_setAlphaType">setAlphaType</a> | sets <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> of shared pixels | -| <a href="#SkBitmap_setHasHardwareMipMap">setHasHardwareMipMap</a> | sets Mip_Map support present; Android only | -| <a href="#SkBitmap_setImmutable">setImmutable</a> | marks that pixels will not change | -| <a href="#SkBitmap_setInfo">setInfo</a> | sets height, width, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and so on, releasing pixels | -| <a href="#SkBitmap_setIsVolatile">setIsVolatile</a> | marks if pixels should not be cached | -| <a href="#SkBitmap_setPixelRef">setPixelRef</a> | sets <a href="undocumented#Pixel_Ref">Pixel Ref</a> and offset | -| <a href="#SkBitmap_setPixels">setPixels</a> | sets <a href="undocumented#Pixel_Ref">Pixel Ref</a> without an offset | -| <a href="#SkBitmap_shiftPerPixel">shiftPerPixel</a> | returns bit shift from pixels to bytes | -| <a href="#SkBitmap_swap">swap</a> | exchanges <a href="#Bitmap">Bitmap</a> pair | -| <a href="#SkBitmap_toString">toString</a> | converts <a href="#Bitmap">Bitmap</a> to machine readable form | -| <a href="#SkBitmap_tryAllocN32Pixels">tryAllocN32Pixels</a> | allocates compatible <a href="SkColor_Reference#ARGB">Color ARGB</a> pixels if possible | -| <a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> if possible | -| <a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> with options if possible | -| <a href="#SkBitmap_validate">validate</a> | asserts if <a href="#Bitmap">Bitmap</a> is invalid (debug only) | -| <a href="#SkBitmap_width">width</a> | returns pixel column count | -| <a href="#SkBitmap_writePixels">writePixels</a> | copies and converts pixels | - -# <a name="SkBitmap::Allocator"></a> Class SkBitmap::Allocator <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - class <a href="#SkBitmap_Allocator">Allocator</a> : public <a href="undocumented#SkRefCnt">SkRefCnt</a> { + class <a href='#SkBitmap_Allocator'>Allocator</a> : public <a href='undocumented#SkRefCnt'>SkRefCnt</a> { public: - virtual bool <a href="#SkBitmap_Allocator_allocPixelRef">allocPixelRef(SkBitmap* bitmap)</a> = 0; + virtual bool <a href='#SkBitmap_Allocator_allocPixelRef'>allocPixelRef(SkBitmap* bitmap)</a> = 0; }; </pre> -Abstract subclass of <a href="#SkBitmap_HeapAllocator">HeapAllocator</a>. +Abstract subclass of <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a>. -<a name="SkBitmap_Allocator_allocPixelRef"></a> +<a name='SkBitmap_Allocator_allocPixelRef'></a> ## allocPixelRef -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual bool allocPixelRef(SkBitmap* bitmap) = 0 +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual bool <a href='#SkBitmap_Allocator_allocPixelRef'>allocPixelRef</a>(<a href='#SkBitmap'>SkBitmap</a>* bitmap) = 0 </pre> -Allocates the pixel memory for the <a href="#SkBitmap_Allocator_allocPixelRef_bitmap">bitmap</a>, given its dimensions and -<a href="SkImageInfo_Reference#Color_Type">Color Type</a>. Returns true on success, where success means either <a href="#SkBitmap_setPixels">setPixels</a> -or <a href="#SkBitmap_setPixelRef">setPixelRef</a> was called. +Allocates the pixel memory for the <a href='#SkBitmap_Allocator_allocPixelRef_bitmap'>bitmap</a>, given its dimensions and +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. Returns true on success, where success means either <a href='#SkBitmap_setPixels'>setPixels</a> +or <a href='#SkBitmap_setPixelRef'>setPixelRef</a> was called. ### Parameters -<table> <tr> <td><a name="SkBitmap_Allocator_allocPixelRef_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> containing <a href="SkImageInfo_Reference#Image_Info">Image Info</a> as input, and <a href="undocumented#Pixel_Ref">Pixel Ref</a> as output</td> +<table> <tr> <td><a name='SkBitmap_Allocator_allocPixelRef_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> containing <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> as input, and <a href='undocumented#Pixel_Ref'>Pixel Ref</a> as output</td> </tr> </table> ### Return Value -true if <a href="undocumented#Pixel_Ref">Pixel Ref</a> was allocated +true if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> was allocated ### See Also -<a href="#SkBitmap_HeapAllocator">HeapAllocator</a> +<a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> --- -# <a name="SkBitmap::HeapAllocator"></a> Class SkBitmap::HeapAllocator +# <a name='SkBitmap_HeapAllocator'>Class SkBitmap::HeapAllocator</a> + +## <a name='Member_Function'>Member_Function</a> + + +SkBitmap member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> + <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - class <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> : public <a href="#SkBitmap_Allocator">Allocator</a> { + class <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> : public <a href='#SkBitmap_Allocator'>Allocator</a> { public: - bool <a href="#SkBitmap_HeapAllocator_allocPixelRef">allocPixelRef(SkBitmap* bitmap)</a> override; + bool <a href='#SkBitmap_HeapAllocator_allocPixelRef'>allocPixelRef(SkBitmap* bitmap)</a> override; }; </pre> -Subclass of <a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> that returns a <a href="undocumented#Pixel_Ref">Pixel Ref</a> that allocates its pixel -memory from the heap. This is the default <a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> invoked by -<a href="#SkBitmap_allocPixels">allocPixels</a>. +Subclass of <a href='#SkBitmap_Allocator'>SkBitmap::Allocator</a> that returns a <a href='undocumented#Pixel_Ref'>Pixel Ref</a> that allocates its pixel +memory from the heap. This is the default <a href='#SkBitmap_Allocator'>SkBitmap::Allocator</a> invoked by +<a href='#SkBitmap_allocPixels'>allocPixels</a>. -<a name="SkBitmap_HeapAllocator_allocPixelRef"></a> +<a name='SkBitmap_HeapAllocator_allocPixelRef'></a> ## allocPixelRef -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool allocPixelRef(SkBitmap* bitmap) override +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_HeapAllocator_allocPixelRef'>allocPixelRef</a>(<a href='#SkBitmap'>SkBitmap</a>* bitmap) override </pre> -Allocates the pixel memory for the <a href="#SkBitmap_HeapAllocator_allocPixelRef_bitmap">bitmap</a>, given its dimensions and -<a href="SkImageInfo_Reference#Color_Type">Color Type</a>. Returns true on success, where success means either <a href="#SkBitmap_setPixels">setPixels</a> -or <a href="#SkBitmap_setPixelRef">setPixelRef</a> was called. +Allocates the pixel memory for the <a href='#SkBitmap_HeapAllocator_allocPixelRef_bitmap'>bitmap</a>, given its dimensions and +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. Returns true on success, where success means either <a href='#SkBitmap_setPixels'>setPixels</a> +or <a href='#SkBitmap_setPixelRef'>setPixelRef</a> was called. ### Parameters -<table> <tr> <td><a name="SkBitmap_HeapAllocator_allocPixelRef_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> containing <a href="SkImageInfo_Reference#Image_Info">Image Info</a> as input, and <a href="undocumented#Pixel_Ref">Pixel Ref</a> as output</td> +<table> <tr> <td><a name='SkBitmap_HeapAllocator_allocPixelRef_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> containing <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> as input, and <a href='undocumented#Pixel_Ref'>Pixel Ref</a> as output</td> </tr> </table> @@ -249,27 +574,27 @@ pixel address = 0x560ddd0ac670 ### See Also -<a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> <a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a><sup><a href="#SkBitmap_tryAllocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_4">[4]</a></sup> +<a href='#SkBitmap_Allocator'>SkBitmap::Allocator</a> <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a><sup><a href='#SkBitmap_tryAllocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_empty_constructor"></a> +<a name='SkBitmap_empty_constructor'></a> ## SkBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkBitmap() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkBitmap'>SkBitmap</a>() </pre> -Creates an empty <a href="#Bitmap">Bitmap</a> without pixels, with <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, -<a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, and with a width and height of zero. <a href="undocumented#Pixel_Ref">Pixel Ref</a> origin is -set to (0, 0). <a href="#Bitmap">Bitmap</a> is not volatile. +Creates an empty <a href='#Bitmap'>Bitmap</a> without pixels, with <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, +<a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, and with a width and height of zero. <a href='undocumented#Pixel_Ref'>Pixel Ref</a> origin is +set to (0, 0). <a href='#Bitmap'>Bitmap</a> is not volatile. -Use <a href="#SkBitmap_setInfo">setInfo</a> to associate <a href="SkImageInfo_Reference#SkColorType">SkColorType</a>, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, width, and height -after <a href="#Bitmap">Bitmap</a> has been created. +Use <a href='#SkBitmap_setInfo'>setInfo</a> to associate <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a>, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, width, and height +after <a href='#Bitmap'>Bitmap</a> has been created. ### Return Value -empty <a href="#Bitmap">Bitmap</a> +empty <a href='#Bitmap'>Bitmap</a> ### Example @@ -286,34 +611,34 @@ width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType ### See Also -<a href="#SkBitmap_setInfo">setInfo</a> +<a href='#SkBitmap_setInfo'>setInfo</a> --- -<a name="SkBitmap_copy_const_SkBitmap"></a> +<a name='SkBitmap_copy_const_SkBitmap'></a> ## SkBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkBitmap(const SkBitmap& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkBitmap'>SkBitmap</a>(const <a href='#SkBitmap'>SkBitmap</a>& src) </pre> -Copies settings from <a href="#SkBitmap_copy_const_SkBitmap_src">src</a> to returned <a href="#Bitmap">Bitmap</a>. Shares pixels if <a href="#SkBitmap_copy_const_SkBitmap_src">src</a> has pixels +Copies settings from <a href='#SkBitmap_copy_const_SkBitmap_src'>src</a> to returned <a href='#Bitmap'>Bitmap</a>. Shares pixels if <a href='#SkBitmap_copy_const_SkBitmap_src'>src</a> has pixels allocated, so both bitmaps reference the same pixels. ### Parameters -<table> <tr> <td><a name="SkBitmap_copy_const_SkBitmap_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> to copy <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, and share <a href="undocumented#Pixel_Ref">Pixel Ref</a></td> +<table> <tr> <td><a name='SkBitmap_copy_const_SkBitmap_src'><code><strong>src</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> to copy <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, and share <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> </tr> </table> ### Return Value -copy of <a href="#SkBitmap_copy_const_SkBitmap_src">src</a> +copy of <a href='#SkBitmap_copy_const_SkBitmap_src'>src</a> ### Example -<div><fiddle-embed name="f12c2af14b0fffd094d632b5f766aa1d"> +<div><fiddle-embed name="bbbae7a181bfd128a4484e8e9f454db1"> #### Example Output @@ -327,34 +652,34 @@ copy has pixels: true ### See Also -<a href="#SkBitmap_setInfo">setInfo</a> <a href="#SkBitmap_setPixelRef">setPixelRef</a> <a href="#SkBitmap_setPixels">setPixels</a> <a href="#SkBitmap_swap">swap</a> +<a href='#SkBitmap_setInfo'>setInfo</a> <a href='#SkBitmap_setPixelRef'>setPixelRef</a> <a href='#SkBitmap_setPixels'>setPixels</a> <a href='#SkBitmap_swap'>swap</a> --- -<a name="SkBitmap_move_SkBitmap"></a> +<a name='SkBitmap_move_SkBitmap'></a> ## SkBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkBitmap(SkBitmap&& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkBitmap'>SkBitmap</a>(<a href='#SkBitmap'>SkBitmap</a>&& src) </pre> -Copies settings from <a href="#SkBitmap_move_SkBitmap_src">src</a> to returned <a href="#Bitmap">Bitmap</a>. Moves ownership of <a href="#SkBitmap_move_SkBitmap_src">src</a> pixels to -<a href="#Bitmap">Bitmap</a>. +Copies settings from <a href='#SkBitmap_move_SkBitmap_src'>src</a> to returned <a href='#Bitmap'>Bitmap</a>. Moves ownership of <a href='#SkBitmap_move_SkBitmap_src'>src</a> pixels to +<a href='#Bitmap'>Bitmap</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_move_SkBitmap_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> to copy <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, and reassign <a href="undocumented#Pixel_Ref">Pixel Ref</a></td> +<table> <tr> <td><a name='SkBitmap_move_SkBitmap_src'><code><strong>src</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> to copy <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, and reassign <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> </tr> </table> ### Return Value -copy of <a href="#SkBitmap_move_SkBitmap_src">src</a> +copy of <a href='#SkBitmap_move_SkBitmap_src'>src</a> ### Example -<div><fiddle-embed name="a137b2027d2ac098a21d68d93391f5bb"> +<div><fiddle-embed name="40afd4f1fa69e02d69d92b38252088ef"> #### Example Output @@ -368,49 +693,49 @@ copy has pixels: true ### See Also -<a href="#SkBitmap_setInfo">setInfo</a> <a href="#SkBitmap_setPixelRef">setPixelRef</a> <a href="#SkBitmap_setPixels">setPixels</a> <a href="#SkBitmap_swap">swap</a> +<a href='#SkBitmap_setInfo'>setInfo</a> <a href='#SkBitmap_setPixelRef'>setPixelRef</a> <a href='#SkBitmap_setPixels'>setPixels</a> <a href='#SkBitmap_swap'>swap</a> --- -<a name="SkBitmap_destructor"></a> +<a name='SkBitmap_destructor'></a> ## ~SkBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -~SkBitmap() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkBitmap_destructor'>~SkBitmap</a>() </pre> -Decrements <a href="undocumented#Pixel_Ref">Pixel Ref</a> reference count, if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is not nullptr. +Decrements <a href='undocumented#Pixel_Ref'>Pixel Ref</a> reference count, if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is not nullptr. ### See Also -<a href="undocumented#Pixel_Ref">Pixel Ref</a> +<a href='undocumented#Pixel_Ref'>Pixel Ref</a> --- -<a name="SkBitmap_copy_operator"></a> +<a name='SkBitmap_copy_operator'></a> ## operator= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkBitmap& operator=(const SkBitmap& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkBitmap'>SkBitmap</a>& <a href='#SkBitmap_copy_operator'>operator=(const SkBitmap& src)</a> </pre> -Copies settings from <a href="#SkBitmap_copy_operator_src">src</a> to returned <a href="#Bitmap">Bitmap</a>. Shares pixels if <a href="#SkBitmap_copy_operator_src">src</a> has pixels +Copies settings from <a href='#SkBitmap_copy_operator_src'>src</a> to returned <a href='#Bitmap'>Bitmap</a>. Shares pixels if <a href='#SkBitmap_copy_operator_src'>src</a> has pixels allocated, so both bitmaps reference the same pixels. ### Parameters -<table> <tr> <td><a name="SkBitmap_copy_operator_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> to copy <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, and share <a href="undocumented#Pixel_Ref">Pixel Ref</a></td> +<table> <tr> <td><a name='SkBitmap_copy_operator_src'><code><strong>src</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> to copy <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, and share <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> </tr> </table> ### Return Value -copy of <a href="#SkBitmap_copy_operator_src">src</a> +copy of <a href='#SkBitmap_copy_operator_src'>src</a> ### Example -<div><fiddle-embed name="98d5866308756c21c8f8b639bc4e033a"> +<div><fiddle-embed name="45279c519ae808f78bd30e9d84bdfdde"> #### Example Output @@ -424,34 +749,34 @@ copy has pixels: true ### See Also -<a href="#SkBitmap_setInfo">setInfo</a> <a href="#SkBitmap_setPixelRef">setPixelRef</a> <a href="#SkBitmap_setPixels">setPixels</a> <a href="#SkBitmap_swap">swap</a> +<a href='#SkBitmap_setInfo'>setInfo</a> <a href='#SkBitmap_setPixelRef'>setPixelRef</a> <a href='#SkBitmap_setPixels'>setPixels</a> <a href='#SkBitmap_swap'>swap</a> --- -<a name="SkBitmap_move_operator"></a> +<a name='SkBitmap_move_operator'></a> ## operator= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkBitmap& operator=(SkBitmap&& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkBitmap'>SkBitmap</a>& <a href='#SkBitmap_move_operator'>operator=(SkBitmap&& src)</a> </pre> -Copies settings from <a href="#SkBitmap_move_operator_src">src</a> to returned <a href="#Bitmap">Bitmap</a>. Moves ownership of <a href="#SkBitmap_move_operator_src">src</a> pixels to -<a href="#Bitmap">Bitmap</a>. +Copies settings from <a href='#SkBitmap_move_operator_src'>src</a> to returned <a href='#Bitmap'>Bitmap</a>. Moves ownership of <a href='#SkBitmap_move_operator_src'>src</a> pixels to +<a href='#Bitmap'>Bitmap</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_move_operator_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> to copy <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, and reassign <a href="undocumented#Pixel_Ref">Pixel Ref</a></td> +<table> <tr> <td><a name='SkBitmap_move_operator_src'><code><strong>src</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> to copy <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, and reassign <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> </tr> </table> ### Return Value -copy of <a href="#SkBitmap_move_operator_src">src</a> +copy of <a href='#SkBitmap_move_operator_src'>src</a> ### Example -<div><fiddle-embed name="02836d36fa714d553c32f0d8ea11da73"> +<div><fiddle-embed name="35ea3fed27d8db22dc00f48670de64de"> #### Example Output @@ -465,23 +790,23 @@ copy has pixels: true ### See Also -<a href="#SkBitmap_setInfo">setInfo</a> <a href="#SkBitmap_setPixelRef">setPixelRef</a> <a href="#SkBitmap_setPixels">setPixels</a> <a href="#SkBitmap_swap">swap</a> +<a href='#SkBitmap_setInfo'>setInfo</a> <a href='#SkBitmap_setPixelRef'>setPixelRef</a> <a href='#SkBitmap_setPixels'>setPixels</a> <a href='#SkBitmap_swap'>swap</a> --- -<a name="SkBitmap_swap"></a> +<a name='SkBitmap_swap'></a> ## swap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void swap(SkBitmap& other) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_swap'>swap</a>(<a href='#SkBitmap'>SkBitmap</a>& other) </pre> Swaps the fields of the two bitmaps. ### Parameters -<table> <tr> <td><a name="SkBitmap_swap_other"> <code><strong>other </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> exchanged with original</td> +<table> <tr> <td><a name='SkBitmap_swap_other'><code><strong>other</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> exchanged with original</td> </tr> </table> @@ -502,61 +827,164 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT ### See Also -<a href="#SkBitmap_move_SkBitmap">SkBitmap(SkBitmap&& src)</a> <a href="#SkBitmap_move_operator">operator=(SkBitmap&& src)</a> - ---- - -## <a name="Property"></a> Property - -| name | description | -| --- | --- | -| <a href="#SkBitmap_alphaType">alphaType</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> | -| <a href="#SkBitmap_bounds">bounds</a> | returns <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> as Rectangle | -| <a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> | returns number of bytes in pixel based on <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkBitmap_colorSpace">colorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkBitmap_colorType">colorType</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkBitmap_dimensions">dimensions</a> | returns <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> | -| <a href="#SkBitmap_drawsNothing">drawsNothing</a> | returns true if no <a href="#SkBitmap_width">width</a>, no <a href="#SkBitmap_height">height</a>, or no <a href="undocumented#Pixel_Ref">Pixel Ref</a> | -| <a href="#SkBitmap_empty">empty</a> | returns true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> has zero <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> | -| <a href="#SkBitmap_getAddr">getAddr</a> | returns readable pixel address as void pointer | -| <a href="#SkBitmap_getAddr16">getAddr16</a> | returns readable pixel address as 16-bit pointer | -| <a href="#SkBitmap_getAddr32">getAddr32</a> | returns readable pixel address as 32-bit pointer | -| <a href="#SkBitmap_getAddr8">getAddr8</a> | returns readable pixel address as 8-bit pointer | -| <a href="#SkBitmap_getBounds">getBounds</a> | returns <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> as Rectangle | -| | <a href="#SkBitmap_getBounds">getBounds(SkRect* bounds)</a> const | -| | <a href="#SkBitmap_getBounds_2">getBounds(SkIRect* bounds)</a> const | -| <a href="#SkBitmap_getColor">getColor</a> | returns one pixel as <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> | -| <a href="#SkBitmap_getPixels">getPixels</a> | returns address of pixels | -| <a href="#SkBitmap_getSubset">getSubset</a> | returns bounds offset by origin | -| <a href="#SkBitmap_hasHardwareMipMap">hasHardwareMipMap</a> | returns Mip_Map support present; Android only | -| <a href="#SkBitmap_height">height</a> | returns pixel row count | -| <a href="#SkBitmap_info">info</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> | -| <a href="#SkBitmap_isImmutable">isImmutable</a> | returns true if pixels will not change | -| <a href="#SkBitmap_isNull">isNull</a> | returns true if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr | -| <a href="#SkBitmap_isOpaque">isOpaque</a> | returns true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> describes opaque pixels | -| <a href="#SkBitmap_isVolatile">isVolatile</a> | returns true if pixels should not be cached | -| <a href="#SkBitmap_pixelRef">pixelRef</a> | returns <a href="undocumented#Pixel_Ref">Pixel Ref</a>, or nullptr | -| <a href="#SkBitmap_pixelRefOrigin">pixelRefOrigin</a> | returns offset within <a href="undocumented#Pixel_Ref">Pixel Ref</a> | -| <a href="#SkBitmap_pixmap">pixmap</a> | returns <a href="SkPixmap_Reference#Pixmap">Pixmap</a> | -| <a href="#SkBitmap_refColorSpace">refColorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkBitmap_rowBytes">rowBytes</a> | returns interval between rows in bytes | -| <a href="#SkBitmap_rowBytesAsPixels">rowBytesAsPixels</a> | returns interval between rows in pixels | -| <a href="#SkBitmap_shiftPerPixel">shiftPerPixel</a> | returns bit shift from pixels to bytes | -| <a href="#SkBitmap_width">width</a> | returns pixel column count | - -<a name="SkBitmap_pixmap"></a> +<a href='#SkBitmap_move_SkBitmap'>SkBitmap(SkBitmap&& src)</a> <a href='#SkBitmap_move_operator'>operator=(SkBitmap&& src)</a> + +--- + +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> as Rectangle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of bytes in pixel based on <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_dimensions'>dimensions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_drawsNothing'>drawsNothing</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no <a href='#SkBitmap_width'>width</a>, no <a href='#SkBitmap_height'>height</a>, or no <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_empty'>empty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> has zero <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr'>getAddr</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as void pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr16'>getAddr16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 16-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr32'>getAddr32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 32-bit pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAddr8'>getAddr8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 8-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds'>getBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> as Rectangle</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds'>getBounds(SkRect* bounds)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds_2'>getBounds(SkIRect* bounds)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getColor'>getColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one pixel as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getPixels'>getPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns address of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getSubset'>getSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds offset by origin</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns Mip_Map support present; Android only</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_info'>info</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isImmutable'>isImmutable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels will not change</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isNull'>isNull</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> describes opaque pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isVolatile'>isVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels should not be cached</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRef'>pixelRef</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, or nullptr</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns offset within <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixmap'>pixmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_refColorSpace'>refColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytes'>rowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in bytes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> +</table> + + +<a name='SkBitmap_pixmap'></a> ## pixmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkPixmap& pixmap() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& <a href='#SkBitmap_pixmap'>pixmap</a>() const </pre> -Returns a constant reference to the <a href="SkPixmap_Reference#Pixmap">Pixmap</a> holding the <a href="#Bitmap">Bitmap</a> pixel -address, row bytes, and <a href="SkImageInfo_Reference#Image_Info">Image Info</a>. +Returns a constant reference to the <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> holding the <a href='#Bitmap'>Bitmap</a> pixel +address, row bytes, and <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>. ### Return Value -reference to <a href="SkPixmap_Reference#Pixmap">Pixmap</a> describing this <a href="#Bitmap">Bitmap</a> +reference to <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> describing this <a href='#Bitmap'>Bitmap</a> ### Example @@ -582,22 +1010,22 @@ reference to <a href="SkPixmap_Reference#Pixmap">Pixmap</a> describing this <a h ### See Also -<a href="#SkBitmap_peekPixels">peekPixels</a> <a href="#SkBitmap_installPixels">installPixels</a><sup><a href="#SkBitmap_installPixels_2">[2]</a></sup><sup><a href="#SkBitmap_installPixels_3">[3]</a></sup> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> +<a href='#SkBitmap_peekPixels'>peekPixels</a> <a href='#SkBitmap_installPixels'>installPixels</a><sup><a href='#SkBitmap_installPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_installPixels_3'>[3]</a></sup> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> --- -<a name="SkBitmap_info"></a> +<a name='SkBitmap_info'></a> ## info -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkImageInfo& info() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& <a href='#SkBitmap_info'>info</a>() const </pre> -Returns width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and <a href="undocumented#Color_Space">Color Space</a>. +Returns width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and <a href='undocumented#Color_Space'>Color Space</a>. ### Return Value -reference to <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +reference to <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -613,27 +1041,27 @@ width: 56 height: 56 color: BGRA_8888 alpha: Opaque ### See Also -<a href="SkImageInfo_Reference#Image_Info">Image Info</a> +<a href='SkImageInfo_Reference#Image_Info'>Image Info</a> --- -<a name="SkBitmap_width"></a> +<a name='SkBitmap_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkBitmap_width'>width</a>() const </pre> Returns pixel count in each row. Should be equal or less than: -<a href="#SkBitmap_rowBytes">rowBytes</a> / <a href="#SkBitmap_info">info</a>.<a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a>. +<a href='#SkBitmap_rowBytes'>rowBytes</a> / <a href='#SkBitmap_info'>info</a>.<a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a>. -Maybe be less than <a href="#SkBitmap_pixelRef">pixelRef</a>.<a href="#SkBitmap_width">width</a>. Will not exceed <a href="#SkBitmap_pixelRef">pixelRef</a>.<a href="#SkBitmap_width">width</a> less -<a href="#SkBitmap_pixelRefOrigin">pixelRefOrigin</a>.fX. +Maybe be less than <a href='#SkBitmap_pixelRef'>pixelRef</a>.<a href='#SkBitmap_width'>width</a>. Will not exceed <a href='#SkBitmap_pixelRef'>pixelRef</a>.<a href='#SkBitmap_width'>width</a> less +<a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a>.fX. ### Return Value -pixel width in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +pixel width in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -649,25 +1077,25 @@ bitmap width: 16 info width: 16 ### See Also -<a href="#SkBitmap_height">height</a> <a href="undocumented#SkPixelRef_width">SkPixelRef::width()</a> <a href="SkImageInfo_Reference#SkImageInfo_width">SkImageInfo::width()</a> +<a href='#SkBitmap_height'>height</a> <a href='undocumented#SkPixelRef_width'>SkPixelRef::width()</a> <a href='SkImageInfo_Reference#SkImageInfo_width'>SkImageInfo::width()</a> --- -<a name="SkBitmap_height"></a> +<a name='SkBitmap_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkBitmap_height'>height</a>() const </pre> Returns pixel row count. -Maybe be less than <a href="#SkBitmap_pixelRef">pixelRef</a>.<a href="#SkBitmap_height">height</a>. Will not exceed <a href="#SkBitmap_pixelRef">pixelRef</a>.<a href="#SkBitmap_height">height</a> less -<a href="#SkBitmap_pixelRefOrigin">pixelRefOrigin</a>.fY. +Maybe be less than <a href='#SkBitmap_pixelRef'>pixelRef</a>.<a href='#SkBitmap_height'>height</a>. Will not exceed <a href='#SkBitmap_pixelRef'>pixelRef</a>.<a href='#SkBitmap_height'>height</a> less +<a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a>.fY. ### Return Value -pixel height in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +pixel height in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -683,25 +1111,25 @@ bitmap height: 32 info height: 32 ### See Also -<a href="#SkBitmap_width">width</a> <a href="undocumented#SkPixelRef_height">SkPixelRef::height()</a> <a href="SkImageInfo_Reference#SkImageInfo_height">SkImageInfo::height()</a> +<a href='#SkBitmap_width'>width</a> <a href='undocumented#SkPixelRef_height'>SkPixelRef::height()</a> <a href='SkImageInfo_Reference#SkImageInfo_height'>SkImageInfo::height()</a> --- -<a name="SkBitmap_colorType"></a> +<a name='SkBitmap_colorType'></a> ## colorType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorType colorType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> <a href='#SkBitmap_colorType'>colorType</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>. +Returns <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>. ### Return Value -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -717,23 +1145,23 @@ color type: kAlpha_8_SkColorType ### See Also -<a href="#SkBitmap_alphaType">alphaType</a> <a href="SkImageInfo_Reference#SkImageInfo_colorType">SkImageInfo::colorType</a> +<a href='#SkBitmap_alphaType'>alphaType</a> <a href='SkImageInfo_Reference#SkImageInfo_colorType'>SkImageInfo::colorType</a> --- -<a name="SkBitmap_alphaType"></a> +<a name='SkBitmap_alphaType'></a> ## alphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkAlphaType alphaType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkBitmap_alphaType'>alphaType</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>. +Returns <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>. ### Return Value -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -749,29 +1177,29 @@ alpha type: kPremul_SkAlphaType ### See Also -<a href="#SkBitmap_colorType">colorType</a> <a href="SkImageInfo_Reference#SkImageInfo_alphaType">SkImageInfo::alphaType</a> +<a href='#SkBitmap_colorType'>colorType</a> <a href='SkImageInfo_Reference#SkImageInfo_alphaType'>SkImageInfo::alphaType</a> --- -<a name="SkBitmap_colorSpace"></a> +<a name='SkBitmap_colorSpace'></a> ## colorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorSpace* colorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkColorSpace'>SkColorSpace</a>* <a href='#SkBitmap_colorSpace'>colorSpace</a>() const </pre> -Returns <a href="undocumented#Color_Space">Color Space</a>, the range of colors, associated with <a href="SkImageInfo_Reference#Image_Info">Image Info</a>. The -reference count of <a href="undocumented#Color_Space">Color Space</a> is unchanged. The returned <a href="undocumented#Color_Space">Color Space</a> is +Returns <a href='undocumented#Color_Space'>Color Space</a>, the range of colors, associated with <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>. The +reference count of <a href='undocumented#Color_Space'>Color Space</a> is unchanged. The returned <a href='undocumented#Color_Space'>Color Space</a> is immutable. ### Return Value -<a href="undocumented#Color_Space">Color Space</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, or nullptr +<a href='undocumented#Color_Space'>Color Space</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, or nullptr ### Example -<div><fiddle-embed name="7ade8a1a21ea5197e565c86740b47b73"><div><a href="undocumented#SkColorSpace_MakeSRGBLinear">SkColorSpace::MakeSRGBLinear</a> creates <a href="undocumented#Color_Space">Color Space</a> with linear gamma -and an sRGB gamut. This <a href="undocumented#Color_Space">Color Space</a> gamma is not close to sRGB gamma. +<div><fiddle-embed name="817f95879fadba44baf87ea60e9b595a"><div><a href='undocumented#SkColorSpace_MakeSRGBLinear'>SkColorSpace::MakeSRGBLinear</a> creates <a href='undocumented#Color_Space'>Color Space</a> with linear gamma +and an sRGB gamut. This <a href='undocumented#Color_Space'>Color Space</a> gamma is not close to sRGB gamma. </div> #### Example Output @@ -784,30 +1212,30 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false ### See Also -<a href="undocumented#Color_Space">Color Space</a> <a href="SkImageInfo_Reference#SkImageInfo_colorSpace">SkImageInfo::colorSpace</a> +<a href='undocumented#Color_Space'>Color Space</a> <a href='SkImageInfo_Reference#SkImageInfo_colorSpace'>SkImageInfo::colorSpace</a> --- -<a name="SkBitmap_refColorSpace"></a> +<a name='SkBitmap_refColorSpace'></a> ## refColorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkColorSpace> refColorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkBitmap_refColorSpace'>refColorSpace</a>() const </pre> -Returns smart pointer to <a href="undocumented#Color_Space">Color Space</a>, the range of colors, associated with -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>. The smart pointer tracks the number of objects sharing this -<a href="undocumented#Color_Space">Color Space</a> reference so the memory is released when the owners destruct. +Returns smart pointer to <a href='undocumented#Color_Space'>Color Space</a>, the range of colors, associated with +<a href='SkImageInfo_Reference#Image_Info'>Image Info</a>. The smart pointer tracks the number of objects sharing this +<a href='undocumented#Color_Space'>Color Space</a> reference so the memory is released when the owners destruct. -The returned <a href="undocumented#Color_Space">Color Space</a> is immutable. +The returned <a href='undocumented#Color_Space'>Color Space</a> is immutable. ### Return Value -<a href="undocumented#Color_Space">Color Space</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> wrapped in a smart pointer +<a href='undocumented#Color_Space'>Color Space</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> wrapped in a smart pointer ### Example -<div><fiddle-embed name="972e9bb22c1ce94bb97b2d106168280e"> +<div><fiddle-embed name="cb028b7931da85b949ad0953b9711f9f"> #### Example Output @@ -819,19 +1247,19 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false ### See Also -<a href="undocumented#Color_Space">Color Space</a> <a href="SkImageInfo_Reference#SkImageInfo_colorSpace">SkImageInfo::colorSpace</a> +<a href='undocumented#Color_Space'>Color Space</a> <a href='SkImageInfo_Reference#SkImageInfo_colorSpace'>SkImageInfo::colorSpace</a> --- -<a name="SkBitmap_bytesPerPixel"></a> +<a name='SkBitmap_bytesPerPixel'></a> ## bytesPerPixel -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int bytesPerPixel() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a>() const </pre> -Returns number of bytes per pixel required by <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. -Returns zero if <a href="#SkBitmap_colorType">colorType</a>( is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns number of bytes per pixel required by <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. +Returns zero if <a href='#SkBitmap_colorType'>colorType</a>( is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -839,10 +1267,10 @@ bytes in pixel ### Example -<div><fiddle-embed name="2a688e6f0a516c0d44a826381e9d637f"><a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> +<div><fiddle-embed name="2a688e6f0a516c0d44a826381e9d637f"><a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> #### Example Output @@ -864,19 +1292,19 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8 ### See Also -<a href="#SkBitmap_rowBytes">rowBytes</a> <a href="#SkBitmap_rowBytesAsPixels">rowBytesAsPixels</a> <a href="#SkBitmap_width">width</a> <a href="#SkBitmap_shiftPerPixel">shiftPerPixel</a> <a href="SkImageInfo_Reference#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> +<a href='#SkBitmap_rowBytes'>rowBytes</a> <a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a> <a href='#SkBitmap_width'>width</a> <a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a> <a href='SkImageInfo_Reference#SkImageInfo_bytesPerPixel'>SkImageInfo::bytesPerPixel</a> --- -<a name="SkBitmap_rowBytesAsPixels"></a> +<a name='SkBitmap_rowBytesAsPixels'></a> ## rowBytesAsPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int rowBytesAsPixels() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a>() const </pre> Returns number of pixels that fit on row. Should be greater than or equal to -<a href="#SkBitmap_width">width</a>. +<a href='#SkBitmap_width'>width</a>. ### Return Value @@ -900,19 +1328,19 @@ rowBytes: 8 rowBytesAsPixels: 2 ### See Also -<a href="#SkBitmap_rowBytes">rowBytes</a> <a href="#SkBitmap_shiftPerPixel">shiftPerPixel</a> <a href="#SkBitmap_width">width</a> <a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> +<a href='#SkBitmap_rowBytes'>rowBytes</a> <a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a> <a href='#SkBitmap_width'>width</a> <a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a> --- -<a name="SkBitmap_shiftPerPixel"></a> +<a name='SkBitmap_shiftPerPixel'></a> ## shiftPerPixel -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int shiftPerPixel() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a>() const </pre> Returns bit shift converting row bytes to row pixels. -Returns zero for <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns zero for <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -920,10 +1348,10 @@ one of: 0, 1, 2, 3; left shift to convert pixels to bytes ### Example -<div><fiddle-embed name="56ede4b7d45c15d5936f81ac3d74f070"><a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> +<div><fiddle-embed name="56ede4b7d45c15d5936f81ac3d74f070"><a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> #### Example Output @@ -945,21 +1373,21 @@ color: kRGBA_F16_SkColorType shiftPerPixel: 3 ### See Also -<a href="#SkBitmap_rowBytes">rowBytes</a> <a href="#SkBitmap_rowBytesAsPixels">rowBytesAsPixels</a> <a href="#SkBitmap_width">width</a> <a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> +<a href='#SkBitmap_rowBytes'>rowBytes</a> <a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a> <a href='#SkBitmap_width'>width</a> <a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a> --- -<a name="SkBitmap_empty"></a> +<a name='SkBitmap_empty'></a> ## empty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool empty() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_empty'>empty</a>() const </pre> -Returns true if either <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> are zero. +Returns true if either <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> are zero. -Does not check if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr; call <a href="#SkBitmap_drawsNothing">drawsNothing</a> to check <a href="#SkBitmap_width">width</a>, -<a href="#SkBitmap_height">height</a>, and <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +Does not check if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr; call <a href='#SkBitmap_drawsNothing'>drawsNothing</a> to check <a href='#SkBitmap_width'>width</a>, +<a href='#SkBitmap_height'>height</a>, and <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Return Value @@ -982,25 +1410,25 @@ width: 2 height: 2 empty: false ### See Also -<a href="#SkBitmap_height">height</a> <a href="#SkBitmap_width">width</a> <a href="#SkBitmap_drawsNothing">drawsNothing</a> +<a href='#SkBitmap_height'>height</a> <a href='#SkBitmap_width'>width</a> <a href='#SkBitmap_drawsNothing'>drawsNothing</a> --- -<a name="SkBitmap_isNull"></a> +<a name='SkBitmap_isNull'></a> ## isNull -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isNull() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_isNull'>isNull</a>() const </pre> -Return true if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr. +Return true if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr. -Does not check if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> are zero; call <a href="#SkBitmap_drawsNothing">drawsNothing</a> to check -<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a>, and <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +Does not check if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> are zero; call <a href='#SkBitmap_drawsNothing'>drawsNothing</a> to check +<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a>, and <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Return Value -true if no <a href="undocumented#Pixel_Ref">Pixel Ref</a> is associated +true if no <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is associated ### Example @@ -1018,19 +1446,19 @@ allocated bitmap does have pixels ### See Also -<a href="#SkBitmap_empty">empty</a> <a href="#SkBitmap_drawsNothing">drawsNothing</a> <a href="#SkBitmap_pixelRef">pixelRef</a> +<a href='#SkBitmap_empty'>empty</a> <a href='#SkBitmap_drawsNothing'>drawsNothing</a> <a href='#SkBitmap_pixelRef'>pixelRef</a> --- -<a name="SkBitmap_drawsNothing"></a> +<a name='SkBitmap_drawsNothing'></a> ## drawsNothing -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool drawsNothing() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_drawsNothing'>drawsNothing</a>() const </pre> -Return true if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> are zero, or if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr. -If true, <a href="#Bitmap">Bitmap</a> has no effect when drawn or drawn into. +Return true if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> are zero, or if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr. +If true, <a href='#Bitmap'>Bitmap</a> has no effect when drawn or drawn into. ### Return Value @@ -1053,22 +1481,22 @@ empty:false isNull:false drawsNothing:false ### See Also -<a href="#SkBitmap_empty">empty</a> <a href="#SkBitmap_isNull">isNull</a> <a href="#SkBitmap_pixelRef">pixelRef</a> +<a href='#SkBitmap_empty'>empty</a> <a href='#SkBitmap_isNull'>isNull</a> <a href='#SkBitmap_pixelRef'>pixelRef</a> --- -<a name="SkBitmap_rowBytes"></a> +<a name='SkBitmap_rowBytes'></a> ## rowBytes -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t rowBytes() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkBitmap_rowBytes'>rowBytes</a>() const </pre> Returns row bytes, the interval from one pixel row to the next. Row bytes -is at least as large as<a href="#SkBitmap_width">width</a> * <a href="#SkBitmap_info">info</a>.<a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a>. +is at least as large as<a href='#SkBitmap_width'>width</a> * <a href='#SkBitmap_info'>info</a>.<a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a>. -Returns zero if <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, or if row bytes supplied to -<a href="#SkBitmap_setInfo">setInfo</a> is not large enough to hold a row of pixels. +Returns zero if <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, or if row bytes supplied to +<a href='#SkBitmap_setInfo'>setInfo</a> is not large enough to hold a row of pixels. ### Return Value @@ -1089,71 +1517,71 @@ setInfo returned:true rowBytes:8 ### See Also -<a href="#SkBitmap_info">info</a> <a href="#SkBitmap_setInfo">setInfo</a> <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a> +<a href='#SkBitmap_info'>info</a> <a href='#SkBitmap_setInfo'>setInfo</a> <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a> --- -<a name="SkBitmap_setAlphaType"></a> +<a name='SkBitmap_setAlphaType'></a> ## setAlphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setAlphaType(SkAlphaType alphaType) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_setAlphaType'>setAlphaType</a>(<a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkBitmap_alphaType'>alphaType</a>) </pre> -Sets <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, if <a href="#SkBitmap_alphaType">alphaType</a> is compatible with <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. -Returns true unless <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> and current <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> -is not <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. +Sets <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, if <a href='#SkBitmap_alphaType'>alphaType</a> is compatible with <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. +Returns true unless <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a> and current <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> +is not <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. -Returns true if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. <a href="#SkBitmap_alphaType">alphaType</a> is ignored, and -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> remains <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. +Returns true if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. <a href='#SkBitmap_alphaType'>alphaType</a> is ignored, and +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> remains <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. -Returns true if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> or <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>. -<a href="#SkBitmap_alphaType">alphaType</a> is ignored, and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> remains <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. +Returns true if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> or <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>. +<a href='#SkBitmap_alphaType'>alphaType</a> is ignored, and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> remains <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. -If <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, or <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>: returns true unless -<a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is not <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. -If <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#SkBitmap_alphaType">alphaType</a> is ignored. +If <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, or <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>: returns true unless +<a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is not <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. +If <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#SkBitmap_alphaType'>alphaType</a> is ignored. -If <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, returns true unless -<a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is not <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. -If <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#SkBitmap_alphaType">alphaType</a> is ignored. If <a href="#SkBitmap_alphaType">alphaType</a> is -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>, it is treated as <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>. +If <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, returns true unless +<a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is not <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. +If <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#SkBitmap_alphaType'>alphaType</a> is ignored. If <a href='#SkBitmap_alphaType'>alphaType</a> is +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>, it is treated as <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>. -This changes <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> in <a href="undocumented#Pixel_Ref">Pixel Ref</a>; all bitmaps sharing <a href="undocumented#Pixel_Ref">Pixel Ref</a> +This changes <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> in <a href='undocumented#Pixel_Ref'>Pixel Ref</a>; all bitmaps sharing <a href='undocumented#Pixel_Ref'>Pixel Ref</a> are affected. ### Parameters -<table> <tr> <td><a name="SkBitmap_setAlphaType_alphaType"> <code><strong>alphaType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> +<table> <tr> <td><a name='SkBitmap_setAlphaType_alphaType'><code><strong>alphaType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> </tr> </table> ### Return Value -true if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is set +true if <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is set ### Example -<div><fiddle-embed name="be21305f5654a1d8ed765710813a1f14"><a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </fiddle-embed></div> +<div><fiddle-embed name="dd73f0f927a049b17982c8cf06dd2d00"><a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </fiddle-embed></div> ### See Also -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="#SkBitmap_setInfo">setInfo</a> +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='#SkBitmap_setInfo'>setInfo</a> --- -<a name="SkBitmap_getPixels"></a> +<a name='SkBitmap_getPixels'></a> ## getPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void* getPixels() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void* <a href='#SkBitmap_getPixels'>getPixels</a>() const </pre> Returns pixel address, the base address corresponding to the pixel origin. @@ -1177,22 +1605,22 @@ bitmap.getColor(0, 0) == 0xFFFFFFFF ### See Also -<a href="#SkBitmap_isNull">isNull</a> <a href="#SkBitmap_drawsNothing">drawsNothing</a> +<a href='#SkBitmap_isNull'>isNull</a> <a href='#SkBitmap_drawsNothing'>drawsNothing</a> --- -<a name="SkBitmap_computeByteSize"></a> +<a name='SkBitmap_computeByteSize'></a> ## computeByteSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t computeByteSize() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkBitmap_computeByteSize'>computeByteSize</a>() const </pre> Returns minimum memory required for pixel storage. -Does not include unused memory on last row when <a href="#SkBitmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkBitmap_width">width</a>. +Does not include unused memory on last row when <a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a> exceeds <a href='#SkBitmap_width'>width</a>. Returns zero if result does not fit in size_t. -Returns zero if <a href="#SkBitmap_height">height</a> or <a href="#SkBitmap_width">width</a> is 0. -Returns <a href="#SkBitmap_height">height</a> times <a href="#SkBitmap_rowBytes">rowBytes</a> if <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns zero if <a href='#SkBitmap_height'>height</a> or <a href='#SkBitmap_width'>width</a> is 0. +Returns <a href='#SkBitmap_height'>height</a> times <a href='#SkBitmap_rowBytes'>rowBytes</a> if <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -1220,20 +1648,20 @@ width: 1000000 height: 1000000 computeByteSize: 4999999000000 ### See Also -<a href="SkImageInfo_Reference#SkImageInfo_computeByteSize">SkImageInfo::computeByteSize</a> +<a href='SkImageInfo_Reference#SkImageInfo_computeByteSize'>SkImageInfo::computeByteSize</a> --- -<a name="SkBitmap_isImmutable"></a> +<a name='SkBitmap_isImmutable'></a> ## isImmutable -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isImmutable() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_isImmutable'>isImmutable</a>() const </pre> Returns true if pixels can not change. -Most immutable <a href="#Bitmap">Bitmap</a> checks trigger an assert only on debug builds. +Most immutable <a href='#Bitmap'>Bitmap</a> checks trigger an assert only on debug builds. ### Return Value @@ -1241,7 +1669,7 @@ true if pixels are immutable ### Example -<div><fiddle-embed name="cca4f94232e5e1fcee9a841b13df9d9c"> +<div><fiddle-embed name="db61fdcd382342ee88ea1b4f27c27b95"> #### Example Output @@ -1254,22 +1682,22 @@ copy is immutable ### See Also -<a href="#SkBitmap_setImmutable">setImmutable</a> <a href="undocumented#SkPixelRef_isImmutable">SkPixelRef::isImmutable</a> <a href="SkImage_Reference#SkImage">SkImage</a> +<a href='#SkBitmap_setImmutable'>setImmutable</a> <a href='undocumented#SkPixelRef_isImmutable'>SkPixelRef::isImmutable</a> <a href='SkImage_Reference#SkImage'>SkImage</a> --- -<a name="SkBitmap_setImmutable"></a> +<a name='SkBitmap_setImmutable'></a> ## setImmutable -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setImmutable() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_setImmutable'>setImmutable</a>() </pre> -Sets internal flag to mark <a href="#Bitmap">Bitmap</a> as immutable. Once set, pixels can not change. -Any other bitmap sharing the same <a href="undocumented#Pixel_Ref">Pixel Ref</a> are also marked as immutable. -Once <a href="undocumented#Pixel_Ref">Pixel Ref</a> is marked immutable, the setting cannot be cleared. +Sets internal flag to mark <a href='#Bitmap'>Bitmap</a> as immutable. Once set, pixels can not change. +Any other bitmap sharing the same <a href='undocumented#Pixel_Ref'>Pixel Ref</a> are also marked as immutable. +Once <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is marked immutable, the setting cannot be cleared. -Writing to immutable <a href="#Bitmap">Bitmap</a> pixels triggers an assert on debug builds. +Writing to immutable <a href='#Bitmap'>Bitmap</a> pixels triggers an assert on debug builds. ### Example @@ -1278,31 +1706,31 @@ Writing to immutable <a href="#Bitmap">Bitmap</a> pixels triggers an assert on d ### See Also -<a href="#SkBitmap_isImmutable">isImmutable</a> <a href="undocumented#SkPixelRef_setImmutable">SkPixelRef::setImmutable</a> <a href="SkImage_Reference#SkImage">SkImage</a> +<a href='#SkBitmap_isImmutable'>isImmutable</a> <a href='undocumented#SkPixelRef_setImmutable'>SkPixelRef::setImmutable</a> <a href='SkImage_Reference#SkImage'>SkImage</a> --- -<a name="SkBitmap_isOpaque"></a> +<a name='SkBitmap_isOpaque'></a> ## isOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isOpaque() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_isOpaque'>isOpaque</a>() const </pre> -Returns true if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is set to hint that all pixels are opaque; their -<a href="SkColor_Reference#Alpha">Color Alpha</a> value is implicitly or explicitly 1.0. If true, and all pixels are +Returns true if <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is set to hint that all pixels are opaque; their +<a href='SkColor_Reference#Alpha'>Color Alpha</a> value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly. -Does not check if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> allows <a href="SkColor_Reference#Alpha">Alpha</a>, or if any pixel value has +Does not check if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> allows <a href='SkColor_Reference#Alpha'>Alpha</a>, or if any pixel value has transparency. ### Return Value -true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> +true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> ### Example -<div><fiddle-embed name="5e76b68bb46d54315eb0c12d83bd6949"><div><a href="#SkBitmap_isOpaque">isOpaque</a> ignores whether all pixels are opaque or not. +<div><fiddle-embed name="5e76b68bb46d54315eb0c12d83bd6949"><div><a href='#SkBitmap_isOpaque'>isOpaque</a> ignores whether all pixels are opaque or not. </div> #### Example Output @@ -1318,21 +1746,21 @@ isOpaque: true ### See Also -<a href="#SkBitmap_ComputeIsOpaque">ComputeIsOpaque</a> <a href="SkImageInfo_Reference#SkImageInfo_isOpaque">SkImageInfo::isOpaque</a> +<a href='#SkBitmap_ComputeIsOpaque'>ComputeIsOpaque</a> <a href='SkImageInfo_Reference#SkImageInfo_isOpaque'>SkImageInfo::isOpaque</a> --- -<a name="SkBitmap_isVolatile"></a> +<a name='SkBitmap_isVolatile'></a> ## isVolatile -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isVolatile() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_isVolatile'>isVolatile</a>() const </pre> If true, provides a hint to caller that pixels should not -be cached. Only true if <a href="#SkBitmap_setIsVolatile">setIsVolatile</a> has been called to mark as volatile. +be cached. Only true if <a href='#SkBitmap_setIsVolatile'>setIsVolatile</a> has been called to mark as volatile. -Volatile state is not shared by other bitmaps sharing the same <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +Volatile state is not shared by other bitmaps sharing the same <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Return Value @@ -1340,7 +1768,7 @@ true if marked volatile ### Example -<div><fiddle-embed name="4f3e4d39cf34ea52fcd933dbafc46dfa"> +<div><fiddle-embed name="23c4543ac6cdd0e8fe762816a0dc2e03"> #### Example Output @@ -1353,60 +1781,60 @@ copy is not volatile ### See Also -<a href="#SkBitmap_setIsVolatile">setIsVolatile</a> +<a href='#SkBitmap_setIsVolatile'>setIsVolatile</a> --- -<a name="SkBitmap_setIsVolatile"></a> +<a name='SkBitmap_setIsVolatile'></a> ## setIsVolatile -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setIsVolatile(bool isVolatile) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_setIsVolatile'>setIsVolatile</a>(bool <a href='#SkBitmap_isVolatile'>isVolatile</a>) </pre> -Sets if pixels should be read from <a href="undocumented#Pixel_Ref">Pixel Ref</a> on every access. <a href="#Bitmap">Bitmaps</a> are not +Sets if pixels should be read from <a href='undocumented#Pixel_Ref'>Pixel Ref</a> on every access. <a href='#Bitmap'>Bitmaps</a> are not volatile by default; a GPU back end may upload pixel values expecting them to be -accessed repeatedly. Marking temporary <a href="#Bitmap">Bitmaps</a> as volatile provides a hint to -<a href="undocumented#Device">Device</a> that the <a href="#Bitmap">Bitmap</a> pixels should not be cached. This can +accessed repeatedly. Marking temporary <a href='#Bitmap'>Bitmaps</a> as volatile provides a hint to +<a href='undocumented#Device'>Device</a> that the <a href='#Bitmap'>Bitmap</a> pixels should not be cached. This can improve performance by avoiding overhead and reducing resource -consumption on <a href="undocumented#Device">Device</a>. +consumption on <a href='undocumented#Device'>Device</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_setIsVolatile_isVolatile"> <code><strong>isVolatile </strong></code> </a></td> <td> -true if backing pixels are temporary</td> +<table> <tr> <td><a name='SkBitmap_setIsVolatile_isVolatile'><code><strong>isVolatile</strong></code></a></td> + <td>true if backing pixels are temporary</td> </tr> </table> ### Example -<div><fiddle-embed name="9443ada07e6123fc895be4c958244218"></fiddle-embed></div> +<div><fiddle-embed name="e8627a4df659b896402f89a91326618f"></fiddle-embed></div> ### See Also -<a href="#SkBitmap_isVolatile">isVolatile</a> +<a href='#SkBitmap_isVolatile'>isVolatile</a> --- -<a name="SkBitmap_reset"></a> +<a name='SkBitmap_reset'></a> ## reset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_reset'>reset</a>() </pre> -Resets to its initial state; all fields are set to zero, as if <a href="#Bitmap">Bitmap</a> had -been initialized by <a href="#SkBitmap_empty_constructor">SkBitmap()</a>. +Resets to its initial state; all fields are set to zero, as if <a href='#Bitmap'>Bitmap</a> had +been initialized by <a href='#SkBitmap_empty_constructor'>SkBitmap()</a>. -Sets width, height, row bytes to zero; pixel address to nullptr; <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> to -<a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; and <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> to <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. +Sets width, height, row bytes to zero; pixel address to nullptr; <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> to +<a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; and <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> to <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. -If <a href="undocumented#Pixel_Ref">Pixel Ref</a> is allocated, its reference count is decreased by one, releasing -its memory if <a href="#Bitmap">Bitmap</a> is the sole owner. +If <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is allocated, its reference count is decreased by one, releasing +its memory if <a href='#Bitmap'>Bitmap</a> is the sole owner. ### Example -<div><fiddle-embed name="458f838acf38302abec477cec3102f0f"> +<div><fiddle-embed name="52ccaeda67924373c5b55a2b89fe314d"> #### Example Output @@ -1419,41 +1847,41 @@ width:0 height:0 isNull:true ### See Also -<a href="#SkBitmap_empty_constructor">SkBitmap()</a> <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> +<a href='#SkBitmap_empty_constructor'>SkBitmap()</a> <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> --- -<a name="SkBitmap_ComputeIsOpaque"></a> +<a name='SkBitmap_ComputeIsOpaque'></a> ## ComputeIsOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool ComputeIsOpaque(const SkBitmap& bm) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkBitmap_ComputeIsOpaque'>ComputeIsOpaque</a>(const <a href='#SkBitmap'>SkBitmap</a>& bm) </pre> -Returns true if all pixels are opaque. <a href="SkImageInfo_Reference#Color_Type">Color Type</a> determines how pixels -are encoded, and whether pixel describes <a href="SkColor_Reference#Alpha">Alpha</a>. Returns true for <a href="SkImageInfo_Reference#Color_Type">Color Types</a> -without alpha in each pixel; for other <a href="SkImageInfo_Reference#Color_Type">Color Types</a>, returns true if all +Returns true if all pixels are opaque. <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> determines how pixels +are encoded, and whether pixel describes <a href='SkColor_Reference#Alpha'>Alpha</a>. Returns true for <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> +without alpha in each pixel; for other <a href='SkImageInfo_Reference#Color_Type'>Color Types</a>, returns true if all pixels have alpha values equivalent to 1.0 or greater. -For <a href="SkImageInfo_Reference#Color_Type">Color Types</a> <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> or <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>: always -returns true. For <a href="SkImageInfo_Reference#Color_Type">Color Types</a> <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, -<a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>: returns true if all pixel <a href="SkColor_Reference#Alpha">Alpha</a> values are 255. -For <a href="SkImageInfo_Reference#Color_Type">Color Type</a> <a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>: returns true if all pixel <a href="SkColor_Reference#Alpha">Alpha</a> values are 15. -For <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>: returns true if all pixel <a href="SkColor_Reference#Alpha">Alpha</a> values are 1.0 or +For <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> or <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>: always +returns true. For <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, +<a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>: returns true if all pixel <a href='SkColor_Reference#Alpha'>Alpha</a> values are 255. +For <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> <a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>: returns true if all pixel <a href='SkColor_Reference#Alpha'>Alpha</a> values are 15. +For <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>: returns true if all pixel <a href='SkColor_Reference#Alpha'>Alpha</a> values are 1.0 or greater. -Returns false for <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns false for <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_ComputeIsOpaque_bm"> <code><strong>bm </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> to check</td> +<table> <tr> <td><a name='SkBitmap_ComputeIsOpaque_bm'><code><strong>bm</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> to check</td> </tr> </table> ### Return Value -true if all pixels have opaque values or <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is opaque +true if all pixels have opaque values or <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is opaque ### Example @@ -1472,23 +1900,23 @@ computeIsOpaque: true ### See Also -<a href="#SkBitmap_isOpaque">isOpaque</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> <a href="SkColor_Reference#Alpha">Alpha</a> +<a href='#SkBitmap_isOpaque'>isOpaque</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> <a href='SkColor_Reference#Alpha'>Alpha</a> --- -<a name="SkBitmap_getBounds"></a> +<a name='SkBitmap_getBounds'></a> ## getBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void getBounds(SkRect* bounds) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_getBounds'>getBounds</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* bounds) const </pre> -Returns <a href="SkRect_Reference#Rect">Rect</a> { 0, 0, <a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a> }. +Returns <a href='SkRect_Reference#Rect'>Rect</a> { 0, 0, <a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a> }. ### Parameters -<table> <tr> <td><a name="SkBitmap_getBounds_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -container for floating point rectangle</td> +<table> <tr> <td><a name='SkBitmap_getBounds_bounds'><code><strong>bounds</strong></code></a></td> + <td>container for floating point rectangle</td> </tr> </table> @@ -1498,22 +1926,22 @@ container for floating point rectangle</td> ### See Also -<a href="#SkBitmap_bounds">bounds</a> +<a href='#SkBitmap_bounds'>bounds</a> --- -<a name="SkBitmap_getBounds_2"></a> +<a name='SkBitmap_getBounds_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void getBounds(SkIRect* bounds) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_getBounds'>getBounds</a>(<a href='SkIRect_Reference#SkIRect'>SkIRect</a>* bounds) const </pre> -Returns <a href="SkIRect_Reference#IRect">IRect</a> { 0, 0, <a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a> }. +Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a> }. ### Parameters -<table> <tr> <td><a name="SkBitmap_getBounds_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -container for integral rectangle</td> +<table> <tr> <td><a name='SkBitmap_getBounds_2_bounds'><code><strong>bounds</strong></code></a></td> + <td>container for integral rectangle</td> </tr> </table> @@ -1523,22 +1951,22 @@ container for integral rectangle</td> ### See Also -<a href="#SkBitmap_bounds">bounds</a> +<a href='#SkBitmap_bounds'>bounds</a> --- -<a name="SkBitmap_bounds"></a> +<a name='SkBitmap_bounds'></a> ## bounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect bounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkBitmap_bounds'>bounds</a>() const </pre> -Returns <a href="SkIRect_Reference#IRect">IRect</a> { 0, 0, <a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a> }. +Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a> }. ### Return Value -integral rectangle from origin to <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> +integral rectangle from origin to <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> ### Example @@ -1546,22 +1974,22 @@ integral rectangle from origin to <a href="#SkBitmap_width">width</a> and <a hre ### See Also -<a href="#SkBitmap_getBounds">getBounds</a><sup><a href="#SkBitmap_getBounds_2">[2]</a></sup> +<a href='#SkBitmap_getBounds'>getBounds</a><sup><a href='#SkBitmap_getBounds_2'>[2]</a></sup> --- -<a name="SkBitmap_dimensions"></a> +<a name='SkBitmap_dimensions'></a> ## dimensions -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkISize dimensions() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkISize'>SkISize</a> <a href='#SkBitmap_dimensions'>dimensions</a>() const </pre> -Returns <a href="undocumented#ISize">ISize</a> { <a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a> }. +Returns <a href='undocumented#ISize'>ISize</a> { <a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a> }. ### Return Value -integral size of <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_height">height</a> +integral size of <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> ### Example @@ -1569,22 +1997,22 @@ integral size of <a href="#SkBitmap_width">width</a> and <a href="#SkBitmap_heig ### See Also -<a href="#SkBitmap_height">height</a> <a href="#SkBitmap_width">width</a> +<a href='#SkBitmap_height'>height</a> <a href='#SkBitmap_width'>width</a> --- -<a name="SkBitmap_getSubset"></a> +<a name='SkBitmap_getSubset'></a> ## getSubset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect getSubset() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkBitmap_getSubset'>getSubset</a>() const </pre> -Returns the bounds of this bitmap, offset by its <a href="undocumented#Pixel_Ref">Pixel Ref</a> origin. +Returns the bounds of this bitmap, offset by its <a href='undocumented#Pixel_Ref'>Pixel Ref</a> origin. ### Return Value -bounds within <a href="undocumented#Pixel_Ref">Pixel Ref</a> bounds +bounds within <a href='undocumented#Pixel_Ref'>Pixel Ref</a> bounds ### Example @@ -1601,56 +2029,61 @@ subset: 100, 100, 412, 412 ### See Also -<a href="#SkBitmap_extractSubset">extractSubset</a> <a href="#SkBitmap_getBounds">getBounds</a><sup><a href="#SkBitmap_getBounds_2">[2]</a></sup> +<a href='#SkBitmap_extractSubset'>extractSubset</a> <a href='#SkBitmap_getBounds'>getBounds</a><sup><a href='#SkBitmap_getBounds_2'>[2]</a></sup> --- -<a name="SkBitmap_setInfo"></a> +<a name='SkBitmap_setInfo'></a> ## setInfo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setInfo(const SkImageInfo& imageInfo, size_t rowBytes = 0) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_setInfo'>setInfo</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, size_t <a href='#SkBitmap_rowBytes'>rowBytes</a> = 0) </pre> -Sets width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a>, and optional -<a href="#SkBitmap_rowBytes">rowBytes</a>. Frees pixels, and returns true if successful. - -<a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> may be altered to a value permitted by <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_colorSpace">colorSpace</a>. -If <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> is -set to <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. -If <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a> and <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> is -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>, <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> is replaced by <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>. -If <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> or <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, -<a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> is set to <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. -If <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, or <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>: <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> remains +Sets width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, and optional +<a href='#SkBitmap_rowBytes'>rowBytes</a>. Frees pixels, and returns true if successful. + +<a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> may be altered to a value permitted by <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_colorSpace'>colorSpace</a>. +If <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> is +set to <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. +If <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a> and <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> is +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>, <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> is replaced by <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>. +If <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> or <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, +<a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> is set to <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. +If <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, or <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>: <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> remains unchanged. -<a href="#SkBitmap_rowBytes">rowBytes</a> must equal or exceed <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>. If <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_colorSpace">colorSpace</a> is -<a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#SkBitmap_rowBytes">rowBytes</a> is ignored and treated as zero; for all other -<a href="undocumented#Color_Space">Color Space</a> values, <a href="#SkBitmap_rowBytes">rowBytes</a> of zero is treated as <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>. +<a href='#SkBitmap_rowBytes'>rowBytes</a> must equal or exceed <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>. If <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_colorSpace'>colorSpace</a> is +<a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#SkBitmap_rowBytes'>rowBytes</a> is ignored and treated as zero; for all other +<a href='undocumented#Color_Space'>Color Space</a> values, <a href='#SkBitmap_rowBytes'>rowBytes</a> of zero is treated as <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>. -Calls <a href="#SkBitmap_reset">reset</a> and returns false if: +Calls <a href='#SkBitmap_reset'>reset</a> and returns false if: <table> <tr> - <td><a href="#SkBitmap_rowBytes">rowBytes</a> exceeds 31 bits</td> </tr> <tr> - <td><a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_width">width</a> is negative</td> </tr> <tr> - <td><a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_height">height</a> is negative</td> </tr> <tr> - <td><a href="#SkBitmap_rowBytes">rowBytes</a> is positive and less than <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_width">width</a> times <a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a></td> </tr> + <td><a href='#SkBitmap_rowBytes'>rowBytes</a> exceeds 31 bits</td> + </tr> <tr> + <td><a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_width'>width</a> is negative</td> + </tr> <tr> + <td><a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_height'>height</a> is negative</td> + </tr> <tr> + <td><a href='#SkBitmap_rowBytes'>rowBytes</a> is positive and less than <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_width'>width</a> times <a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a></td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkBitmap_setInfo_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_setInfo_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -<a href="#SkBitmap_setInfo_imageInfo">imageInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a> or larger; or zero</td> +<table> <tr> <td><a name='SkBitmap_setInfo_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_setInfo_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td><a href='#SkBitmap_setInfo_imageInfo'>imageInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a> or larger; or zero</td> </tr> </table> ### Return Value -true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> set successfully +true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> set successfully ### Example @@ -1658,86 +2091,149 @@ true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> set successful ### See Also -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> <a href="undocumented#Color_Space">Color Space</a> <a href="#SkBitmap_height">height</a> <a href="#SkBitmap_rowBytes">rowBytes</a> <a href="#SkBitmap_width">width</a> +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> <a href='undocumented#Color_Space'>Color Space</a> <a href='#SkBitmap_height'>height</a> <a href='#SkBitmap_rowBytes'>rowBytes</a> <a href='#SkBitmap_width'>width</a> --- -## <a name="SkBitmap_AllocFlags"></a> Enum SkBitmap::AllocFlags +## <a name='SkBitmap_AllocFlags'>Enum SkBitmap::AllocFlags</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkBitmap_AllocFlags">AllocFlags</a> { - <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> = 1 << 0, + enum <a href='#SkBitmap_AllocFlags'>AllocFlags</a> { + <a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a> = 1 << 0, }; </pre> -<a href="#SkBitmap_AllocFlags">AllocFlags</a> provides the option to zero pixel memory when allocated. +<a href='#SkBitmap_AllocFlags'>AllocFlags</a> provides the option to zero pixel memory when allocated. ### Constants -<table> - <tr> - <td><a name="SkBitmap_kZeroPixels_AllocFlag"> <code><strong>SkBitmap::kZeroPixels_AllocFlag </strong></code> </a></td><td>1</td><td>Instructs <a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> and <a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> to zero pixel memory. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkBitmap_kZeroPixels_AllocFlag'><code>SkBitmap::kZeroPixels_AllocFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Instructs <a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a> and <a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a> to zero pixel memory. </td> </tr> </table> ### See Also -<a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> <a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> <a href="#SkBitmap_erase">erase</a> <a href="#SkBitmap_eraseColor">eraseColor</a> +<a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a> <a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a> <a href='#SkBitmap_erase'>erase</a> <a href='#SkBitmap_eraseColor'>eraseColor</a> +## <a name='Allocate'>Allocate</a> -## <a name="Allocate"></a> Allocate +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocN32Pixels'>allocN32Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates compatible <a href='SkColor_Reference#ARGB'>Color ARGB</a> pixels, or aborts</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixels'>allocPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, or aborts</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixels'>allocPixels(const SkImageInfo& info, size t rowBytes)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixels_2'>allocPixels(const SkImageInfo& info)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixels_3'>allocPixels</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixels_4'>allocPixels(Allocator* allocator)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> with options, or aborts</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_installPixels'>installPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, with optional release function</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_installPixels'>installPixels(const SkImageInfo& info, void* pixels, size t rowBytes, void (*releaseProc)</a> (void* addr, void* context) , void* context)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_installPixels_2'>installPixels(const SkImageInfo& info, void* pixels, size t rowBytes)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_installPixels_3'>installPixels(const SkPixmap& pixmap)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocN32Pixels'>tryAllocN32Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates compatible <a href='SkColor_Reference#ARGB'>Color ARGB</a> pixels if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels'>tryAllocPixels(const SkImageInfo& info, size t rowBytes)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels_2'>tryAllocPixels(const SkImageInfo& info)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels_3'>tryAllocPixels</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels_4'>tryAllocPixels(Allocator* allocator)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> with options if possible</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkBitmap_allocN32Pixels">allocN32Pixels</a> | allocates compatible <a href="SkColor_Reference#ARGB">Color ARGB</a> pixels, or aborts | -| <a href="#SkBitmap_allocPixels">allocPixels</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, or aborts | -| | <a href="#SkBitmap_allocPixels">allocPixels(const SkImageInfo& info, size t rowBytes)</a> | -| | <a href="#SkBitmap_allocPixels_2">allocPixels(const SkImageInfo& info)</a> | -| | <a href="#SkBitmap_allocPixels_3">allocPixels</a> | -| | <a href="#SkBitmap_allocPixels_4">allocPixels(Allocator* allocator)</a> | -| <a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> with options, or aborts | -| <a href="#SkBitmap_installPixels">installPixels</a> | creates <a href="undocumented#Pixel_Ref">Pixel Ref</a>, with optional release function | -| | <a href="#SkBitmap_installPixels">installPixels(const SkImageInfo& info, void* pixels, size t rowBytes, void (*releaseProc)</a> (void* addr, void* context) , void* context) | -| | <a href="#SkBitmap_installPixels_2">installPixels(const SkImageInfo& info, void* pixels, size t rowBytes)</a> | -| | <a href="#SkBitmap_installPixels_3">installPixels(const SkPixmap& pixmap)</a> | -| <a href="#SkBitmap_tryAllocN32Pixels">tryAllocN32Pixels</a> | allocates compatible <a href="SkColor_Reference#ARGB">Color ARGB</a> pixels if possible | -| <a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> if possible | -| | <a href="#SkBitmap_tryAllocPixels">tryAllocPixels(const SkImageInfo& info, size t rowBytes)</a> | -| | <a href="#SkBitmap_tryAllocPixels_2">tryAllocPixels(const SkImageInfo& info)</a> | -| | <a href="#SkBitmap_tryAllocPixels_3">tryAllocPixels</a> | -| | <a href="#SkBitmap_tryAllocPixels_4">tryAllocPixels(Allocator* allocator)</a> | -| <a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> | allocates pixels from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> with options if possible | -<a name="SkBitmap_tryAllocPixelsFlags"></a> +<a name='SkBitmap_tryAllocPixelsFlags'></a> ## tryAllocPixelsFlags -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT tryAllocPixelsFlags(const SkImageInfo& info, uint32_t flags) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, uint32_t flags) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a> and allocates pixel -memory. If <a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, memory is zeroed. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a> and allocates pixel +memory. If <a href='#SkBitmap_tryAllocPixelsFlags_flags'>flags</a> is <a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a>, memory is zeroed. -Returns false and calls <a href="#SkBitmap_reset">reset</a> if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or memory could +Returns false and calls <a href='#SkBitmap_reset'>reset</a> if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or memory could not be allocated, or memory could not optionally be zeroed. On most platforms, allocating pixel memory may succeed even though there is not sufficient memory to hold pixels; allocation does not take place until the pixels are written to. The actual behavior depends on the platform -implementation of malloc(), if <a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is zero, and calloc(), if <a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is -<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>. +implementation of malloc(), if <a href='#SkBitmap_tryAllocPixelsFlags_flags'>flags</a> is zero, and calloc(), if <a href='#SkBitmap_tryAllocPixelsFlags_flags'>flags</a> is +<a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a>. -<a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> set to <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> offers equal or better performance than -subsequently calling <a href="#SkBitmap_eraseColor">eraseColor</a> with <a href="SkColor_Reference#SK_ColorTRANSPARENT">SK ColorTRANSPARENT</a>. +<a href='#SkBitmap_tryAllocPixelsFlags_flags'>flags</a> set to <a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a> offers equal or better performance than +subsequently calling <a href='#SkBitmap_eraseColor'>eraseColor</a> with <a href='SkColor_Reference#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_tryAllocPixelsFlags_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_tryAllocPixelsFlags_flags"> <code><strong>flags </strong></code> </a></td> <td> -<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, or zero</td> +<table> <tr> <td><a name='SkBitmap_tryAllocPixelsFlags_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_tryAllocPixelsFlags_flags'><code><strong>flags</strong></code></a></td> + <td><a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a>, or zero</td> </tr> </table> @@ -1747,7 +2243,7 @@ true if pixels allocation is successful ### Example -<div><fiddle-embed name="4fff5f5034ced615ad5a1d50c40aeff3"> +<div><fiddle-embed name="f1d1880d38e0aea4cefd3e11745e8a09"> #### Example Output @@ -1759,21 +2255,21 @@ bitmap allocation succeeded! ### See Also -<a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> <a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a><sup><a href="#SkBitmap_tryAllocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_4">[4]</a></sup> <a href="undocumented#SkMallocPixelRef_MakeZeroed">SkMallocPixelRef::MakeZeroed</a> +<a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a> <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a><sup><a href='#SkBitmap_tryAllocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_4'>[4]</a></sup> <a href='undocumented#SkMallocPixelRef_MakeZeroed'>SkMallocPixelRef::MakeZeroed</a> --- -<a name="SkBitmap_allocPixelsFlags"></a> +<a name='SkBitmap_allocPixelsFlags'></a> ## allocPixelsFlags -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void allocPixelsFlags(const SkImageInfo& info, uint32_t flags) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, uint32_t flags) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a> and allocates pixel -memory. If <a href="#SkBitmap_allocPixelsFlags_flags">flags</a> is <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, memory is zeroed. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a> and allocates pixel +memory. If <a href='#SkBitmap_allocPixelsFlags_flags'>flags</a> is <a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a>, memory is zeroed. -Aborts execution if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or memory could +Aborts execution if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or memory could not be allocated, or memory could not optionally be zeroed. Abort steps may be provided by the user at compile time by defining SK_ABORT. @@ -1781,45 +2277,46 @@ SK_ABORT. On most platforms, allocating pixel memory may succeed even though there is not sufficient memory to hold pixels; allocation does not take place until the pixels are written to. The actual behavior depends on the platform -implementation of malloc(), if <a href="#SkBitmap_allocPixelsFlags_flags">flags</a> is zero, and calloc(), if <a href="#SkBitmap_allocPixelsFlags_flags">flags</a> is -<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>. +implementation of malloc(), if <a href='#SkBitmap_allocPixelsFlags_flags'>flags</a> is zero, and calloc(), if <a href='#SkBitmap_allocPixelsFlags_flags'>flags</a> is +<a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a>. -<a href="#SkBitmap_allocPixelsFlags_flags">flags</a> set to <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> offers equal or better performance than -subsequently calling <a href="#SkBitmap_eraseColor">eraseColor</a> with <a href="SkColor_Reference#SK_ColorTRANSPARENT">SK ColorTRANSPARENT</a>. +<a href='#SkBitmap_allocPixelsFlags_flags'>flags</a> set to <a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a> offers equal or better performance than +subsequently calling <a href='#SkBitmap_eraseColor'>eraseColor</a> with <a href='SkColor_Reference#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_allocPixelsFlags_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_allocPixelsFlags_flags"> <code><strong>flags </strong></code> </a></td> <td> -<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>, or zero</td> +<table> <tr> <td><a name='SkBitmap_allocPixelsFlags_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_allocPixelsFlags_flags'><code><strong>flags</strong></code></a></td> + <td><a href='#SkBitmap_kZeroPixels_AllocFlag'>kZeroPixels AllocFlag</a>, or zero</td> </tr> </table> ### Example -<div><fiddle-embed name="f21b8965a88c94a32393a8890c4672af"><div><a href="undocumented#Text">Text</a> is drawn on a transparent background; drawing the bitmap a second time +<div><fiddle-embed name="737e721c7d9e0f367d25521a1b823b9d"><div><a href='undocumented#Text'>Text</a> is drawn on a transparent background; drawing the bitmap a second time lets the first draw show through. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> <a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="undocumented#SkMallocPixelRef_MakeZeroed">SkMallocPixelRef::MakeZeroed</a> +<a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a> <a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='undocumented#SkMallocPixelRef_MakeZeroed'>SkMallocPixelRef::MakeZeroed</a> --- -<a name="SkBitmap_tryAllocPixels"></a> +<a name='SkBitmap_tryAllocPixels'></a> ## tryAllocPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info, size_t rowBytes) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, size_t <a href='#SkBitmap_rowBytes'>rowBytes</a>) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a> and allocates pixel -memory. <a href="#SkBitmap_rowBytes">rowBytes</a> must equal or exceed info.<a href="#SkBitmap_width">width</a> times info.<a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a>, -or equal zero. Pass in zero for <a href="#SkBitmap_rowBytes">rowBytes</a> to compute the minimum valid value. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a> and allocates pixel +memory. <a href='#SkBitmap_rowBytes'>rowBytes</a> must equal or exceed info.<a href='#SkBitmap_width'>width</a> times info.<a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a>, +or equal zero. Pass in zero for <a href='#SkBitmap_rowBytes'>rowBytes</a> to compute the minimum valid value. -Returns false and calls <a href="#SkBitmap_reset">reset</a> if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or memory could +Returns false and calls <a href='#SkBitmap_reset'>reset</a> if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or memory could not be allocated. On most platforms, allocating pixel memory may succeed even though there is @@ -1829,10 +2326,11 @@ implementation of malloc(). ### Parameters -<table> <tr> <td><a name="SkBitmap_tryAllocPixels_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_tryAllocPixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger; may be zero</td> +<table> <tr> <td><a name='SkBitmap_tryAllocPixels_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_tryAllocPixels_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger; may be zero</td> </tr> </table> @@ -1846,22 +2344,22 @@ true if pixel storage is allocated ### See Also -<a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> <a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="undocumented#SkMallocPixelRef_MakeAllocate">SkMallocPixelRef::MakeAllocate</a> +<a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a> <a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='undocumented#SkMallocPixelRef_MakeAllocate'>SkMallocPixelRef::MakeAllocate</a> --- -<a name="SkBitmap_allocPixels"></a> +<a name='SkBitmap_allocPixels'></a> ## allocPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void allocPixels(const SkImageInfo& info, size_t rowBytes) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_allocPixels'>allocPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, size_t <a href='#SkBitmap_rowBytes'>rowBytes</a>) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a> and allocates pixel -memory. <a href="#SkBitmap_rowBytes">rowBytes</a> must equal or exceed info.<a href="#SkBitmap_width">width</a> times info.<a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a>, -or equal zero. Pass in zero for <a href="#SkBitmap_rowBytes">rowBytes</a> to compute the minimum valid value. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a> and allocates pixel +memory. <a href='#SkBitmap_rowBytes'>rowBytes</a> must equal or exceed info.<a href='#SkBitmap_width'>width</a> times info.<a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a>, +or equal zero. Pass in zero for <a href='#SkBitmap_rowBytes'>rowBytes</a> to compute the minimum valid value. -Aborts execution if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or memory could +Aborts execution if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or memory could not be allocated. Abort steps may be provided by the user at compile time by defining SK_ABORT. @@ -1872,10 +2370,11 @@ implementation of malloc(). ### Parameters -<table> <tr> <td><a name="SkBitmap_allocPixels_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_allocPixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger; may be zero</td> +<table> <tr> <td><a name='SkBitmap_allocPixels_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_allocPixels_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger; may be zero</td> </tr> </table> @@ -1885,20 +2384,20 @@ size of pixel row or larger; may be zero</td> ### See Also -<a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a><sup><a href="#SkBitmap_tryAllocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_4">[4]</a></sup> <a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> <a href="undocumented#SkMallocPixelRef_MakeAllocate">SkMallocPixelRef::MakeAllocate</a> +<a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a><sup><a href='#SkBitmap_tryAllocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_4'>[4]</a></sup> <a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a> <a href='undocumented#SkMallocPixelRef_MakeAllocate'>SkMallocPixelRef::MakeAllocate</a> --- -<a name="SkBitmap_tryAllocPixels_2"></a> +<a name='SkBitmap_tryAllocPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a> and allocates pixel +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a> and allocates pixel memory. -Returns false and calls <a href="#SkBitmap_reset">reset</a> if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or memory could +Returns false and calls <a href='#SkBitmap_reset'>reset</a> if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or memory could not be allocated. On most platforms, allocating pixel memory may succeed even though there is @@ -1908,8 +2407,8 @@ implementation of malloc(). ### Parameters -<table> <tr> <td><a name="SkBitmap_tryAllocPixels_2_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> +<table> <tr> <td><a name='SkBitmap_tryAllocPixels_2_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> </tr> </table> @@ -1923,20 +2422,20 @@ true if pixel storage is allocated ### See Also -<a href="#SkBitmap_tryAllocPixelsFlags">tryAllocPixelsFlags</a> <a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="undocumented#SkMallocPixelRef_MakeAllocate">SkMallocPixelRef::MakeAllocate</a> +<a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a> <a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='undocumented#SkMallocPixelRef_MakeAllocate'>SkMallocPixelRef::MakeAllocate</a> --- -<a name="SkBitmap_allocPixels_2"></a> +<a name='SkBitmap_allocPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void allocPixels(const SkImageInfo& info) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_allocPixels'>allocPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a> and allocates pixel +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a> and allocates pixel memory. -Aborts execution if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or memory could +Aborts execution if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or memory could not be allocated. Abort steps may be provided by the user at compile time by defining SK_ABORT. @@ -1947,8 +2446,8 @@ implementation of malloc(). ### Parameters -<table> <tr> <td><a name="SkBitmap_allocPixels_2_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> +<table> <tr> <td><a name='SkBitmap_allocPixels_2_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> </tr> </table> @@ -1958,37 +2457,39 @@ contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a ### See Also -<a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a><sup><a href="#SkBitmap_tryAllocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_4">[4]</a></sup> <a href="#SkBitmap_allocPixelsFlags">allocPixelsFlags</a> <a href="undocumented#SkMallocPixelRef_MakeAllocate">SkMallocPixelRef::MakeAllocate</a> +<a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a><sup><a href='#SkBitmap_tryAllocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_4'>[4]</a></sup> <a href='#SkBitmap_allocPixelsFlags'>allocPixelsFlags</a> <a href='undocumented#SkMallocPixelRef_MakeAllocate'>SkMallocPixelRef::MakeAllocate</a> --- -<a name="SkBitmap_tryAllocN32Pixels"></a> +<a name='SkBitmap_tryAllocN32Pixels'></a> ## tryAllocN32Pixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT tryAllocN32Pixels(int width, int height, bool isOpaque = false) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkBitmap_tryAllocN32Pixels'>tryAllocN32Pixels</a>(int width, int height, bool <a href='#SkBitmap_isOpaque'>isOpaque</a> = false) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to width, height, and <a href="SkImageInfo_Reference#Color_Type_Native">Native Color Type</a>; and allocates -pixel memory. If <a href="#SkBitmap_isOpaque">isOpaque</a> is true, sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>; -otherwise, sets to <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to width, height, and <a href='SkImageInfo_Reference#kN32_SkColorType'>Native_Color_Type</a>; and allocates +pixel memory. If <a href='#SkBitmap_isOpaque'>isOpaque</a> is true, sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>; +otherwise, sets to <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>. -Calls <a href="#SkBitmap_reset">reset</a> and returns false if width exceeds 29 bits or is negative, +Calls <a href='#SkBitmap_reset'>reset</a> and returns false if width exceeds 29 bits or is negative, or height is negative. Returns false if allocation fails. -Use to create <a href="#Bitmap">Bitmap</a> that matches <a href="SkColor_Reference#SkPMColor">SkPMColor</a>, the native pixel arrangement on -the platform. <a href="#Bitmap">Bitmap</a> drawn to output device skips converting its pixel format. +Use to create <a href='#Bitmap'>Bitmap</a> that matches <a href='SkColor_Reference#SkPMColor'>SkPMColor</a>, the native pixel arrangement on +the platform. <a href='#Bitmap'>Bitmap</a> drawn to output device skips converting its pixel format. ### Parameters -<table> <tr> <td><a name="SkBitmap_tryAllocN32Pixels_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkBitmap_tryAllocN32Pixels_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> - </tr> <tr> <td><a name="SkBitmap_tryAllocN32Pixels_isOpaque"> <code><strong>isOpaque </strong></code> </a></td> <td> -true if pixels do not have transparency</td> +<table> <tr> <td><a name='SkBitmap_tryAllocN32Pixels_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkBitmap_tryAllocN32Pixels_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkBitmap_tryAllocN32Pixels_isOpaque'><code><strong>isOpaque</strong></code></a></td> + <td>true if pixels do not have transparency</td> </tr> </table> @@ -2002,36 +2503,38 @@ true if pixel storage is allocated ### See Also -<a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a><sup><a href="#SkBitmap_tryAllocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_4">[4]</a></sup> <a href="#SkBitmap_allocN32Pixels">allocN32Pixels</a> <a href="undocumented#SkMallocPixelRef_MakeAllocate">SkMallocPixelRef::MakeAllocate</a> +<a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a><sup><a href='#SkBitmap_tryAllocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_4'>[4]</a></sup> <a href='#SkBitmap_allocN32Pixels'>allocN32Pixels</a> <a href='undocumented#SkMallocPixelRef_MakeAllocate'>SkMallocPixelRef::MakeAllocate</a> --- -<a name="SkBitmap_allocN32Pixels"></a> +<a name='SkBitmap_allocN32Pixels'></a> ## allocN32Pixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void allocN32Pixels(int width, int height, bool isOpaque = false) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_allocN32Pixels'>allocN32Pixels</a>(int width, int height, bool <a href='#SkBitmap_isOpaque'>isOpaque</a> = false) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to width, height, and the <a href="SkImageInfo_Reference#Color_Type_Native">Native Color Type</a>; and allocates -pixel memory. If <a href="#SkBitmap_isOpaque">isOpaque</a> is true, sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>; -otherwise, sets to <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to width, height, and the <a href='SkImageInfo_Reference#kN32_SkColorType'>Native_Color_Type</a>; and allocates +pixel memory. If <a href='#SkBitmap_isOpaque'>isOpaque</a> is true, sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>; +otherwise, sets to <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. Aborts if width exceeds 29 bits or is negative, or height is negative, or allocation fails. Abort steps may be provided by the user at compile time by defining SK_ABORT. -Use to create <a href="#Bitmap">Bitmap</a> that matches <a href="SkColor_Reference#SkPMColor">SkPMColor</a>, the native pixel arrangement on -the platform. <a href="#Bitmap">Bitmap</a> drawn to output device skips converting its pixel format. +Use to create <a href='#Bitmap'>Bitmap</a> that matches <a href='SkColor_Reference#SkPMColor'>SkPMColor</a>, the native pixel arrangement on +the platform. <a href='#Bitmap'>Bitmap</a> drawn to output device skips converting its pixel format. ### Parameters -<table> <tr> <td><a name="SkBitmap_allocN32Pixels_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkBitmap_allocN32Pixels_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> - </tr> <tr> <td><a name="SkBitmap_allocN32Pixels_isOpaque"> <code><strong>isOpaque </strong></code> </a></td> <td> -true if pixels do not have transparency</td> +<table> <tr> <td><a name='SkBitmap_allocN32Pixels_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkBitmap_allocN32Pixels_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkBitmap_allocN32Pixels_isOpaque'><code><strong>isOpaque</strong></code></a></td> + <td>true if pixels do not have transparency</td> </tr> </table> @@ -2041,55 +2544,59 @@ true if pixels do not have transparency</td> ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="#SkBitmap_tryAllocN32Pixels">tryAllocN32Pixels</a> <a href="undocumented#SkMallocPixelRef_MakeAllocate">SkMallocPixelRef::MakeAllocate</a> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='#SkBitmap_tryAllocN32Pixels'>tryAllocN32Pixels</a> <a href='undocumented#SkMallocPixelRef_MakeAllocate'>SkMallocPixelRef::MakeAllocate</a> --- -<a name="SkBitmap_installPixels"></a> +<a name='SkBitmap_installPixels'></a> ## installPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, void (*releaseProc) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_installPixels'>installPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, void* pixels, size_t <a href='#SkBitmap_rowBytes'>rowBytes</a>, void (*releaseProc) (void* addr, void* context) , void* context) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a>, and creates <a href="undocumented#Pixel_Ref">Pixel Ref</a> -containing <a href="#SkBitmap_installPixels_pixels">pixels</a> and <a href="#SkBitmap_rowBytes">rowBytes</a>. <a href="#SkBitmap_installPixels_releaseProc">releaseProc</a>, if not nullptr, is called -immediately on failure or when <a href="#SkBitmap_installPixels_pixels">pixels</a> are no longer referenced. <a href="#SkBitmap_installPixels_context">context</a> may be +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a>, and creates <a href='undocumented#Pixel_Ref'>Pixel Ref</a> +containing <a href='#SkBitmap_installPixels_pixels'>pixels</a> and <a href='#SkBitmap_rowBytes'>rowBytes</a>. <a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a>, if not nullptr, is called +immediately on failure or when <a href='#SkBitmap_installPixels_pixels'>pixels</a> are no longer referenced. <a href='#SkBitmap_installPixels_context'>context</a> may be nullptr. -If <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or <a href="#SkBitmap_rowBytes">rowBytes</a> is less than info.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>: -calls <a href="#SkBitmap_installPixels_releaseProc">releaseProc</a> if present, calls <a href="#SkBitmap_reset">reset</a>, and returns false. +If <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or <a href='#SkBitmap_rowBytes'>rowBytes</a> is less than info.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>: +calls <a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a> if present, calls <a href='#SkBitmap_reset'>reset</a>, and returns false. -Otherwise, if <a href="#SkBitmap_installPixels_pixels">pixels</a> equals nullptr: sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, calls <a href="#SkBitmap_installPixels_releaseProc">releaseProc</a> if +Otherwise, if <a href='#SkBitmap_installPixels_pixels'>pixels</a> equals nullptr: sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, calls <a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a> if present, returns true. -If <a href="SkImageInfo_Reference#Image_Info">Image Info</a> is set, <a href="#SkBitmap_installPixels_pixels">pixels</a> is not nullptr, and <a href="#SkBitmap_installPixels_releaseProc">releaseProc</a> is not nullptr: -when <a href="#SkBitmap_installPixels_pixels">pixels</a> are no longer referenced, calls <a href="#SkBitmap_installPixels_releaseProc">releaseProc</a> with <a href="#SkBitmap_installPixels_pixels">pixels</a> and <a href="#SkBitmap_installPixels_context">context</a> +If <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> is set, <a href='#SkBitmap_installPixels_pixels'>pixels</a> is not nullptr, and <a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a> is not nullptr: +when <a href='#SkBitmap_installPixels_pixels'>pixels</a> are no longer referenced, calls <a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a> with <a href='#SkBitmap_installPixels_pixels'>pixels</a> and <a href='#SkBitmap_installPixels_context'>context</a> as parameters. ### Parameters -<table> <tr> <td><a name="SkBitmap_installPixels_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_installPixels_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -address or pixel storage; may be nullptr</td> - </tr> <tr> <td><a name="SkBitmap_installPixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger</td> - </tr> <tr> <td><a name="SkBitmap_installPixels_releaseProc"> <code><strong>releaseProc </strong></code> </a></td> <td> -function called when <a href="#SkBitmap_installPixels_pixels">pixels</a> can be deleted; may be nullptr</td> - </tr> <tr> <td><a name="SkBitmap_installPixels_context"> <code><strong>context </strong></code> </a></td> <td> -caller state passed to <a href="#SkBitmap_installPixels_releaseProc">releaseProc</a>; may be nullptr</td> +<table> <tr> <td><a name='SkBitmap_installPixels_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_installPixels_pixels'><code><strong>pixels</strong></code></a></td> + <td>address or pixel storage; may be nullptr</td> + </tr> + <tr> <td><a name='SkBitmap_installPixels_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger</td> + </tr> + <tr> <td><a name='SkBitmap_installPixels_releaseProc'><code><strong>releaseProc</strong></code></a></td> + <td>function called when <a href='#SkBitmap_installPixels_pixels'>pixels</a> can be deleted; may be nullptr</td> + </tr> + <tr> <td><a name='SkBitmap_installPixels_context'><code><strong>context</strong></code></a></td> + <td>caller state passed to <a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> is set to info +true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> is set to info ### Example -<div><fiddle-embed name="ff5b5c349efb5d929ff5dff07b7727e6"><div><a href="#SkBitmap_installPixels_releaseProc">releaseProc</a> is called immediately because <a href="#SkBitmap_rowBytes">rowBytes</a> is too small for <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +<div><fiddle-embed name="8c4f7bf73fffa1a812ee8e88e44e639c"><div><a href='#SkBitmap_installPixels_releaseProc'>releaseProc</a> is called immediately because <a href='#SkBitmap_rowBytes'>rowBytes</a> is too small for <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. </div> #### Example Output @@ -2104,138 +2611,182 @@ install not successful ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_installPixels_2"></a> +<a name='SkBitmap_installPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_installPixels'>installPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, void* pixels, size_t <a href='#SkBitmap_rowBytes'>rowBytes</a>) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to info following the rules in <a href="#SkBitmap_setInfo">setInfo</a>, and creates <a href="undocumented#Pixel_Ref">Pixel Ref</a> -containing <a href="#SkBitmap_installPixels_2_pixels">pixels</a> and <a href="#SkBitmap_rowBytes">rowBytes</a>. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to info following the rules in <a href='#SkBitmap_setInfo'>setInfo</a>, and creates <a href='undocumented#Pixel_Ref'>Pixel Ref</a> +containing <a href='#SkBitmap_installPixels_2_pixels'>pixels</a> and <a href='#SkBitmap_rowBytes'>rowBytes</a>. -If <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or <a href="#SkBitmap_rowBytes">rowBytes</a> is less than info.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>: -calls <a href="#SkBitmap_reset">reset</a>, and returns false. +If <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or <a href='#SkBitmap_rowBytes'>rowBytes</a> is less than info.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>: +calls <a href='#SkBitmap_reset'>reset</a>, and returns false. -Otherwise, if <a href="#SkBitmap_installPixels_2_pixels">pixels</a> equals nullptr: sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, returns true. +Otherwise, if <a href='#SkBitmap_installPixels_2_pixels'>pixels</a> equals nullptr: sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, returns true. -Caller must ensure that <a href="#SkBitmap_installPixels_2_pixels">pixels</a> are valid for the lifetime of <a href="#Bitmap">Bitmap</a> and <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +Caller must ensure that <a href='#SkBitmap_installPixels_2_pixels'>pixels</a> are valid for the lifetime of <a href='#Bitmap'>Bitmap</a> and <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_installPixels_2_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_installPixels_2_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -address or pixel storage; may be nullptr</td> - </tr> <tr> <td><a name="SkBitmap_installPixels_2_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger</td> +<table> <tr> <td><a name='SkBitmap_installPixels_2_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_installPixels_2_pixels'><code><strong>pixels</strong></code></a></td> + <td>address or pixel storage; may be nullptr</td> + </tr> + <tr> <td><a name='SkBitmap_installPixels_2_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger</td> </tr> </table> ### Return Value -true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> is set to info +true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> is set to info ### Example -<div><fiddle-embed name="a7e04447b2081010c50d7920e80a6bb2"><div>GPU does not support <a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>, does not assert that it does not. +<div><fiddle-embed name="a7e04447b2081010c50d7920e80a6bb2"><div>GPU does not support <a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>, does not assert that it does not. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_installPixels_3"></a> +<a name='SkBitmap_installPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool installPixels(const SkPixmap& pixmap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_installPixels'>installPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& pixmap) </pre> -Sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to pixmap.<a href="#SkBitmap_info">info</a> following the rules in <a href="#SkBitmap_setInfo">setInfo</a>, and creates -<a href="undocumented#Pixel_Ref">Pixel Ref</a> containing pixmap.addr() and pixmap.<a href="#SkBitmap_rowBytes">rowBytes</a>. +Sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to pixmap.<a href='#SkBitmap_info'>info</a> following the rules in <a href='#SkBitmap_setInfo'>setInfo</a>, and creates +<a href='undocumented#Pixel_Ref'>Pixel Ref</a> containing pixmap.addr() and pixmap.<a href='#SkBitmap_rowBytes'>rowBytes</a>. -If <a href="SkImageInfo_Reference#Image_Info">Image Info</a> could not be set, or pixmap.<a href="#SkBitmap_rowBytes">rowBytes</a> is less than -<a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>: calls <a href="#SkBitmap_reset">reset</a>, and returns false. +If <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> could not be set, or pixmap.<a href='#SkBitmap_rowBytes'>rowBytes</a> is less than +<a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a>: calls <a href='#SkBitmap_reset'>reset</a>, and returns false. -Otherwise, if pixmap.addr() equals nullptr: sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, returns true. +Otherwise, if pixmap.addr() equals nullptr: sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, returns true. -Caller must ensure that pixmap is valid for the lifetime of <a href="#Bitmap">Bitmap</a> and <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +Caller must ensure that pixmap is valid for the lifetime of <a href='#Bitmap'>Bitmap</a> and <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_installPixels_3_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixel address, and <a href="#SkBitmap_rowBytes">rowBytes</a></td> +<table> <tr> <td><a name='SkBitmap_installPixels_3_pixmap'><code><strong>pixmap</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixel address, and <a href='#SkBitmap_rowBytes'>rowBytes</a></td> </tr> </table> ### Return Value -true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> was set to pixmap.<a href="#SkBitmap_info">info</a> +true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> was set to pixmap.<a href='#SkBitmap_info'>info</a> ### Example -<div><fiddle-embed name="6e2a8c9358b34aebd2ec586815fe9d3a"><div><a href="#Draw">Draw</a> a five by five bitmap, and draw it again with a center white pixel. +<div><fiddle-embed name="6e2a8c9358b34aebd2ec586815fe9d3a"><div><a href='#Draw'>Draw</a> a five by five bitmap, and draw it again with a center white pixel. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_installMaskPixels"></a> +<a name='SkBitmap_installMaskPixels'></a> ## installMaskPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool installMaskPixels(const SkMask& mask) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_installMaskPixels'>installMaskPixels</a>(const <a href='undocumented#SkMask'>SkMask</a>& mask) </pre> +Deprecated. + soon --- -## <a name="Pixels"></a> Pixels +## <a name='Pixels'>Pixels</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_notifyPixelsChanged'>notifyPixelsChanged</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks pixels as changed, altering the unique ID</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels_2'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels_3'>readPixels(const SkPixmap& dst, int srcX, int srcY)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels_4'>readPixels(const SkPixmap& dst)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setPixels'>setPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> without an offset</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_writePixels'>writePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_writePixels'>writePixels(const SkPixmap& src, int dstX, int dstY)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_writePixels_2'>writePixels(const SkPixmap& src)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_writePixels_3'>writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior)</a></td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkBitmap_notifyPixelsChanged">notifyPixelsChanged</a> | marks pixels as changed, altering the unique ID | -| <a href="#SkBitmap_peekPixels">peekPixels</a> | returns <a href="SkPixmap_Reference#Pixmap">Pixmap</a> if possible | -| <a href="#SkBitmap_readPixels">readPixels</a> | copies and converts pixels | -| | <a href="#SkBitmap_readPixels">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior)</a> const | -| | <a href="#SkBitmap_readPixels_2">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a> const | -| | <a href="#SkBitmap_readPixels_3">readPixels(const SkPixmap& dst, int srcX, int srcY)</a> const | -| | <a href="#SkBitmap_readPixels_4">readPixels(const SkPixmap& dst)</a> const | -| <a href="#SkBitmap_setPixels">setPixels</a> | sets <a href="undocumented#Pixel_Ref">Pixel Ref</a> without an offset | -| <a href="#SkBitmap_writePixels">writePixels</a> | copies and converts pixels | -| | <a href="#SkBitmap_writePixels">writePixels(const SkPixmap& src, int dstX, int dstY)</a> | -| | <a href="#SkBitmap_writePixels_2">writePixels(const SkPixmap& src)</a> | -| | <a href="#SkBitmap_writePixels_3">writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior)</a> | -<a name="SkBitmap_setPixels"></a> +<a name='SkBitmap_setPixels'></a> ## setPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPixels(void* pixels) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_setPixels'>setPixels</a>(void* pixels) </pre> -Replaces <a href="undocumented#Pixel_Ref">Pixel Ref</a> with <a href="#SkBitmap_setPixels_pixels">pixels</a>, preserving <a href="SkImageInfo_Reference#Image_Info">Image Info</a> and <a href="#SkBitmap_rowBytes">rowBytes</a>. -Sets <a href="undocumented#Pixel_Ref">Pixel Ref</a> origin to (0, 0). +Replaces <a href='undocumented#Pixel_Ref'>Pixel Ref</a> with <a href='#SkBitmap_setPixels_pixels'>pixels</a>, preserving <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> and <a href='#SkBitmap_rowBytes'>rowBytes</a>. +Sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> origin to (0, 0). -If <a href="#SkBitmap_setPixels_pixels">pixels</a> is nullptr, or if <a href="#SkBitmap_info">info</a>.<a href="#SkBitmap_colorType">colorType</a> equals <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; -release reference to <a href="undocumented#Pixel_Ref">Pixel Ref</a>, and set <a href="undocumented#Pixel_Ref">Pixel Ref</a> to nullptr. +If <a href='#SkBitmap_setPixels_pixels'>pixels</a> is nullptr, or if <a href='#SkBitmap_info'>info</a>.<a href='#SkBitmap_colorType'>colorType</a> equals <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; +release reference to <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, and set <a href='undocumented#Pixel_Ref'>Pixel Ref</a> to nullptr. Caller is responsible for handling ownership pixel memory for the lifetime -of <a href="#Bitmap">Bitmap</a> and <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +of <a href='#Bitmap'>Bitmap</a> and <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_setPixels_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -address of pixel storage, managed by caller</td> +<table> <tr> <td><a name='SkBitmap_setPixels_pixels'><code><strong>pixels</strong></code></a></td> + <td>address of pixel storage, managed by caller</td> </tr> </table> @@ -2245,20 +2796,20 @@ address of pixel storage, managed by caller</td> ### See Also -<a href="#SkBitmap_installPixels">installPixels</a><sup><a href="#SkBitmap_installPixels_2">[2]</a></sup><sup><a href="#SkBitmap_installPixels_3">[3]</a></sup> <a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> +<a href='#SkBitmap_installPixels'>installPixels</a><sup><a href='#SkBitmap_installPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_installPixels_3'>[3]</a></sup> <a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_tryAllocPixels_3"></a> +<a name='SkBitmap_tryAllocPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT tryAllocPixels() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a>() </pre> -Allocates pixel memory with <a href="#SkBitmap_HeapAllocator">HeapAllocator</a>, and replaces existing <a href="undocumented#Pixel_Ref">Pixel Ref</a>. -The allocation size is determined by <a href="SkImageInfo_Reference#Image_Info">Image Info</a> width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +Allocates pixel memory with <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a>, and replaces existing <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. +The allocation size is determined by <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -Returns false if <a href="#SkBitmap_info">info</a>.<a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, or allocation fails. +Returns false if <a href='#SkBitmap_info'>info</a>.<a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, or allocation fails. ### Return Value @@ -2266,97 +2817,97 @@ true if the allocation succeeds ### Example -<div><fiddle-embed name="720e4c053fae9e929ab6518b47e49370"><div><a href="#Bitmap">Bitmap</a> hosts and draws gray values in set1. <a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a> replaces <a href="undocumented#Pixel_Ref">Pixel Ref</a> -and erases it to black, but does not alter set1. <a href="#SkBitmap_setPixels">setPixels</a> replaces black -<a href="undocumented#Pixel_Ref">Pixel Ref</a> with set1. +<div><fiddle-embed name="720e4c053fae9e929ab6518b47e49370"><div><a href='#Bitmap'>Bitmap</a> hosts and draws gray values in set1. <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a> replaces <a href='undocumented#Pixel_Ref'>Pixel Ref</a> +and erases it to black, but does not alter set1. <a href='#SkBitmap_setPixels'>setPixels</a> replaces black +<a href='undocumented#Pixel_Ref'>Pixel Ref</a> with set1. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="#SkBitmap_installPixels">installPixels</a><sup><a href="#SkBitmap_installPixels_2">[2]</a></sup><sup><a href="#SkBitmap_installPixels_3">[3]</a></sup> <a href="#SkBitmap_setPixels">setPixels</a> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='#SkBitmap_installPixels'>installPixels</a><sup><a href='#SkBitmap_installPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_installPixels_3'>[3]</a></sup> <a href='#SkBitmap_setPixels'>setPixels</a> --- -<a name="SkBitmap_allocPixels_3"></a> +<a name='SkBitmap_allocPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void allocPixels() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_allocPixels'>allocPixels</a>() </pre> -Allocates pixel memory with <a href="#SkBitmap_HeapAllocator">HeapAllocator</a>, and replaces existing <a href="undocumented#Pixel_Ref">Pixel Ref</a>. -The allocation size is determined by <a href="SkImageInfo_Reference#Image_Info">Image Info</a> width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +Allocates pixel memory with <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a>, and replaces existing <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. +The allocation size is determined by <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -Aborts if <a href="#SkBitmap_info">info</a>.<a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, or allocation fails. +Aborts if <a href='#SkBitmap_info'>info</a>.<a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, or allocation fails. Abort steps may be provided by the user at compile time by defining SK_ABORT. ### Example -<div><fiddle-embed name="1219b38c788bf270fb20f8cd2d78cff8"><div><a href="#Bitmap">Bitmap</a> hosts and draws gray values in set1. <a href="#SkBitmap_allocPixels">allocPixels</a> replaces <a href="undocumented#Pixel_Ref">Pixel Ref</a> -and erases it to black, but does not alter set1. <a href="#SkBitmap_setPixels">setPixels</a> replaces black -<a href="undocumented#Pixel_Ref">Pixel Ref</a> with set2. +<div><fiddle-embed name="1219b38c788bf270fb20f8cd2d78cff8"><div><a href='#Bitmap'>Bitmap</a> hosts and draws gray values in set1. <a href='#SkBitmap_allocPixels'>allocPixels</a> replaces <a href='undocumented#Pixel_Ref'>Pixel Ref</a> +and erases it to black, but does not alter set1. <a href='#SkBitmap_setPixels'>setPixels</a> replaces black +<a href='undocumented#Pixel_Ref'>Pixel Ref</a> with set2. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_tryAllocPixels">tryAllocPixels</a><sup><a href="#SkBitmap_tryAllocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_tryAllocPixels_4">[4]</a></sup> <a href="#SkBitmap_installPixels">installPixels</a><sup><a href="#SkBitmap_installPixels_2">[2]</a></sup><sup><a href="#SkBitmap_installPixels_3">[3]</a></sup> <a href="#SkBitmap_setPixels">setPixels</a> +<a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a><sup><a href='#SkBitmap_tryAllocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_tryAllocPixels_4'>[4]</a></sup> <a href='#SkBitmap_installPixels'>installPixels</a><sup><a href='#SkBitmap_installPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_installPixels_3'>[3]</a></sup> <a href='#SkBitmap_setPixels'>setPixels</a> --- -<a name="SkBitmap_tryAllocPixels_4"></a> +<a name='SkBitmap_tryAllocPixels_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT tryAllocPixels(Allocator* allocator) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a>(<a href='#SkBitmap_Allocator'>Allocator</a>* allocator) </pre> -Allocates pixel memory with <a href="#SkBitmap_tryAllocPixels_4_allocator">allocator</a>, and replaces existing <a href="undocumented#Pixel_Ref">Pixel Ref</a>. -The allocation size is determined by <a href="SkImageInfo_Reference#Image_Info">Image Info</a> width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. -If <a href="#SkBitmap_tryAllocPixels_4_allocator">allocator</a> is nullptr, use <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> instead. +Allocates pixel memory with <a href='#SkBitmap_tryAllocPixels_4_allocator'>allocator</a>, and replaces existing <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. +The allocation size is determined by <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. +If <a href='#SkBitmap_tryAllocPixels_4_allocator'>allocator</a> is nullptr, use <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> instead. -Returns false if <a href="#SkBitmap_Allocator_allocPixelRef">Allocator::allocPixelRef</a> return false. +Returns false if <a href='#SkBitmap_Allocator_allocPixelRef'>Allocator::allocPixelRef</a> return false. ### Parameters -<table> <tr> <td><a name="SkBitmap_tryAllocPixels_4_allocator"> <code><strong>allocator </strong></code> </a></td> <td> -instance of <a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> instantiation</td> +<table> <tr> <td><a name='SkBitmap_tryAllocPixels_4_allocator'><code><strong>allocator</strong></code></a></td> + <td>instance of <a href='#SkBitmap_Allocator'>SkBitmap::Allocator</a> instantiation</td> </tr> </table> ### Return Value -true if custom <a href="#SkBitmap_tryAllocPixels_4_allocator">allocator</a> reports success +true if custom <a href='#SkBitmap_tryAllocPixels_4_allocator'>allocator</a> reports success ### Example -<div><fiddle-embed name="eb6f861ca1839146d26e40d56c2a001c"><div><a href="#SkBitmap_HeapAllocator">HeapAllocator</a> limits the maximum size of <a href="#Bitmap">Bitmap</a> to two gigabytes. Using -a custom <a href="#SkBitmap_tryAllocPixels_4_allocator">allocator</a>, this limitation may be relaxed. This example can be -modified to allocate an eight gigabyte <a href="#Bitmap">Bitmap</a> on a 64 bit platform with +<div><fiddle-embed name="eb6f861ca1839146d26e40d56c2a001c"><div><a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> limits the maximum size of <a href='#Bitmap'>Bitmap</a> to two gigabytes. Using +a custom <a href='#SkBitmap_tryAllocPixels_4_allocator'>allocator</a>, this limitation may be relaxed. This example can be +modified to allocate an eight gigabyte <a href='#Bitmap'>Bitmap</a> on a 64-bit platform with sufficient memory. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="#SkBitmap_Allocator">Allocator</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='#SkBitmap_Allocator'>Allocator</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> --- -<a name="SkBitmap_allocPixels_4"></a> +<a name='SkBitmap_allocPixels_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void allocPixels(Allocator* allocator) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_allocPixels'>allocPixels</a>(<a href='#SkBitmap_Allocator'>Allocator</a>* allocator) </pre> -Allocates pixel memory with <a href="#SkBitmap_allocPixels_4_allocator">allocator</a>, and replaces existing <a href="undocumented#Pixel_Ref">Pixel Ref</a>. -The allocation size is determined by <a href="SkImageInfo_Reference#Image_Info">Image Info</a> width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. -If <a href="#SkBitmap_allocPixels_4_allocator">allocator</a> is nullptr, use <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> instead. +Allocates pixel memory with <a href='#SkBitmap_allocPixels_4_allocator'>allocator</a>, and replaces existing <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. +The allocation size is determined by <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. +If <a href='#SkBitmap_allocPixels_4_allocator'>allocator</a> is nullptr, use <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> instead. -Aborts if <a href="#SkBitmap_Allocator_allocPixelRef">Allocator::allocPixelRef</a> return false. Abort steps may be provided by +Aborts if <a href='#SkBitmap_Allocator_allocPixelRef'>Allocator::allocPixelRef</a> return false. Abort steps may be provided by the user at compile time by defining SK_ABORT. ### Parameters -<table> <tr> <td><a name="SkBitmap_allocPixels_4_allocator"> <code><strong>allocator </strong></code> </a></td> <td> -instance of <a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> instantiation</td> +<table> <tr> <td><a name='SkBitmap_allocPixels_4_allocator'><code><strong>allocator</strong></code></a></td> + <td>instance of <a href='#SkBitmap_Allocator'>SkBitmap::Allocator</a> instantiation</td> </tr> </table> @@ -2366,25 +2917,25 @@ instance of <a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> instantiation< ### See Also -<a href="#SkBitmap_allocPixels">allocPixels</a><sup><a href="#SkBitmap_allocPixels_2">[2]</a></sup><sup><a href="#SkBitmap_allocPixels_3">[3]</a></sup><sup><a href="#SkBitmap_allocPixels_4">[4]</a></sup> <a href="#SkBitmap_Allocator">Allocator</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +<a href='#SkBitmap_allocPixels'>allocPixels</a><sup><a href='#SkBitmap_allocPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_allocPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_allocPixels_4'>[4]</a></sup> <a href='#SkBitmap_Allocator'>Allocator</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> --- -<a name="SkBitmap_pixelRef"></a> +<a name='SkBitmap_pixelRef'></a> ## pixelRef -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPixelRef* pixelRef() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkPixelRef'>SkPixelRef</a>* <a href='#SkBitmap_pixelRef'>pixelRef</a>() const </pre> -Returns <a href="undocumented#Pixel_Ref">Pixel Ref</a>, which contains: pixel base address; its dimensions; and -<a href="#SkBitmap_rowBytes">rowBytes</a>, the interval from one row to the next. Does not change <a href="undocumented#Pixel_Ref">Pixel Ref</a> -reference count. <a href="undocumented#Pixel_Ref">Pixel Ref</a> may be shared by multiple bitmaps. -If <a href="undocumented#Pixel_Ref">Pixel Ref</a> has not been set, returns nullptr. +Returns <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, which contains: pixel base address; its dimensions; and +<a href='#SkBitmap_rowBytes'>rowBytes</a>, the interval from one row to the next. Does not change <a href='undocumented#Pixel_Ref'>Pixel Ref</a> +reference count. <a href='undocumented#Pixel_Ref'>Pixel Ref</a> may be shared by multiple bitmaps. +If <a href='undocumented#Pixel_Ref'>Pixel Ref</a> has not been set, returns nullptr. ### Return Value -<a href="undocumented#Pixel_Ref">Pixel Ref</a>, or nullptr +<a href='undocumented#Pixel_Ref'>Pixel Ref</a>, or nullptr ### Example @@ -2392,29 +2943,29 @@ If <a href="undocumented#Pixel_Ref">Pixel Ref</a> has not been set, returns null ### See Also -<a href="#SkBitmap_getPixels">getPixels</a> <a href="#SkBitmap_getAddr">getAddr</a> +<a href='#SkBitmap_getPixels'>getPixels</a> <a href='#SkBitmap_getAddr'>getAddr</a> --- -<a name="SkBitmap_pixelRefOrigin"></a> +<a name='SkBitmap_pixelRefOrigin'></a> ## pixelRefOrigin -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIPoint pixelRefOrigin() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a> <a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a>() const </pre> -Returns origin of pixels within <a href="undocumented#Pixel_Ref">Pixel Ref</a>. <a href="#Bitmap">Bitmap</a> bounds is always contained -by <a href="undocumented#Pixel_Ref">Pixel Ref</a> bounds, which may be the same size or larger. Multiple <a href="#Bitmap">Bitmaps</a> -can share the same <a href="undocumented#Pixel_Ref">Pixel Ref</a>, where each <a href="#Bitmap">Bitmap</a> has different bounds. +Returns origin of pixels within <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. <a href='#Bitmap'>Bitmap</a> bounds is always contained +by <a href='undocumented#Pixel_Ref'>Pixel Ref</a> bounds, which may be the same size or larger. Multiple <a href='#Bitmap'>Bitmaps</a> +can share the same <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, where each <a href='#Bitmap'>Bitmap</a> has different bounds. -The returned origin added to <a href="#Bitmap">Bitmap</a> dimensions equals or is smaller than the -<a href="undocumented#Pixel_Ref">Pixel Ref</a> dimensions. +The returned origin added to <a href='#Bitmap'>Bitmap</a> dimensions equals or is smaller than the +<a href='undocumented#Pixel_Ref'>Pixel Ref</a> dimensions. -Returns (0, 0) if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr. +Returns (0, 0) if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr. ### Return Value -pixel origin within <a href="undocumented#Pixel_Ref">Pixel Ref</a> +pixel origin within <a href='undocumented#Pixel_Ref'>Pixel Ref</a> ### Example @@ -2431,71 +2982,95 @@ subset origin: 32, 64 ### See Also -<a href="undocumented#SkPixelRef">SkPixelRef</a> <a href="#SkBitmap_getSubset">getSubset</a> <a href="#SkBitmap_setPixelRef">setPixelRef</a> +<a href='undocumented#SkPixelRef'>SkPixelRef</a> <a href='#SkBitmap_getSubset'>getSubset</a> <a href='#SkBitmap_setPixelRef'>setPixelRef</a> --- -## <a name="Set"></a> Set +## <a name='Set'>Set</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setAlphaType'>setAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of shared pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setHasHardwareMipMap'>setHasHardwareMipMap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets Mip_Map support present; Android only</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setImmutable'>setImmutable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks that pixels will not change</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setInfo'>setInfo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets height, width, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and so on, releasing pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setIsVolatile'>setIsVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks if pixels should not be cached</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setPixelRef'>setPixelRef</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> and offset</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkBitmap_setAlphaType">setAlphaType</a> | sets <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> of shared pixels | -| <a href="#SkBitmap_setHasHardwareMipMap">setHasHardwareMipMap</a> | sets Mip_Map support present; Android only | -| <a href="#SkBitmap_setImmutable">setImmutable</a> | marks that pixels will not change | -| <a href="#SkBitmap_setInfo">setInfo</a> | sets height, width, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and so on, releasing pixels | -| <a href="#SkBitmap_setIsVolatile">setIsVolatile</a> | marks if pixels should not be cached | -| <a href="#SkBitmap_setPixelRef">setPixelRef</a> | sets <a href="undocumented#Pixel_Ref">Pixel Ref</a> and offset | -<a name="SkBitmap_setPixelRef"></a> +<a name='SkBitmap_setPixelRef'></a> ## setPixelRef -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPixelRef(sk_sp<SkPixelRef> pixelRef, int dx, int dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_setPixelRef'>setPixelRef</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkPixelRef'>SkPixelRef</a>> <a href='#SkBitmap_pixelRef'>pixelRef</a>, int dx, int dy) </pre> -Replaces <a href="#SkBitmap_pixelRef">pixelRef</a> and origin in <a href="#Bitmap">Bitmap</a>. <a href="#SkBitmap_setPixelRef_dx">dx</a> and <a href="#SkBitmap_setPixelRef_dy">dy</a> specify the offset -within the <a href="undocumented#Pixel_Ref">Pixel Ref</a> pixels for the top-left corner of the bitmap. +Replaces <a href='#SkBitmap_pixelRef'>pixelRef</a> and origin in <a href='#Bitmap'>Bitmap</a>. <a href='#SkBitmap_setPixelRef_dx'>dx</a> and <a href='#SkBitmap_setPixelRef_dy'>dy</a> specify the offset +within the <a href='undocumented#Pixel_Ref'>Pixel Ref</a> pixels for the top-left corner of the bitmap. -Asserts in debug builds if <a href="#SkBitmap_setPixelRef_dx">dx</a> or <a href="#SkBitmap_setPixelRef_dy">dy</a> are out of range. Pins <a href="#SkBitmap_setPixelRef_dx">dx</a> and <a href="#SkBitmap_setPixelRef_dy">dy</a> +Asserts in debug builds if <a href='#SkBitmap_setPixelRef_dx'>dx</a> or <a href='#SkBitmap_setPixelRef_dy'>dy</a> are out of range. Pins <a href='#SkBitmap_setPixelRef_dx'>dx</a> and <a href='#SkBitmap_setPixelRef_dy'>dy</a> to legal range in release builds. The caller is responsible for ensuring that the pixels match the -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a>. +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_setPixelRef_pixelRef"> <code><strong>pixelRef </strong></code> </a></td> <td> -<a href="undocumented#Pixel_Ref">Pixel Ref</a> describing pixel address and <a href="#SkBitmap_rowBytes">rowBytes</a></td> - </tr> <tr> <td><a name="SkBitmap_setPixelRef_dx"> <code><strong>dx </strong></code> </a></td> <td> -column offset in <a href="undocumented#Pixel_Ref">Pixel Ref</a> for bitmap origin</td> - </tr> <tr> <td><a name="SkBitmap_setPixelRef_dy"> <code><strong>dy </strong></code> </a></td> <td> -row offset in <a href="undocumented#Pixel_Ref">Pixel Ref</a> for bitmap origin</td> +<table> <tr> <td><a name='SkBitmap_setPixelRef_pixelRef'><code><strong>pixelRef</strong></code></a></td> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> describing pixel address and <a href='#SkBitmap_rowBytes'>rowBytes</a></td> + </tr> + <tr> <td><a name='SkBitmap_setPixelRef_dx'><code><strong>dx</strong></code></a></td> + <td>column offset in <a href='undocumented#Pixel_Ref'>Pixel Ref</a> for bitmap origin</td> + </tr> + <tr> <td><a name='SkBitmap_setPixelRef_dy'><code><strong>dy</strong></code></a></td> + <td>row offset in <a href='undocumented#Pixel_Ref'>Pixel Ref</a> for bitmap origin</td> </tr> </table> ### Example -<div><fiddle-embed name="13df9e5b1adcec33d11e4b0f8a91ecb8"><div>Treating 32 bit data as 8 bit data is unlikely to produce useful results. +<div><fiddle-embed name="f98cc0451c6e77a8833d261c9a484c5f"><div>Treating 32-bit data as 8-bit data is unlikely to produce useful results. </div></fiddle-embed></div> ### See Also -<a href="#SkBitmap_setInfo">setInfo</a> +<a href='#SkBitmap_setInfo'>setInfo</a> --- -<a name="SkBitmap_readyToDraw"></a> +<a name='SkBitmap_readyToDraw'></a> ## readyToDraw -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readyToDraw() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_readyToDraw'>readyToDraw</a>() const </pre> -Returns true if <a href="#Bitmap">Bitmap</a> is can be drawn. +Returns true if <a href='#Bitmap'>Bitmap</a> is can be drawn. ### Return Value -true if <a href="#SkBitmap_getPixels">getPixels</a> is not nullptr +true if <a href='#SkBitmap_getPixels'>getPixels</a> is not nullptr ### Example @@ -2503,26 +3078,26 @@ true if <a href="#SkBitmap_getPixels">getPixels</a> is not nullptr ### See Also -<a href="#SkBitmap_getPixels">getPixels</a> <a href="#SkBitmap_drawsNothing">drawsNothing</a> +<a href='#SkBitmap_getPixels'>getPixels</a> <a href='#SkBitmap_drawsNothing'>drawsNothing</a> --- -<a name="SkBitmap_getGenerationID"></a> +<a name='SkBitmap_getGenerationID'></a> ## getGenerationID -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t getGenerationID() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkBitmap_getGenerationID'>getGenerationID</a>() const </pre> -Returns a unique value corresponding to the pixels in <a href="undocumented#Pixel_Ref">Pixel Ref</a>. -Returns a different value after <a href="#SkBitmap_notifyPixelsChanged">notifyPixelsChanged</a> has been called. -Returns zero if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr. +Returns a unique value corresponding to the pixels in <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. +Returns a different value after <a href='#SkBitmap_notifyPixelsChanged'>notifyPixelsChanged</a> has been called. +Returns zero if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr. Determines if pixels have changed since last examined. ### Return Value -unique value for pixels in <a href="undocumented#Pixel_Ref">Pixel Ref</a> +unique value for pixels in <a href='undocumented#Pixel_Ref'>Pixel Ref</a> ### Example @@ -2541,189 +3116,211 @@ erase id 6 ### See Also -<a href="#SkBitmap_notifyPixelsChanged">notifyPixelsChanged</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +<a href='#SkBitmap_notifyPixelsChanged'>notifyPixelsChanged</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> --- -<a name="SkBitmap_notifyPixelsChanged"></a> +<a name='SkBitmap_notifyPixelsChanged'></a> ## notifyPixelsChanged -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void notifyPixelsChanged() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_notifyPixelsChanged'>notifyPixelsChanged</a>() const </pre> -Marks that pixels in <a href="undocumented#Pixel_Ref">Pixel Ref</a> have changed. Subsequent calls to -<a href="#SkBitmap_getGenerationID">getGenerationID</a> return a different value. +Marks that pixels in <a href='undocumented#Pixel_Ref'>Pixel Ref</a> have changed. Subsequent calls to +<a href='#SkBitmap_getGenerationID'>getGenerationID</a> return a different value. ### Example -<div><fiddle-embed name="706e6409c8364e7786d6c69db7242c76"></fiddle-embed></div> +<div><fiddle-embed name="8f463ed17b0ed4fb9c503a0ec71706f9"></fiddle-embed></div> ### See Also -<a href="#SkBitmap_getGenerationID">getGenerationID</a> <a href="#SkBitmap_isVolatile">isVolatile</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +<a href='#SkBitmap_getGenerationID'>getGenerationID</a> <a href='#SkBitmap_isVolatile'>isVolatile</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> --- -## <a name="Draw"></a> Draw +## <a name='Draw'>Draw</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_erase'>erase</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to rectangle of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_eraseARGB'>eraseARGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_eraseColor'>eraseColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to pixels</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkBitmap_erase">erase</a> | writes <a href="SkColor_Reference#Color">Color</a> to rectangle of pixels | -| <a href="#SkBitmap_eraseARGB">eraseARGB</a> | writes <a href="SkColor_Reference#Color">Color</a> to pixels | -| <a href="#SkBitmap_eraseColor">eraseColor</a> | writes <a href="SkColor_Reference#Color">Color</a> to pixels | -<a name="SkBitmap_eraseColor"></a> +<a name='SkBitmap_eraseColor'></a> ## eraseColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void eraseColor(SkColor c) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_eraseColor'>eraseColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> c) const </pre> -Replaces pixel values with <a href="#SkBitmap_eraseColor_c">c</a>. All pixels contained by <a href="#SkBitmap_bounds">bounds</a> are affected. -If the <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a> or k565_SkColorType, then <a href="SkColor_Reference#Alpha">Color Alpha</a> -is ignored; <a href="SkColor_Reference#RGB">Color RGB</a> is treated as opaque. If <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, -then <a href="SkColor_Reference#RGB">Color RGB</a> is ignored. +Replaces pixel values with <a href='#SkBitmap_eraseColor_c'>c</a>. All pixels contained by <a href='#SkBitmap_bounds'>bounds</a> are affected. +If the <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a> or k565_SkColorType, then <a href='SkColor_Reference#Alpha'>Color Alpha</a> +is ignored; <a href='SkColor_Reference#RGB'>Color RGB</a> is treated as opaque. If <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, +then <a href='SkColor_Reference#RGB'>Color RGB</a> is ignored. ### Parameters -<table> <tr> <td><a name="SkBitmap_eraseColor_c"> <code><strong>c </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a></td> +<table> <tr> <td><a name='SkBitmap_eraseColor_c'><code><strong>c</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td> </tr> </table> ### Example -<div><fiddle-embed name="22804faa423192f96a29578b1d396ace"></fiddle-embed></div> +<div><fiddle-embed name="418928dbfffa9eb00c8225530f44baf5"></fiddle-embed></div> ### See Also -<a href="#SkBitmap_eraseARGB">eraseARGB</a> <a href="#SkBitmap_erase">erase</a> +<a href='#SkBitmap_eraseARGB'>eraseARGB</a> <a href='#SkBitmap_erase'>erase</a> --- -<a name="SkBitmap_eraseARGB"></a> +<a name='SkBitmap_eraseARGB'></a> ## eraseARGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_eraseARGB'>eraseARGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> a, <a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b) const </pre> -Replaces pixel values with <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> built from <a href="#SkBitmap_eraseARGB_a">a</a>, <a href="#SkBitmap_eraseARGB_r">r</a>, <a href="#SkBitmap_eraseARGB_g">g</a>, and <a href="#SkBitmap_eraseARGB_b">b</a>. -All pixels contained by <a href="#SkBitmap_bounds">bounds</a> are affected. -If the <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a> or k565_SkColorType, then <a href="#SkBitmap_eraseARGB_a">a</a> -is ignored; <a href="#SkBitmap_eraseARGB_r">r</a>, <a href="#SkBitmap_eraseARGB_g">g</a>, and <a href="#SkBitmap_eraseARGB_b">b</a> are treated as opaque. If <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, -then <a href="#SkBitmap_eraseARGB_r">r</a>, <a href="#SkBitmap_eraseARGB_g">g</a>, and <a href="#SkBitmap_eraseARGB_b">b</a> are ignored. +Replaces pixel values with <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a> built from <a href='#SkBitmap_eraseARGB_a'>a</a>, <a href='#SkBitmap_eraseARGB_r'>r</a>, <a href='#SkBitmap_eraseARGB_g'>g</a>, and <a href='#SkBitmap_eraseARGB_b'>b</a>. +All pixels contained by <a href='#SkBitmap_bounds'>bounds</a> are affected. +If the <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a> or k565_SkColorType, then <a href='#SkBitmap_eraseARGB_a'>a</a> +is ignored; <a href='#SkBitmap_eraseARGB_r'>r</a>, <a href='#SkBitmap_eraseARGB_g'>g</a>, and <a href='#SkBitmap_eraseARGB_b'>b</a> are treated as opaque. If <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, +then <a href='#SkBitmap_eraseARGB_r'>r</a>, <a href='#SkBitmap_eraseARGB_g'>g</a>, and <a href='#SkBitmap_eraseARGB_b'>b</a> are ignored. ### Parameters -<table> <tr> <td><a name="SkBitmap_eraseARGB_a"> <code><strong>a </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#Alpha">Color Alpha</a>, from fully transparent (0) to fully opaque (255)</td> - </tr> <tr> <td><a name="SkBitmap_eraseARGB_r"> <code><strong>r </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#RGB_Red">Color RGB Red</a>, from no red (0) to full red (255)</td> - </tr> <tr> <td><a name="SkBitmap_eraseARGB_g"> <code><strong>g </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#RGB_Green">Color RGB Green</a>, from no green (0) to full green (255)</td> - </tr> <tr> <td><a name="SkBitmap_eraseARGB_b"> <code><strong>b </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#RGB_Blue">Color RGB Blue</a>, from no blue (0) to full blue (255)</td> +<table> <tr> <td><a name='SkBitmap_eraseARGB_a'><code><strong>a</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#Alpha'>Color Alpha</a>, from fully transparent (0) to fully opaque (255)</td> + </tr> + <tr> <td><a name='SkBitmap_eraseARGB_r'><code><strong>r</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#RGB_Red'>Color RGB Red</a>, from no red (0) to full red (255)</td> + </tr> + <tr> <td><a name='SkBitmap_eraseARGB_g'><code><strong>g</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#RGB_Green'>Color RGB Green</a>, from no green (0) to full green (255)</td> + </tr> + <tr> <td><a name='SkBitmap_eraseARGB_b'><code><strong>b</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#RGB_Blue'>Color RGB Blue</a>, from no blue (0) to full blue (255)</td> </tr> </table> ### Example -<div><fiddle-embed name="ebaa436565ce9c0f883bef871d099654"></fiddle-embed></div> +<div><fiddle-embed name="67277b0a1003f340473a35982533561c"></fiddle-embed></div> ### See Also -<a href="#SkBitmap_eraseColor">eraseColor</a> <a href="#SkBitmap_erase">erase</a> +<a href='#SkBitmap_eraseColor'>eraseColor</a> <a href='#SkBitmap_erase'>erase</a> --- -<a name="SkBitmap_eraseRGB"></a> +<a name='SkBitmap_eraseRGB'></a> ## eraseRGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void eraseRGB(U8CPU r, U8CPU g, U8CPU b) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_eraseRGB'>eraseRGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b) const </pre> +Deprecated. + --- -<a name="SkBitmap_erase"></a> +<a name='SkBitmap_erase'></a> ## erase -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void erase(SkColor c, const SkIRect& area) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_erase'>erase</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> c, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& area) const </pre> -Replaces pixel values inside <a href="#SkBitmap_erase_area">area</a> with <a href="#SkBitmap_erase_c">c</a>. If <a href="#SkBitmap_erase_area">area</a> does not intersect <a href="#SkBitmap_bounds">bounds</a>, +Replaces pixel values inside <a href='#SkBitmap_erase_area'>area</a> with <a href='#SkBitmap_erase_c'>c</a>. If <a href='#SkBitmap_erase_area'>area</a> does not intersect <a href='#SkBitmap_bounds'>bounds</a>, call has no effect. -If the <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a> or k565_SkColorType, then <a href="SkColor_Reference#Alpha">Color Alpha</a> -is ignored; <a href="SkColor_Reference#RGB">Color RGB</a> is treated as opaque. If <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, -then <a href="SkColor_Reference#RGB">Color RGB</a> is ignored. +If the <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a> or k565_SkColorType, then <a href='SkColor_Reference#Alpha'>Color Alpha</a> +is ignored; <a href='SkColor_Reference#RGB'>Color RGB</a> is treated as opaque. If <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, +then <a href='SkColor_Reference#RGB'>Color RGB</a> is ignored. ### Parameters -<table> <tr> <td><a name="SkBitmap_erase_c"> <code><strong>c </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a></td> - </tr> <tr> <td><a name="SkBitmap_erase_area"> <code><strong>area </strong></code> </a></td> <td> -rectangle to fill</td> +<table> <tr> <td><a name='SkBitmap_erase_c'><code><strong>c</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr> <td><a name='SkBitmap_erase_area'><code><strong>area</strong></code></a></td> + <td>rectangle to fill</td> </tr> </table> ### Example -<div><fiddle-embed name="116baaa35348b5c0a353fb6d4917d574"></fiddle-embed></div> +<div><fiddle-embed name="2c5c4230ccd2861a5d15b7cd2764ab6e"></fiddle-embed></div> ### See Also -<a href="#SkBitmap_eraseColor">eraseColor</a> <a href="#SkBitmap_eraseARGB">eraseARGB</a> <a href="#SkBitmap_eraseRGB">eraseRGB</a> <a href="SkCanvas_Reference#SkCanvas_drawRect">SkCanvas::drawRect</a> +<a href='#SkBitmap_eraseColor'>eraseColor</a> <a href='#SkBitmap_eraseARGB'>eraseARGB</a> <a href='#SkBitmap_eraseRGB'>eraseRGB</a> <a href='SkCanvas_Reference#SkCanvas_drawRect'>SkCanvas::drawRect</a> --- -<a name="SkBitmap_eraseArea"></a> +<a name='SkBitmap_eraseArea'></a> ## eraseArea -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void eraseArea(const SkIRect& area, SkColor c) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_eraseArea'>eraseArea</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& area, <a href='SkColor_Reference#SkColor'>SkColor</a> c) const </pre> +Deprecated. + --- -<a name="SkBitmap_getColor"></a> +<a name='SkBitmap_getColor'></a> ## getColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColor getColor(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkBitmap_getColor'>getColor</a>(int x, int y) const </pre> -Returns pixel at (<a href="#SkBitmap_getColor_x">x</a>, <a href="#SkBitmap_getColor_y">y</a>) as <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a>. -Returns black with <a href="SkColor_Reference#Alpha">Alpha</a> if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>. +Returns pixel at (<a href='#SkBitmap_getColor_x'>x</a>, <a href='#SkBitmap_getColor_y'>y</a>) as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a>. +Returns black with <a href='SkColor_Reference#Alpha'>Alpha</a> if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>. -Input is not validated: out of bounds values of <a href="#SkBitmap_getColor_x">x</a> or <a href="#SkBitmap_getColor_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkBitmap_getColor_x'>x</a> or <a href='#SkBitmap_getColor_y'>y</a> trigger an assert() if built with SK_DEBUG defined; and returns undefined values or may crash if -SK_RELEASE is defined. Fails if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a> or +SK_RELEASE is defined. Fails if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a> or pixel address is nullptr. -<a href="undocumented#Color_Space">Color Space</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> is ignored. Some <a href="SkColor_Reference#Color">Color</a> precision may be lost in the -conversion to <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a>; original pixel data may have additional +<a href='undocumented#Color_Space'>Color Space</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> is ignored. Some <a href='SkColor_Reference#Color'>Color</a> precision may be lost in the +conversion to <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a>; original pixel data may have additional precision. ### Parameters -<table> <tr> <td><a name="SkBitmap_getColor_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_getColor_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_getColor_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_getColor_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -pixel converted to <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> +pixel converted to <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a> ### Example -<div><fiddle-embed name="2e49fa71dd4be95470248ea6eb35468b"> +<div><fiddle-embed name="0f05970f0ce47f462e8c0a3aa146575f"> #### Example Output @@ -2744,32 +3341,33 @@ Unpremultiplied: ### See Also -<a href="#SkBitmap_getAddr">getAddr</a> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> +<a href='#SkBitmap_getAddr'>getAddr</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_getAddr"></a> +<a name='SkBitmap_getAddr'></a> ## getAddr -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void* getAddr(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void* <a href='#SkBitmap_getAddr'>getAddr</a>(int x, int y) const </pre> -Returns pixel address at (<a href="#SkBitmap_getAddr_x">x</a>, <a href="#SkBitmap_getAddr_y">y</a>). +Returns pixel address at (<a href='#SkBitmap_getAddr_x'>x</a>, <a href='#SkBitmap_getAddr_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkBitmap_getAddr_x">x</a> or <a href="#SkBitmap_getAddr_y">y</a>, or <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, +Input is not validated: out of bounds values of <a href='#SkBitmap_getAddr_x'>x</a> or <a href='#SkBitmap_getAddr_y'>y</a>, or <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, trigger an assert() if built with SK_DEBUG defined. Returns nullptr if -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, or <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr. +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, or <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr. Performs a lookup of pixel size; for better performance, call -one of: <a href="#SkBitmap_getAddr8">getAddr8</a>, <a href="#SkBitmap_getAddr16">getAddr16</a>, or <a href="#SkBitmap_getAddr32">getAddr32</a>. +one of: <a href='#SkBitmap_getAddr8'>getAddr8</a>, <a href='#SkBitmap_getAddr16'>getAddr16</a>, or <a href='#SkBitmap_getAddr32'>getAddr32</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_getAddr_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_getAddr_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_getAddr_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_getAddr_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> @@ -2791,40 +3389,45 @@ addr interval == rowBytes ### See Also -<a href="#SkBitmap_getAddr8">getAddr8</a> <a href="#SkBitmap_getAddr16">getAddr16</a> <a href="#SkBitmap_getAddr32">getAddr32</a> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_addr">SkPixmap::addr</a><sup><a href="SkPixmap_Reference#SkPixmap_addr_2">[2]</a></sup> +<a href='#SkBitmap_getAddr8'>getAddr8</a> <a href='#SkBitmap_getAddr16'>getAddr16</a> <a href='#SkBitmap_getAddr32'>getAddr32</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_addr'>SkPixmap::addr</a><sup><a href='SkPixmap_Reference#SkPixmap_addr_2'>[2]</a></sup> --- -<a name="SkBitmap_getAddr32"></a> +<a name='SkBitmap_getAddr32'></a> ## getAddr32 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -inline uint32_t* getAddr32(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +inline uint32_t* <a href='#SkBitmap_getAddr32'>getAddr32</a>(int x, int y) const </pre> -Returns address at (<a href="#SkBitmap_getAddr32_x">x</a>, <a href="#SkBitmap_getAddr32_y">y</a>). +Returns address at (<a href='#SkBitmap_getAddr32_x'>x</a>, <a href='#SkBitmap_getAddr32_y'>y</a>). Input is not validated. Triggers an assert() if built with SK_DEBUG defined and: <table> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> is not four</td> </tr> <tr> - <td><a href="#SkBitmap_getAddr32_x">x</a> is negative, or not less than <a href="#SkBitmap_width">width</a></td> </tr> <tr> - <td><a href="#SkBitmap_getAddr32_y">y</a> is negative, or not less than <a href="#SkBitmap_height">height</a></td> </tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a> is not four</td> + </tr> <tr> + <td><a href='#SkBitmap_getAddr32_x'>x</a> is negative, or not less than <a href='#SkBitmap_width'>width</a></td> + </tr> <tr> + <td><a href='#SkBitmap_getAddr32_y'>y</a> is negative, or not less than <a href='#SkBitmap_height'>height</a></td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkBitmap_getAddr32_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_getAddr32_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_getAddr32_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_getAddr32_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -unsigned 32-bit pointer to pixel at (<a href="#SkBitmap_getAddr32_x">x</a>, <a href="#SkBitmap_getAddr32_y">y</a>) +unsigned 32-bit pointer to pixel at (<a href='#SkBitmap_getAddr32_x'>x</a>, <a href='#SkBitmap_getAddr32_y'>y</a>) ### Example @@ -2840,44 +3443,49 @@ addr interval == rowBytes ### See Also -<a href="#SkBitmap_getAddr8">getAddr8</a> <a href="#SkBitmap_getAddr16">getAddr16</a> <a href="#SkBitmap_getAddr">getAddr</a> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_addr32">SkPixmap::addr32</a><sup><a href="SkPixmap_Reference#SkPixmap_addr32_2">[2]</a></sup> +<a href='#SkBitmap_getAddr8'>getAddr8</a> <a href='#SkBitmap_getAddr16'>getAddr16</a> <a href='#SkBitmap_getAddr'>getAddr</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_addr32'>SkPixmap::addr32</a><sup><a href='SkPixmap_Reference#SkPixmap_addr32_2'>[2]</a></sup> --- -<a name="SkBitmap_getAddr16"></a> +<a name='SkBitmap_getAddr16'></a> ## getAddr16 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -inline uint16_t* getAddr16(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +inline uint16_t* <a href='#SkBitmap_getAddr16'>getAddr16</a>(int x, int y) const </pre> -Returns address at (<a href="#SkBitmap_getAddr16_x">x</a>, <a href="#SkBitmap_getAddr16_y">y</a>). +Returns address at (<a href='#SkBitmap_getAddr16_x'>x</a>, <a href='#SkBitmap_getAddr16_y'>y</a>). Input is not validated. Triggers an assert() if built with SK_DEBUG defined and: <table> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> is not two</td> </tr> <tr> - <td><a href="#SkBitmap_getAddr16_x">x</a> is negative, or not less than <a href="#SkBitmap_width">width</a></td> </tr> <tr> - <td><a href="#SkBitmap_getAddr16_y">y</a> is negative, or not less than <a href="#SkBitmap_height">height</a></td> </tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a> is not two</td> + </tr> <tr> + <td><a href='#SkBitmap_getAddr16_x'>x</a> is negative, or not less than <a href='#SkBitmap_width'>width</a></td> + </tr> <tr> + <td><a href='#SkBitmap_getAddr16_y'>y</a> is negative, or not less than <a href='#SkBitmap_height'>height</a></td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkBitmap_getAddr16_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_getAddr16_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_getAddr16_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_getAddr16_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -unsigned 16-bit pointer to pixel at (<a href="#SkBitmap_getAddr16_x">x</a>, <a href="#SkBitmap_getAddr16_y">y</a>) +unsigned 16-bit pointer to pixel at (<a href='#SkBitmap_getAddr16_x'>x</a>, <a href='#SkBitmap_getAddr16_y'>y</a>) ### Example -<div><fiddle-embed name="3d7e49d428c9a4812558b39cf505baa6"> +<div><fiddle-embed name="53e00899ef2e00e2096daf7a07d9b059"> #### Example Output @@ -2889,40 +3497,45 @@ addr interval == rowBytes ### See Also -<a href="#SkBitmap_getAddr8">getAddr8</a> <a href="#SkBitmap_getAddr">getAddr</a> <a href="#SkBitmap_getAddr32">getAddr32</a> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_addr16">SkPixmap::addr16</a><sup><a href="SkPixmap_Reference#SkPixmap_addr16_2">[2]</a></sup> +<a href='#SkBitmap_getAddr8'>getAddr8</a> <a href='#SkBitmap_getAddr'>getAddr</a> <a href='#SkBitmap_getAddr32'>getAddr32</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_addr16'>SkPixmap::addr16</a><sup><a href='SkPixmap_Reference#SkPixmap_addr16_2'>[2]</a></sup> --- -<a name="SkBitmap_getAddr8"></a> +<a name='SkBitmap_getAddr8'></a> ## getAddr8 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -inline uint8_t* getAddr8(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +inline uint8_t* <a href='#SkBitmap_getAddr8'>getAddr8</a>(int x, int y) const </pre> -Returns address at (<a href="#SkBitmap_getAddr8_x">x</a>, <a href="#SkBitmap_getAddr8_y">y</a>). +Returns address at (<a href='#SkBitmap_getAddr8_x'>x</a>, <a href='#SkBitmap_getAddr8_y'>y</a>). Input is not validated. Triggers an assert() if built with SK_DEBUG defined and: <table> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_bytesPerPixel">bytesPerPixel</a> is not one</td> </tr> <tr> - <td><a href="#SkBitmap_getAddr8_x">x</a> is negative, or not less than <a href="#SkBitmap_width">width</a></td> </tr> <tr> - <td><a href="#SkBitmap_getAddr8_y">y</a> is negative, or not less than <a href="#SkBitmap_height">height</a></td> </tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_bytesPerPixel'>bytesPerPixel</a> is not one</td> + </tr> <tr> + <td><a href='#SkBitmap_getAddr8_x'>x</a> is negative, or not less than <a href='#SkBitmap_width'>width</a></td> + </tr> <tr> + <td><a href='#SkBitmap_getAddr8_y'>y</a> is negative, or not less than <a href='#SkBitmap_height'>height</a></td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkBitmap_getAddr8_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_getAddr8_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_getAddr8_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_getAddr8_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -unsigned 8-bit pointer to pixel at (<a href="#SkBitmap_getAddr8_x">x</a>, <a href="#SkBitmap_getAddr8_y">y</a>) +unsigned 8-bit pointer to pixel at (<a href='#SkBitmap_getAddr8_x'>x</a>, <a href='#SkBitmap_getAddr8_y'>y</a>) ### Example @@ -2938,50 +3551,54 @@ unsigned 8-bit pointer to pixel at (<a href="#SkBitmap_getAddr8_x">x</a>, <a hre ### See Also -<a href="#SkBitmap_getAddr">getAddr</a> <a href="#SkBitmap_getAddr16">getAddr16</a> <a href="#SkBitmap_getAddr32">getAddr32</a> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_addr8">SkPixmap::addr8</a><sup><a href="SkPixmap_Reference#SkPixmap_addr8_2">[2]</a></sup> +<a href='#SkBitmap_getAddr'>getAddr</a> <a href='#SkBitmap_getAddr16'>getAddr16</a> <a href='#SkBitmap_getAddr32'>getAddr32</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_addr8'>SkPixmap::addr8</a><sup><a href='SkPixmap_Reference#SkPixmap_addr8_2'>[2]</a></sup> --- -<a name="SkBitmap_extractSubset"></a> +<a name='SkBitmap_extractSubset'></a> ## extractSubset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool extractSubset(SkBitmap* dst, const SkIRect& subset) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_extractSubset'>extractSubset</a>(<a href='#SkBitmap'>SkBitmap</a>* dst, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& subset) const </pre> -Shares <a href="undocumented#Pixel_Ref">Pixel Ref</a> with <a href="#SkBitmap_extractSubset_dst">dst</a>. <a href="#Pixels">Pixels</a> are not copied; <a href="#Bitmap">Bitmap</a> and <a href="#SkBitmap_extractSubset_dst">dst</a> point -to the same pixels; <a href="#SkBitmap_extractSubset_dst">dst</a> <a href="#SkBitmap_bounds">bounds</a> are set to the intersection of <a href="#SkBitmap_extractSubset_subset">subset</a> -and the original <a href="#SkBitmap_bounds">bounds</a>. +Shares <a href='undocumented#Pixel_Ref'>Pixel Ref</a> with <a href='#SkBitmap_extractSubset_dst'>dst</a>. <a href='#Pixels'>Pixels</a> are not copied; <a href='#Bitmap'>Bitmap</a> and <a href='#SkBitmap_extractSubset_dst'>dst</a> point +to the same pixels; <a href='#SkBitmap_extractSubset_dst'>dst</a> <a href='#SkBitmap_bounds'>bounds</a> are set to the intersection of <a href='#SkBitmap_extractSubset_subset'>subset</a> +and the original <a href='#SkBitmap_bounds'>bounds</a>. -<a href="#SkBitmap_extractSubset_subset">subset</a> may be larger than <a href="#SkBitmap_bounds">bounds</a>. Any area outside of <a href="#SkBitmap_bounds">bounds</a> is ignored. +<a href='#SkBitmap_extractSubset_subset'>subset</a> may be larger than <a href='#SkBitmap_bounds'>bounds</a>. Any area outside of <a href='#SkBitmap_bounds'>bounds</a> is ignored. -Any contents of <a href="#SkBitmap_extractSubset_dst">dst</a> are discarded. <a href="#SkBitmap_isVolatile">isVolatile</a> setting is copied to <a href="#SkBitmap_extractSubset_dst">dst</a>. -<a href="#SkBitmap_extractSubset_dst">dst</a> is set to <a href="#SkBitmap_colorType">colorType</a>, <a href="#SkBitmap_alphaType">alphaType</a>, and <a href="#SkBitmap_colorSpace">colorSpace</a>. +Any contents of <a href='#SkBitmap_extractSubset_dst'>dst</a> are discarded. <a href='#SkBitmap_isVolatile'>isVolatile</a> setting is copied to <a href='#SkBitmap_extractSubset_dst'>dst</a>. +<a href='#SkBitmap_extractSubset_dst'>dst</a> is set to <a href='#SkBitmap_colorType'>colorType</a>, <a href='#SkBitmap_alphaType'>alphaType</a>, and <a href='#SkBitmap_colorSpace'>colorSpace</a>. Return false if: <table> <tr> - <td><a href="#SkBitmap_extractSubset_dst">dst</a> is nullptr</td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_extractSubset_subset">subset</a> does not intersect <a href="#SkBitmap_bounds">bounds</a></td> </tr> + <td><a href='#SkBitmap_extractSubset_dst'>dst</a> is nullptr</td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_extractSubset_subset'>subset</a> does not intersect <a href='#SkBitmap_bounds'>bounds</a></td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkBitmap_extractSubset_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="#Bitmap">Bitmap</a> set to <a href="#SkBitmap_extractSubset_subset">subset</a></td> - </tr> <tr> <td><a name="SkBitmap_extractSubset_subset"> <code><strong>subset </strong></code> </a></td> <td> -rectangle of pixels to reference</td> +<table> <tr> <td><a name='SkBitmap_extractSubset_dst'><code><strong>dst</strong></code></a></td> + <td><a href='#Bitmap'>Bitmap</a> set to <a href='#SkBitmap_extractSubset_subset'>subset</a></td> + </tr> + <tr> <td><a name='SkBitmap_extractSubset_subset'><code><strong>subset</strong></code></a></td> + <td>rectangle of pixels to reference</td> </tr> </table> ### Return Value -true if <a href="#SkBitmap_extractSubset_dst">dst</a> is replaced by <a href="#SkBitmap_extractSubset_subset">subset</a> +true if <a href='#SkBitmap_extractSubset_dst'>dst</a> is replaced by <a href='#SkBitmap_extractSubset_subset'>subset</a> ### Example -<div><fiddle-embed name="3ad80d8fcb13344612f361812658b696"> +<div><fiddle-embed name="304148c50c91490bfd58e9222342419c"> #### Example Output @@ -3005,68 +3622,77 @@ subset: 1000, 100, 1000, 200 success; false ### See Also -<a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> +<a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> --- -<a name="SkBitmap_readPixels"></a> +<a name='SkBitmap_readPixels'></a> ## readPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, - SkTransferFunctionBehavior behavior) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, + <a href='undocumented#SkTransferFunctionBehavior'>SkTransferFunctionBehavior</a> behavior) const </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Bitmap">Bitmap</a> pixels to <a href="#SkBitmap_readPixels_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkBitmap_readPixels_srcX">srcX</a>, <a href="#SkBitmap_readPixels_srcY">srcY</a>), -and does not exceed <a href="#Bitmap">Bitmap</a> (<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a>). +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Bitmap'>Bitmap</a> pixels to <a href='#SkBitmap_readPixels_dstPixels'>dstPixels</a>. Copy starts at (<a href='#SkBitmap_readPixels_srcX'>srcX</a>, <a href='#SkBitmap_readPixels_srcY'>srcY</a>), +and does not exceed <a href='#Bitmap'>Bitmap</a> (<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_readPixels_dstInfo">dstInfo</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and -<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkBitmap_readPixels_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +<a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and +<a href='undocumented#Color_Space'>Color Space</a> of destination. <a href='#SkBitmap_readPixels_dstRowBytes'>dstRowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>.addr() equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_readPixels_dstRowBytes">dstRowBytes</a> is less than <a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>.addr() equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_readPixels_dstRowBytes'>dstRowBytes</a> is less than <a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkBitmap_colorType">colorType</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkBitmap_colorSpace">colorSpace</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkBitmap_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkBitmap_colorType'>colorType</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkBitmap_colorSpace'>colorSpace</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkBitmap_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkBitmap_readPixels_srcX">srcX</a> and <a href="#SkBitmap_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> is zero or negative. -Returns false ifabs(srcX) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_width">width</a>, -or ifabs(srcY) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_height">height</a>. - -If <a href="#SkBitmap_readPixels_behavior">behavior</a> is <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts source -pixels to a linear space before converting to <a href="#SkBitmap_readPixels_dstInfo">dstInfo</a>. -If <a href="#SkBitmap_readPixels_behavior">behavior</a> is <a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: source + +<a href='#SkBitmap_readPixels_srcX'>srcX</a> and <a href='#SkBitmap_readPixels_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> is zero or negative. +Returns false ifabs(srcX) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_width'>width</a>, +or ifabs(srcY) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_height'>height</a>. + +If <a href='#SkBitmap_readPixels_behavior'>behavior</a> is <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>: converts source +pixels to a linear space before converting to <a href='#SkBitmap_readPixels_dstInfo'>dstInfo</a>. +If <a href='#SkBitmap_readPixels_behavior'>behavior</a> is <a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a>: source pixels are treated as if they are linear, regardless of how they are encoded. ### Parameters -<table> <tr> <td><a name="SkBitmap_readPixels_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -destination width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_readPixels_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -destination pixel storage</td> - </tr> <tr> <td><a name="SkBitmap_readPixels_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -destination row length</td> - </tr> <tr> <td><a name="SkBitmap_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkBitmap_height">height</a></td> - </tr> <tr> <td><a name="SkBitmap_readPixels_behavior"> <code><strong>behavior </strong></code> </a></td> <td> -one of: <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>, -<a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a></td> +<table> <tr> <td><a name='SkBitmap_readPixels_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>destination width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>destination pixel storage</td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>destination row length</td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkBitmap_height'>height</a></td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_behavior'><code><strong>behavior</strong></code></a></td> + <td>one of: <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>, +<a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkBitmap_readPixels_dstPixels">dstPixels</a> +true if pixels are copied to <a href='#SkBitmap_readPixels_dstPixels'>dstPixels</a> ### Example @@ -3074,58 +3700,66 @@ true if pixels are copied to <a href="#SkBitmap_readPixels_dstPixels">dstPixels< ### See Also -<a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkBitmap_readPixels_2"></a> +<a name='SkBitmap_readPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Bitmap">Bitmap</a> to <a href="#SkBitmap_readPixels_2_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkBitmap_readPixels_2_srcX">srcX</a>, <a href="#SkBitmap_readPixels_2_srcY">srcY</a>), -and does not exceed <a href="#Bitmap">Bitmap</a> (<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Bitmap'>Bitmap</a> to <a href='#SkBitmap_readPixels_2_dstPixels'>dstPixels</a>. Copy starts at (<a href='#SkBitmap_readPixels_2_srcX'>srcX</a>, <a href='#SkBitmap_readPixels_2_srcY'>srcY</a>), +and does not exceed <a href='#Bitmap'>Bitmap</a> (<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of -destination. <a href="#SkBitmap_readPixels_2_dstRowBytes">dstRowBytes</a> specifics the gap from one destination row to the next. +<a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a> of +destination. <a href='#SkBitmap_readPixels_2_dstRowBytes'>dstRowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.addr() equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_readPixels_2_dstRowBytes">dstRowBytes</a> is less than <a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a>.addr() equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_readPixels_2_dstRowBytes'>dstRowBytes</a> is less than <a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkBitmap_colorType">colorType</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkBitmap_colorSpace">colorSpace</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkBitmap_alphaType">alphaType</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkBitmap_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkBitmap_colorType'>colorType</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkBitmap_colorSpace'>colorSpace</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkBitmap_alphaType'>alphaType</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkBitmap_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkBitmap_readPixels_2_srcX">srcX</a> and <a href="#SkBitmap_readPixels_2_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> is zero or negative. -Returns false ifabs(srcX) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_width">width</a>, -or ifabs(srcY) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_height">height</a>. + +<a href='#SkBitmap_readPixels_2_srcX'>srcX</a> and <a href='#SkBitmap_readPixels_2_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> is zero or negative. +Returns false ifabs(srcX) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_width'>width</a>, +or ifabs(srcY) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_height'>height</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_readPixels_2_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -destination width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkBitmap_readPixels_2_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -destination pixel storage</td> - </tr> <tr> <td><a name="SkBitmap_readPixels_2_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -destination row length</td> - </tr> <tr> <td><a name="SkBitmap_readPixels_2_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_readPixels_2_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_readPixels_2_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>destination width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_2_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>destination pixel storage</td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_2_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>destination row length</td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_2_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_2_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkBitmap_readPixels_2_dstPixels">dstPixels</a> +true if pixels are copied to <a href='#SkBitmap_readPixels_2_dstPixels'>dstPixels</a> ### Example @@ -3135,54 +3769,60 @@ creates visible banding. ### See Also -<a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkBitmap_readPixels_3"></a> +<a name='SkBitmap_readPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& dst, int srcX, int srcY) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_readPixels'>readPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& dst, int srcX, int srcY) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Bitmap">Bitmap</a> to <a href="#SkBitmap_readPixels_3_dst">dst</a>. Copy starts at (<a href="#SkBitmap_readPixels_3_srcX">srcX</a>, <a href="#SkBitmap_readPixels_3_srcY">srcY</a>), and -does not exceed <a href="#Bitmap">Bitmap</a> (<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Bitmap'>Bitmap</a> to <a href='#SkBitmap_readPixels_3_dst'>dst</a>. Copy starts at (<a href='#SkBitmap_readPixels_3_srcX'>srcX</a>, <a href='#SkBitmap_readPixels_3_srcY'>srcY</a>), and +does not exceed <a href='#Bitmap'>Bitmap</a> (<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_readPixels_3_dst">dst</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, pixel storage, -and row bytes of destination. <a href="#SkBitmap_readPixels_3_dst">dst</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one destination +<a href='#SkBitmap_readPixels_3_dst'>dst</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, pixel storage, +and row bytes of destination. <a href='#SkBitmap_readPixels_3_dst'>dst</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_readPixels_3_dst">dst</a> pixel storage equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_readPixels_3_dst">dst</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> is less than <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_readPixels_3_dst'>dst</a> pixel storage equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_readPixels_3_dst'>dst</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> is less than <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_readPixels_3_dst">dst</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_readPixels_3_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_readPixels_3_dst">dst</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_readPixels_3_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_readPixels_3_dst'>dst</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_readPixels_3_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_readPixels_3_dst'>dst</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_readPixels_3_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkBitmap_readPixels_3_srcX">srcX</a> and <a href="#SkBitmap_readPixels_3_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> is zero or negative. -Returns false ifabs(srcX) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_width">width</a>, -or ifabs(srcY) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_height">height</a>. + +<a href='#SkBitmap_readPixels_3_srcX'>srcX</a> and <a href='#SkBitmap_readPixels_3_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> is zero or negative. +Returns false ifabs(srcX) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_width'>width</a>, +or ifabs(srcY) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_height'>height</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_readPixels_3_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> - </tr> <tr> <td><a name="SkBitmap_readPixels_3_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_readPixels_3_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_readPixels_3_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_3_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_readPixels_3_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkBitmap_readPixels_3_dst">dst</a> +true if pixels are copied to <a href='#SkBitmap_readPixels_3_dst'>dst</a> ### Example @@ -3190,102 +3830,111 @@ true if pixels are copied to <a href="#SkBitmap_readPixels_3_dst">dst</a> ### See Also -<a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkBitmap_readPixels_4"></a> +<a name='SkBitmap_readPixels_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_readPixels'>readPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& dst) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Bitmap">Bitmap</a> to <a href="#SkBitmap_readPixels_4_dst">dst</a>. Copy starts at (0, 0), and -does not exceed <a href="#Bitmap">Bitmap</a> (<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Bitmap'>Bitmap</a> to <a href='#SkBitmap_readPixels_4_dst'>dst</a>. Copy starts at (0, 0), and +does not exceed <a href='#Bitmap'>Bitmap</a> (<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_readPixels_4_dst">dst</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, pixel storage, -and row bytes of destination. <a href="#SkBitmap_readPixels_4_dst">dst</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one destination +<a href='#SkBitmap_readPixels_4_dst'>dst</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, pixel storage, +and row bytes of destination. <a href='#SkBitmap_readPixels_4_dst'>dst</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_readPixels_4_dst">dst</a> pixel storage equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_readPixels_4_dst">dst</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> is less than <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_readPixels_4_dst'>dst</a> pixel storage equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_readPixels_4_dst'>dst</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> is less than <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_readPixels_4_dst">dst</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_readPixels_4_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_readPixels_4_dst">dst</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_readPixels_4_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_readPixels_4_dst'>dst</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_readPixels_4_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_readPixels_4_dst'>dst</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_readPixels_4_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns false if pixel conversion is not possible. ### Parameters -<table> <tr> <td><a name="SkBitmap_readPixels_4_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> +<table> <tr> <td><a name='SkBitmap_readPixels_4_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkBitmap_readPixels_4_dst">dst</a> +true if pixels are copied to <a href='#SkBitmap_readPixels_4_dst'>dst</a> ### Example -<div><fiddle-embed name="2260ff6d04708699b6223b4f73fd268e"></fiddle-embed></div> +<div><fiddle-embed name="4590fbf052659d6e629fbfd827081ae5"></fiddle-embed></div> ### See Also -<a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkBitmap_writePixels"></a> +<a name='SkBitmap_writePixels'></a> ## writePixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool writePixels(const SkPixmap& src, int dstX, int dstY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_writePixels'>writePixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& src, int dstX, int dstY) </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#SkBitmap_writePixels_src">src</a>. Copy starts at (<a href="#SkBitmap_writePixels_dstX">dstX</a>, <a href="#SkBitmap_writePixels_dstY">dstY</a>), and does not exceed -(<a href="#SkBitmap_writePixels_src">src</a>.<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_writePixels_src">src</a>.<a href="#SkBitmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#SkBitmap_writePixels_src'>src</a>. Copy starts at (<a href='#SkBitmap_writePixels_dstX'>dstX</a>, <a href='#SkBitmap_writePixels_dstY'>dstY</a>), and does not exceed +(<a href='#SkBitmap_writePixels_src'>src</a>.<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_writePixels_src'>src</a>.<a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_writePixels_src">src</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, pixel storage, -and row bytes of source. <a href="#SkBitmap_writePixels_src">src</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one source +<a href='#SkBitmap_writePixels_src'>src</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, pixel storage, +and row bytes of source. <a href='#SkBitmap_writePixels_src'>src</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> specifics the gap from one source row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_writePixels_src">src</a> pixel storage equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_writePixels_src">src</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> is less than <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_writePixels_src'>src</a> pixel storage equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_writePixels_src'>src</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> is less than <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_writePixels_src">src</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_writePixels_src">src</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_writePixels_src">src</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_writePixels_src">src</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_writePixels_src'>src</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_writePixels_src'>src</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_writePixels_src'>src</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_writePixels_src'>src</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkBitmap_writePixels_dstX">dstX</a> and <a href="#SkBitmap_writePixels_dstY">dstY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> is zero or negative. -Returns false ifabs(dstX) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_width">width</a>, -or ifabs(dstY) >= <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_height">height</a>. + +<a href='#SkBitmap_writePixels_dstX'>dstX</a> and <a href='#SkBitmap_writePixels_dstY'>dstY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> is zero or negative. +Returns false ifabs(dstX) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_width'>width</a>, +or ifabs(dstY) >= <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_height'>height</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_writePixels_src"> <code><strong>src </strong></code> </a></td> <td> -source <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> - </tr> <tr> <td><a name="SkBitmap_writePixels_dstX"> <code><strong>dstX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_writePixels_dstY"> <code><strong>dstY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkBitmap_height">height</a></td> +<table> <tr> <td><a name='SkBitmap_writePixels_src'><code><strong>src</strong></code></a></td> + <td>source <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> + </tr> + <tr> <td><a name='SkBitmap_writePixels_dstX'><code><strong>dstX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_writePixels_dstY'><code><strong>dstY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkBitmap_height'>height</a></td> </tr> </table> ### Return Value -true if <a href="#SkBitmap_writePixels_src">src</a> pixels are copied to <a href="#Bitmap">Bitmap</a> +true if <a href='#SkBitmap_writePixels_src'>src</a> pixels are copied to <a href='#Bitmap'>Bitmap</a> ### Example @@ -3293,46 +3942,49 @@ true if <a href="#SkBitmap_writePixels_src">src</a> pixels are copied to <a href ### See Also -<a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> +<a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_writePixels_2"></a> +<a name='SkBitmap_writePixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool writePixels(const SkPixmap& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_writePixels'>writePixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& src) </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#SkBitmap_writePixels_2_src">src</a>. Copy starts at (0, 0), and does not exceed -(<a href="#SkBitmap_writePixels_2_src">src</a>.<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_writePixels_2_src">src</a>.<a href="#SkBitmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#SkBitmap_writePixels_2_src'>src</a>. Copy starts at (0, 0), and does not exceed +(<a href='#SkBitmap_writePixels_2_src'>src</a>.<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_writePixels_2_src'>src</a>.<a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_writePixels_2_src">src</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, pixel storage, -and row bytes of source. <a href="#SkBitmap_writePixels_2_src">src</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one source +<a href='#SkBitmap_writePixels_2_src'>src</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, pixel storage, +and row bytes of source. <a href='#SkBitmap_writePixels_2_src'>src</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> specifics the gap from one source row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_writePixels_2_src">src</a> pixel storage equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_writePixels_2_src">src</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> is less than <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_writePixels_2_src'>src</a> pixel storage equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_writePixels_2_src'>src</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> is less than <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_writePixels_2_src">src</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_writePixels_2_src">src</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_writePixels_2_src">src</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_writePixels_2_src">src</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_writePixels_2_src'>src</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_writePixels_2_src'>src</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_writePixels_2_src'>src</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_writePixels_2_src'>src</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns false if pixel conversion is not possible. ### Parameters -<table> <tr> <td><a name="SkBitmap_writePixels_2_src"> <code><strong>src </strong></code> </a></td> <td> -source <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> +<table> <tr> <td><a name='SkBitmap_writePixels_2_src'><code><strong>src</strong></code></a></td> + <td>source <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> </tr> </table> ### Return Value -true if <a href="#SkBitmap_writePixels_2_src">src</a> pixels are copied to <a href="#Bitmap">Bitmap</a> +true if <a href='#SkBitmap_writePixels_2_src'>src</a> pixels are copied to <a href='#Bitmap'>Bitmap</a> ### Example @@ -3340,59 +3992,65 @@ true if <a href="#SkBitmap_writePixels_2_src">src</a> pixels are copied to <a hr ### See Also -<a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> +<a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_writePixels_3"></a> +<a name='SkBitmap_writePixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_writePixels'>writePixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& src, int x, int y, <a href='undocumented#SkTransferFunctionBehavior'>SkTransferFunctionBehavior</a> behavior) </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#SkBitmap_writePixels_3_src">src</a>. Copy starts at (0, 0), and does not exceed -(<a href="#SkBitmap_writePixels_3_src">src</a>.<a href="#SkBitmap_width">width</a>, <a href="#SkBitmap_writePixels_3_src">src</a>.<a href="#SkBitmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#SkBitmap_writePixels_3_src'>src</a>. Copy starts at (0, 0), and does not exceed +(<a href='#SkBitmap_writePixels_3_src'>src</a>.<a href='#SkBitmap_width'>width</a>, <a href='#SkBitmap_writePixels_3_src'>src</a>.<a href='#SkBitmap_height'>height</a>). -<a href="#SkBitmap_writePixels_3_src">src</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, pixel storage, -and row bytes of source. <a href="#SkBitmap_writePixels_3_src">src</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> specifics the gap from one source +<a href='#SkBitmap_writePixels_3_src'>src</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, pixel storage, +and row bytes of source. <a href='#SkBitmap_writePixels_3_src'>src</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> specifics the gap from one source row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkBitmap_writePixels_3_src">src</a> pixel storage equals nullptr</td> </tr> <tr> - <td><a href="#SkBitmap_writePixels_3_src">src</a>.<a href="#SkBitmap_rowBytes">rowBytes</a> is less than <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkBitmap_writePixels_3_src'>src</a> pixel storage equals nullptr</td> + </tr> <tr> + <td><a href='#SkBitmap_writePixels_3_src'>src</a>.<a href='#SkBitmap_rowBytes'>rowBytes</a> is less than <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkBitmap_writePixels_3_src">src</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkBitmap_writePixels_3_src">src</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkBitmap_writePixels_3_src">src</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Bitmap">Bitmap</a> <a href="#SkBitmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkBitmap_writePixels_3_src">src</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns -false if pixel conversion is not possible. Returns false if <a href="#SkBitmap_width">width</a> or <a href="#SkBitmap_height">height</a> +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkBitmap_writePixels_3_src'>src</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkBitmap_writePixels_3_src'>src</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkBitmap_writePixels_3_src'>src</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Bitmap'>Bitmap</a> <a href='#SkBitmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkBitmap_writePixels_3_src'>src</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns +false if pixel conversion is not possible. Returns false if <a href='#SkBitmap_width'>width</a> or <a href='#SkBitmap_height'>height</a> is zero or negative. -If <a href="#SkBitmap_writePixels_3_behavior">behavior</a> is <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts <a href="#SkBitmap_writePixels_3_src">src</a> -pixels to a linear space before converting to <a href="SkImageInfo_Reference#Image_Info">Image Info</a>. -If <a href="#SkBitmap_writePixels_3_behavior">behavior</a> is <a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: <a href="#SkBitmap_writePixels_3_src">src</a> +If <a href='#SkBitmap_writePixels_3_behavior'>behavior</a> is <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>: converts <a href='#SkBitmap_writePixels_3_src'>src</a> +pixels to a linear space before converting to <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>. +If <a href='#SkBitmap_writePixels_3_behavior'>behavior</a> is <a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a>: <a href='#SkBitmap_writePixels_3_src'>src</a> pixels are treated as if they are linear, regardless of how they are encoded. ### Parameters -<table> <tr> <td><a name="SkBitmap_writePixels_3_src"> <code><strong>src </strong></code> </a></td> <td> -source <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> - </tr> <tr> <td><a name="SkBitmap_writePixels_3_x"> <code><strong>x </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkBitmap_width">width</a></td> - </tr> <tr> <td><a name="SkBitmap_writePixels_3_y"> <code><strong>y </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkBitmap_height">height</a></td> - </tr> <tr> <td><a name="SkBitmap_writePixels_3_behavior"> <code><strong>behavior </strong></code> </a></td> <td> -one of: <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>, -<a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a></td> +<table> <tr> <td><a name='SkBitmap_writePixels_3_src'><code><strong>src</strong></code></a></td> + <td>source <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> + </tr> + <tr> <td><a name='SkBitmap_writePixels_3_x'><code><strong>x</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkBitmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkBitmap_writePixels_3_y'><code><strong>y</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkBitmap_height'>height</a></td> + </tr> + <tr> <td><a name='SkBitmap_writePixels_3_behavior'><code><strong>behavior</strong></code></a></td> + <td>one of: <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>, +<a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a></td> </tr> </table> ### Return Value -true if <a href="#SkBitmap_writePixels_3_src">src</a> pixels are copied to <a href="#Bitmap">Bitmap</a> +true if <a href='#SkBitmap_writePixels_3_src'>src</a> pixels are copied to <a href='#Bitmap'>Bitmap</a> ### Example @@ -3400,69 +4058,73 @@ true if <a href="#SkBitmap_writePixels_3_src">src</a> pixels are copied to <a hr ### See Also -<a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> +<a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> --- -<a name="SkBitmap_hasHardwareMipMap"></a> +<a name='SkBitmap_hasHardwareMipMap'></a> ## hasHardwareMipMap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool hasHardwareMipMap() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a>() const </pre> +Android framework only. + ### Return Value -true if <a href="#SkBitmap_setHasHardwareMipMap">setHasHardwareMipMap</a> has been called with true +true if <a href='#SkBitmap_setHasHardwareMipMap'>setHasHardwareMipMap</a> has been called with true ### See Also -<a href="#SkBitmap_setHasHardwareMipMap">setHasHardwareMipMap</a> +<a href='#SkBitmap_setHasHardwareMipMap'>setHasHardwareMipMap</a> --- -<a name="SkBitmap_setHasHardwareMipMap"></a> +<a name='SkBitmap_setHasHardwareMipMap'></a> ## setHasHardwareMipMap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setHasHardwareMipMap(bool hasHardwareMipMap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_setHasHardwareMipMap'>setHasHardwareMipMap</a>(bool <a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a>) </pre> +Android framework only. + ### Parameters -<table> <tr> <td><a name="SkBitmap_setHasHardwareMipMap_hasHardwareMipMap"> <code><strong>hasHardwareMipMap </strong></code> </a></td> <td> -sets state</td> +<table> <tr> <td><a name='SkBitmap_setHasHardwareMipMap_hasHardwareMipMap'><code><strong>hasHardwareMipMap</strong></code></a></td> + <td>sets state</td> </tr> </table> ### See Also -<a href="#SkBitmap_hasHardwareMipMap">hasHardwareMipMap</a> +<a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a> --- -<a name="SkBitmap_extractAlpha"></a> +<a name='SkBitmap_extractAlpha'></a> ## extractAlpha -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool extractAlpha(SkBitmap* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_extractAlpha'>extractAlpha</a>(<a href='#SkBitmap'>SkBitmap</a>* dst) const </pre> -Sets <a href="#SkBitmap_extractAlpha_dst">dst</a> to <a href="SkColor_Reference#Alpha">Alpha</a> described by pixels. Returns false if <a href="#SkBitmap_extractAlpha_dst">dst</a> cannot be written to -or <a href="#SkBitmap_extractAlpha_dst">dst</a> pixels cannot be allocated. +Sets <a href='#SkBitmap_extractAlpha_dst'>dst</a> to <a href='SkColor_Reference#Alpha'>Alpha</a> described by pixels. Returns false if <a href='#SkBitmap_extractAlpha_dst'>dst</a> cannot be written to +or <a href='#SkBitmap_extractAlpha_dst'>dst</a> pixels cannot be allocated. -Uses <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> to reserve memory for <a href="#SkBitmap_extractAlpha_dst">dst</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a>. +Uses <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> to reserve memory for <a href='#SkBitmap_extractAlpha_dst'>dst</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_extractAlpha_dst"> <code><strong>dst </strong></code> </a></td> <td> -holds <a href="undocumented#Pixel_Ref">Pixel Ref</a> to fill with alpha layer</td> +<table> <tr> <td><a name='SkBitmap_extractAlpha_dst'><code><strong>dst</strong></code></a></td> + <td>holds <a href='undocumented#Pixel_Ref'>Pixel Ref</a> to fill with alpha layer</td> </tr> </table> ### Return Value -true if <a href="SkColor_Reference#Alpha">Alpha</a> layer was constructed in <a href="#SkBitmap_extractAlpha_dst">dst</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +true if <a href='SkColor_Reference#Alpha'>Alpha</a> layer was constructed in <a href='#SkBitmap_extractAlpha_dst'>dst</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> ### Example @@ -3470,38 +4132,40 @@ true if <a href="SkColor_Reference#Alpha">Alpha</a> layer was constructed in <a ### See Also -<a href="#SkBitmap_extractSubset">extractSubset</a> +<a href='#SkBitmap_extractSubset'>extractSubset</a> --- -<a name="SkBitmap_extractAlpha_2"></a> +<a name='SkBitmap_extractAlpha_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool extractAlpha(SkBitmap* dst, const SkPaint* paint, SkIPoint* offset) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_extractAlpha'>extractAlpha</a>(<a href='#SkBitmap'>SkBitmap</a>* dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>* offset) const </pre> -Sets <a href="#SkBitmap_extractAlpha_2_dst">dst</a> to <a href="SkColor_Reference#Alpha">Alpha</a> described by pixels. Returns false if <a href="#SkBitmap_extractAlpha_2_dst">dst</a> cannot be written to -or <a href="#SkBitmap_extractAlpha_2_dst">dst</a> pixels cannot be allocated. +Sets <a href='#SkBitmap_extractAlpha_2_dst'>dst</a> to <a href='SkColor_Reference#Alpha'>Alpha</a> described by pixels. Returns false if <a href='#SkBitmap_extractAlpha_2_dst'>dst</a> cannot be written to +or <a href='#SkBitmap_extractAlpha_2_dst'>dst</a> pixels cannot be allocated. -If <a href="#SkBitmap_extractAlpha_2_paint">paint</a> is not nullptr and contains <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#SkMaskFilter">SkMaskFilter</a> -generates <a href="undocumented#Mask_Alpha">Mask Alpha</a> from <a href="#Bitmap">Bitmap</a>. Uses <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> to reserve memory for <a href="#SkBitmap_extractAlpha_2_dst">dst</a> -<a href="undocumented#Pixel_Ref">Pixel Ref</a>. Sets <a href="#SkBitmap_extractAlpha_2_offset">offset</a> to top-left position for <a href="#SkBitmap_extractAlpha_2_dst">dst</a> for alignment with <a href="#Bitmap">Bitmap</a>; -(0, 0) unless <a href="undocumented#SkMaskFilter">SkMaskFilter</a> generates mask. +If <a href='#SkBitmap_extractAlpha_2_paint'>paint</a> is not nullptr and contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#SkMaskFilter'>SkMaskFilter</a> +generates <a href='undocumented#Mask_Alpha'>Mask Alpha</a> from <a href='#Bitmap'>Bitmap</a>. Uses <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a> to reserve memory for <a href='#SkBitmap_extractAlpha_2_dst'>dst</a> +<a href='undocumented#Pixel_Ref'>Pixel Ref</a>. Sets <a href='#SkBitmap_extractAlpha_2_offset'>offset</a> to top-left position for <a href='#SkBitmap_extractAlpha_2_dst'>dst</a> for alignment with <a href='#Bitmap'>Bitmap</a>; +(0, 0) unless <a href='undocumented#SkMaskFilter'>SkMaskFilter</a> generates mask. ### Parameters -<table> <tr> <td><a name="SkBitmap_extractAlpha_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -holds <a href="undocumented#Pixel_Ref">Pixel Ref</a> to fill with alpha layer</td> - </tr> <tr> <td><a name="SkBitmap_extractAlpha_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -holds optional <a href="undocumented#Mask_Filter">Mask Filter</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkBitmap_extractAlpha_2_offset"> <code><strong>offset </strong></code> </a></td> <td> -top-left position for <a href="#SkBitmap_extractAlpha_2_dst">dst</a>; may be nullptr</td> +<table> <tr> <td><a name='SkBitmap_extractAlpha_2_dst'><code><strong>dst</strong></code></a></td> + <td>holds <a href='undocumented#Pixel_Ref'>Pixel Ref</a> to fill with alpha layer</td> + </tr> + <tr> <td><a name='SkBitmap_extractAlpha_2_paint'><code><strong>paint</strong></code></a></td> + <td>holds optional <a href='undocumented#Mask_Filter'>Mask Filter</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkBitmap_extractAlpha_2_offset'><code><strong>offset</strong></code></a></td> + <td>top-left position for <a href='#SkBitmap_extractAlpha_2_dst'>dst</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="SkColor_Reference#Alpha">Alpha</a> layer was constructed in <a href="#SkBitmap_extractAlpha_2_dst">dst</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +true if <a href='SkColor_Reference#Alpha'>Alpha</a> layer was constructed in <a href='#SkBitmap_extractAlpha_2_dst'>dst</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> ### Example @@ -3509,41 +4173,44 @@ true if <a href="SkColor_Reference#Alpha">Alpha</a> layer was constructed in <a ### See Also -<a href="#SkBitmap_extractSubset">extractSubset</a> +<a href='#SkBitmap_extractSubset'>extractSubset</a> --- -<a name="SkBitmap_extractAlpha_3"></a> +<a name='SkBitmap_extractAlpha_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator, SkIPoint* offset) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_extractAlpha'>extractAlpha</a>(<a href='#SkBitmap'>SkBitmap</a>* dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='#SkBitmap_Allocator'>Allocator</a>* allocator, <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>* offset) const </pre> -Sets <a href="#SkBitmap_extractAlpha_3_dst">dst</a> to <a href="SkColor_Reference#Alpha">Alpha</a> described by pixels. Returns false if <a href="#SkBitmap_extractAlpha_3_dst">dst</a> cannot be written to -or <a href="#SkBitmap_extractAlpha_3_dst">dst</a> pixels cannot be allocated. +Sets <a href='#SkBitmap_extractAlpha_3_dst'>dst</a> to <a href='SkColor_Reference#Alpha'>Alpha</a> described by pixels. Returns false if <a href='#SkBitmap_extractAlpha_3_dst'>dst</a> cannot be written to +or <a href='#SkBitmap_extractAlpha_3_dst'>dst</a> pixels cannot be allocated. -If <a href="#SkBitmap_extractAlpha_3_paint">paint</a> is not nullptr and contains <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#SkMaskFilter">SkMaskFilter</a> -generates <a href="undocumented#Mask_Alpha">Mask Alpha</a> from <a href="#Bitmap">Bitmap</a>. <a href="#SkBitmap_extractAlpha_3_allocator">allocator</a> may reference a custom allocation -class or be set to nullptr to use <a href="#SkBitmap_HeapAllocator">HeapAllocator</a>. Sets <a href="#SkBitmap_extractAlpha_3_offset">offset</a> to top-left -position for <a href="#SkBitmap_extractAlpha_3_dst">dst</a> for alignment with <a href="#Bitmap">Bitmap</a>; (0, 0) unless <a href="undocumented#SkMaskFilter">SkMaskFilter</a> generates +If <a href='#SkBitmap_extractAlpha_3_paint'>paint</a> is not nullptr and contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#SkMaskFilter'>SkMaskFilter</a> +generates <a href='undocumented#Mask_Alpha'>Mask Alpha</a> from <a href='#Bitmap'>Bitmap</a>. <a href='#SkBitmap_extractAlpha_3_allocator'>allocator</a> may reference a custom allocation +class or be set to nullptr to use <a href='#SkBitmap_HeapAllocator'>HeapAllocator</a>. Sets <a href='#SkBitmap_extractAlpha_3_offset'>offset</a> to top-left +position for <a href='#SkBitmap_extractAlpha_3_dst'>dst</a> for alignment with <a href='#Bitmap'>Bitmap</a>; (0, 0) unless <a href='undocumented#SkMaskFilter'>SkMaskFilter</a> generates mask. ### Parameters -<table> <tr> <td><a name="SkBitmap_extractAlpha_3_dst"> <code><strong>dst </strong></code> </a></td> <td> -holds <a href="undocumented#Pixel_Ref">Pixel Ref</a> to fill with alpha layer</td> - </tr> <tr> <td><a name="SkBitmap_extractAlpha_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -holds optional <a href="undocumented#Mask_Filter">Mask Filter</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkBitmap_extractAlpha_3_allocator"> <code><strong>allocator </strong></code> </a></td> <td> -method to reserve memory for <a href="undocumented#Pixel_Ref">Pixel Ref</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkBitmap_extractAlpha_3_offset"> <code><strong>offset </strong></code> </a></td> <td> -top-left position for <a href="#SkBitmap_extractAlpha_3_dst">dst</a>; may be nullptr</td> +<table> <tr> <td><a name='SkBitmap_extractAlpha_3_dst'><code><strong>dst</strong></code></a></td> + <td>holds <a href='undocumented#Pixel_Ref'>Pixel Ref</a> to fill with alpha layer</td> + </tr> + <tr> <td><a name='SkBitmap_extractAlpha_3_paint'><code><strong>paint</strong></code></a></td> + <td>holds optional <a href='undocumented#Mask_Filter'>Mask Filter</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkBitmap_extractAlpha_3_allocator'><code><strong>allocator</strong></code></a></td> + <td>function to reserve memory for <a href='undocumented#Pixel_Ref'>Pixel Ref</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkBitmap_extractAlpha_3_offset'><code><strong>offset</strong></code></a></td> + <td>top-left position for <a href='#SkBitmap_extractAlpha_3_dst'>dst</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="SkColor_Reference#Alpha">Alpha</a> layer was constructed in <a href="#SkBitmap_extractAlpha_3_dst">dst</a> <a href="undocumented#Pixel_Ref">Pixel Ref</a> +true if <a href='SkColor_Reference#Alpha'>Alpha</a> layer was constructed in <a href='#SkBitmap_extractAlpha_3_dst'>dst</a> <a href='undocumented#Pixel_Ref'>Pixel Ref</a> ### Example @@ -3551,33 +4218,33 @@ true if <a href="SkColor_Reference#Alpha">Alpha</a> layer was constructed in <a ### See Also -<a href="#SkBitmap_extractSubset">extractSubset</a> +<a href='#SkBitmap_extractSubset'>extractSubset</a> --- -<a name="SkBitmap_peekPixels"></a> +<a name='SkBitmap_peekPixels'></a> ## peekPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool peekPixels(SkPixmap* pixmap) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkBitmap_peekPixels'>peekPixels</a>(<a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>* pixmap) const </pre> -Copies <a href="#Bitmap">Bitmap</a> pixel address, row bytes, and <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to pixmap, if address +Copies <a href='#Bitmap'>Bitmap</a> pixel address, row bytes, and <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to pixmap, if address is available, and returns true. If pixel address is not available, return false and leave pixmap unchanged. -pixmap contents become invalid on any future change to <a href="#Bitmap">Bitmap</a>. +pixmap contents become invalid on any future change to <a href='#Bitmap'>Bitmap</a>. ### Parameters -<table> <tr> <td><a name="SkBitmap_peekPixels_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -storage for pixel state if pixels are readable; otherwise, ignored</td> +<table> <tr> <td><a name='SkBitmap_peekPixels_pixmap'><code><strong>pixmap</strong></code></a></td> + <td>storage for pixel state if pixels are readable; otherwise, ignored</td> </tr> </table> ### Return Value -true if <a href="#Bitmap">Bitmap</a> has direct access to pixels +true if <a href='#Bitmap'>Bitmap</a> has direct access to pixels ### Example @@ -3603,27 +4270,52 @@ x---x- ### See Also -<a href="#SkBitmap_pixmap">pixmap</a> <a href="#SkBitmap_installPixels">installPixels</a><sup><a href="#SkBitmap_installPixels_2">[2]</a></sup><sup><a href="#SkBitmap_installPixels_3">[3]</a></sup> <a href="#SkBitmap_readPixels">readPixels</a><sup><a href="#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="#SkBitmap_readPixels_4">[4]</a></sup> <a href="#SkBitmap_writePixels">writePixels</a><sup><a href="#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="#SkBitmap_writePixels_3">[3]</a></sup> +<a href='#SkBitmap_pixmap'>pixmap</a> <a href='#SkBitmap_installPixels'>installPixels</a><sup><a href='#SkBitmap_installPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_installPixels_3'>[3]</a></sup> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='#SkBitmap_readPixels_4'>[4]</a></sup> <a href='#SkBitmap_writePixels'>writePixels</a><sup><a href='#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='#SkBitmap_writePixels_3'>[3]</a></sup> --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> -| name | description | -| --- | --- | -| <a href="#SkBitmap_ComputeIsOpaque">ComputeIsOpaque</a> | returns true if all pixels are opaque | -| <a href="#SkBitmap_computeByteSize">computeByteSize</a> | returns size required for pixels | -| <a href="#SkBitmap_getGenerationID">getGenerationID</a> | returns unique ID | -| <a href="#SkBitmap_readyToDraw">readyToDraw</a> | returns true if address of pixels is not nullptr | -| <a href="#SkBitmap_swap">swap</a> | exchanges <a href="#Bitmap">Bitmap</a> pair | -| <a href="#SkBitmap_toString">toString</a> | converts <a href="#Bitmap">Bitmap</a> to machine readable form | -| <a href="#SkBitmap_validate">validate</a> | asserts if <a href="#Bitmap">Bitmap</a> is invalid (debug only) | -<a name="SkBitmap_validate"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_ComputeIsOpaque'>ComputeIsOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if all pixels are opaque</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_computeByteSize'>computeByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns size required for pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getGenerationID'>getGenerationID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readyToDraw'>readyToDraw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if address of pixels is not nullptr</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_swap'>swap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Bitmap'>Bitmap</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Bitmap'>Bitmap</a> to machine readable form</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_validate'>validate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Bitmap'>Bitmap</a> is invalid (debug only)</td> + </tr> +</table> + + +<a name='SkBitmap_validate'></a> ## validate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void validate() const; +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_validate'>validate</a>() const; </pre> Asserts if internal values are illegal or inconsistent. Only available if @@ -3631,24 +4323,24 @@ SK_DEBUG is defined at compile time. ### See Also -<a href="SkImageInfo_Reference#SkImageInfo_validate">SkImageInfo::validate</a> +<a href='SkImageInfo_Reference#SkImageInfo_validate'>SkImageInfo::validate</a> --- -<a name="SkBitmap_toString"></a> +<a name='SkBitmap_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const; +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkBitmap_toString'>toString</a>(<a href='undocumented#SkString'>SkString</a>* str) const; </pre> -Creates string representation of <a href="#Bitmap">Bitmap</a>. The representation is read by +Creates string representation of <a href='#Bitmap'>Bitmap</a>. The representation is read by internal debugging tools. ### Parameters -<table> <tr> <td><a name="SkBitmap_toString_str"> <code><strong>str </strong></code> </a></td> <td> -storage for string representation</td> +<table> <tr> <td><a name='SkBitmap_toString_str'><code><strong>str</strong></code></a></td> + <td>storage for string representation</td> </tr> </table> @@ -3666,7 +4358,7 @@ bitmap dimensions (6, 11) ### See Also -<a href="SkPaint_Reference#SkPaint_toString">SkPaint::toString</a> +<a href='SkPaint_Reference#SkPaint_toString'>SkPaint::toString</a> --- diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index 77389ecca3..17f6e37c3c 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -1,219 +1,628 @@ SkCanvas Reference === -# <a name="Canvas"></a> Canvas - -## <a name="Overview"></a> Overview - -## <a name="Overview_Subtopic"></a> Overview Subtopic - -| name | description | -| --- | --- | -| <a href="#Class_or_Struct">Class or Struct</a> | embedded struct and class members | -| <a href="#Constant">Constant</a> | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkCanvas">SkCanvas</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -| Typedef | types defined by other types | - -# <a name="SkCanvas"></a> Class SkCanvas -<a href="#Canvas">Canvas</a> provides an interface for drawing, and how the drawing is clipped and transformed. -<a href="#Canvas">Canvas</a> contains a stack of <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> values. - -<a href="#Canvas">Canvas</a> and <a href="SkPaint_Reference#Paint">Paint</a> together provide the state to draw into <a href="SkSurface_Reference#Surface">Surface</a> or <a href="undocumented#Device">Device</a>. -Each <a href="#Canvas">Canvas</a> draw call transforms the geometry of the object by the concatenation of all -<a href="#Matrix">Matrix</a> values in the stack. The transformed geometry is clipped by the intersection -of all of <a href="#Clip">Clip</a> values in the stack. The <a href="#Canvas">Canvas</a> draw calls use <a href="SkPaint_Reference#Paint">Paint</a> to supply drawing -state such as <a href="SkColor_Reference#Color">Color</a>, <a href="undocumented#Typeface">Typeface</a>, text size, stroke width, <a href="undocumented#Shader">Shader</a> and so on. - -To draw to a pixel-based destination, create <a href="undocumented#Raster_Surface">Raster Surface</a> or <a href="undocumented#GPU_Surface">GPU Surface</a>. -Request <a href="#Canvas">Canvas</a> from <a href="SkSurface_Reference#Surface">Surface</a> to obtain the interface to draw. -<a href="#Canvas">Canvas</a> generated by <a href="undocumented#Raster_Surface">Raster Surface</a> draws to memory visible to the CPU. -<a href="#Canvas">Canvas</a> generated by <a href="undocumented#GPU_Surface">GPU Surface</a> uses Vulkan or OpenGL to draw to the GPU. - -To draw to a document, obtain <a href="#Canvas">Canvas</a> from <a href="undocumented#Canvas">SVG Canvas</a>, <a href="undocumented#PDF">Document PDF</a>, or <a href="undocumented#Recorder">Picture Recorder</a>. -<a href="undocumented#Document">Document</a> based <a href="#Canvas">Canvas</a> and other <a href="#Canvas">Canvas</a> Subclasses reference <a href="undocumented#Device">Device</a> describing the +# <a name='Canvas'>Canvas</a> + +# <a name='SkCanvas'>Class SkCanvas</a> +<a href='#Canvas'>Canvas</a> provides an interface for drawing, and how the drawing is clipped and transformed. +<a href='#Canvas'>Canvas</a> contains a stack of <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a> values. + +<a href='#Canvas'>Canvas</a> and <a href='SkPaint_Reference#Paint'>Paint</a> together provide the state to draw into <a href='SkSurface_Reference#Surface'>Surface</a> or <a href='undocumented#Device'>Device</a>. +Each <a href='#Canvas'>Canvas</a> draw call transforms the geometry of the object by the concatenation of all +<a href='#Matrix'>Matrix</a> values in the stack. The transformed geometry is clipped by the intersection +of all of <a href='#Clip'>Clip</a> values in the stack. The <a href='#Canvas'>Canvas</a> draw calls use <a href='SkPaint_Reference#Paint'>Paint</a> to supply drawing +state such as <a href='SkColor_Reference#Color'>Color</a>, <a href='undocumented#Typeface'>Typeface</a>, text size, stroke width, <a href='undocumented#Shader'>Shader</a> and so on. + +To draw to a pixel-based destination, create <a href='undocumented#Raster_Surface'>Raster Surface</a> or <a href='undocumented#GPU_Surface'>GPU Surface</a>. +Request <a href='#Canvas'>Canvas</a> from <a href='SkSurface_Reference#Surface'>Surface</a> to obtain the interface to draw. +<a href='#Canvas'>Canvas</a> generated by <a href='undocumented#Raster_Surface'>Raster Surface</a> draws to memory visible to the CPU. +<a href='#Canvas'>Canvas</a> generated by <a href='undocumented#GPU_Surface'>GPU Surface</a> uses Vulkan or OpenGL to draw to the GPU. + +To draw to a document, obtain <a href='#Canvas'>Canvas</a> from <a href='undocumented#Canvas'>SVG Canvas</a>, <a href='undocumented#PDF'>Document PDF</a>, or <a href='undocumented#Recorder'>Picture Recorder</a>. +<a href='undocumented#Document'>Document</a> based <a href='#Canvas'>Canvas</a> and other <a href='#Canvas'>Canvas</a> Subclasses reference <a href='undocumented#Device'>Device</a> describing the destination. -<a href="#Canvas">Canvas</a> can be constructed to draw to <a href="SkBitmap_Reference#Bitmap">Bitmap</a> without first creating <a href="undocumented#Raster_Surface">Raster Surface</a>. +<a href='#Canvas'>Canvas</a> can be constructed to draw to <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> without first creating <a href='undocumented#Raster_Surface'>Raster Surface</a>. This approach may be deprecated in the future. -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Clip">Clip</a> | stack of clipping <a href="SkPath_Reference#Path">Paths</a> | -| <a href="#Draw">Draw</a> | draws into <a href="#Canvas">Canvas</a> | -| <a href="#Draw_Image">Draw Image</a> | draws <a href="SkImage_Reference#Image">Image</a> to <a href="#Canvas">Canvas</a> | -| <a href="#Draw_Text">Draw Text</a> | draws text into <a href="#Canvas">Canvas</a> | -| <a href="#Layer">Layer</a> | temporary <a href="SkBitmap_Reference#Bitmap">Bitmap</a> to draw into | -| <a href="#Matrix">Matrix</a> | coordinate transformation | -| <a href="#Pixels">Pixels</a> | read and write pixel values | -| <a href="#Property">Property</a> | metrics and attributes | -| <a href="#State_Stack">State Stack</a> | stack of state for hierarchical drawing | -| <a href="#Utility">Utility</a> | rarely called management functions | - -## <a name="Constant"></a> Constant - -| name | description | -| --- | --- | -| <a href="#SkCanvas_ColorBehavior">ColorBehavior</a> | Android framework only | -| <a href="#SkCanvas_PointMode">PointMode</a> | sets <a href="#SkCanvas_drawPoints">drawPoints</a> options | -| <a href="#SkCanvas_SaveLayerFlagsSet">SaveLayerFlagsSet</a> | sets <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> options | -| <a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> | sets <a href="#SkCanvas_drawImageRect">drawImageRect</a> options | - -## <a name="Class_or_Struct"></a> Class or Struct - -| name | description | -| --- | --- | -| <a href="#SkCanvas_Lattice">Lattice</a> | divides <a href="SkBitmap_Reference#Bitmap">Bitmap</a> or <a href="SkImage_Reference#Image">Image</a> into a rectangular grid | -| <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> | contains the state used to create the <a href="#Layer">Layer</a> | - -## <a name="Constructor"></a> Constructor - -Create the desired type of <a href="SkSurface_Reference#Surface">Surface</a> to obtain its <a href="#Canvas">Canvas</a> when possible. Useful -when no <a href="SkSurface_Reference#Surface">Surface</a> is required, and some helpers implicitly create <a href="undocumented#Raster_Surface">Raster Surface</a>. - -| name | description | -| --- | --- | -| <a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> | creates from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkCanvas_MakeRasterDirectN32">MakeRasterDirectN32</a> | creates from image data and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkCanvas_empty_constructor">SkCanvas()</a> | creates with no <a href="SkSurface_Reference#Surface">Surface</a>, no dimensions | -| <a href="#SkCanvas_copy_const_SkBitmap">SkCanvas(const SkBitmap& bitmap)</a> | uses existing <a href="SkBitmap_Reference#Bitmap">Bitmap</a> | -| <a href="#SkCanvas_const_SkBitmap">SkCanvas(const SkBitmap& bitmap, ColorBehavior behavior)</a> | Android framework only | -| <a href="#SkCanvas_const_SkBitmap_const_SkSurfaceProps">SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)</a> | uses existing <a href="SkBitmap_Reference#Bitmap">Bitmap</a> and <a href="undocumented#Surface_Properties">Surface Properties</a> | -| <a href="#SkCanvas_int_int_const_SkSurfaceProps_star">SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr)</a> | no <a href="SkSurface_Reference#Surface">Surface</a>, set dimensions, <a href="undocumented#Surface_Properties">Surface Properties</a> | -| <a href="#SkCanvas_makeSurface">makeSurface</a> | creates <a href="SkSurface_Reference#Surface">Surface</a> matching <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#SkSurfaceProps">SkSurfaceProps</a> | -| <a href="#SkCanvas_destructor">~SkCanvas()</a> | draws saved <a href="#Layer">Layers</a>, frees resources | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> | creates from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkCanvas_MakeRasterDirectN32">MakeRasterDirectN32</a> | creates from image data and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkCanvas_accessTopLayerPixels">accessTopLayerPixels</a> | returns writable pixel access if available | -| <a href="#SkCanvas_accessTopRasterHandle">accessTopRasterHandle</a> | returns context that tracks <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_androidFramework_setDeviceClipRestriction">androidFramework setDeviceClipRestriction</a> | for use by Android framework | -| <a href="#SkCanvas_clear">clear</a> | fills <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> | -| <a href="#SkCanvas_clipPath">clipPath</a> | combines <a href="#Clip">Clip</a> with <a href="SkPath_Reference#Path">Path</a> | -| <a href="#SkCanvas_clipRRect">clipRRect</a> | combines <a href="#Clip">Clip</a> with <a href="undocumented#Round_Rect">Round Rect</a> | -| <a href="#SkCanvas_clipRect">clipRect</a> | combines <a href="#Clip">Clip</a> with <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkCanvas_clipRegion">clipRegion</a> | combines <a href="#Clip">Clip</a> with <a href="undocumented#Region">Region</a> | -| <a href="#SkCanvas_concat">concat</a> | multiplies <a href="#Matrix">Matrix</a> by <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_discard">discard</a> | makes <a href="#Canvas">Canvas</a> contents undefined | -| <a href="#SkCanvas_drawAnnotation">drawAnnotation</a> | associates a <a href="SkRect_Reference#Rect">Rect</a> with a key-value pair | -| <a href="#SkCanvas_drawArc">drawArc</a> | draws <a href="undocumented#Arc">Arc</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawAtlas">drawAtlas</a> | draws sprites using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawBitmap">drawBitmap</a> | draws <a href="SkBitmap_Reference#Bitmap">Bitmap</a> at (x, y) position | -| <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> | draws proportionally stretched <a href="SkBitmap_Reference#Bitmap">Bitmap</a> | -| <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> | draws <a href="undocumented#Nine_Patch">Nine Patch</a> <a href="SkBitmap_Reference#Bitmap">Bitmap</a> | -| <a href="#SkCanvas_drawBitmapRect">drawBitmapRect</a> | draws <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, source <a href="SkRect_Reference#Rect">Rect</a> to destination <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkCanvas_drawCircle">drawCircle</a> | draws <a href="undocumented#Circle">Circle</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawColor">drawColor</a> | fills <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> and <a href="undocumented#Blend_Mode">Blend Mode</a> | -| <a href="#SkCanvas_drawDRRect">drawDRRect</a> | draws double <a href="undocumented#Round_Rect">Round Rect</a> stroked or filled | -| <a href="#SkCanvas_drawDrawable">drawDrawable</a> | draws <a href="undocumented#Drawable">Drawable</a>, encapsulated drawing commands | -| <a href="#SkCanvas_drawIRect">drawIRect</a> | draws <a href="SkIRect_Reference#IRect">IRect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawImage">drawImage</a> | draws <a href="SkImage_Reference#Image">Image</a> at (x, y) position | -| <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> | draws proportionally stretched <a href="SkImage_Reference#Image">Image</a> | -| <a href="#SkCanvas_drawImageNine">drawImageNine</a> | draws <a href="undocumented#Nine_Patch">Nine Patch</a> <a href="SkImage_Reference#Image">Image</a> | -| <a href="#SkCanvas_drawImageRect">drawImageRect</a> | draws <a href="SkImage_Reference#Image">Image</a>, source <a href="SkRect_Reference#Rect">Rect</a> to destination <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkCanvas_drawLine">drawLine</a> | draws line segment between two points | -| <a href="#SkCanvas_drawOval">drawOval</a> | draws <a href="undocumented#Oval">Oval</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawPaint">drawPaint</a> | fills <a href="#Clip">Clip</a> with <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawPatch">drawPatch</a> | draws Coons_Patch | -| <a href="#SkCanvas_drawPath">drawPath</a> | draws <a href="SkPath_Reference#Path">Path</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawPicture">drawPicture</a> | draws <a href="undocumented#Picture">Picture</a> using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_drawPoint">drawPoint</a> | draws point at (x, y) position | -| <a href="#SkCanvas_drawPoints">drawPoints</a> | draws array as points, lines, polygon | -| <a href="#SkCanvas_drawPosText">drawPosText</a> | draws text at array of (x, y) positions | -| <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> | draws text at x positions with common baseline | -| <a href="#SkCanvas_drawRRect">drawRRect</a> | draws <a href="undocumented#Round_Rect">Round Rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawRect">drawRect</a> | draws <a href="SkRect_Reference#Rect">Rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawRegion">drawRegion</a> | draws <a href="undocumented#Region">Region</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> | draws <a href="undocumented#Round_Rect">Round Rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawString">drawString</a> | draws null terminated string at (x, y) using font advance | -| <a href="#SkCanvas_drawText">drawText</a> | draws text at (x, y), using font advance | -| <a href="#SkCanvas_drawTextBlob">drawTextBlob</a> | draws text with arrays of positions and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> | draws text following <a href="SkPath_Reference#Path">Path</a> contour | -| <a href="#SkCanvas_drawTextOnPathHV">drawTextOnPathHV</a> | draws text following <a href="SkPath_Reference#Path">Path</a> with offsets | -| <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> | draws text with array of <a href="undocumented#RSXform">RSXform</a> | -| <a href="#SkCanvas_drawVertices">drawVertices</a> | draws <a href="undocumented#Vertices">Vertices</a>, a triangle mesh | -| <a href="#SkCanvas_flush">flush</a> | triggers execution of all pending draw operations | -| <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> | returns size of base <a href="#Layer">Layer</a> in global coordinates | -| <a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a> | returns <a href="SkIRect_Reference#IRect">IRect</a> bounds of <a href="#Clip">Clip</a> | -| <a href="#SkCanvas_getGrContext">getGrContext</a> | returns <a href="undocumented#GPU_Context">GPU Context</a> of the <a href="undocumented#GPU_Surface">GPU Surface</a> | -| <a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a> | returns <a href="#Clip">Clip</a> bounds in source coordinates | -| <a href="#SkCanvas_getMetaData">getMetaData</a> | associates additional data with the canvas | -| <a href="#SkCanvas_getProps">getProps</a> | copies <a href="undocumented#Surface_Properties">Surface Properties</a> if available | -| <a href="#SkCanvas_getSaveCount">getSaveCount</a> | returns depth of stack containing <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_getTotalMatrix">getTotalMatrix</a> | returns <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_imageInfo">imageInfo</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> for <a href="#Canvas">Canvas</a> | -| <a href="#SkCanvas_isClipEmpty">isClipEmpty</a> | returns if <a href="#Clip">Clip</a> is empty | -| <a href="#SkCanvas_isClipRect">isClipRect</a> | returns if <a href="#Clip">Clip</a> is <a href="SkRect_Reference#Rect">Rect</a> and not empty | -| <a href="#SkCanvas_makeSurface">makeSurface</a> | creates <a href="SkSurface_Reference#Surface">Surface</a> matching <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#SkSurfaceProps">SkSurfaceProps</a> | -| <a href="#SkCanvas_peekPixels">peekPixels</a> | returns if <a href="#Canvas">Canvas</a> has direct access to its pixels | -| <a href="#SkCanvas_quickReject">quickReject</a> | returns if <a href="SkRect_Reference#Rect">Rect</a> is outside <a href="#Clip">Clip</a> | -| <a href="#SkCanvas_readPixels">readPixels</a> | copies and converts rectangle of pixels from <a href="#Canvas">Canvas</a> | -| <a href="#SkCanvas_resetMatrix">resetMatrix</a> | resets <a href="#Matrix">Matrix</a> to identity | -| <a href="#SkCanvas_restore">restore</a> | restores changes to <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, pops save stack | -| <a href="#SkCanvas_restoreToCount">restoreToCount</a> | restores changes to <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> to given depth | -| <a href="#SkCanvas_rotate">rotate</a> | rotates <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_save">save</a> | saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack | -| <a href="#SkCanvas_saveLayer">saveLayer</a> | saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates <a href="#Layer">Layer</a> | -| <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> | saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates <a href="#Layer">Layer</a>; sets opacity | -| <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> | saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates <a href="#Layer">Layer</a> for LCD text | -| <a href="#SkCanvas_scale">scale</a> | scales <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_setAllowSimplifyClip">setAllowSimplifyClip</a> | experimental | -| <a href="#SkCanvas_setMatrix">setMatrix</a> | sets <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_skew">skew</a> | skews <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_translate">translate</a> | translates <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_writePixels">writePixels</a> | copies and converts rectangle of pixels to <a href="#Canvas">Canvas</a> | - -<a name="SkCanvas_MakeRasterDirect"></a> +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkCanvas'>SkCanvas</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Struct'>Struct Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded struct members</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Typedef'>Typedef Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>types defined by other types</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkCanvas global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Clip'>Clip</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stack of clipping <a href='SkPath_Reference#Path'>Paths</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw'>Draw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws into <a href='#Canvas'>Canvas</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw_Image'>Draw Image</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkImage_Reference#Image'>Image</a> to <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw_Image_Lattice'>Draw Image Lattice</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>divides <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> or <a href='SkImage_Reference#Image'>Image</a> into a rectangular grid</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw_Text'>Draw Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text into <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Layer'>Layer</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>temporary <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> to draw into</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Layer_SaveLayerRec'>Layer SaveLayerRec</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contains the state used to create the <a href='#Layer'>Layer</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix'>Matrix</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>coordinate transformation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Pixels'>Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>read and write pixel values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>metrics and attributes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#State_Stack'>State Stack</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stack of state for hierarchical drawing</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> +</table> + + +## <a name='Constant'>Constant</a> + + +SkCanvas related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_ColorBehavior'>ColorBehavior</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exists for Android framework only</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_PointMode'>PointMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkCanvas_drawPoints'>drawPoints</a> options</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_SaveLayerFlagsSet'>SaveLayerFlagsSet</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> options</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkCanvas_drawImageRect'>drawImageRect</a> options</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sample outside bounds; faster</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kInitWithPrevious_SaveLayerFlag'>kInitWithPrevious SaveLayerFlag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>initializes with previous contents</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_ColorBehavior_kLegacy'>ColorBehavior::kLegacy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>placeholder</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kLines_PointMode'>kLines PointMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draw each pair of points as a line segment</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kPoints_PointMode'>kPoints PointMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draw each point separately</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kPolygon_PointMode'>kPolygon PointMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draw the array of points as a open polygon</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kPreserveLCDText_SaveLayerFlag'>kPreserveLCDText SaveLayerFlag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Layer'>Layer</a> for LCD text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sample only inside bounds; slower</td> + </tr> +</table> + + +## <a name='Struct'>Struct</a> + + +SkCanvas uses C++ structs to declare the public data structures and interfaces. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_Lattice'>Lattice</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>divides <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> or <a href='SkImage_Reference#Image'>Image</a> into a rectangular grid</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contains the state used to create the <a href='#Layer'>Layer</a></td> + </tr> +</table> + + +## <a name='Typedef'>Typedef</a> + + +SkCanvas <code>typedef</code> define a data type. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>options for <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a></td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + +Create the desired type of <a href='SkSurface_Reference#Surface'>Surface</a> to obtain its <a href='#Canvas'>Canvas</a> when possible. Useful +when no <a href='SkSurface_Reference#Surface'>Surface</a> is required, and some helpers implicitly create <a href='undocumented#Raster_Surface'>Raster Surface</a>. + + +SkCanvas can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_MakeRasterDirectN32'>MakeRasterDirectN32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates from image data and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_empty_constructor'>SkCanvas()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with no <a href='SkSurface_Reference#Surface'>Surface</a>, no dimensions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_copy_const_SkBitmap'>SkCanvas(const SkBitmap& bitmap)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses existing <a href='SkBitmap_Reference#Bitmap'>Bitmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_const_SkBitmap'>SkCanvas(const SkBitmap& bitmap, ColorBehavior behavior)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exists for Android framework only</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_const_SkBitmap_const_SkSurfaceProps'>SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses existing <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> and <a href='undocumented#Surface_Properties'>Surface Properties</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_int_int_const_SkSurfaceProps_star'>SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with no <a href='SkSurface_Reference#Surface'>Surface</a>, set dimensions, <a href='undocumented#Surface_Properties'>Surface Properties</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_makeSurface'>makeSurface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='SkSurface_Reference#Surface'>Surface</a> matching <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_destructor'>~SkCanvas()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws saved <a href='#Layer'>Layers</a>, frees resources</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkCanvas member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_MakeRasterDirectN32'>MakeRasterDirectN32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates from image data and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_accessTopLayerPixels'>accessTopLayerPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel access if available</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_accessTopRasterHandle'>accessTopRasterHandle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns context that tracks <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_androidFramework_setDeviceClipRestriction'>androidFramework setDeviceClipRestriction</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exists for use by Android framework</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_clear'>clear</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fills <a href='#Clip'>Clip</a> with <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_clipPath'>clipPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>combines <a href='#Clip'>Clip</a> with <a href='SkPath_Reference#Path'>Path</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_clipRRect'>clipRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>combines <a href='#Clip'>Clip</a> with <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_clipRect'>clipRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>combines <a href='#Clip'>Clip</a> with <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_clipRegion'>clipRegion</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>combines <a href='#Clip'>Clip</a> with <a href='undocumented#Region'>Region</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_concat'>concat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Matrix'>Matrix</a> by <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_discard'>discard</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes <a href='#Canvas'>Canvas</a> contents undefined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAnnotation'>drawAnnotation</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>associates a <a href='SkRect_Reference#Rect'>Rect</a> with a key-value pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawArc'>drawArc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Arc'>Arc</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAtlas'>drawAtlas</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws sprites using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawBitmap'>drawBitmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> at (x, y) position</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws proportionally stretched <a href='SkBitmap_Reference#Bitmap'>Bitmap</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Nine_Patch'>Nine Patch</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawBitmapRect'>drawBitmapRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, source <a href='SkRect_Reference#Rect'>Rect</a> to destination <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawCircle'>drawCircle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Circle'>Circle</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawColor'>drawColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fills <a href='#Clip'>Clip</a> with <a href='SkColor_Reference#Color'>Color</a> and <a href='undocumented#Blend_Mode'>Blend Mode</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawDRRect'>drawDRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws double <a href='undocumented#Round_Rect'>Round Rect</a> stroked or filled</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawDrawable'>drawDrawable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Drawable'>Drawable</a>, encapsulated drawing commands</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawIRect'>drawIRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkIRect_Reference#IRect'>IRect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawImage'>drawImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkImage_Reference#Image'>Image</a> at (x, y) position</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawImageLattice'>drawImageLattice</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws proportionally stretched <a href='SkImage_Reference#Image'>Image</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawImageNine'>drawImageNine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Nine_Patch'>Nine Patch</a> <a href='SkImage_Reference#Image'>Image</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawImageRect'>drawImageRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkImage_Reference#Image'>Image</a>, source <a href='SkRect_Reference#Rect'>Rect</a> to destination <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawLine'>drawLine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws line segment between two points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawOval'>drawOval</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Oval'>Oval</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPaint'>drawPaint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fills <a href='#Clip'>Clip</a> with <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPatch'>drawPatch</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws Coons_Patch</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPath'>drawPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkPath_Reference#Path'>Path</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPicture'>drawPicture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Picture'>Picture</a> using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPoint'>drawPoint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws point at (x, y) position</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPoints'>drawPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws array as points, lines, polygon</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPosText'>drawPosText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text at array of (x, y) positions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPosTextH'>drawPosTextH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text at x positions with common baseline</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRRect'>drawRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Round_Rect'>Round Rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRect'>drawRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkRect_Reference#Rect'>Rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRegion'>drawRegion</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Region'>Region</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRoundRect'>drawRoundRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Round_Rect'>Round Rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawString'>drawString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws null terminated string at (x, y) using font advance</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawText'>drawText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text at (x, y), using font advance</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextBlob'>drawTextBlob</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text with arrays of positions and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text following <a href='SkPath_Reference#Path'>Path</a> contour</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextOnPathHV'>drawTextOnPathHV</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text following <a href='SkPath_Reference#Path'>Path</a> with offsets</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text with array of <a href='undocumented#RSXform'>RSXform</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices'>drawVertices</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Vertices'>Vertices</a>, a triangle mesh</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_flush'>flush</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>triggers execution of all pending draw operations</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns size of base <a href='#Layer'>Layer</a> in global coordinates</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkIRect_Reference#IRect'>IRect</a> bounds of <a href='#Clip'>Clip</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getGrContext'>getGrContext</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#GPU_Context'>GPU Context</a> of the <a href='undocumented#GPU_Surface'>GPU Surface</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Clip'>Clip</a> bounds in source coordinates</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getMetaData'>getMetaData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>associates additional data with the canvas</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getProps'>getProps</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='undocumented#Surface_Properties'>Surface Properties</a> if available</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getSaveCount'>getSaveCount</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns depth of stack containing <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getTotalMatrix'>getTotalMatrix</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_imageInfo'>imageInfo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> for <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_isClipEmpty'>isClipEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Clip'>Clip</a> is empty</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_isClipRect'>isClipRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Clip'>Clip</a> is <a href='SkRect_Reference#Rect'>Rect</a> and not empty</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_makeSurface'>makeSurface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='SkSurface_Reference#Surface'>Surface</a> matching <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Canvas'>Canvas</a> has direct access to its pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_quickReject'>quickReject</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='SkRect_Reference#Rect'>Rect</a> is outside <a href='#Clip'>Clip</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts rectangle of pixels from <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_resetMatrix'>resetMatrix</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resets <a href='#Matrix'>Matrix</a> to identity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_restore'>restore</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>restores changes to <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>, pops save stack</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_restoreToCount'>restoreToCount</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>restores changes to <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> to given depth</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_rotate'>rotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rotates <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_save'>save</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>saves <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> on stack</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_saveLayer'>saveLayer</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>saves <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> on stack; creates <a href='#Layer'>Layer</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>saves <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> on stack; creates <a href='#Layer'>Layer</a>; sets opacity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>saves <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> on stack; creates <a href='#Layer'>Layer</a> for LCD text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_scale'>scale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_setMatrix'>setMatrix</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_skew'>skew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>skews <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_translate'>translate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_writePixels'>writePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts rectangle of pixels to <a href='#Canvas'>Canvas</a></td> + </tr> +</table> + + +<a name='SkCanvas_MakeRasterDirect'></a> ## MakeRasterDirect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static std::unique_ptr<SkCanvas> MakeRasterDirect(const SkImageInfo& info, void* pixels, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static std::unique_ptr<<a href='#SkCanvas'>SkCanvas</a>> <a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, void* pixels, size_t rowBytes, - const SkSurfaceProps* props = nullptr) + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props = nullptr) </pre> -Allocates raster <a href="#Canvas">Canvas</a> that will draw directly into <a href="#SkCanvas_MakeRasterDirect_pixels">pixels</a>. +Allocates raster <a href='#Canvas'>Canvas</a> that will draw directly into <a href='#SkCanvas_MakeRasterDirect_pixels'>pixels</a>. -<a href="#Canvas">Canvas</a> is returned if all parameters are valid. +<a href='#Canvas'>Canvas</a> is returned if all parameters are valid. Valid parameters include: -<a href="#SkCanvas_MakeRasterDirect_info">info</a> dimensions are zero or positive; -<a href="#SkCanvas_MakeRasterDirect_info">info</a> contains <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> supported by <a href="undocumented#Raster_Surface">Raster Surface</a>; -<a href="#SkCanvas_MakeRasterDirect_pixels">pixels</a> is not nullptr; -<a href="#SkCanvas_MakeRasterDirect_rowBytes">rowBytes</a> is zero or large enough to contain <a href="#SkCanvas_MakeRasterDirect_info">info</a> width <a href="#SkCanvas_MakeRasterDirect_pixels">pixels</a> of <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +<a href='#SkCanvas_MakeRasterDirect_info'>info</a> dimensions are zero or positive; +<a href='#SkCanvas_MakeRasterDirect_info'>info</a> contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> supported by <a href='undocumented#Raster_Surface'>Raster Surface</a>; +<a href='#SkCanvas_MakeRasterDirect_pixels'>pixels</a> is not nullptr; +<a href='#SkCanvas_MakeRasterDirect_rowBytes'>rowBytes</a> is zero or large enough to contain <a href='#SkCanvas_MakeRasterDirect_info'>info</a> width <a href='#SkCanvas_MakeRasterDirect_pixels'>pixels</a> of <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -Pass zero for <a href="#SkCanvas_MakeRasterDirect_rowBytes">rowBytes</a> to compute <a href="#SkCanvas_MakeRasterDirect_rowBytes">rowBytes</a> from <a href="#SkCanvas_MakeRasterDirect_info">info</a> width and size of pixel. -If <a href="#SkCanvas_MakeRasterDirect_rowBytes">rowBytes</a> is greater than zero, it must be equal to or greater than -<a href="#SkCanvas_MakeRasterDirect_info">info</a> width times bytes required for <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +Pass zero for <a href='#SkCanvas_MakeRasterDirect_rowBytes'>rowBytes</a> to compute <a href='#SkCanvas_MakeRasterDirect_rowBytes'>rowBytes</a> from <a href='#SkCanvas_MakeRasterDirect_info'>info</a> width and size of pixel. +If <a href='#SkCanvas_MakeRasterDirect_rowBytes'>rowBytes</a> is greater than zero, it must be equal to or greater than +<a href='#SkCanvas_MakeRasterDirect_info'>info</a> width times bytes required for <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -<a href="undocumented#Pixel">Pixel</a> buffer size should be <a href="#SkCanvas_MakeRasterDirect_info">info</a> height times computed <a href="#SkCanvas_MakeRasterDirect_rowBytes">rowBytes</a>. -<a href="#Pixels">Pixels</a> are not initialized. -To access <a href="#SkCanvas_MakeRasterDirect_pixels">pixels</a> after drawing, call <a href="#SkCanvas_flush">flush</a> or <a href="#SkCanvas_peekPixels">peekPixels</a>. +<a href='undocumented#Pixel'>Pixel</a> buffer size should be <a href='#SkCanvas_MakeRasterDirect_info'>info</a> height times computed <a href='#SkCanvas_MakeRasterDirect_rowBytes'>rowBytes</a>. +<a href='#Pixels'>Pixels</a> are not initialized. +To access <a href='#SkCanvas_MakeRasterDirect_pixels'>pixels</a> after drawing, call <a href='#SkCanvas_flush'>flush</a> or <a href='#SkCanvas_peekPixels'>peekPixels</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_MakeRasterDirect_info"> <code><strong>info </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, of <a href="undocumented#Raster_Surface">Raster Surface</a>; +<table> <tr> <td><a name='SkCanvas_MakeRasterDirect_info'><code><strong>info</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width, or height, or both, may be zero</td> - </tr> <tr> <td><a name="SkCanvas_MakeRasterDirect_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -pointer to destination <a href="#SkCanvas_MakeRasterDirect_pixels">pixels</a> buffer</td> - </tr> <tr> <td><a name="SkCanvas_MakeRasterDirect_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -interval from one <a href="SkSurface_Reference#Surface">Surface</a> row to the next, or zero</td> - </tr> <tr> <td><a name="SkCanvas_MakeRasterDirect_props"> <code><strong>props </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent fonts; + </tr> + <tr> <td><a name='SkCanvas_MakeRasterDirect_pixels'><code><strong>pixels</strong></code></a></td> + <td>pointer to destination <a href='#SkCanvas_MakeRasterDirect_pixels'>pixels</a> buffer</td> + </tr> + <tr> <td><a name='SkCanvas_MakeRasterDirect_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>interval from one <a href='SkSurface_Reference#Surface'>Surface</a> row to the next, or zero</td> + </tr> + <tr> <td><a name='SkCanvas_MakeRasterDirect_props'><code><strong>props</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Canvas">Canvas</a> if all parameters are valid; otherwise, nullptr +<a href='#Canvas'>Canvas</a> if all parameters are valid; otherwise, nullptr ### Example @@ -233,57 +642,60 @@ in the center. ### See Also -<a href="#SkCanvas_MakeRasterDirectN32">MakeRasterDirectN32</a> <a href="SkSurface_Reference#SkSurface_MakeRasterDirect">SkSurface::MakeRasterDirect</a> +<a href='#SkCanvas_MakeRasterDirectN32'>MakeRasterDirectN32</a> <a href='SkSurface_Reference#SkSurface_MakeRasterDirect'>SkSurface::MakeRasterDirect</a> --- -<a name="SkCanvas_MakeRasterDirectN32"></a> +<a name='SkCanvas_MakeRasterDirectN32'></a> ## MakeRasterDirectN32 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static std::unique_ptr<SkCanvas> MakeRasterDirectN32(int width, int height, SkPMColor* pixels, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static std::unique_ptr<<a href='#SkCanvas'>SkCanvas</a>> <a href='#SkCanvas_MakeRasterDirectN32'>MakeRasterDirectN32</a>(int width, int height, <a href='SkColor_Reference#SkPMColor'>SkPMColor</a>* pixels, size_t rowBytes) </pre> -Allocates raster <a href="#Canvas">Canvas</a> specified by inline image specification. Subsequent <a href="#Canvas">Canvas</a> -calls draw into <a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a>. -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> is set to <a href="SkImageInfo_Reference#kN32_SkColorType">kN32_SkColorType</a>. -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is set to <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>. -To access <a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a> after drawing, call <a href="#SkCanvas_flush">flush</a> or <a href="#SkCanvas_peekPixels">peekPixels</a>. +Allocates raster <a href='#Canvas'>Canvas</a> specified by inline image specification. Subsequent <a href='#Canvas'>Canvas</a> +calls draw into <a href='#SkCanvas_MakeRasterDirectN32_pixels'>pixels</a>. +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is set to <a href='SkImageInfo_Reference#kN32_SkColorType'>kN32_SkColorType</a>. +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is set to <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>. +To access <a href='#SkCanvas_MakeRasterDirectN32_pixels'>pixels</a> after drawing, call <a href='#SkCanvas_flush'>flush</a> or <a href='#SkCanvas_peekPixels'>peekPixels</a>. -<a href="#Canvas">Canvas</a> is returned if all parameters are valid. +<a href='#Canvas'>Canvas</a> is returned if all parameters are valid. Valid parameters include: -<a href="#SkCanvas_MakeRasterDirectN32_width">width</a> and <a href="#SkCanvas_MakeRasterDirectN32_height">height</a> are zero or positive; -<a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a> is not nullptr; -<a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> is zero or large enough to contain <a href="#SkCanvas_MakeRasterDirectN32_width">width</a> <a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a> of <a href="SkImageInfo_Reference#kN32_SkColorType">kN32_SkColorType</a>. +<a href='#SkCanvas_MakeRasterDirectN32_width'>width</a> and <a href='#SkCanvas_MakeRasterDirectN32_height'>height</a> are zero or positive; +<a href='#SkCanvas_MakeRasterDirectN32_pixels'>pixels</a> is not nullptr; +<a href='#SkCanvas_MakeRasterDirectN32_rowBytes'>rowBytes</a> is zero or large enough to contain <a href='#SkCanvas_MakeRasterDirectN32_width'>width</a> <a href='#SkCanvas_MakeRasterDirectN32_pixels'>pixels</a> of <a href='SkImageInfo_Reference#kN32_SkColorType'>kN32_SkColorType</a>. -Pass zero for <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> to compute <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> from <a href="#SkCanvas_MakeRasterDirectN32_width">width</a> and size of pixel. -If <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> is greater than zero, it must be equal to or greater than -<a href="#SkCanvas_MakeRasterDirectN32_width">width</a> times bytes required for <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +Pass zero for <a href='#SkCanvas_MakeRasterDirectN32_rowBytes'>rowBytes</a> to compute <a href='#SkCanvas_MakeRasterDirectN32_rowBytes'>rowBytes</a> from <a href='#SkCanvas_MakeRasterDirectN32_width'>width</a> and size of pixel. +If <a href='#SkCanvas_MakeRasterDirectN32_rowBytes'>rowBytes</a> is greater than zero, it must be equal to or greater than +<a href='#SkCanvas_MakeRasterDirectN32_width'>width</a> times bytes required for <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -<a href="undocumented#Pixel">Pixel</a> buffer size should be <a href="#SkCanvas_MakeRasterDirectN32_height">height</a> times <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a>. +<a href='undocumented#Pixel'>Pixel</a> buffer size should be <a href='#SkCanvas_MakeRasterDirectN32_height'>height</a> times <a href='#SkCanvas_MakeRasterDirectN32_rowBytes'>rowBytes</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_MakeRasterDirectN32_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count on <a href="undocumented#Raster_Surface">Raster Surface</a> created; must be zero or greater</td> - </tr> <tr> <td><a name="SkCanvas_MakeRasterDirectN32_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count on <a href="undocumented#Raster_Surface">Raster Surface</a> created; must be zero or greater</td> - </tr> <tr> <td><a name="SkCanvas_MakeRasterDirectN32_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -pointer to destination <a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a> buffer; buffer size should be <a href="#SkCanvas_MakeRasterDirectN32_height">height</a> -times <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a></td> - </tr> <tr> <td><a name="SkCanvas_MakeRasterDirectN32_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -interval from one <a href="SkSurface_Reference#Surface">Surface</a> row to the next, or zero</td> +<table> <tr> <td><a name='SkCanvas_MakeRasterDirectN32_width'><code><strong>width</strong></code></a></td> + <td>pixel column count on <a href='undocumented#Raster_Surface'>Raster Surface</a> created; must be zero or greater</td> + </tr> + <tr> <td><a name='SkCanvas_MakeRasterDirectN32_height'><code><strong>height</strong></code></a></td> + <td>pixel row count on <a href='undocumented#Raster_Surface'>Raster Surface</a> created; must be zero or greater</td> + </tr> + <tr> <td><a name='SkCanvas_MakeRasterDirectN32_pixels'><code><strong>pixels</strong></code></a></td> + <td>pointer to destination <a href='#SkCanvas_MakeRasterDirectN32_pixels'>pixels</a> buffer; buffer size should be <a href='#SkCanvas_MakeRasterDirectN32_height'>height</a> +times <a href='#SkCanvas_MakeRasterDirectN32_rowBytes'>rowBytes</a></td> + </tr> + <tr> <td><a name='SkCanvas_MakeRasterDirectN32_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>interval from one <a href='SkSurface_Reference#Surface'>Surface</a> row to the next, or zero</td> </tr> </table> ### Return Value -<a href="#Canvas">Canvas</a> if all parameters are valid; otherwise, nullptr +<a href='#Canvas'>Canvas</a> if all parameters are valid; otherwise, nullptr ### Example -<div><fiddle-embed name="a9b116a7ebd1708237ce81ef532e9cb4"><div>Allocates a three by three bitmap, clears it to white, and draws a black pixel +<div><fiddle-embed name="4cacf302830e644234d522f6e2f8f580"><div>Allocates a three by three bitmap, clears it to white, and draws a black pixel in the center. </div> @@ -299,23 +711,23 @@ in the center. ### See Also -<a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> <a href="SkSurface_Reference#SkSurface_MakeRasterDirect">SkSurface::MakeRasterDirect</a> <a href="SkImageInfo_Reference#SkImageInfo_MakeN32Premul">SkImageInfo::MakeN32Premul</a><sup><a href="SkImageInfo_Reference#SkImageInfo_MakeN32Premul_2">[2]</a></sup> +<a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a> <a href='SkSurface_Reference#SkSurface_MakeRasterDirect'>SkSurface::MakeRasterDirect</a> <a href='SkImageInfo_Reference#SkImageInfo_MakeN32Premul'>SkImageInfo::MakeN32Premul</a><sup><a href='SkImageInfo_Reference#SkImageInfo_MakeN32Premul_2'>[2]</a></sup> --- -<a name="SkCanvas_empty_constructor"></a> +<a name='SkCanvas_empty_constructor'></a> ## SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas'>SkCanvas</a>() </pre> -Creates an empty <a href="#Canvas">Canvas</a> with no backing device or pixels, with +Creates an empty <a href='#Canvas'>Canvas</a> with no backing device or pixels, with a width and height of zero. ### Return Value -empty <a href="#Canvas">Canvas</a> +empty <a href='#Canvas'>Canvas</a> ### Example @@ -334,41 +746,43 @@ paint draws text top to bottom ### See Also -<a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> <a href="undocumented#SkRasterHandleAllocator_MakeCanvas">SkRasterHandleAllocator::MakeCanvas</a> <a href="SkSurface_Reference#SkSurface_getCanvas">SkSurface::getCanvas</a> <a href="undocumented#SkCreateColorSpaceXformCanvas">SkCreateColorSpaceXformCanvas</a> +<a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a> <a href='undocumented#SkRasterHandleAllocator_MakeCanvas'>SkRasterHandleAllocator::MakeCanvas</a> <a href='SkSurface_Reference#SkSurface_getCanvas'>SkSurface::getCanvas</a> <a href='undocumented#SkCreateColorSpaceXformCanvas'>SkCreateColorSpaceXformCanvas</a> --- -<a name="SkCanvas_int_int_const_SkSurfaceProps_star"></a> +<a name='SkCanvas_int_int_const_SkSurfaceProps_star'></a> ## SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas'>SkCanvas</a>(int width, int height, const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props = nullptr) </pre> -Creates <a href="#Canvas">Canvas</a> of the specified dimensions without a <a href="SkSurface_Reference#Surface">Surface</a>. -Used by Subclasses with custom implementations for draw methods. +Creates <a href='#Canvas'>Canvas</a> of the specified dimensions without a <a href='SkSurface_Reference#Surface'>Surface</a>. +Used by Subclasses with custom implementations for draw member functions. -If <a href="#SkCanvas_int_int_const_SkSurfaceProps_star_props">props</a> equals nullptr, <a href="undocumented#Surface_Properties">Surface Properties</a> are created with -<a href="undocumented#Legacy_Font_Host">Surface Properties Legacy Font Host</a> settings, which choose the pixel striping +If <a href='#SkCanvas_int_int_const_SkSurfaceProps_star_props'>props</a> equals nullptr, <a href='undocumented#Surface_Properties'>Surface Properties</a> are created with +<a href='undocumented#Legacy_Font_Host'>Surface Properties Legacy Font Host</a> settings, which choose the pixel striping direction and order. Since a platform may dynamically change its direction when the device is rotated, and since a platform may have multiple monitors with different characteristics, it is best not to rely on this legacy behavior. ### Parameters -<table> <tr> <td><a name="SkCanvas_int_int_const_SkSurfaceProps_star_width"> <code><strong>width </strong></code> </a></td> <td> -zero or greater</td> - </tr> <tr> <td><a name="SkCanvas_int_int_const_SkSurfaceProps_star_height"> <code><strong>height </strong></code> </a></td> <td> -zero or greater</td> - </tr> <tr> <td><a name="SkCanvas_int_int_const_SkSurfaceProps_star_props"> <code><strong>props </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent fonts; +<table> <tr> <td><a name='SkCanvas_int_int_const_SkSurfaceProps_star_width'><code><strong>width</strong></code></a></td> + <td>zero or greater</td> + </tr> + <tr> <td><a name='SkCanvas_int_int_const_SkSurfaceProps_star_height'><code><strong>height</strong></code></a></td> + <td>zero or greater</td> + </tr> + <tr> <td><a name='SkCanvas_int_int_const_SkSurfaceProps_star_props'><code><strong>props</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Canvas">Canvas</a> placeholder with dimensions +<a href='#Canvas'>Canvas</a> placeholder with dimensions ### Example @@ -384,47 +798,49 @@ canvas is empty ### See Also -<a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> <a href="undocumented#SkSurfaceProps">SkSurfaceProps</a> <a href="undocumented#SkPixelGeometry">SkPixelGeometry</a> <a href="undocumented#SkCreateColorSpaceXformCanvas">SkCreateColorSpaceXformCanvas</a> +<a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a> <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a> <a href='undocumented#SkPixelGeometry'>SkPixelGeometry</a> <a href='undocumented#SkCreateColorSpaceXformCanvas'>SkCreateColorSpaceXformCanvas</a> --- -<a name="SkCanvas_copy_SkBaseDevice"></a> +<a name='SkCanvas_copy_SkBaseDevice'></a> ## SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -explicit SkCanvas(sk_sp<SkBaseDevice> device) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +explicit <a href='#SkCanvas'>SkCanvas</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkBaseDevice'>SkBaseDevice</a>> device) </pre> +Deprecated. + soon --- -<a name="SkCanvas_copy_const_SkBitmap"></a> +<a name='SkCanvas_copy_const_SkBitmap'></a> ## SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -explicit SkCanvas(const SkBitmap& bitmap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +explicit <a href='#SkCanvas'>SkCanvas</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap) </pre> -Construct a canvas that draws into <a href="#SkCanvas_copy_const_SkBitmap_bitmap">bitmap</a>. -Sets <a href="undocumented#SkSurfaceProps_kLegacyFontHost_InitType">SkSurfaceProps::kLegacyFontHost InitType</a> in constructed <a href="SkSurface_Reference#Surface">Surface</a>. +Construct a canvas that draws into <a href='#SkCanvas_copy_const_SkBitmap_bitmap'>bitmap</a>. +Sets <a href='undocumented#SkSurfaceProps_kLegacyFontHost_InitType'>SkSurfaceProps::kLegacyFontHost InitType</a> in constructed <a href='SkSurface_Reference#Surface'>Surface</a>. -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> is copied so that subsequently editing <a href="#SkCanvas_copy_const_SkBitmap_bitmap">bitmap</a> will not affect -constructed <a href="#Canvas">Canvas</a>. +<a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is copied so that subsequently editing <a href='#SkCanvas_copy_const_SkBitmap_bitmap'>bitmap</a> will not affect +constructed <a href='#Canvas'>Canvas</a>. May be deprecated in the future. ### Parameters -<table> <tr> <td><a name="SkCanvas_copy_const_SkBitmap_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and pixel -storage of <a href="undocumented#Raster_Surface">Raster Surface</a></td> +<table> <tr> <td><a name='SkCanvas_copy_const_SkBitmap_bitmap'><code><strong>bitmap</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and pixel +storage of <a href='undocumented#Raster_Surface'>Raster Surface</a></td> </tr> </table> ### Return Value -<a href="#Canvas">Canvas</a> that can be used to draw into <a href="#SkCanvas_copy_const_SkBitmap_bitmap">bitmap</a> +<a href='#Canvas'>Canvas</a> that can be used to draw into <a href='#SkCanvas_copy_const_SkBitmap_bitmap'>bitmap</a> ### Example @@ -451,77 +867,88 @@ storage of <a href="undocumented#Raster_Surface">Raster Surface</a></td> ### See Also -<a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> <a href="undocumented#SkRasterHandleAllocator_MakeCanvas">SkRasterHandleAllocator::MakeCanvas</a> <a href="SkSurface_Reference#SkSurface_getCanvas">SkSurface::getCanvas</a> <a href="undocumented#SkCreateColorSpaceXformCanvas">SkCreateColorSpaceXformCanvas</a> +<a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a> <a href='undocumented#SkRasterHandleAllocator_MakeCanvas'>SkRasterHandleAllocator::MakeCanvas</a> <a href='SkSurface_Reference#SkSurface_getCanvas'>SkSurface::getCanvas</a> <a href='undocumented#SkCreateColorSpaceXformCanvas'>SkCreateColorSpaceXformCanvas</a> --- -## <a name="SkCanvas_ColorBehavior"></a> Enum SkCanvas::ColorBehavior +## <a name='SkCanvas_ColorBehavior'>Enum SkCanvas::ColorBehavior</a> + +Android framework only. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum class <a href="#SkCanvas_ColorBehavior">ColorBehavior</a> { - <a href="#SkCanvas_ColorBehavior_kLegacy">kLegacy</a>, + enum class <a href='#SkCanvas_ColorBehavior'>ColorBehavior</a> { + <a href='#SkCanvas_ColorBehavior_kLegacy'>kLegacy</a>, }; </pre> ### Constants -<table> - <tr> - <td><a name="SkCanvas_ColorBehavior_kLegacy"> <code><strong>SkCanvas::ColorBehavior::kLegacy </strong></code> </a></td><td>0</td><td>Is a placeholder to allow specialized constructor; has no meaning. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_ColorBehavior_kLegacy'><code>SkCanvas::ColorBehavior::kLegacy</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Is a placeholder to allow specialized constructor; has no meaning. </td> </tr> +</table> - - -<a name="SkCanvas_const_SkBitmap"></a> +<a name='SkCanvas_const_SkBitmap'></a> ## SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas(const SkBitmap& bitmap, ColorBehavior behavior) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas'>SkCanvas</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, <a href='#SkCanvas_ColorBehavior'>ColorBehavior</a> behavior) </pre> +Android framework only. + ### Parameters -<table> <tr> <td><a name="SkCanvas_const_SkBitmap_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -specifies a <a href="#SkCanvas_const_SkBitmap_bitmap">bitmap</a> for the canvas to draw into</td> - </tr> <tr> <td><a name="SkCanvas_const_SkBitmap_behavior"> <code><strong>behavior </strong></code> </a></td> <td> -specializes this constructor; value is unused</td> +<table> <tr> <td><a name='SkCanvas_const_SkBitmap_bitmap'><code><strong>bitmap</strong></code></a></td> + <td>specifies a <a href='#SkCanvas_const_SkBitmap_bitmap'>bitmap</a> for the canvas to draw into</td> + </tr> + <tr> <td><a name='SkCanvas_const_SkBitmap_behavior'><code><strong>behavior</strong></code></a></td> + <td>specializes this constructor; value is unused</td> </tr> </table> ### Return Value -<a href="#Canvas">Canvas</a> that can be used to draw into <a href="#SkCanvas_const_SkBitmap_bitmap">bitmap</a> +<a href='#Canvas'>Canvas</a> that can be used to draw into <a href='#SkCanvas_const_SkBitmap_bitmap'>bitmap</a> --- -<a name="SkCanvas_const_SkBitmap_const_SkSurfaceProps"></a> +<a name='SkCanvas_const_SkBitmap_const_SkSurfaceProps'></a> ## SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas'>SkCanvas</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>& props) </pre> -Construct a canvas that draws into <a href="#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap">bitmap</a>. -Use <a href="#SkCanvas_const_SkBitmap_const_SkSurfaceProps_props">props</a> to match the device characteristics, like LCD striping. +Construct a canvas that draws into <a href='#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap'>bitmap</a>. +Use <a href='#SkCanvas_const_SkBitmap_const_SkSurfaceProps_props'>props</a> to match the device characteristics, like LCD striping. -<a href="#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap">bitmap</a> is copied so that subsequently editing <a href="#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap">bitmap</a> will not affect -constructed <a href="#Canvas">Canvas</a>. +<a href='#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap'>bitmap</a> is copied so that subsequently editing <a href='#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap'>bitmap</a> will not affect +constructed <a href='#Canvas'>Canvas</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, -and pixel storage of <a href="undocumented#Raster_Surface">Raster Surface</a></td> - </tr> <tr> <td><a name="SkCanvas_const_SkBitmap_const_SkSurfaceProps_props"> <code><strong>props </strong></code> </a></td> <td> -order and orientation of RGB striping; and whether to use +<table> <tr> <td><a name='SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap'><code><strong>bitmap</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, +and pixel storage of <a href='undocumented#Raster_Surface'>Raster Surface</a></td> + </tr> + <tr> <td><a name='SkCanvas_const_SkBitmap_const_SkSurfaceProps_props'><code><strong>props</strong></code></a></td> + <td>order and orientation of RGB striping; and whether to use device independent fonts</td> </tr> </table> ### Return Value -<a href="#Canvas">Canvas</a> that can be used to draw into <a href="#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap">bitmap</a> +<a href='#Canvas'>Canvas</a> that can be used to draw into <a href='#SkCanvas_const_SkBitmap_const_SkSurfaceProps_bitmap'>bitmap</a> ### Example @@ -548,55 +975,80 @@ device independent fonts</td> ### See Also -<a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> <a href="undocumented#SkRasterHandleAllocator_MakeCanvas">SkRasterHandleAllocator::MakeCanvas</a> <a href="SkSurface_Reference#SkSurface_getCanvas">SkSurface::getCanvas</a> <a href="undocumented#SkCreateColorSpaceXformCanvas">SkCreateColorSpaceXformCanvas</a> +<a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a> <a href='undocumented#SkRasterHandleAllocator_MakeCanvas'>SkRasterHandleAllocator::MakeCanvas</a> <a href='SkSurface_Reference#SkSurface_getCanvas'>SkSurface::getCanvas</a> <a href='undocumented#SkCreateColorSpaceXformCanvas'>SkCreateColorSpaceXformCanvas</a> --- -<a name="SkCanvas_destructor"></a> +<a name='SkCanvas_destructor'></a> ## ~SkCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual ~SkCanvas() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual <a href='#SkCanvas_destructor'>~SkCanvas</a>() </pre> -Draws saved <a href="#Layer">Layers</a>, if any. -Frees up resources used by <a href="#Canvas">Canvas</a>. +Draws saved <a href='#Layer'>Layers</a>, if any. +Frees up resources used by <a href='#Canvas'>Canvas</a>. ### Example -<div><fiddle-embed name="b7bc91ff16c9b9351b2a127f35394b82"><div><a href="#Canvas">Canvas</a> <a href="#Layer">Layer</a> draws into bitmap. <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> sets up an additional -drawing surface that blends with the bitmap. When <a href="#Layer">Layer</a> goes out of -scope, <a href="#Layer">Layer</a> Destructor is called. The saved <a href="#Layer">Layer</a> is restored, drawing +<div><fiddle-embed name="b7bc91ff16c9b9351b2a127f35394b82"><div><a href='#Canvas'>Canvas</a> <a href='#Layer'>Layer</a> draws into bitmap. <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> sets up an additional +drawing surface that blends with the bitmap. When <a href='#Layer'>Layer</a> goes out of +scope, <a href='#Layer'>Layer</a> Destructor is called. The saved <a href='#Layer'>Layer</a> is restored, drawing transparent letters. </div></fiddle-embed></div> ### See Also -<a href="#State_Stack">State Stack</a> +<a href='#State_Stack'>State Stack</a> --- -## <a name="Property"></a> Property +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns size of base <a href='#Layer'>Layer</a> in global coordinates</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getGrContext'>getGrContext</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#GPU_Context'>GPU Context</a> of the <a href='undocumented#GPU_Surface'>GPU Surface</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getMetaData'>getMetaData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>associates additional data with the canvas</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_getProps'>getProps</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='undocumented#Surface_Properties'>Surface Properties</a> if available</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_imageInfo'>imageInfo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> for <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_isClipEmpty'>isClipEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Clip'>Clip</a> is empty</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_isClipRect'>isClipRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Clip'>Clip</a> is <a href='SkRect_Reference#Rect'>Rect</a> and not empty</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> | returns size of base <a href="#Layer">Layer</a> in global coordinates | -| <a href="#SkCanvas_getGrContext">getGrContext</a> | returns <a href="undocumented#GPU_Context">GPU Context</a> of the <a href="undocumented#GPU_Surface">GPU Surface</a> | -| <a href="#SkCanvas_getMetaData">getMetaData</a> | associates additional data with the canvas | -| <a href="#SkCanvas_getProps">getProps</a> | copies <a href="undocumented#Surface_Properties">Surface Properties</a> if available | -| <a href="#SkCanvas_imageInfo">imageInfo</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> for <a href="#Canvas">Canvas</a> | -| <a href="#SkCanvas_isClipEmpty">isClipEmpty</a> | returns if <a href="#Clip">Clip</a> is empty | -| <a href="#SkCanvas_isClipRect">isClipRect</a> | returns if <a href="#Clip">Clip</a> is <a href="SkRect_Reference#Rect">Rect</a> and not empty | -<a name="SkCanvas_getMetaData"></a> +<a name='SkCanvas_getMetaData'></a> ## getMetaData -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkMetaData& getMetaData() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkMetaData'>SkMetaData</a>& <a href='#SkCanvas_getMetaData'>getMetaData</a>() </pre> Returns storage to associate additional data with the canvas. -The storage is freed when <a href="#Canvas">Canvas</a> is deleted. +The storage is freed when <a href='#Canvas'>Canvas</a> is deleted. ### Return Value @@ -618,23 +1070,23 @@ after: (null) ### See Also -<a href="undocumented#SkMetaData">SkMetaData</a> +<a href='undocumented#SkMetaData'>SkMetaData</a> --- -<a name="SkCanvas_imageInfo"></a> +<a name='SkCanvas_imageInfo'></a> ## imageInfo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageInfo imageInfo() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> <a href='#SkCanvas_imageInfo'>imageInfo</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> for <a href="#Canvas">Canvas</a>. If <a href="#Canvas">Canvas</a> is not associated with <a href="undocumented#Raster_Surface">Raster Surface</a> or -<a href="undocumented#GPU_Surface">GPU Surface</a>, returned <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is set to <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> for <a href='#Canvas'>Canvas</a>. If <a href='#Canvas'>Canvas</a> is not associated with <a href='undocumented#Raster_Surface'>Raster Surface</a> or +<a href='undocumented#GPU_Surface'>GPU Surface</a>, returned <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is set to <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value -dimensions and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> of <a href="#Canvas">Canvas</a> +dimensions and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> of <a href='#Canvas'>Canvas</a> ### Example @@ -650,31 +1102,31 @@ emptyInfo == canvasInfo ### See Also -<a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> <a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> <a href="#SkCanvas_makeSurface">makeSurface</a> +<a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> <a href='#SkCanvas_MakeRasterDirect'>MakeRasterDirect</a> <a href='#SkCanvas_makeSurface'>makeSurface</a> --- -<a name="SkCanvas_getProps"></a> +<a name='SkCanvas_getProps'></a> ## getProps -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getProps(SkSurfaceProps* props) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_getProps'>getProps</a>(<a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props) const </pre> -If <a href="#Canvas">Canvas</a> is associated with <a href="undocumented#Raster_Surface">Raster Surface</a> or -<a href="undocumented#GPU_Surface">GPU Surface</a>, copies <a href="undocumented#Surface_Properties">Surface Properties</a> and returns true. Otherwise, -return false and leave <a href="#SkCanvas_getProps_props">props</a> unchanged. +If <a href='#Canvas'>Canvas</a> is associated with <a href='undocumented#Raster_Surface'>Raster Surface</a> or +<a href='undocumented#GPU_Surface'>GPU Surface</a>, copies <a href='undocumented#Surface_Properties'>Surface Properties</a> and returns true. Otherwise, +return false and leave <a href='#SkCanvas_getProps_props'>props</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkCanvas_getProps_props"> <code><strong>props </strong></code> </a></td> <td> -storage for writable <a href="undocumented#SkSurfaceProps">SkSurfaceProps</a></td> +<table> <tr> <td><a name='SkCanvas_getProps_props'><code><strong>props</strong></code></a></td> + <td>storage for writable <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a></td> </tr> </table> ### Return Value -true if <a href="undocumented#Surface_Properties">Surface Properties</a> was copied +true if <a href='undocumented#Surface_Properties'>Surface Properties</a> was copied ### Example @@ -691,51 +1143,67 @@ isRGB:1 ### See Also -<a href="undocumented#SkSurfaceProps">SkSurfaceProps</a> <a href="#SkCanvas_makeSurface">makeSurface</a> +<a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a> <a href='#SkCanvas_makeSurface'>makeSurface</a> --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_accessTopLayerPixels'>accessTopLayerPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel access if available</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_accessTopRasterHandle'>accessTopRasterHandle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns context that tracks <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_discard'>discard</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes <a href='#Canvas'>Canvas</a> contents undefined</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_flush'>flush</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>triggers execution of all pending draw operations</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkCanvas_accessTopLayerPixels">accessTopLayerPixels</a> | returns writable pixel access if available | -| <a href="#SkCanvas_accessTopRasterHandle">accessTopRasterHandle</a> | returns context that tracks <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> | -| <a href="#SkCanvas_discard">discard</a> | makes <a href="#Canvas">Canvas</a> contents undefined | -| <a href="#SkCanvas_flush">flush</a> | triggers execution of all pending draw operations | -<a name="SkCanvas_flush"></a> +<a name='SkCanvas_flush'></a> ## flush -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void flush() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_flush'>flush</a>() </pre> Triggers the immediate execution of all pending draw operations. -If <a href="#Canvas">Canvas</a> is associated with <a href="undocumented#GPU_Surface">GPU Surface</a>, resolves all pending GPU operations. -If <a href="#Canvas">Canvas</a> is associated with <a href="undocumented#Raster_Surface">Raster Surface</a>, has no effect; raster draw +If <a href='#Canvas'>Canvas</a> is associated with <a href='undocumented#GPU_Surface'>GPU Surface</a>, resolves all pending GPU operations. +If <a href='#Canvas'>Canvas</a> is associated with <a href='undocumented#Raster_Surface'>Raster Surface</a>, has no effect; raster draw operations are never deferred. ### See Also -<a href="#SkCanvas_peekPixels">peekPixels</a> <a href="SkSurface_Reference#SkSurface_flush">SkSurface::flush()</a> <a href="undocumented#GrContext_flush">GrContext::flush()</a> <a href="SkSurface_Reference#SkSurface_prepareForExternalIO">SkSurface::prepareForExternalIO</a> GrContext::abandonContext() +<a href='#SkCanvas_peekPixels'>peekPixels</a> <a href='SkSurface_Reference#SkSurface_flush'>SkSurface::flush()</a> <a href='undocumented#GrContext_flush'>GrContext::flush()</a> <a href='SkSurface_Reference#SkSurface_prepareForExternalIO'>SkSurface::prepareForExternalIO</a> GrContext::abandonContext() --- -<a name="SkCanvas_getBaseLayerSize"></a> +<a name='SkCanvas_getBaseLayerSize'></a> ## getBaseLayerSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual SkISize getBaseLayerSize() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual <a href='undocumented#SkISize'>SkISize</a> <a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a>() const </pre> -Gets the size of the base or root <a href="#Layer">Layer</a> in global canvas coordinates. The -origin of the base <a href="#Layer">Layer</a> is always (0,0). The area available for drawing may be -smaller (due to clipping or <a href="#SkCanvas_saveLayer">saveLayer</a>). +Gets the size of the base or root <a href='#Layer'>Layer</a> in global canvas coordinates. The +origin of the base <a href='#Layer'>Layer</a> is always (0,0). The area available for drawing may be +smaller (due to clipping or <a href='#SkCanvas_saveLayer'>saveLayer</a>). ### Return Value -integral width and height of base <a href="#Layer">Layer</a> +integral width and height of base <a href='#Layer'>Layer</a> ### Example @@ -752,35 +1220,36 @@ size=20,30 ### See Also -<a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a><sup><a href="#SkCanvas_getDeviceClipBounds_2">[2]</a></sup> +<a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a><sup><a href='#SkCanvas_getDeviceClipBounds_2'>[2]</a></sup> --- -<a name="SkCanvas_makeSurface"></a> +<a name='SkCanvas_makeSurface'></a> ## makeSurface -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkSurface> makeSurface(const SkImageInfo& info, const SkSurfaceProps* props = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='SkSurface_Reference#SkSurface'>SkSurface</a>> <a href='#SkCanvas_makeSurface'>makeSurface</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props = nullptr) </pre> -Creates <a href="SkSurface_Reference#Surface">Surface</a> matching <a href="#SkCanvas_makeSurface_info">info</a> and <a href="#SkCanvas_makeSurface_props">props</a>, and associates it with <a href="#Canvas">Canvas</a>. +Creates <a href='SkSurface_Reference#Surface'>Surface</a> matching <a href='#SkCanvas_makeSurface_info'>info</a> and <a href='#SkCanvas_makeSurface_props'>props</a>, and associates it with <a href='#Canvas'>Canvas</a>. Returns nullptr if no match found. -If <a href="#SkCanvas_makeSurface_props">props</a> is nullptr, matches <a href="undocumented#Surface_Properties">Surface Properties</a> in <a href="#Canvas">Canvas</a>. If <a href="#SkCanvas_makeSurface_props">props</a> is nullptr and <a href="#Canvas">Canvas</a> -does not have <a href="undocumented#Surface_Properties">Surface Properties</a>, creates <a href="SkSurface_Reference#Surface">Surface</a> with default <a href="undocumented#Surface_Properties">Surface Properties</a>. +If <a href='#SkCanvas_makeSurface_props'>props</a> is nullptr, matches <a href='undocumented#Surface_Properties'>Surface Properties</a> in <a href='#Canvas'>Canvas</a>. If <a href='#SkCanvas_makeSurface_props'>props</a> is nullptr and <a href='#Canvas'>Canvas</a> +does not have <a href='undocumented#Surface_Properties'>Surface Properties</a>, creates <a href='SkSurface_Reference#Surface'>Surface</a> with default <a href='undocumented#Surface_Properties'>Surface Properties</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_makeSurface_info"> <code><strong>info </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkCanvas_makeSurface_props"> <code><strong>props </strong></code> </a></td> <td> -<a href="undocumented#Surface_Properties">Surface Properties</a> to match; may be nullptr to match <a href="#Canvas">Canvas</a></td> +<table> <tr> <td><a name='SkCanvas_makeSurface_info'><code><strong>info</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkCanvas_makeSurface_props'><code><strong>props</strong></code></a></td> + <td><a href='undocumented#Surface_Properties'>Surface Properties</a> to match; may be nullptr to match <a href='#Canvas'>Canvas</a></td> </tr> </table> ### Return Value -<a href="SkSurface_Reference#Surface">Surface</a> matching <a href="#SkCanvas_makeSurface_info">info</a> and <a href="#SkCanvas_makeSurface_props">props</a>, or nullptr if no match is available +<a href='SkSurface_Reference#Surface'>Surface</a> matching <a href='#SkCanvas_makeSurface_info'>info</a> and <a href='#SkCanvas_makeSurface_props'>props</a>, or nullptr if no match is available ### Example @@ -797,22 +1266,22 @@ size = 3, 4 ### See Also -<a href="SkSurface_Reference#SkSurface">SkSurface</a> <a href="SkSurface_Reference#SkSurface_makeSurface">SkSurface::makeSurface</a> <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> <a href="undocumented#SkSurfaceProps">SkSurfaceProps</a> +<a href='SkSurface_Reference#SkSurface'>SkSurface</a> <a href='SkSurface_Reference#SkSurface_makeSurface'>SkSurface::makeSurface</a> <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a> --- -<a name="SkCanvas_getGrContext"></a> +<a name='SkCanvas_getGrContext'></a> ## getGrContext -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual GrContext* getGrContext() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual <a href='undocumented#GrContext'>GrContext</a>* <a href='#SkCanvas_getGrContext'>getGrContext</a>() </pre> -Returns <a href="undocumented#GPU_Context">GPU Context</a> of the <a href="undocumented#GPU_Surface">GPU Surface</a> associated with <a href="#Canvas">Canvas</a>. +Returns <a href='undocumented#GPU_Context'>GPU Context</a> of the <a href='undocumented#GPU_Surface'>GPU Surface</a> associated with <a href='#Canvas'>Canvas</a>. ### Return Value -<a href="undocumented#GPU_Context">GPU Context</a>, if available; nullptr otherwise +<a href='undocumented#GPU_Context'>GPU Context</a>, if available; nullptr otherwise ### Example @@ -820,32 +1289,34 @@ Returns <a href="undocumented#GPU_Context">GPU Context</a> of the <a href="undoc ### See Also -<a href="undocumented#GrContext">GrContext</a> +<a href='undocumented#GrContext'>GrContext</a> --- -<a name="SkCanvas_accessTopLayerPixels"></a> +<a name='SkCanvas_accessTopLayerPixels'></a> ## accessTopLayerPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* origin = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void* <a href='#SkCanvas_accessTopLayerPixels'>accessTopLayerPixels</a>(<a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>* info, size_t* rowBytes, <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>* origin = nullptr) </pre> -Returns the pixel base address, <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, <a href="#SkCanvas_accessTopLayerPixels_rowBytes">rowBytes</a>, and <a href="#SkCanvas_accessTopLayerPixels_origin">origin</a> if the pixels +Returns the pixel base address, <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, <a href='#SkCanvas_accessTopLayerPixels_rowBytes'>rowBytes</a>, and <a href='#SkCanvas_accessTopLayerPixels_origin'>origin</a> if the pixels can be read directly. The returned address is only valid -while <a href="#Canvas">Canvas</a> is in scope and unchanged. Any <a href="#Canvas">Canvas</a> call or <a href="SkSurface_Reference#Surface">Surface</a> call +while <a href='#Canvas'>Canvas</a> is in scope and unchanged. Any <a href='#Canvas'>Canvas</a> call or <a href='SkSurface_Reference#Surface'>Surface</a> call may invalidate the returned address and other returned values. -If pixels are inaccessible, <a href="#SkCanvas_accessTopLayerPixels_info">info</a>, <a href="#SkCanvas_accessTopLayerPixels_rowBytes">rowBytes</a>, and <a href="#SkCanvas_accessTopLayerPixels_origin">origin</a> are unchanged. +If pixels are inaccessible, <a href='#SkCanvas_accessTopLayerPixels_info'>info</a>, <a href='#SkCanvas_accessTopLayerPixels_rowBytes'>rowBytes</a>, and <a href='#SkCanvas_accessTopLayerPixels_origin'>origin</a> are unchanged. ### Parameters -<table> <tr> <td><a name="SkCanvas_accessTopLayerPixels_info"> <code><strong>info </strong></code> </a></td> <td> -storage for writable pixels' <a href="SkImageInfo_Reference#Image_Info">Image Info</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_accessTopLayerPixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -storage for writable pixels' row bytes; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_accessTopLayerPixels_origin"> <code><strong>origin </strong></code> </a></td> <td> -storage for <a href="#Canvas">Canvas</a> top <a href="#Layer">Layer</a> <a href="#SkCanvas_accessTopLayerPixels_origin">origin</a>, its top-left corner; +<table> <tr> <td><a name='SkCanvas_accessTopLayerPixels_info'><code><strong>info</strong></code></a></td> + <td>storage for writable pixels' <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_accessTopLayerPixels_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>storage for writable pixels' row bytes; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_accessTopLayerPixels_origin'><code><strong>origin</strong></code></a></td> + <td>storage for <a href='#Canvas'>Canvas</a> top <a href='#Layer'>Layer</a> <a href='#SkCanvas_accessTopLayerPixels_origin'>origin</a>, its top-left corner; may be nullptr</td> </tr> </table> @@ -860,32 +1331,32 @@ address of pixels, or nullptr if inaccessible ### Example -<div><fiddle-embed name="a7ac9c21bbabcdeeca00f72a61cd0f3e"><div>Draws "" on the device. Then draws "" in <a href="#Layer">Layer</a>, and reads -<a href="#Layer">Layer</a> to add a large dotted "". Finally blends <a href="#Layer">Layer</a> with the +<div><fiddle-embed name="a7ac9c21bbabcdeeca00f72a61cd0f3e"><div>Draws "" on the device. Then draws "" in <a href='#Layer'>Layer</a>, and reads +<a href='#Layer'>Layer</a> to add a large dotted "". Finally blends <a href='#Layer'>Layer</a> with the device. -The <a href="#Layer">Layer</a> and blended result appear on the CPU and GPU but the large dotted +The <a href='#Layer'>Layer</a> and blended result appear on the CPU and GPU but the large dotted "" appear only on the CPU. </div></fiddle-embed></div> ### See Also -<a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> <a href="SkPixmap_Reference#SkPixmap">SkPixmap</a> +<a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a> --- -<a name="SkCanvas_accessTopRasterHandle"></a> +<a name='SkCanvas_accessTopRasterHandle'></a> ## accessTopRasterHandle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRasterHandleAllocator::Handle accessTopRasterHandle() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkRasterHandleAllocator_Handle'>SkRasterHandleAllocator::Handle</a> <a href='#SkCanvas_accessTopRasterHandle'>accessTopRasterHandle</a>() const </pre> -Returns custom context that tracks the <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a>. +Returns custom context that tracks the <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a>. -Use <a href="undocumented#Raster_Handle_Allocator">Raster Handle Allocator</a> to blend Skia drawing with custom drawing, typically performed +Use <a href='undocumented#Raster_Handle_Allocator'>Raster Handle Allocator</a> to blend Skia drawing with custom drawing, typically performed by the host platform user interface. The custom context returned is generated by -<a href="undocumented#SkRasterHandleAllocator_MakeCanvas">SkRasterHandleAllocator::MakeCanvas</a>, which creates a custom canvas with raster storage for +<a href='undocumented#SkRasterHandleAllocator_MakeCanvas'>SkRasterHandleAllocator::MakeCanvas</a>, which creates a custom canvas with raster storage for the drawing destination. ### Return Value @@ -906,50 +1377,78 @@ context = skia ### See Also -<a href="undocumented#SkRasterHandleAllocator">SkRasterHandleAllocator</a> +<a href='undocumented#SkRasterHandleAllocator'>SkRasterHandleAllocator</a> --- -## <a name="Pixels"></a> Pixels +## <a name='Pixels'>Pixels</a> -| name | description | -| --- | --- | -| <a href="#SkCanvas_peekPixels">peekPixels</a> | returns if <a href="#Canvas">Canvas</a> has direct access to its pixels | -| <a href="#SkCanvas_readPixels">readPixels</a> | copies and converts rectangle of pixels from <a href="#Canvas">Canvas</a> | -| | <a href="#SkCanvas_readPixels">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a> | -| | <a href="#SkCanvas_readPixels_2">readPixels(const SkPixmap& pixmap, int srcX, int srcY)</a> | -| | <a href="#SkCanvas_readPixels_3">readPixels(const SkBitmap& bitmap, int srcX, int srcY)</a> | -| <a href="#SkCanvas_writePixels">writePixels</a> | copies and converts rectangle of pixels to <a href="#Canvas">Canvas</a> | -| | <a href="#SkCanvas_writePixels">writePixels(const SkImageInfo& info, const void* pixels, size t rowBytes, int x, int y)</a> | -| | <a href="#SkCanvas_writePixels_2">writePixels(const SkBitmap& bitmap, int x, int y)</a> | -<a name="SkCanvas_peekPixels"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Canvas'>Canvas</a> has direct access to its pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts rectangle of pixels from <a href='#Canvas'>Canvas</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_readPixels'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_readPixels_2'>readPixels(const SkPixmap& pixmap, int srcX, int srcY)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_readPixels_3'>readPixels(const SkBitmap& bitmap, int srcX, int srcY)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_writePixels'>writePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts rectangle of pixels to <a href='#Canvas'>Canvas</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_writePixels'>writePixels(const SkImageInfo& info, const void* pixels, size t rowBytes, int x, int y)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_writePixels_2'>writePixels(const SkBitmap& bitmap, int x, int y)</a></td> + </tr> +</table> + + +<a name='SkCanvas_peekPixels'></a> ## peekPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool peekPixels(SkPixmap* pixmap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_peekPixels'>peekPixels</a>(<a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>* pixmap) </pre> -Returns true if <a href="#Canvas">Canvas</a> has direct access to its pixels. +Returns true if <a href='#Canvas'>Canvas</a> has direct access to its pixels. -<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster. <a href="#Pixels">Pixels</a> are not readable when <a href="#Canvas">Canvas</a> -is returned from <a href="undocumented#GPU_Surface">GPU Surface</a>, returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, returned by -<a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility class -like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>. +<a href='#Pixels'>Pixels</a> are readable when <a href='undocumented#Device'>Device</a> is raster. <a href='#Pixels'>Pixels</a> are not readable when <a href='#Canvas'>Canvas</a> +is returned from <a href='undocumented#GPU_Surface'>GPU Surface</a>, returned by <a href='undocumented#SkDocument_beginPage'>SkDocument::beginPage</a>, returned by +<a href='undocumented#SkPictureRecorder_beginRecording'>SkPictureRecorder::beginRecording</a>, or <a href='#Canvas'>Canvas</a> is the base of a utility class +like <a href='undocumented#SkDebugCanvas'>SkDebugCanvas</a>. -<a href="#SkCanvas_peekPixels_pixmap">pixmap</a> is valid only while <a href="#Canvas">Canvas</a> is in scope and unchanged. Any -<a href="#Canvas">Canvas</a> or <a href="SkSurface_Reference#Surface">Surface</a> call may invalidate the <a href="#SkCanvas_peekPixels_pixmap">pixmap</a> values. +<a href='#SkCanvas_peekPixels_pixmap'>pixmap</a> is valid only while <a href='#Canvas'>Canvas</a> is in scope and unchanged. Any +<a href='#Canvas'>Canvas</a> or <a href='SkSurface_Reference#Surface'>Surface</a> call may invalidate the <a href='#SkCanvas_peekPixels_pixmap'>pixmap</a> values. ### Parameters -<table> <tr> <td><a name="SkCanvas_peekPixels_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -storage for pixel state if pixels are readable; otherwise, ignored</td> +<table> <tr> <td><a name='SkCanvas_peekPixels_pixmap'><code><strong>pixmap</strong></code></a></td> + <td>storage for pixel state if pixels are readable; otherwise, ignored</td> </tr> </table> ### Return Value -true if <a href="#Canvas">Canvas</a> has direct access to pixels +true if <a href='#Canvas'>Canvas</a> has direct access to pixels ### Example @@ -965,59 +1464,67 @@ width=256 height=256 ### See Also -<a href="#SkCanvas_readPixels">readPixels</a><sup><a href="#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_peekPixels">SkBitmap::peekPixels</a> <a href="SkImage_Reference#SkImage_peekPixels">SkImage::peekPixels</a> <a href="SkSurface_Reference#SkSurface_peekPixels">SkSurface::peekPixels</a> +<a href='#SkCanvas_readPixels'>readPixels</a><sup><a href='#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_peekPixels'>SkBitmap::peekPixels</a> <a href='SkImage_Reference#SkImage_peekPixels'>SkImage::peekPixels</a> <a href='SkSurface_Reference#SkSurface_peekPixels'>SkSurface::peekPixels</a> --- -<a name="SkCanvas_readPixels"></a> +<a name='SkCanvas_readPixels'></a> ## readPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Canvas">Canvas</a> into <a href="#SkCanvas_readPixels_dstPixels">dstPixels</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Canvas'>Canvas</a> into <a href='#SkCanvas_readPixels_dstPixels'>dstPixels</a>. <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a> are ignored. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkCanvas_readPixels_srcX">srcX</a>, <a href="#SkCanvas_readPixels_srcY">srcY</a>) and (<a href="#SkCanvas_imageInfo">imageInfo</a>.width(), <a href="#SkCanvas_imageInfo">imageInfo</a>.height()). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.width(), <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.height()). +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkCanvas_readPixels_srcX'>srcX</a>, <a href='#SkCanvas_readPixels_srcY'>srcY</a>) and (<a href='#SkCanvas_imageInfo'>imageInfo</a>.width(), <a href='#SkCanvas_imageInfo'>imageInfo</a>.height()). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.width(), <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.colorType() and <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.alphaType() if required. +converting to <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.colorType() and <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU. -<a href="#Pixels">Pixels</a> are not readable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, -returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility -class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>. +<a href='#Pixels'>Pixels</a> are readable when <a href='undocumented#Device'>Device</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are not readable when <a href='#SkCanvas'>SkCanvas</a> is returned by <a href='undocumented#SkDocument_beginPage'>SkDocument::beginPage</a>, +returned by <a href='undocumented#SkPictureRecorder_beginRecording'>SkPictureRecorder::beginRecording</a>, or <a href='#Canvas'>Canvas</a> is the base of a utility +class like <a href='undocumented#SkDebugCanvas'>SkDebugCanvas</a>. The destination pixel storage must be allocated by the caller. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> do not match. Only pixels within both source and destination rectangles -are copied. <a href="#SkCanvas_readPixels_dstPixels">dstPixels</a> contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +are copied. <a href='#SkCanvas_readPixels_dstPixels'>dstPixels</a> contents outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkCanvas_readPixels_srcX">srcX</a> or <a href="#SkCanvas_readPixels_srcY">srcY</a> to offset pixels across or down destination. +Pass negative values for <a href='#SkCanvas_readPixels_srcX'>srcX</a> or <a href='#SkCanvas_readPixels_srcY'>srcY</a> to offset pixels across or down destination. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels could not be converted to <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.colorType() or <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.alphaType().</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels are not readable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> - <td><a href="#SkCanvas_readPixels_dstRowBytes">dstRowBytes</a> is too small to contain one row of pixels.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels could not be converted to <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.colorType() or <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.alphaType().</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels are not readable; for instance, <a href='#Canvas'>Canvas</a> is document-based.</td> + </tr> <tr> + <td><a href='#SkCanvas_readPixels_dstRowBytes'>dstRowBytes</a> is too small to contain one row of pixels.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkCanvas_readPixels_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> of <a href="#SkCanvas_readPixels_dstPixels">dstPixels</a></td> - </tr> <tr> <td><a name="SkCanvas_readPixels_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -storage for pixels; <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.height() times <a href="#SkCanvas_readPixels_dstRowBytes">dstRowBytes</a>, or larger</td> - </tr> <tr> <td><a name="SkCanvas_readPixels_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -size of one destination row; <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.width() times pixel size, or larger</td> - </tr> <tr> <td><a name="SkCanvas_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -offset into readable pixels in x; may be negative</td> - </tr> <tr> <td><a name="SkCanvas_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -offset into readable pixels in y; may be negative</td> +<table> <tr> <td><a name='SkCanvas_readPixels_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of <a href='#SkCanvas_readPixels_dstPixels'>dstPixels</a></td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>storage for pixels; <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.height() times <a href='#SkCanvas_readPixels_dstRowBytes'>dstRowBytes</a>, or larger</td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>size of one destination row; <a href='#SkCanvas_readPixels_dstInfo'>dstInfo</a>.width() times pixel size, or larger</td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_srcX'><code><strong>srcX</strong></code></a></td> + <td>offset into readable pixels in x; may be negative</td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_srcY'><code><strong>srcY</strong></code></a></td> + <td>offset into readable pixels in y; may be negative</td> </tr> </table> @@ -1028,17 +1535,17 @@ true if pixels were copied ### Example <div><fiddle-embed name="102d014d7f753db2a9b9ee08893aaf11"><div>A black circle drawn on a blue background provides an image to copy. -<a href="#SkCanvas_readPixels">readPixels</a> copies one quarter of the canvas into each of the four corners. +<a href='#SkCanvas_readPixels'>readPixels</a> copies one quarter of the canvas into each of the four corners. The copied quarter circles overdraw the original circle. </div></fiddle-embed></div> ### Example -<div><fiddle-embed name="481e990e923a0ed34654f4361b94f096"><div><a href="#Canvas">Canvas</a> returned by <a href="undocumented#Raster_Surface">Raster Surface</a> has <a href="undocumented#Premultiply">Premultiplied</a> pixel values. -<a href="#SkCanvas_clear">clear</a> takes <a href="undocumented#Unpremultiply">Unpremultiplied</a> input with <a href="SkColor_Reference#Alpha">Color Alpha</a> equal 0x80 -and <a href="SkColor_Reference#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="SkColor_Reference#RGB">Color RGB</a> is multiplied by <a href="SkColor_Reference#Alpha">Color Alpha</a> -to generate <a href="undocumented#Premultiply">Premultiplied</a> value 0x802B5580. <a href="#SkCanvas_readPixels">readPixels</a> converts pixel back -to <a href="undocumented#Unpremultiply">Unpremultiplied</a> value 0x8056A9FF, introducing error. +<div><fiddle-embed name="481e990e923a0ed34654f4361b94f096"><div><a href='#Canvas'>Canvas</a> returned by <a href='undocumented#Raster_Surface'>Raster Surface</a> has <a href='undocumented#Premultiply'>Premultiplied</a> pixel values. +<a href='#SkCanvas_clear'>clear</a> takes <a href='undocumented#Unpremultiply'>Unpremultiplied</a> input with <a href='SkColor_Reference#Alpha'>Color Alpha</a> equal 0x80 +and <a href='SkColor_Reference#RGB'>Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href='SkColor_Reference#RGB'>Color RGB</a> is multiplied by <a href='SkColor_Reference#Alpha'>Color Alpha</a> +to generate <a href='undocumented#Premultiply'>Premultiplied</a> value 0x802B5580. <a href='#SkCanvas_readPixels'>readPixels</a> converts pixel back +to <a href='undocumented#Unpremultiply'>Unpremultiplied</a> value 0x8056A9FF, introducing error. </div> #### Example Output @@ -1052,55 +1559,62 @@ pixel = 8056a9ff ### See Also -<a href="#SkCanvas_peekPixels">peekPixels</a> <a href="#SkCanvas_writePixels">writePixels</a><sup><a href="#SkCanvas_writePixels_2">[2]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkCanvas_peekPixels'>peekPixels</a> <a href='#SkCanvas_writePixels'>writePixels</a><sup><a href='#SkCanvas_writePixels_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkCanvas_readPixels_2"></a> +<a name='SkCanvas_readPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& pixmap, int srcX, int srcY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_readPixels'>readPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& pixmap, int srcX, int srcY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Canvas">Canvas</a> into <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Canvas'>Canvas</a> into <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>. <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a> are ignored. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkCanvas_readPixels_2_srcX">srcX</a>, <a href="#SkCanvas_readPixels_2_srcY">srcY</a>) and (<a href="#SkCanvas_imageInfo">imageInfo</a>.width(), <a href="#SkCanvas_imageInfo">imageInfo</a>.height()). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.width(), <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.height()). +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkCanvas_readPixels_2_srcX'>srcX</a>, <a href='#SkCanvas_readPixels_2_srcY'>srcY</a>) and (<a href='#SkCanvas_imageInfo'>imageInfo</a>.width(), <a href='#SkCanvas_imageInfo'>imageInfo</a>.height()). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.width(), <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.colorType() and <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.alphaType() if required. +converting to <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.colorType() and <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU. -<a href="#Pixels">Pixels</a> are not readable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, -returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility -class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>. +<a href='#Pixels'>Pixels</a> are readable when <a href='undocumented#Device'>Device</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are not readable when <a href='#SkCanvas'>SkCanvas</a> is returned by <a href='undocumented#SkDocument_beginPage'>SkDocument::beginPage</a>, +returned by <a href='undocumented#SkPictureRecorder_beginRecording'>SkPictureRecorder::beginRecording</a>, or <a href='#Canvas'>Canvas</a> is the base of a utility +class like <a href='undocumented#SkDebugCanvas'>SkDebugCanvas</a>. -Caller must allocate pixel storage in <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a> if needed. +Caller must allocate pixel storage in <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a> if needed. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> -do not match. Only pixels within both source and destination <a href="SkRect_Reference#Rect">Rects</a> -are copied. <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a> pixels contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> +do not match. Only pixels within both source and destination <a href='SkRect_Reference#Rect'>Rects</a> +are copied. <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a> pixels contents outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkCanvas_readPixels_2_srcX">srcX</a> or <a href="#SkCanvas_readPixels_2_srcY">srcY</a> to offset pixels across or down <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>. +Pass negative values for <a href='#SkCanvas_readPixels_2_srcX'>srcX</a> or <a href='#SkCanvas_readPixels_2_srcY'>srcY</a> to offset pixels across or down <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels could not be converted to <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.colorType() or <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.alphaType().</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels are not readable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> - <td><a href="SkPixmap_Reference#Pixmap">Pixmap</a> pixels could not be allocated.</td> </tr> <tr> - <td><a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.rowBytes() is too small to contain one row of pixels.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels could not be converted to <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.colorType() or <a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.alphaType().</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels are not readable; for instance, <a href='#Canvas'>Canvas</a> is document-based.</td> + </tr> <tr> + <td><a href='SkPixmap_Reference#Pixmap'>Pixmap</a> pixels could not be allocated.</td> + </tr> <tr> + <td><a href='#SkCanvas_readPixels_2_pixmap'>pixmap</a>.rowBytes() is too small to contain one row of pixels.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkCanvas_readPixels_2_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -storage for pixels copied from <a href="#Canvas">Canvas</a></td> - </tr> <tr> <td><a name="SkCanvas_readPixels_2_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -offset into readable pixels in x; may be negative</td> - </tr> <tr> <td><a name="SkCanvas_readPixels_2_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -offset into readable pixels in y; may be negative</td> +<table> <tr> <td><a name='SkCanvas_readPixels_2_pixmap'><code><strong>pixmap</strong></code></a></td> + <td>storage for pixels copied from <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_2_srcX'><code><strong>srcX</strong></code></a></td> + <td>offset into readable pixels in x; may be negative</td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_2_srcY'><code><strong>srcY</strong></code></a></td> + <td>offset into readable pixels in y; may be negative</td> </tr> </table> @@ -1110,9 +1624,9 @@ true if pixels were copied ### Example -<div><fiddle-embed name="85f199032943b6483722c34a91c4e20f"><div><a href="#SkCanvas_clear">clear</a> takes <a href="undocumented#Unpremultiply">Unpremultiplied</a> input with <a href="SkColor_Reference#Alpha">Color Alpha</a> equal 0x80 -and <a href="SkColor_Reference#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="SkColor_Reference#RGB">Color RGB</a> is multiplied by <a href="SkColor_Reference#Alpha">Color Alpha</a> -to generate <a href="undocumented#Premultiply">Premultiplied</a> value 0x802B5580. +<div><fiddle-embed name="85f199032943b6483722c34a91c4e20f"><div><a href='#SkCanvas_clear'>clear</a> takes <a href='undocumented#Unpremultiply'>Unpremultiplied</a> input with <a href='SkColor_Reference#Alpha'>Color Alpha</a> equal 0x80 +and <a href='SkColor_Reference#RGB'>Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href='SkColor_Reference#RGB'>Color RGB</a> is multiplied by <a href='SkColor_Reference#Alpha'>Color Alpha</a> +to generate <a href='undocumented#Premultiply'>Premultiplied</a> value 0x802B5580. </div> #### Example Output @@ -1125,55 +1639,62 @@ pixel = 802b5580 ### See Also -<a href="#SkCanvas_peekPixels">peekPixels</a> <a href="#SkCanvas_writePixels">writePixels</a><sup><a href="#SkCanvas_writePixels_2">[2]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkCanvas_peekPixels'>peekPixels</a> <a href='#SkCanvas_writePixels'>writePixels</a><sup><a href='#SkCanvas_writePixels_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkCanvas_readPixels_3"></a> +<a name='SkCanvas_readPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkBitmap& bitmap, int srcX, int srcY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_readPixels'>readPixels</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, int srcX, int srcY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Canvas">Canvas</a> into <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Canvas'>Canvas</a> into <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>. <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a> are ignored. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkCanvas_readPixels_3_srcX">srcX</a>, <a href="#SkCanvas_readPixels_3_srcY">srcY</a>) and (<a href="#SkCanvas_imageInfo">imageInfo</a>.width(), <a href="#SkCanvas_imageInfo">imageInfo</a>.height()). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.width(), <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.height()). +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkCanvas_readPixels_3_srcX'>srcX</a>, <a href='#SkCanvas_readPixels_3_srcY'>srcY</a>) and (<a href='#SkCanvas_imageInfo'>imageInfo</a>.width(), <a href='#SkCanvas_imageInfo'>imageInfo</a>.height()). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.width(), <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.colorType() and <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.alphaType() if required. +converting to <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.colorType() and <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU. -<a href="#Pixels">Pixels</a> are not readable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, -returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility -class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>. +<a href='#Pixels'>Pixels</a> are readable when <a href='undocumented#Device'>Device</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are not readable when <a href='#SkCanvas'>SkCanvas</a> is returned by <a href='undocumented#SkDocument_beginPage'>SkDocument::beginPage</a>, +returned by <a href='undocumented#SkPictureRecorder_beginRecording'>SkPictureRecorder::beginRecording</a>, or <a href='#Canvas'>Canvas</a> is the base of a utility +class like <a href='undocumented#SkDebugCanvas'>SkDebugCanvas</a>. -Caller must allocate pixel storage in <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a> if needed. +Caller must allocate pixel storage in <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a> if needed. -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +<a href='SkBitmap_Reference#Bitmap'>Bitmap</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> do not match. Only pixels within both source and destination rectangles -are copied. <a href="SkBitmap_Reference#Bitmap">Bitmap</a> pixels outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +are copied. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> pixels outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkCanvas_readPixels_3_srcX">srcX</a> or <a href="#SkCanvas_readPixels_3_srcY">srcY</a> to offset pixels across or down <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>. +Pass negative values for <a href='#SkCanvas_readPixels_3_srcX'>srcX</a> or <a href='#SkCanvas_readPixels_3_srcY'>srcY</a> to offset pixels across or down <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels could not be converted to <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.colorType() or <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.alphaType().</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels are not readable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> - <td><a href="#SkCanvas_readPixels_3_bitmap">bitmap</a> pixels could not be allocated.</td> </tr> <tr> - <td><a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.rowBytes() is too small to contain one row of pixels.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels could not be converted to <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.colorType() or <a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.alphaType().</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels are not readable; for instance, <a href='#Canvas'>Canvas</a> is document-based.</td> + </tr> <tr> + <td><a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a> pixels could not be allocated.</td> + </tr> <tr> + <td><a href='#SkCanvas_readPixels_3_bitmap'>bitmap</a>.rowBytes() is too small to contain one row of pixels.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkCanvas_readPixels_3_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -storage for pixels copied from <a href="#Canvas">Canvas</a></td> - </tr> <tr> <td><a name="SkCanvas_readPixels_3_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -offset into readable pixels in x; may be negative</td> - </tr> <tr> <td><a name="SkCanvas_readPixels_3_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -offset into readable pixels in y; may be negative</td> +<table> <tr> <td><a name='SkCanvas_readPixels_3_bitmap'><code><strong>bitmap</strong></code></a></td> + <td>storage for pixels copied from <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_3_srcX'><code><strong>srcX</strong></code></a></td> + <td>offset into readable pixels in x; may be negative</td> + </tr> + <tr> <td><a name='SkCanvas_readPixels_3_srcY'><code><strong>srcY</strong></code></a></td> + <td>offset into readable pixels in y; may be negative</td> </tr> </table> @@ -1183,9 +1704,9 @@ true if pixels were copied ### Example -<div><fiddle-embed name="af6dec8ef974aa67bf102f29915bcd6a"><div><a href="#SkCanvas_clear">clear</a> takes <a href="undocumented#Unpremultiply">Unpremultiplied</a> input with <a href="SkColor_Reference#Alpha">Color Alpha</a> equal 0x80 -and <a href="SkColor_Reference#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="SkColor_Reference#RGB">Color RGB</a> is multiplied by <a href="SkColor_Reference#Alpha">Color Alpha</a> -to generate <a href="undocumented#Premultiply">Premultiplied</a> value 0x802B5580. +<div><fiddle-embed name="af6dec8ef974aa67bf102f29915bcd6a"><div><a href='#SkCanvas_clear'>clear</a> takes <a href='undocumented#Unpremultiply'>Unpremultiplied</a> input with <a href='SkColor_Reference#Alpha'>Color Alpha</a> equal 0x80 +and <a href='SkColor_Reference#RGB'>Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href='SkColor_Reference#RGB'>Color RGB</a> is multiplied by <a href='SkColor_Reference#Alpha'>Color Alpha</a> +to generate <a href='undocumented#Premultiply'>Premultiplied</a> value 0x802B5580. </div> #### Example Output @@ -1198,65 +1719,73 @@ pixel = 802b5580 ### See Also -<a href="#SkCanvas_peekPixels">peekPixels</a> <a href="#SkCanvas_writePixels">writePixels</a><sup><a href="#SkCanvas_writePixels_2">[2]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkCanvas_peekPixels'>peekPixels</a> <a href='#SkCanvas_writePixels'>writePixels</a><sup><a href='#SkCanvas_writePixels_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkCanvas_writePixels"></a> +<a name='SkCanvas_writePixels'></a> ## writePixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, int x, int y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_writePixels'>writePixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, const void* pixels, size_t rowBytes, int x, int y) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> from <a href="#SkCanvas_writePixels_pixels">pixels</a> to <a href="#Canvas">Canvas</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are ignored. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkCanvas_writePixels_info">info</a>.width(), <a href="#SkCanvas_writePixels_info">info</a>.height()). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkCanvas_writePixels_x">x</a>, <a href="#SkCanvas_writePixels_y">y</a>) and -(<a href="#SkCanvas_imageInfo">imageInfo</a>.width(), <a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +Copies <a href='SkRect_Reference#Rect'>Rect</a> from <a href='#SkCanvas_writePixels_pixels'>pixels</a> to <a href='#Canvas'>Canvas</a>. <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a> are ignored. +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkCanvas_writePixels_info'>info</a>.width(), <a href='#SkCanvas_writePixels_info'>info</a>.height()). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkCanvas_writePixels_x'>x</a>, <a href='#SkCanvas_writePixels_y'>y</a>) and +(<a href='#SkCanvas_imageInfo'>imageInfo</a>.width(), <a href='#SkCanvas_imageInfo'>imageInfo</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() and <a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType() if required. +converting to <a href='#SkCanvas_imageInfo'>imageInfo</a>.colorType() and <a href='#SkCanvas_imageInfo'>imageInfo</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are writable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU. -<a href="#Pixels">Pixels</a> are not writable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, -returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility -class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>. +<a href='#Pixels'>Pixels</a> are writable when <a href='undocumented#Device'>Device</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are not writable when <a href='#SkCanvas'>SkCanvas</a> is returned by <a href='undocumented#SkDocument_beginPage'>SkDocument::beginPage</a>, +returned by <a href='undocumented#SkPictureRecorder_beginRecording'>SkPictureRecorder::beginRecording</a>, or <a href='#Canvas'>Canvas</a> is the base of a utility +class like <a href='undocumented#SkDebugCanvas'>SkDebugCanvas</a>. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> -do not match. Only <a href="#SkCanvas_writePixels_pixels">pixels</a> within both source and destination rectangles -are copied. <a href="#Canvas">Canvas</a> <a href="#SkCanvas_writePixels_pixels">pixels</a> outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> +do not match. Only <a href='#SkCanvas_writePixels_pixels'>pixels</a> within both source and destination rectangles +are copied. <a href='#Canvas'>Canvas</a> <a href='#SkCanvas_writePixels_pixels'>pixels</a> outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkCanvas_writePixels_x">x</a> or <a href="#SkCanvas_writePixels_y">y</a> to offset <a href="#SkCanvas_writePixels_pixels">pixels</a> to the left or -above <a href="#Canvas">Canvas</a> <a href="#SkCanvas_writePixels_pixels">pixels</a>. +Pass negative values for <a href='#SkCanvas_writePixels_x'>x</a> or <a href='#SkCanvas_writePixels_y'>y</a> to offset <a href='#SkCanvas_writePixels_pixels'>pixels</a> to the left or +above <a href='#Canvas'>Canvas</a> <a href='#SkCanvas_writePixels_pixels'>pixels</a>. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_pixels">pixels</a> could not be converted to <a href="#Canvas">Canvas</a> <a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() or -<a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType().</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> <a href="#SkCanvas_writePixels_pixels">pixels</a> are not writable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_rowBytes">rowBytes</a> is too small to contain one row of <a href="#SkCanvas_writePixels_pixels">pixels</a>.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#SkCanvas_writePixels_pixels'>pixels</a> could not be converted to <a href='#Canvas'>Canvas</a> <a href='#SkCanvas_imageInfo'>imageInfo</a>.colorType() or +<a href='#SkCanvas_imageInfo'>imageInfo</a>.alphaType().</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> <a href='#SkCanvas_writePixels_pixels'>pixels</a> are not writable; for instance, <a href='#Canvas'>Canvas</a> is document-based.</td> + </tr> <tr> + <td><a href='#SkCanvas_writePixels_rowBytes'>rowBytes</a> is too small to contain one row of <a href='#SkCanvas_writePixels_pixels'>pixels</a>.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkCanvas_writePixels_info"> <code><strong>info </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> of <a href="#SkCanvas_writePixels_pixels">pixels</a></td> - </tr> <tr> <td><a name="SkCanvas_writePixels_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -<a href="#SkCanvas_writePixels_pixels">pixels</a> to copy, of size <a href="#SkCanvas_writePixels_info">info</a>.height() times <a href="#SkCanvas_writePixels_rowBytes">rowBytes</a>, or larger</td> - </tr> <tr> <td><a name="SkCanvas_writePixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of one row of <a href="#SkCanvas_writePixels_pixels">pixels</a>; <a href="#SkCanvas_writePixels_info">info</a>.width() times pixel size, or larger</td> - </tr> <tr> <td><a name="SkCanvas_writePixels_x"> <code><strong>x </strong></code> </a></td> <td> -offset into <a href="#Canvas">Canvas</a> writable <a href="#SkCanvas_writePixels_pixels">pixels</a> in <a href="#SkCanvas_writePixels_x">x</a>; may be negative</td> - </tr> <tr> <td><a name="SkCanvas_writePixels_y"> <code><strong>y </strong></code> </a></td> <td> -offset into <a href="#Canvas">Canvas</a> writable <a href="#SkCanvas_writePixels_pixels">pixels</a> in <a href="#SkCanvas_writePixels_y">y</a>; may be negative</td> +<table> <tr> <td><a name='SkCanvas_writePixels_info'><code><strong>info</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of <a href='#SkCanvas_writePixels_pixels'>pixels</a></td> + </tr> + <tr> <td><a name='SkCanvas_writePixels_pixels'><code><strong>pixels</strong></code></a></td> + <td><a href='#SkCanvas_writePixels_pixels'>pixels</a> to copy, of size <a href='#SkCanvas_writePixels_info'>info</a>.height() times <a href='#SkCanvas_writePixels_rowBytes'>rowBytes</a>, or larger</td> + </tr> + <tr> <td><a name='SkCanvas_writePixels_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of one row of <a href='#SkCanvas_writePixels_pixels'>pixels</a>; <a href='#SkCanvas_writePixels_info'>info</a>.width() times pixel size, or larger</td> + </tr> + <tr> <td><a name='SkCanvas_writePixels_x'><code><strong>x</strong></code></a></td> + <td>offset into <a href='#Canvas'>Canvas</a> writable <a href='#SkCanvas_writePixels_pixels'>pixels</a> in <a href='#SkCanvas_writePixels_x'>x</a>; may be negative</td> + </tr> + <tr> <td><a name='SkCanvas_writePixels_y'><code><strong>y</strong></code></a></td> + <td>offset into <a href='#Canvas'>Canvas</a> writable <a href='#SkCanvas_writePixels_pixels'>pixels</a> in <a href='#SkCanvas_writePixels_y'>y</a>; may be negative</td> </tr> </table> ### Return Value -true if <a href="#SkCanvas_writePixels_pixels">pixels</a> were written to <a href="#Canvas">Canvas</a> +true if <a href='#SkCanvas_writePixels_pixels'>pixels</a> were written to <a href='#Canvas'>Canvas</a> ### Example @@ -1264,62 +1793,69 @@ true if <a href="#SkCanvas_writePixels_pixels">pixels</a> were written to <a hre ### See Also -<a href="#SkCanvas_readPixels">readPixels</a><sup><a href="#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="#SkCanvas_readPixels_3">[3]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="SkBitmap_Reference#SkBitmap_writePixels">SkBitmap::writePixels</a><sup><a href="SkBitmap_Reference#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_writePixels_3">[3]</a></sup> +<a href='#SkCanvas_readPixels'>readPixels</a><sup><a href='#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='#SkCanvas_readPixels_3'>[3]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='SkBitmap_Reference#SkBitmap_writePixels'>SkBitmap::writePixels</a><sup><a href='SkBitmap_Reference#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_writePixels_3'>[3]</a></sup> --- -<a name="SkCanvas_writePixels_2"></a> +<a name='SkCanvas_writePixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool writePixels(const SkBitmap& bitmap, int x, int y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_writePixels'>writePixels</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, int x, int y) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> from pixels to <a href="#Canvas">Canvas</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are ignored. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkCanvas_writePixels_2_bitmap">bitmap</a>.width(), <a href="#SkCanvas_writePixels_2_bitmap">bitmap</a>.height()). +Copies <a href='SkRect_Reference#Rect'>Rect</a> from pixels to <a href='#Canvas'>Canvas</a>. <a href='#Matrix'>Matrix</a> and <a href='#Clip'>Clip</a> are ignored. +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkCanvas_writePixels_2_bitmap'>bitmap</a>.width(), <a href='#SkCanvas_writePixels_2_bitmap'>bitmap</a>.height()). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkCanvas_writePixels_2_x">x</a>, <a href="#SkCanvas_writePixels_2_y">y</a>) and -(<a href="#SkCanvas_imageInfo">imageInfo</a>.width(), <a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkCanvas_writePixels_2_x'>x</a>, <a href='#SkCanvas_writePixels_2_y'>y</a>) and +(<a href='#SkCanvas_imageInfo'>imageInfo</a>.width(), <a href='#SkCanvas_imageInfo'>imageInfo</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() and <a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType() if required. +converting to <a href='#SkCanvas_imageInfo'>imageInfo</a>.colorType() and <a href='#SkCanvas_imageInfo'>imageInfo</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are writable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU. -<a href="#Pixels">Pixels</a> are not writable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, -returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility -class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>. +<a href='#Pixels'>Pixels</a> are writable when <a href='undocumented#Device'>Device</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are not writable when <a href='#SkCanvas'>SkCanvas</a> is returned by <a href='undocumented#SkDocument_beginPage'>SkDocument::beginPage</a>, +returned by <a href='undocumented#SkPictureRecorder_beginRecording'>SkPictureRecorder::beginRecording</a>, or <a href='#Canvas'>Canvas</a> is the base of a utility +class like <a href='undocumented#SkDebugCanvas'>SkDebugCanvas</a>. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> do not match. Only pixels within both source and destination rectangles -are copied. <a href="#Canvas">Canvas</a> pixels outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +are copied. <a href='#Canvas'>Canvas</a> pixels outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkCanvas_writePixels_2_x">x</a> or <a href="#SkCanvas_writePixels_2_y">y</a> to offset pixels to the left or -above <a href="#Canvas">Canvas</a> pixels. +Pass negative values for <a href='#SkCanvas_writePixels_2_x'>x</a> or <a href='#SkCanvas_writePixels_2_y'>y</a> to offset pixels to the left or +above <a href='#Canvas'>Canvas</a> pixels. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> does not have allocated pixels.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> pixels could not be converted to <a href="#Canvas">Canvas</a> <a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() or -<a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType().</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels are not writable; for instance, <a href="#Canvas">Canvas</a> is document based.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> pixels are inaccessible; for instance, <a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> wraps a texture.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#SkCanvas_writePixels_2_bitmap'>bitmap</a> does not have allocated pixels.</td> + </tr> <tr> + <td><a href='#SkCanvas_writePixels_2_bitmap'>bitmap</a> pixels could not be converted to <a href='#Canvas'>Canvas</a> <a href='#SkCanvas_imageInfo'>imageInfo</a>.colorType() or +<a href='#SkCanvas_imageInfo'>imageInfo</a>.alphaType().</td> + </tr> <tr> + <td><a href='#Canvas'>Canvas</a> pixels are not writable; for instance, <a href='#Canvas'>Canvas</a> is document based.</td> + </tr> <tr> + <td><a href='#SkCanvas_writePixels_2_bitmap'>bitmap</a> pixels are inaccessible; for instance, <a href='#SkCanvas_writePixels_2_bitmap'>bitmap</a> wraps a texture.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkCanvas_writePixels_2_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -contains pixels copied to <a href="#Canvas">Canvas</a></td> - </tr> <tr> <td><a name="SkCanvas_writePixels_2_x"> <code><strong>x </strong></code> </a></td> <td> -offset into <a href="#Canvas">Canvas</a> writable pixels in <a href="#SkCanvas_writePixels_2_x">x</a>; may be negative</td> - </tr> <tr> <td><a name="SkCanvas_writePixels_2_y"> <code><strong>y </strong></code> </a></td> <td> -offset into <a href="#Canvas">Canvas</a> writable pixels in <a href="#SkCanvas_writePixels_2_y">y</a>; may be negative</td> +<table> <tr> <td><a name='SkCanvas_writePixels_2_bitmap'><code><strong>bitmap</strong></code></a></td> + <td>contains pixels copied to <a href='#Canvas'>Canvas</a></td> + </tr> + <tr> <td><a name='SkCanvas_writePixels_2_x'><code><strong>x</strong></code></a></td> + <td>offset into <a href='#Canvas'>Canvas</a> writable pixels in <a href='#SkCanvas_writePixels_2_x'>x</a>; may be negative</td> + </tr> + <tr> <td><a name='SkCanvas_writePixels_2_y'><code><strong>y</strong></code></a></td> + <td>offset into <a href='#Canvas'>Canvas</a> writable pixels in <a href='#SkCanvas_writePixels_2_y'>y</a>; may be negative</td> </tr> </table> ### Return Value -true if pixels were written to <a href="#Canvas">Canvas</a> +true if pixels were written to <a href='#Canvas'>Canvas</a> ### Example @@ -1327,63 +1863,76 @@ true if pixels were written to <a href="#Canvas">Canvas</a> ### See Also -<a href="#SkCanvas_readPixels">readPixels</a><sup><a href="#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="#SkCanvas_readPixels_3">[3]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="SkBitmap_Reference#SkBitmap_writePixels">SkBitmap::writePixels</a><sup><a href="SkBitmap_Reference#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_writePixels_3">[3]</a></sup> +<a href='#SkCanvas_readPixels'>readPixels</a><sup><a href='#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='#SkCanvas_readPixels_3'>[3]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='SkBitmap_Reference#SkBitmap_writePixels'>SkBitmap::writePixels</a><sup><a href='SkBitmap_Reference#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_writePixels_3'>[3]</a></sup> --- -## <a name="State_Stack"></a> State Stack +## <a name='State_Stack'>State Stack</a> -<a href="#Canvas">Canvas</a> maintains a stack of state that allows hierarchical drawing, commonly used +<a href='#Canvas'>Canvas</a> maintains a stack of state that allows hierarchical drawing, commonly used to implement windows and views. The initial state has an identity matrix and and an infinite clip. Even with a wide-open clip, drawing is constrained by the -bounds of the <a href="#Canvas">Canvas</a> <a href="SkSurface_Reference#Surface">Surface</a> or <a href="undocumented#Device">Device</a>. +bounds of the <a href='#Canvas'>Canvas</a> <a href='SkSurface_Reference#Surface'>Surface</a> or <a href='undocumented#Device'>Device</a>. -<a href="#Canvas">Canvas</a> savable state consists of <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>. -<a href="#Clip">Clip</a> describes the area that may be drawn to. -<a href="#Matrix">Matrix</a> transforms the geometry. -<a href="undocumented#Draw_Filter">Draw Filter</a> (deprecated on most platforms) modifies the paint before drawing. +<a href='#Canvas'>Canvas</a> savable state consists of <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>. +<a href='#Clip'>Clip</a> describes the area that may be drawn to. +<a href='#Matrix'>Matrix</a> transforms the geometry. +<a href='undocumented#Draw_Filter'>Draw Filter</a> (deprecated on most platforms) modifies the paint before drawing. -<a href="#SkCanvas_save">save</a>, <a href="#SkCanvas_saveLayer">saveLayer</a>, <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a>, and <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> +<a href='#SkCanvas_save'>save</a>, <a href='#SkCanvas_saveLayer'>saveLayer</a>, <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a>, and <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> save state and return the depth of the stack. -<a href="#SkCanvas_restore">restore</a>, <a href="#SkCanvas_restoreToCount">restoreToCount</a>, and +<a href='#SkCanvas_restore'>restore</a>, <a href='#SkCanvas_restoreToCount'>restoreToCount</a>, and <a href='#SkCanvas_destructor'>~SkCanvas()</a> revert state to its value when saved. + +Each state on the stack intersects <a href='#Clip'>Clip</a> with the previous <a href='#Clip'>Clip</a>, +and concatenates <a href='#Matrix'>Matrix</a> with the previous <a href='#Matrix'>Matrix</a>. +The intersected <a href='#Clip'>Clip</a> makes the drawing area the same or smaller; +the concatenated <a href='#Matrix'>Matrix</a> may move the origin and potentially scale or rotate +the coordinate space. + +<a href='#Canvas'>Canvas</a> does not require balancing the state stack but it is a good idea +to do so. Calling <a href='#SkCanvas_save'>save</a> without <a href='#SkCanvas_restore'>restore</a> will eventually cause Skia to fail; +mismatched <a href='#SkCanvas_save'>save</a> and <a href='#SkCanvas_restore'>restore</a> create hard to find bugs. + +It is not possible to use state to draw outside of the clip defined by the +previous state. ### Example -<div><fiddle-embed name="bb1dbfdca3aedf716beb6f07e2aab065"><div><a href="#Draw">Draw</a> to ever smaller clips; then restore drawing to full canvas. -Note that the second <a href="#SkCanvas_clipRect">clipRect</a> is not permitted to enlarge <a href="#Clip">Clip</a>. +<div><fiddle-embed name="bb1dbfdca3aedf716beb6f07e2aab065"><div><a href='#Draw'>Draw</a> to ever smaller clips; then restore drawing to full canvas. +Note that the second <a href='#SkCanvas_clipRect'>clipRect</a> is not permitted to enlarge <a href='#Clip'>Clip</a>. </div></fiddle-embed></div> -Each <a href="#Clip">Clip</a> uses the current <a href="#Matrix">Matrix</a> for its coordinates. +Each <a href='#Clip'>Clip</a> uses the current <a href='#Matrix'>Matrix</a> for its coordinates. ### Example -<div><fiddle-embed name="9f563a2d60aa31d4b26742e5aa17aa4e"><div>While <a href="#SkCanvas_clipRect">clipRect</a> is given the same rectangle twice, <a href="#Matrix">Matrix</a> makes the second -<a href="#SkCanvas_clipRect">clipRect</a> draw at half the size of the first. +<div><fiddle-embed name="9f563a2d60aa31d4b26742e5aa17aa4e"><div>While <a href='#SkCanvas_clipRect'>clipRect</a> is given the same rectangle twice, <a href='#Matrix'>Matrix</a> makes the second +<a href='#SkCanvas_clipRect'>clipRect</a> draw at half the size of the first. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_restoreToCount">restoreToCount</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_restoreToCount'>restoreToCount</a> -<a name="SkCanvas_save"></a> +<a name='SkCanvas_save'></a> ## save -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int save() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_save'>save</a>() </pre> -Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms). -Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -restoring the <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> to their state when <a href="#SkCanvas_save">save</a> was called. +Saves <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> (<a href='undocumented#Draw_Filter'>Draw Filter</a> deprecated on most platforms). +Calling <a href='#SkCanvas_restore'>restore</a> discards changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>, +restoring the <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> to their state when <a href='#SkCanvas_save'>save</a> was called. -<a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_setMatrix">setMatrix</a>, -and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, <a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. +<a href='#Matrix'>Matrix</a> may be changed by <a href='#SkCanvas_translate'>translate</a>, <a href='#SkCanvas_scale'>scale</a>, <a href='#SkCanvas_rotate'>rotate</a>, <a href='#SkCanvas_skew'>skew</a>, <a href='#SkCanvas_concat'>concat</a>, <a href='#SkCanvas_setMatrix'>setMatrix</a>, +and <a href='#SkCanvas_resetMatrix'>resetMatrix</a>. <a href='#Clip'>Clip</a> may be changed by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a>, <a href='#SkCanvas_clipPath'>clipPath</a>, <a href='#SkCanvas_clipRegion'>clipRegion</a>. -Saved <a href="#Canvas">Canvas</a> state is put on a stack; multiple calls to <a href="#SkCanvas_save">save</a> should be balance -by an equal number of calls to <a href="#SkCanvas_restore">restore</a>. +Saved <a href='#Canvas'>Canvas</a> state is put on a stack; multiple calls to <a href='#SkCanvas_save'>save</a> should be balance +by an equal number of calls to <a href='#SkCanvas_restore'>restore</a>. -Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with result to restore this and subsequent saves. +Call <a href='#SkCanvas_restoreToCount'>restoreToCount</a> with result to restore this and subsequent saves. ### Return Value @@ -1392,24 +1941,24 @@ depth of saved stack ### Example <div><fiddle-embed name="e477dce358a9ba3b0aa1bf33b8a376de"><div>The black square is translated 50 pixels down and to the right. -Restoring <a href="#Canvas">Canvas</a> state removes <a href="#SkCanvas_translate">translate</a> from <a href="#Canvas">Canvas</a> stack; +Restoring <a href='#Canvas'>Canvas</a> state removes <a href='#SkCanvas_translate'>translate</a> from <a href='#Canvas'>Canvas</a> stack; the red square is not translated, and is drawn at the origin. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_restoreToCount">restoreToCount</a> +<a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_restoreToCount'>restoreToCount</a> --- -<a name="SkCanvas_restore"></a> +<a name='SkCanvas_restore'></a> ## restore -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void restore() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_restore'>restore</a>() </pre> -Removes changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> since <a href="#Canvas">Canvas</a> state was +Removes changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> since <a href='#Canvas'>Canvas</a> state was last saved. The state is removed from the stack. Does nothing if the stack is empty. @@ -1420,19 +1969,19 @@ Does nothing if the stack is empty. ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_restoreToCount">restoreToCount</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_restoreToCount'>restoreToCount</a> --- -<a name="SkCanvas_getSaveCount"></a> +<a name='SkCanvas_getSaveCount'></a> ## getSaveCount -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getSaveCount() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_getSaveCount'>getSaveCount</a>() const </pre> -Returns the number of saved states, each containing: <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>. -Equals the number of <a href="#SkCanvas_save">save</a> calls less the number of <a href="#SkCanvas_restore">restore</a> calls plus one. +Returns the number of saved states, each containing: <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>. +Equals the number of <a href='#SkCanvas_save'>save</a> calls less the number of <a href='#SkCanvas_restore'>restore</a> calls plus one. The save count of a new canvas is one. ### Return Value @@ -1455,27 +2004,27 @@ depth = 1 ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_restoreToCount">restoreToCount</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_restoreToCount'>restoreToCount</a> --- -<a name="SkCanvas_restoreToCount"></a> +<a name='SkCanvas_restoreToCount'></a> ## restoreToCount -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void restoreToCount(int saveCount) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_restoreToCount'>restoreToCount</a>(int saveCount) </pre> -Restores state to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> values when <a href="#SkCanvas_save">save</a>, <a href="#SkCanvas_saveLayer">saveLayer</a>, -<a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a>, or <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> returned <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a>. +Restores state to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> values when <a href='#SkCanvas_save'>save</a>, <a href='#SkCanvas_saveLayer'>saveLayer</a>, +<a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a>, or <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> returned <a href='#SkCanvas_restoreToCount_saveCount'>saveCount</a>. -Does nothing if <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a> is greater than state stack count. -Restores state to initial values if <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a> is less than or equal to one. +Does nothing if <a href='#SkCanvas_restoreToCount_saveCount'>saveCount</a> is greater than state stack count. +Restores state to initial values if <a href='#SkCanvas_restoreToCount_saveCount'>saveCount</a> is less than or equal to one. ### Parameters -<table> <tr> <td><a name="SkCanvas_restoreToCount_saveCount"> <code><strong>saveCount </strong></code> </a></td> <td> -depth of state stack to restore</td> +<table> <tr> <td><a name='SkCanvas_restoreToCount_saveCount'><code><strong>saveCount</strong></code></a></td> + <td>depth of state stack to restore</td> </tr> </table> @@ -1495,52 +2044,53 @@ depth = 1 ### See Also -<a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_getSaveCount">getSaveCount</a> <a href="#SkCanvas_save">save</a> +<a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_getSaveCount'>getSaveCount</a> <a href='#SkCanvas_save'>save</a> --- -## <a name="Layer"></a> Layer +## <a name='Layer'>Layer</a> -<a href="#Layer">Layer</a> allocates a temporary <a href="SkBitmap_Reference#Bitmap">Bitmap</a> to draw into. When the drawing is -complete, the <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is drawn into the <a href="#Canvas">Canvas</a>. +<a href='#Layer'>Layer</a> allocates a temporary <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> to draw into. When the drawing is +complete, the <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is drawn into the <a href='#Canvas'>Canvas</a>. -<a href="#Layer">Layer</a> is saved in a stack along with other saved state. When state with a <a href="#Layer">Layer</a> -is restored, the <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is drawn into the previous <a href="#Layer">Layer</a>. +<a href='#Layer'>Layer</a> is saved in a stack along with other saved state. When state with a <a href='#Layer'>Layer</a> +is restored, the <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is drawn into the previous <a href='#Layer'>Layer</a>. -<a href="#Layer">Layer</a> may be initialized with the contents of the previous <a href="#Layer">Layer</a>. When <a href="#Layer">Layer</a> is -restored, its <a href="SkBitmap_Reference#Bitmap">Bitmap</a> can be modified by <a href="SkPaint_Reference#Paint">Paint</a> passed to <a href="#Layer">Layer</a> to apply -<a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a>. +<a href='#Layer'>Layer</a> may be initialized with the contents of the previous <a href='#Layer'>Layer</a>. When <a href='#Layer'>Layer</a> is +restored, its <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> can be modified by <a href='SkPaint_Reference#Paint'>Paint</a> passed to <a href='#Layer'>Layer</a> to apply +<a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a>. -<a name="SkCanvas_saveLayer"></a> +<a name='SkCanvas_saveLayer'></a> ## saveLayer -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int saveLayer(const SkRect* bounds, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_saveLayer'>saveLayer</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates a <a href="SkBitmap_Reference#Bitmap">Bitmap</a> for subsequent drawing. -Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and draws the <a href="SkBitmap_Reference#Bitmap">Bitmap</a>. +Saves <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> (<a href='undocumented#Draw_Filter'>Draw Filter</a> deprecated on most platforms), +and allocates a <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> for subsequent drawing. +Calling <a href='#SkCanvas_restore'>restore</a> discards changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>, +and draws the <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>. -<a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, -<a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, -<a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. +<a href='#Matrix'>Matrix</a> may be changed by <a href='#SkCanvas_translate'>translate</a>, <a href='#SkCanvas_scale'>scale</a>, <a href='#SkCanvas_rotate'>rotate</a>, <a href='#SkCanvas_skew'>skew</a>, <a href='#SkCanvas_concat'>concat</a>, +<a href='#SkCanvas_setMatrix'>setMatrix</a>, and <a href='#SkCanvas_resetMatrix'>resetMatrix</a>. <a href='#Clip'>Clip</a> may be changed by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a>, +<a href='#SkCanvas_clipPath'>clipPath</a>, <a href='#SkCanvas_clipRegion'>clipRegion</a>. -<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_saveLayer_bounds">bounds</a> suggests but does not define the <a href="SkBitmap_Reference#Bitmap">Bitmap</a> size. To clip drawing to -a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. +<a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_saveLayer_bounds'>bounds</a> suggests but does not define the <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> size. To clip drawing to +a specific rectangle, use <a href='#SkCanvas_clipRect'>clipRect</a>. -Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLayer_paint">paint</a> applies <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and -<a href="undocumented#Blend_Mode">Blend Mode</a> when <a href="#SkCanvas_restore">restore</a> is called. +Optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_saveLayer_paint'>paint</a> applies <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and +<a href='undocumented#Blend_Mode'>Blend Mode</a> when <a href='#SkCanvas_restore'>restore</a> is called. -Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to restore this and subsequent saves. +Call <a href='#SkCanvas_restoreToCount'>restoreToCount</a> with returned value to restore this and subsequent saves. ### Parameters -<table> <tr> <td><a name="SkCanvas_saveLayer_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of the <a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_saveLayer_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state for <a href="#Layer">Layer</a>; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_saveLayer_bounds'><code><strong>bounds</strong></code></a></td> + <td>hint to limit the size of the <a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_saveLayer_paint'><code><strong>paint</strong></code></a></td> + <td>graphics state for <a href='#Layer'>Layer</a>; may be nullptr</td> </tr> </table> @@ -1550,45 +2100,46 @@ depth of saved stack ### Example -<div><fiddle-embed name="1a025d6018f64140af2dc36acad59008"><div>Rectangles are blurred by <a href="undocumented#Image_Filter">Image Filter</a> when <a href="#SkCanvas_restore">restore</a> draws <a href="#Layer">Layer</a> to main -<a href="#Canvas">Canvas</a>. +<div><fiddle-embed name="1a025d6018f64140af2dc36acad59008"><div>Rectangles are blurred by <a href='undocumented#Image_Filter'>Image Filter</a> when <a href='#SkCanvas_restore'>restore</a> draws <a href='#Layer'>Layer</a> to main +<a href='#Canvas'>Canvas</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> --- -<a name="SkCanvas_saveLayer_2"></a> +<a name='SkCanvas_saveLayer_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int saveLayer(const SkRect& bounds, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_saveLayer'>saveLayer</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& bounds, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates a <a href="SkBitmap_Reference#Bitmap">Bitmap</a> for subsequent drawing. -Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and draws the <a href="SkBitmap_Reference#Bitmap">Bitmap</a>. +Saves <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> (<a href='undocumented#Draw_Filter'>Draw Filter</a> deprecated on most platforms), +and allocates a <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> for subsequent drawing. +Calling <a href='#SkCanvas_restore'>restore</a> discards changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>, +and draws the <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>. -<a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, -<a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, -<a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. +<a href='#Matrix'>Matrix</a> may be changed by <a href='#SkCanvas_translate'>translate</a>, <a href='#SkCanvas_scale'>scale</a>, <a href='#SkCanvas_rotate'>rotate</a>, <a href='#SkCanvas_skew'>skew</a>, <a href='#SkCanvas_concat'>concat</a>, +<a href='#SkCanvas_setMatrix'>setMatrix</a>, and <a href='#SkCanvas_resetMatrix'>resetMatrix</a>. <a href='#Clip'>Clip</a> may be changed by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a>, +<a href='#SkCanvas_clipPath'>clipPath</a>, <a href='#SkCanvas_clipRegion'>clipRegion</a>. -<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_saveLayer_2_bounds">bounds</a> suggests but does not define the <a href="#Layer">Layer</a> size. To clip drawing to -a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. +<a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_saveLayer_2_bounds'>bounds</a> suggests but does not define the <a href='#Layer'>Layer</a> size. To clip drawing to +a specific rectangle, use <a href='#SkCanvas_clipRect'>clipRect</a>. -Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLayer_2_paint">paint</a> applies <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and -<a href="undocumented#Blend_Mode">Blend Mode</a> when <a href="#SkCanvas_restore">restore</a> is called. +Optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_saveLayer_2_paint'>paint</a> applies <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and +<a href='undocumented#Blend_Mode'>Blend Mode</a> when <a href='#SkCanvas_restore'>restore</a> is called. -Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to restore this and subsequent saves. +Call <a href='#SkCanvas_restoreToCount'>restoreToCount</a> with returned value to restore this and subsequent saves. ### Parameters -<table> <tr> <td><a name="SkCanvas_saveLayer_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_saveLayer_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state for <a href="#Layer">Layer</a>; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_saveLayer_2_bounds'><code><strong>bounds</strong></code></a></td> + <td>hint to limit the size of <a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_saveLayer_2_paint'><code><strong>paint</strong></code></a></td> + <td>graphics state for <a href='#Layer'>Layer</a>; may be nullptr</td> </tr> </table> @@ -1598,53 +2149,54 @@ depth of saved stack ### Example -<div><fiddle-embed name="5b59231feae0c09cb1ab6a292229d7a4"><div>Rectangles are blurred by <a href="undocumented#Image_Filter">Image Filter</a> when <a href="#SkCanvas_restore">restore</a> draws <a href="#Layer">Layer</a> to main <a href="#Canvas">Canvas</a>. -The red rectangle is clipped; it does not fully fit on <a href="#Layer">Layer</a>. -<a href="undocumented#Image_Filter">Image Filter</a> blurs past edge of <a href="#Layer">Layer</a> so red rectangle is blurred on all sides. +<div><fiddle-embed name="5b59231feae0c09cb1ab6a292229d7a4"><div>Rectangles are blurred by <a href='undocumented#Image_Filter'>Image Filter</a> when <a href='#SkCanvas_restore'>restore</a> draws <a href='#Layer'>Layer</a> to main <a href='#Canvas'>Canvas</a>. +The red rectangle is clipped; it does not fully fit on <a href='#Layer'>Layer</a>. +<a href='undocumented#Image_Filter'>Image Filter</a> blurs past edge of <a href='#Layer'>Layer</a> so red rectangle is blurred on all sides. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> --- -<a name="SkCanvas_saveLayerPreserveLCDTextRequests"></a> +<a name='SkCanvas_saveLayerPreserveLCDTextRequests'></a> ## saveLayerPreserveLCDTextRequests -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates a <a href="SkBitmap_Reference#Bitmap">Bitmap</a> for subsequent drawing. -<a href="SkPaint_Reference#LCD_Text">LCD Text</a> is preserved when the <a href="#Layer">Layer</a> is drawn to the prior <a href="#Layer">Layer</a>. +Saves <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> (<a href='undocumented#Draw_Filter'>Draw Filter</a> deprecated on most platforms), +and allocates a <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> for subsequent drawing. +<a href='SkPaint_Reference#LCD_Text'>LCD Text</a> is preserved when the <a href='#Layer'>Layer</a> is drawn to the prior <a href='#Layer'>Layer</a>. -Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and draws <a href="#Layer">Layer</a>. +Calling <a href='#SkCanvas_restore'>restore</a> discards changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>, +and draws <a href='#Layer'>Layer</a>. -<a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, -<a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, -<a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. +<a href='#Matrix'>Matrix</a> may be changed by <a href='#SkCanvas_translate'>translate</a>, <a href='#SkCanvas_scale'>scale</a>, <a href='#SkCanvas_rotate'>rotate</a>, <a href='#SkCanvas_skew'>skew</a>, <a href='#SkCanvas_concat'>concat</a>, +<a href='#SkCanvas_setMatrix'>setMatrix</a>, and <a href='#SkCanvas_resetMatrix'>resetMatrix</a>. <a href='#Clip'>Clip</a> may be changed by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a>, +<a href='#SkCanvas_clipPath'>clipPath</a>, <a href='#SkCanvas_clipRegion'>clipRegion</a>. -<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests_bounds">bounds</a> suggests but does not define the <a href="#Layer">Layer</a> size. To clip drawing to -a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. +<a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests_bounds'>bounds</a> suggests but does not define the <a href='#Layer'>Layer</a> size. To clip drawing to +a specific rectangle, use <a href='#SkCanvas_clipRect'>clipRect</a>. -Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests_paint">paint</a> applies <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and -<a href="undocumented#Blend_Mode">Blend Mode</a> when <a href="#SkCanvas_restore">restore</a> is called. +Optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests_paint'>paint</a> applies <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and +<a href='undocumented#Blend_Mode'>Blend Mode</a> when <a href='#SkCanvas_restore'>restore</a> is called. -Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to restore this and subsequent saves. +Call <a href='#SkCanvas_restoreToCount'>restoreToCount</a> with returned value to restore this and subsequent saves. -<a href="#Draw">Draw</a> text on an opaque background so that <a href="SkPaint_Reference#LCD_Text">LCD Text</a> blends correctly with the -prior <a href="#Layer">Layer</a>. <a href="SkPaint_Reference#LCD_Text">LCD Text</a> drawn on a background with transparency may result in +<a href='#Draw'>Draw</a> text on an opaque background so that <a href='SkPaint_Reference#LCD_Text'>LCD Text</a> blends correctly with the +prior <a href='#Layer'>Layer</a>. <a href='SkPaint_Reference#LCD_Text'>LCD Text</a> drawn on a background with transparency may result in incorrect blending. ### Parameters -<table> <tr> <td><a name="SkCanvas_saveLayerPreserveLCDTextRequests_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_saveLayerPreserveLCDTextRequests_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state for <a href="#Layer">Layer</a>; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_saveLayerPreserveLCDTextRequests_bounds'><code><strong>bounds</strong></code></a></td> + <td>hint to limit the size of <a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_saveLayerPreserveLCDTextRequests_paint'><code><strong>paint</strong></code></a></td> + <td>graphics state for <a href='#Layer'>Layer</a>; may be nullptr</td> </tr> </table> @@ -1658,40 +2210,41 @@ depth of saved stack ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> --- -<a name="SkCanvas_saveLayerAlpha"></a> +<a name='SkCanvas_saveLayerAlpha'></a> ## saveLayerAlpha -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds, <a href='undocumented#U8CPU'>U8CPU</a> alpha) </pre> -Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates <a href="SkBitmap_Reference#Bitmap">Bitmap</a> for subsequent drawing. +Saves <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> (<a href='undocumented#Draw_Filter'>Draw Filter</a> deprecated on most platforms), +and allocates <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> for subsequent drawing. -Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and blends <a href="#Layer">Layer</a> with <a href="#SkCanvas_saveLayerAlpha_alpha">alpha</a> opacity onto prior <a href="#Layer">Layer</a>. +Calling <a href='#SkCanvas_restore'>restore</a> discards changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>, +and blends <a href='#Layer'>Layer</a> with <a href='#SkCanvas_saveLayerAlpha_alpha'>alpha</a> opacity onto prior <a href='#Layer'>Layer</a>. -<a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, -<a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, -<a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. +<a href='#Matrix'>Matrix</a> may be changed by <a href='#SkCanvas_translate'>translate</a>, <a href='#SkCanvas_scale'>scale</a>, <a href='#SkCanvas_rotate'>rotate</a>, <a href='#SkCanvas_skew'>skew</a>, <a href='#SkCanvas_concat'>concat</a>, +<a href='#SkCanvas_setMatrix'>setMatrix</a>, and <a href='#SkCanvas_resetMatrix'>resetMatrix</a>. <a href='#Clip'>Clip</a> may be changed by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a>, +<a href='#SkCanvas_clipPath'>clipPath</a>, <a href='#SkCanvas_clipRegion'>clipRegion</a>. -<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_saveLayerAlpha_bounds">bounds</a> suggests but does not define <a href="#Layer">Layer</a> size. To clip drawing to -a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. +<a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_saveLayerAlpha_bounds'>bounds</a> suggests but does not define <a href='#Layer'>Layer</a> size. To clip drawing to +a specific rectangle, use <a href='#SkCanvas_clipRect'>clipRect</a>. -<a href="#SkCanvas_saveLayerAlpha_alpha">alpha</a> of zero is fully transparent, 255 is fully opaque. +<a href='#SkCanvas_saveLayerAlpha_alpha'>alpha</a> of zero is fully transparent, 255 is fully opaque. -Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to restore this and subsequent saves. +Call <a href='#SkCanvas_restoreToCount'>restoreToCount</a> with returned value to restore this and subsequent saves. ### Parameters -<table> <tr> <td><a name="SkCanvas_saveLayerAlpha_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_saveLayerAlpha_alpha"> <code><strong>alpha </strong></code> </a></td> <td> -opacity of <a href="#Layer">Layer</a></td> +<table> <tr> <td><a name='SkCanvas_saveLayerAlpha_bounds'><code><strong>bounds</strong></code></a></td> + <td>hint to limit the size of <a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_saveLayerAlpha_alpha'><code><strong>alpha</strong></code></a></td> + <td>opacity of <a href='#Layer'>Layer</a></td> </tr> </table> @@ -1705,127 +2258,207 @@ depth of saved stack ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> --- -## <a name="SkCanvas_SaveLayerFlagsSet"></a> Enum SkCanvas::SaveLayerFlagsSet +## <a name='SkCanvas_SaveLayerFlagsSet'>Enum SkCanvas::SaveLayerFlagsSet</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkCanvas_SaveLayerFlagsSet">SaveLayerFlagsSet</a> { - <a href="#SkCanvas_kPreserveLCDText_SaveLayerFlag">kPreserveLCDText SaveLayerFlag</a> = 1 << 1, - <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a> = 1 << 2, - <a href="#SkCanvas_kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag">kMaskAgainstCoverage EXPERIMENTAL DONT USE SaveLayerFlag</a> = 1 << 3, - <a href="#SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag">kDontClipToLayer Legacy SaveLayerFlag</a> = kDontClipToLayer_PrivateSaveLayerFlag, + enum <a href='#SkCanvas_SaveLayerFlagsSet'>SaveLayerFlagsSet</a> { + <a href='#SkCanvas_kPreserveLCDText_SaveLayerFlag'>kPreserveLCDText SaveLayerFlag</a> = 1 << 1, + <a href='#SkCanvas_kInitWithPrevious_SaveLayerFlag'>kInitWithPrevious SaveLayerFlag</a> = 1 << 2, + <a href='#SkCanvas_kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag'>kMaskAgainstCoverage EXPERIMENTAL DONT USE SaveLayerFlag</a> = 1 << 3, + <a href='#SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag'>kDontClipToLayer Legacy SaveLayerFlag</a> = kDontClipToLayer_PrivateSaveLayerFlag, }; - typedef uint32_t <a href="#SkCanvas_SaveLayerFlags">SaveLayerFlags</a>; + typedef uint32_t <a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a>; </pre> -<a href="#SkCanvas_SaveLayerFlags">SaveLayerFlags</a> provides options that may be used in any combination in <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a>, -defining how <a href="#Layer">Layer</a> allocated by <a href="#SkCanvas_saveLayer">saveLayer</a> operates. +# <a name='SkCanvas_SaveLayerFlags'>Typedef SkCanvas::SaveLayerFlags</a> +<a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a> provides options that may be used in any combination in <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a>, +defining how <a href='#Layer'>Layer</a> allocated by <a href='#SkCanvas_saveLayer'>saveLayer</a> operates. It may be set to zero, +<a href='#SkCanvas_kPreserveLCDText_SaveLayerFlag'>kPreserveLCDText SaveLayerFlag</a>, <a href='#SkCanvas_kInitWithPrevious_SaveLayerFlag'>kInitWithPrevious SaveLayerFlag</a>, or both flags. ### Constants -<table> - <tr> - <td><a name="SkCanvas_kPreserveLCDText_SaveLayerFlag"> <code><strong>SkCanvas::kPreserveLCDText_SaveLayerFlag </strong></code> </a></td><td>2</td><td>Creates <a href="#Layer">Layer</a> for LCD text. Flag is ignored if <a href="#Layer">Layer</a> <a href="SkPaint_Reference#Paint">Paint</a> contains -<a href="undocumented#Image_Filter">Image Filter</a> or <a href="undocumented#Color_Filter">Color Filter</a>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kPreserveLCDText_SaveLayerFlag'><code>SkCanvas::kPreserveLCDText_SaveLayerFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Creates <a href='#Layer'>Layer</a> for LCD text. Flag is ignored if <a href='#Layer'>Layer</a> <a href='SkPaint_Reference#Paint'>Paint</a> contains +<a href='undocumented#Image_Filter'>Image Filter</a> or <a href='undocumented#Color_Filter'>Color Filter</a>. </td> </tr> <tr> - <td><a name="SkCanvas_kInitWithPrevious_SaveLayerFlag"> <code><strong>SkCanvas::kInitWithPrevious_SaveLayerFlag </strong></code> </a></td><td>4</td><td>Initializes <a href="#Layer">Layer</a> with the contents of the previous <a href="#Layer">Layer</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kInitWithPrevious_SaveLayerFlag'><code>SkCanvas::kInitWithPrevious_SaveLayerFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Initializes <a href='#Layer'>Layer</a> with the contents of the previous <a href='#Layer'>Layer</a>. </td> </tr> - <tr> - <td><a name="SkCanvas_kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag"> <code><strong>SkCanvas::kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag </strong></code> </a></td><td>8</td><td>Experimental -- don't use</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag'><code>SkCanvas::kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Experimental. + +do not use</td> </tr> <tr> - <td><a name="SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag"> <code><strong>SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag </strong></code> </a></td><td>0x80000000</td><td>soon</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag'><code>SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x80000000</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Deprecated. + +soon</td> </tr> </table> ### Example -<div><fiddle-embed name="05db6a937225e8e31ae3481173d25dae"><div><a href="#Canvas">Canvas</a> <a href="#Layer">Layer</a> captures red and blue circles scaled up by four. -scalePaint blends <a href="#Layer">Layer</a> back with transparency. +<div><fiddle-embed name="05db6a937225e8e31ae3481173d25dae"><div><a href='#Canvas'>Canvas</a> <a href='#Layer'>Layer</a> captures red and blue circles scaled up by four. +scalePaint blends <a href='#Layer'>Layer</a> back with transparency. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> - +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> +## <a name='Layer_SaveLayerRec'>Layer SaveLayerRec</a> -# <a name="SkCanvas_SaveLayerRec"></a> Struct SkCanvas::SaveLayerRec +# <a name='SkCanvas_SaveLayerRec'>Struct SkCanvas::SaveLayerRec</a> +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> contains the state used to create the <a href='#Layer'>Layer</a>. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - struct <a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> { - <a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a>*(... + struct <a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> { + <a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a>*(... - const <a href="SkRect_Reference#SkRect">SkRect</a>* <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>; - const <a href="SkPaint_Reference#SkPaint">SkPaint</a>* <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>; - const <a href="undocumented#SkImageFilter">SkImageFilter</a>* <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a>; - <a href="#SkCanvas_SaveLayerFlags">SaveLayerFlags</a> <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>; + const <a href='SkRect_Reference#SkRect'>SkRect</a>* <a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a>; + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* <a href='#SkCanvas_SaveLayerRec_fPaint'>fPaint</a>; + const <a href='undocumented#SkImageFilter'>SkImageFilter</a>* <a href='#SkCanvas_SaveLayerRec_fBackdrop'>fBackdrop</a>; + <a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a> <a href='#SkCanvas_SaveLayerRec_fSaveLayerFlags'>fSaveLayerFlags</a>; }; </pre> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> contains the state used to create the <a href="#Layer">Layer</a>. +## <a name='Layer_SaveLayerRec_Overview'>Layer SaveLayerRec Overview</a> -<a name="SkCanvas_SaveLayerRec_fBounds"> <code><strong>const SkRect* fBounds</strong></code> </a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Layer_SaveLayerRec_Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkCanvas_SaveLayerRec'>SkCanvas::SaveLayerRec</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Layer_SaveLayerRec_Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> +</table> -<a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a> is used as a hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr. -<a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a> suggests but does not define <a href="#Layer">Layer</a> size. To clip drawing to -a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. -<a name="SkCanvas_SaveLayerRec_fPaint"> <code><strong>const SkPaint* fPaint</strong></code> </a> +## <a name='Layer_SaveLayerRec_Member'>Layer SaveLayerRec Member</a> -<a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a> modifies how <a href="#Layer">Layer</a> overlays the prior <a href="#Layer">Layer</a>; may be nullptr. -<a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Draw_Looper">Draw Looper</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and -<a href="undocumented#Mask_Filter">Mask Filter</a> affect <a href="#Layer">Layer</a> draw. -<a name="SkCanvas_SaveLayerRec_fBackdrop"> <code><strong>const SkImageFilter* fBackdrop</strong></code> </a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> -<a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a> applies <a href="undocumented#Image_Filter">Image Filter</a> to the prior <a href="#Layer">Layer</a> when copying to the <a href="#Layer">Layer</a>; -may be nullptr. Use <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a> to copy the -prior <a href="#Layer">Layer</a> without an <a href="undocumented#Image_Filter">Image Filter</a>. -<a name="SkCanvas_SaveLayerRec_fClipMask"> <code><strong>const SkImage* fClipMask</strong></code> </a> +### Members -<a href="#SkCanvas_restore">restore</a> clips <a href="#Layer">Layer</a> by the <a href="SkColor_Reference#Alpha">Color Alpha</a> channel of <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> when -<a href="#Layer">Layer</a> is copied to <a href="undocumented#Device">Device</a>. <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> may be nullptr. . +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkRect*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_SaveLayerRec_fBounds'><code>fBounds</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a> is used as a hint to limit the size of <a href='#Layer'>Layer</a>; may be nullptr. +<a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a> suggests but does not define <a href='#Layer'>Layer</a> size. To clip drawing to +a specific rectangle, use <a href='#SkCanvas_clipRect'>clipRect</a>. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkPaint*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_SaveLayerRec_fPaint'><code>fPaint</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#SkCanvas_SaveLayerRec_fPaint'>fPaint</a> modifies how <a href='#Layer'>Layer</a> overlays the prior <a href='#Layer'>Layer</a>; may be nullptr. +<a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Draw_Looper'>Draw Looper</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and +<a href='undocumented#Mask_Filter'>Mask Filter</a> affect <a href='#Layer'>Layer</a> draw. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkImageFilter*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_SaveLayerRec_fBackdrop'><code>fBackdrop</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#SkCanvas_SaveLayerRec_fBackdrop'>fBackdrop</a> applies <a href='undocumented#Image_Filter'>Image Filter</a> to the prior <a href='#Layer'>Layer</a> when copying to the <a href='#Layer'>Layer</a>; +may be nullptr. Use <a href='#SkCanvas_kInitWithPrevious_SaveLayerFlag'>kInitWithPrevious SaveLayerFlag</a> to copy the +prior <a href='#Layer'>Layer</a> without an <a href='undocumented#Image_Filter'>Image Filter</a>. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkImage*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_SaveLayerRec_fClipMask'><code>fClipMask</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#SkCanvas_restore'>restore</a> clips <a href='#Layer'>Layer</a> by the <a href='SkColor_Reference#Alpha'>Color Alpha</a> channel of <a href='#SkCanvas_SaveLayerRec_fClipMask'>fClipMask</a> when +<a href='#Layer'>Layer</a> is copied to <a href='undocumented#Device'>Device</a>. <a href='#SkCanvas_SaveLayerRec_fClipMask'>fClipMask</a> may be nullptr. . +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkMatrix*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_SaveLayerRec_fClipMatrix'><code>fClipMatrix</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#SkCanvas_SaveLayerRec_fClipMatrix'>fClipMatrix</a> transforms <a href='#SkCanvas_SaveLayerRec_fClipMask'>fClipMask</a> before it clips <a href='#Layer'>Layer</a>. If +<a href='#SkCanvas_SaveLayerRec_fClipMask'>fClipMask</a> describes a translucent gradient, it may be scaled and rotated +without introducing artifacts. <a href='#SkCanvas_SaveLayerRec_fClipMatrix'>fClipMatrix</a> may be nullptr. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SaveLayerFlags</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_SaveLayerRec_fSaveLayerFlags'><code>fSaveLayerFlags</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#SkCanvas_SaveLayerRec_fSaveLayerFlags'>fSaveLayerFlags</a> are used to create <a href='#Layer'>Layer</a> without transparency, +create <a href='#Layer'>Layer</a> for LCD text, and to create <a href='#Layer'>Layer</a> with the +contents of the previous <a href='#Layer'>Layer</a>. +</td> + </tr> +</table> -<a name="SkCanvas_SaveLayerRec_fClipMatrix"> <code><strong>const SkMatrix* fClipMatrix</strong></code> </a> +### Example -<a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a> transforms <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> before it clips <a href="#Layer">Layer</a>. If -<a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> describes a translucent gradient, it may be scaled and rotated -without introducing artifacts. <a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a> may be nullptr. +<div><fiddle-embed name="ee8c0b120234e27364f8c9a786cf8f89"><div><a href='#Canvas'>Canvas</a> <a href='#Layer'>Layer</a> captures a red Anti-aliased circle and a blue <a href='undocumented#Alias'>Aliased</a> circle scaled +up by four. After drawing another red circle without scaling on top, the <a href='#Layer'>Layer</a> is +transferred to the main canvas. +</div></fiddle-embed></div> -<a name="SkCanvas_SaveLayerRec_fSaveLayerFlags"> <code><strong>SaveLayerFlags fSaveLayerFlags</strong></code> </a> +## <a name='Layer_SaveLayerRec_Constructor'>Layer SaveLayerRec Constructor</a> -<a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a> are used to create <a href="#Layer">Layer</a> without transparency, -create <a href="#Layer">Layer</a> for LCD text, and to create <a href="#Layer">Layer</a> with the -contents of the previous <a href="#Layer">Layer</a>. -### Example +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> -<div><fiddle-embed name="ee8c0b120234e27364f8c9a786cf8f89"><div><a href="#Canvas">Canvas</a> <a href="#Layer">Layer</a> captures a red Anti-aliased circle and a blue <a href="undocumented#Alias">Aliased</a> circle scaled -up by four. After drawing another red circle without scaling on top, the <a href="#Layer">Layer</a> is -transferred to the main canvas. -</div></fiddle-embed></div> -<a name="SkCanvas_SaveLayerRec_SaveLayerRec"></a> +<a name='SkCanvas_SaveLayerRec_SaveLayerRec'></a> ## SaveLayerRec -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SaveLayerRec() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a>() </pre> -Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>, and <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a> to nullptr. Clears <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>. +Sets <a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a>, <a href='#SkCanvas_SaveLayerRec_fPaint'>fPaint</a>, and <a href='#SkCanvas_SaveLayerRec_fBackdrop'>fBackdrop</a> to nullptr. Clears <a href='#SkCanvas_SaveLayerRec_fSaveLayerFlags'>fSaveLayerFlags</a>. ### Return Value -empty <a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> +empty <a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> ### Example @@ -1841,32 +2474,34 @@ rec1 == rec2 ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> --- -<a name="SkCanvas_SaveLayerRec_SaveLayerRec_2"></a> +<a name='SkCanvas_SaveLayerRec_SaveLayerRec_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a> saveLayerFlags = 0) </pre> -Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>, and <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>; sets <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a> to nullptr. +Sets <a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a>, <a href='#SkCanvas_SaveLayerRec_fPaint'>fPaint</a>, and <a href='#SkCanvas_SaveLayerRec_fSaveLayerFlags'>fSaveLayerFlags</a>; sets <a href='#SkCanvas_SaveLayerRec_fBackdrop'>fBackdrop</a> to nullptr. ### Parameters -<table> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -<a href="#Layer">Layer</a> dimensions; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -applied to <a href="#Layer">Layer</a> when overlaying prior <a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_2_saveLayerFlags"> <code><strong>saveLayerFlags </strong></code> </a></td> <td> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify <a href="#Layer">Layer</a></td> +<table> <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_2_bounds'><code><strong>bounds</strong></code></a></td> + <td><a href='#Layer'>Layer</a> dimensions; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_2_paint'><code><strong>paint</strong></code></a></td> + <td>applied to <a href='#Layer'>Layer</a> when overlaying prior <a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_2_saveLayerFlags'><code><strong>saveLayerFlags</strong></code></a></td> + <td><a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> options to modify <a href='#Layer'>Layer</a></td> </tr> </table> ### Return Value -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> with empty backdrop +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> with empty backdrop ### Example @@ -1882,36 +2517,39 @@ rec1 == rec2 ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> --- -<a name="SkCanvas_SaveLayerRec_SaveLayerRec_3"></a> +<a name='SkCanvas_SaveLayerRec_SaveLayerRec_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop, - SaveLayerFlags saveLayerFlags) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, const <a href='undocumented#SkImageFilter'>SkImageFilter</a>* backdrop, + <a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a> saveLayerFlags) </pre> -Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>, <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a>, and <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>. +Sets <a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a>, <a href='#SkCanvas_SaveLayerRec_fPaint'>fPaint</a>, <a href='#SkCanvas_SaveLayerRec_fBackdrop'>fBackdrop</a>, and <a href='#SkCanvas_SaveLayerRec_fSaveLayerFlags'>fSaveLayerFlags</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -<a href="#Layer">Layer</a> dimensions; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -applied to <a href="#Layer">Layer</a> when overlaying prior <a href="#Layer">Layer</a>; +<table> <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_3_bounds'><code><strong>bounds</strong></code></a></td> + <td><a href='#Layer'>Layer</a> dimensions; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_3_paint'><code><strong>paint</strong></code></a></td> + <td>applied to <a href='#Layer'>Layer</a> when overlaying prior <a href='#Layer'>Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_backdrop"> <code><strong>backdrop </strong></code> </a></td> <td> -prior <a href="#Layer">Layer</a> copied with <a href="undocumented#Image_Filter">Image Filter</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_saveLayerFlags"> <code><strong>saveLayerFlags </strong></code> </a></td> <td> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify <a href="#Layer">Layer</a></td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_3_backdrop'><code><strong>backdrop</strong></code></a></td> + <td>prior <a href='#Layer'>Layer</a> copied with <a href='undocumented#Image_Filter'>Image Filter</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_3_saveLayerFlags'><code><strong>saveLayerFlags</strong></code></a></td> + <td><a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> options to modify <a href='#Layer'>Layer</a></td> </tr> </table> ### Return Value -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> fully specified +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> fully specified ### Example @@ -1927,78 +2565,84 @@ rec1 == rec2 ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> --- -<a name="SkCanvas_SaveLayerRec_SaveLayerRec_4"></a> +<a name='SkCanvas_SaveLayerRec_SaveLayerRec_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop, - const SkImage* clipMask, const SkMatrix* clipMatrix, SaveLayerFlags saveLayerFlags) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, const <a href='undocumented#SkImageFilter'>SkImageFilter</a>* backdrop, + const <a href='SkImage_Reference#SkImage'>SkImage</a>* clipMask, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* clipMatrix, <a href='#SkCanvas_SaveLayerFlags'>SaveLayerFlags</a> saveLayerFlags) </pre> -Not ready for general use. -Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>, <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a>, <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a>, <a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a>, and <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>. -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix">clipMatrix</a> uses <a href="SkColor_Reference#Alpha">Color Alpha</a> channel of image, transformed by <a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix">clipMatrix</a>, to clip -<a href="#Layer">Layer</a> when drawn to <a href="#Canvas">Canvas</a>. +Experimental. + +not readySets <a href='#SkCanvas_SaveLayerRec_fBounds'>fBounds</a>, <a href='#SkCanvas_SaveLayerRec_fPaint'>fPaint</a>, <a href='#SkCanvas_SaveLayerRec_fBackdrop'>fBackdrop</a>, <a href='#SkCanvas_SaveLayerRec_fClipMask'>fClipMask</a>, <a href='#SkCanvas_SaveLayerRec_fClipMatrix'>fClipMatrix</a>, and <a href='#SkCanvas_SaveLayerRec_fSaveLayerFlags'>fSaveLayerFlags</a>. +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix'>clipMatrix</a> uses <a href='SkColor_Reference#Alpha'>Color Alpha</a> channel of image, transformed by <a href='#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix'>clipMatrix</a>, to clip +<a href='#Layer'>Layer</a> when drawn to <a href='#Canvas'>Canvas</a>. -Implementation is not complete; has no effect if <a href="undocumented#Device">Device</a> is GPU-backed. +Implementation is not complete; has no effect if <a href='undocumented#Device'>Device</a> is GPU-backed. ### Parameters -<table> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -<a href="#Layer">Layer</a> dimensions; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state applied to <a href="#Layer">Layer</a> when overlaying prior -<a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_backdrop"> <code><strong>backdrop </strong></code> </a></td> <td> -prior <a href="#Layer">Layer</a> copied with <a href="undocumented#Image_Filter">Image Filter</a>; +<table> <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_4_bounds'><code><strong>bounds</strong></code></a></td> + <td><a href='#Layer'>Layer</a> dimensions; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_4_paint'><code><strong>paint</strong></code></a></td> + <td>graphics state applied to <a href='#Layer'>Layer</a> when overlaying prior +<a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_4_backdrop'><code><strong>backdrop</strong></code></a></td> + <td>prior <a href='#Layer'>Layer</a> copied with <a href='undocumented#Image_Filter'>Image Filter</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMask"> <code><strong>clipMask </strong></code> </a></td> <td> -clip applied to <a href="#Layer">Layer</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix"> <code><strong>clipMatrix </strong></code> </a></td> <td> -matrix applied to <a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMask">clipMask</a>; may be nullptr to use + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMask'><code><strong>clipMask</strong></code></a></td> + <td>clip applied to <a href='#Layer'>Layer</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix'><code><strong>clipMatrix</strong></code></a></td> + <td>matrix applied to <a href='#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMask'>clipMask</a>; may be nullptr to use identity matrix</td> - </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_saveLayerFlags"> <code><strong>saveLayerFlags </strong></code> </a></td> <td> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify <a href="#Layer">Layer</a></td> + </tr> + <tr> <td><a name='SkCanvas_SaveLayerRec_SaveLayerRec_4_saveLayerFlags'><code><strong>saveLayerFlags</strong></code></a></td> + <td><a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> options to modify <a href='#Layer'>Layer</a></td> </tr> </table> ### Return Value -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> fully specified +<a href='#SkCanvas_SaveLayerRec_SaveLayerRec'>SaveLayerRec</a> fully specified ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> --- -<a name="SkCanvas_saveLayer_3"></a> +<a name='SkCanvas_saveLayer_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int saveLayer(const SaveLayerRec& layerRec) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkCanvas_saveLayer'>saveLayer</a>(const <a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a>& layerRec) </pre> -Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates <a href="SkBitmap_Reference#Bitmap">Bitmap</a> for subsequent drawing. +Saves <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a> (<a href='undocumented#Draw_Filter'>Draw Filter</a> deprecated on most platforms), +and allocates <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> for subsequent drawing. -Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and blends <a href="SkBitmap_Reference#Bitmap">Bitmap</a> with <a href="SkColor_Reference#Alpha">Color Alpha</a> opacity onto the prior <a href="#Layer">Layer</a>. +Calling <a href='#SkCanvas_restore'>restore</a> discards changes to <a href='#Matrix'>Matrix</a>, <a href='#Clip'>Clip</a>, and <a href='undocumented#Draw_Filter'>Draw Filter</a>, +and blends <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> with <a href='SkColor_Reference#Alpha'>Color Alpha</a> opacity onto the prior <a href='#Layer'>Layer</a>. -<a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, -<a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, -<a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. +<a href='#Matrix'>Matrix</a> may be changed by <a href='#SkCanvas_translate'>translate</a>, <a href='#SkCanvas_scale'>scale</a>, <a href='#SkCanvas_rotate'>rotate</a>, <a href='#SkCanvas_skew'>skew</a>, <a href='#SkCanvas_concat'>concat</a>, +<a href='#SkCanvas_setMatrix'>setMatrix</a>, and <a href='#SkCanvas_resetMatrix'>resetMatrix</a>. <a href='#Clip'>Clip</a> may be changed by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a>, +<a href='#SkCanvas_clipPath'>clipPath</a>, <a href='#SkCanvas_clipRegion'>clipRegion</a>. -<a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> contains the state used to create the <a href="#Layer">Layer</a>. +<a href='#SkCanvas_SaveLayerRec'>SaveLayerRec</a> contains the state used to create the <a href='#Layer'>Layer</a>. -Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to restore this and subsequent saves. +Call <a href='#SkCanvas_restoreToCount'>restoreToCount</a> with returned value to restore this and subsequent saves. ### Parameters -<table> <tr> <td><a name="SkCanvas_saveLayer_3_layerRec"> <code><strong>layerRec </strong></code> </a></td> <td> -<a href="#Layer">Layer</a> state</td> +<table> <tr> <td><a name='SkCanvas_saveLayer_3_layerRec'><code><strong>layerRec</strong></code></a></td> + <td><a href='#Layer'>Layer</a> state</td> </tr> </table> @@ -2008,82 +2652,84 @@ depth of save state stack ### Example -<div><fiddle-embed name="7d3751e82d1b6ec328ffa3d6f48ca831"><div>The example draws an image, and saves it into a <a href="#Layer">Layer</a> with <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a>. -Next it punches a hole in <a href="#Layer">Layer</a> and restore with <a href="undocumented#SkBlendMode_kPlus">SkBlendMode::kPlus</a>. -Where <a href="#Layer">Layer</a> was cleared, the original image will draw unchanged. +<div><fiddle-embed name="7d3751e82d1b6ec328ffa3d6f48ca831"><div>The example draws an image, and saves it into a <a href='#Layer'>Layer</a> with <a href='#SkCanvas_kInitWithPrevious_SaveLayerFlag'>kInitWithPrevious SaveLayerFlag</a>. +Next it punches a hole in <a href='#Layer'>Layer</a> and restore with <a href='undocumented#SkBlendMode_kPlus'>SkBlendMode::kPlus</a>. +Where <a href='#Layer'>Layer</a> was cleared, the original image will draw unchanged. Outside of the circle the mandrill is brightened. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_save">save</a> <a href="#SkCanvas_restore">restore</a> <a href="#SkCanvas_saveLayer">saveLayer</a><sup><a href="#SkCanvas_saveLayer_2">[2]</a></sup><sup><a href="#SkCanvas_saveLayer_3">[3]</a></sup> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> +<a href='#SkCanvas_save'>save</a> <a href='#SkCanvas_restore'>restore</a> <a href='#SkCanvas_saveLayer'>saveLayer</a><sup><a href='#SkCanvas_saveLayer_2'>[2]</a></sup><sup><a href='#SkCanvas_saveLayer_3'>[3]</a></sup> <a href='#SkCanvas_saveLayerPreserveLCDTextRequests'>saveLayerPreserveLCDTextRequests</a> <a href='#SkCanvas_saveLayerAlpha'>saveLayerAlpha</a> --- -## <a name="Matrix"></a> Matrix +## <a name='Matrix'>Matrix</a> -<a name="SkCanvas_translate"></a> +<a name='SkCanvas_translate'></a> ## translate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void translate(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_translate'>translate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Translate <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_translate_dx">dx</a> along the x-axis and <a href="#SkCanvas_translate_dy">dy</a> along the y-axis. +Translate <a href='#Matrix'>Matrix</a> by <a href='#SkCanvas_translate_dx'>dx</a> along the x-axis and <a href='#SkCanvas_translate_dy'>dy</a> along the y-axis. -Mathematically, replace <a href="#Matrix">Matrix</a> with a translation matrix -<a href="undocumented#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. +Mathematically, replace <a href='#Matrix'>Matrix</a> with a translation matrix +<a href='undocumented#Premultiply'>Premultiplied</a> with <a href='#Matrix'>Matrix</a>. -This has the effect of moving the drawing by (<a href="#SkCanvas_translate_dx">dx</a>, <a href="#SkCanvas_translate_dy">dy</a>) before transforming -the result with <a href="#Matrix">Matrix</a>. +This has the effect of moving the drawing by (<a href='#SkCanvas_translate_dx'>dx</a>, <a href='#SkCanvas_translate_dy'>dy</a>) before transforming +the result with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_translate_dx"> <code><strong>dx </strong></code> </a></td> <td> -distance to translate in x</td> - </tr> <tr> <td><a name="SkCanvas_translate_dy"> <code><strong>dy </strong></code> </a></td> <td> -distance to translate in y</td> +<table> <tr> <td><a name='SkCanvas_translate_dx'><code><strong>dx</strong></code></a></td> + <td>distance to translate in x</td> + </tr> + <tr> <td><a name='SkCanvas_translate_dy'><code><strong>dy</strong></code></a></td> + <td>distance to translate in y</td> </tr> </table> ### Example -<div><fiddle-embed name="eb93d5fa66a5f7a10f4f9210494d7222"><div><a href="#SkCanvas_scale">scale</a> followed by <a href="#SkCanvas_translate">translate</a> produces different results from <a href="#SkCanvas_translate">translate</a> followed -by <a href="#SkCanvas_scale">scale</a>. +<div><fiddle-embed name="eb93d5fa66a5f7a10f4f9210494d7222"><div><a href='#SkCanvas_scale'>scale</a> followed by <a href='#SkCanvas_translate'>translate</a> produces different results from <a href='#SkCanvas_translate'>translate</a> followed +by <a href='#SkCanvas_scale'>scale</a>. The blue stroke follows translate of (50, 50); a black fill follows scale of (2, 1/2.f). After restoring the clip, which resets -<a href="#Matrix">Matrix</a>, a red frame follows the same scale of (2, 1/2.f); a gray fill +<a href='#Matrix'>Matrix</a>, a red frame follows the same scale of (2, 1/2.f); a gray fill follows translate of (50, 50). </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_skew">skew</a> <a href="#SkCanvas_rotate">rotate</a><sup><a href="#SkCanvas_rotate_2">[2]</a></sup> <a href="#SkCanvas_setMatrix">setMatrix</a> +<a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_skew'>skew</a> <a href='#SkCanvas_rotate'>rotate</a><sup><a href='#SkCanvas_rotate_2'>[2]</a></sup> <a href='#SkCanvas_setMatrix'>setMatrix</a> --- -<a name="SkCanvas_scale"></a> +<a name='SkCanvas_scale'></a> ## scale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void scale(SkScalar sx, SkScalar sy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_scale'>scale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy) </pre> -Scale <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_scale_sx">sx</a> on the x-axis and <a href="#SkCanvas_scale_sy">sy</a> on the y-axis. +Scale <a href='#Matrix'>Matrix</a> by <a href='#SkCanvas_scale_sx'>sx</a> on the x-axis and <a href='#SkCanvas_scale_sy'>sy</a> on the y-axis. -Mathematically, replace <a href="#Matrix">Matrix</a> with a scale matrix -<a href="undocumented#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. +Mathematically, replace <a href='#Matrix'>Matrix</a> with a scale matrix +<a href='undocumented#Premultiply'>Premultiplied</a> with <a href='#Matrix'>Matrix</a>. -This has the effect of scaling the drawing by (<a href="#SkCanvas_scale_sx">sx</a>, <a href="#SkCanvas_scale_sy">sy</a>) before transforming -the result with <a href="#Matrix">Matrix</a>. +This has the effect of scaling the drawing by (<a href='#SkCanvas_scale_sx'>sx</a>, <a href='#SkCanvas_scale_sy'>sy</a>) before transforming +the result with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_scale_sx"> <code><strong>sx </strong></code> </a></td> <td> -amount to scale in x</td> - </tr> <tr> <td><a name="SkCanvas_scale_sy"> <code><strong>sy </strong></code> </a></td> <td> -amount to scale in y</td> +<table> <tr> <td><a name='SkCanvas_scale_sx'><code><strong>sx</strong></code></a></td> + <td>amount to scale in x</td> + </tr> + <tr> <td><a name='SkCanvas_scale_sy'><code><strong>sy</strong></code></a></td> + <td>amount to scale in y</td> </tr> </table> @@ -2093,68 +2739,70 @@ amount to scale in y</td> ### See Also -<a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_skew">skew</a> <a href="#SkCanvas_rotate">rotate</a><sup><a href="#SkCanvas_rotate_2">[2]</a></sup> <a href="#SkCanvas_setMatrix">setMatrix</a> +<a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_skew'>skew</a> <a href='#SkCanvas_rotate'>rotate</a><sup><a href='#SkCanvas_rotate_2'>[2]</a></sup> <a href='#SkCanvas_setMatrix'>setMatrix</a> --- -<a name="SkCanvas_rotate"></a> +<a name='SkCanvas_rotate'></a> ## rotate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rotate(SkScalar degrees) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_rotate'>rotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees) </pre> -Rotate <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_rotate_degrees">degrees</a>. Positive <a href="#SkCanvas_rotate_degrees">degrees</a> rotates clockwise. +Rotate <a href='#Matrix'>Matrix</a> by <a href='#SkCanvas_rotate_degrees'>degrees</a>. Positive <a href='#SkCanvas_rotate_degrees'>degrees</a> rotates clockwise. -Mathematically, replace <a href="#Matrix">Matrix</a> with a rotation matrix -<a href="undocumented#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. +Mathematically, replace <a href='#Matrix'>Matrix</a> with a rotation matrix +<a href='undocumented#Premultiply'>Premultiplied</a> with <a href='#Matrix'>Matrix</a>. -This has the effect of rotating the drawing by <a href="#SkCanvas_rotate_degrees">degrees</a> before transforming -the result with <a href="#Matrix">Matrix</a>. +This has the effect of rotating the drawing by <a href='#SkCanvas_rotate_degrees'>degrees</a> before transforming +the result with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_rotate_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -amount to rotate, in <a href="#SkCanvas_rotate_degrees">degrees</a></td> +<table> <tr> <td><a name='SkCanvas_rotate_degrees'><code><strong>degrees</strong></code></a></td> + <td>amount to rotate, in <a href='#SkCanvas_rotate_degrees'>degrees</a></td> </tr> </table> ### Example -<div><fiddle-embed name="963789ac8498d4e505748ab3b15cdaa5"><div><a href="#Draw">Draw</a> clock hands at time 5:10. The hour hand and minute hand point up and +<div><fiddle-embed name="963789ac8498d4e505748ab3b15cdaa5"><div><a href='#Draw'>Draw</a> clock hands at time 5:10. The hour hand and minute hand point up and are rotated clockwise. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_skew">skew</a> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_setMatrix">setMatrix</a> +<a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_skew'>skew</a> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_setMatrix'>setMatrix</a> --- -<a name="SkCanvas_rotate_2"></a> +<a name='SkCanvas_rotate_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rotate(SkScalar degrees, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_rotate'>rotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Rotate <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_rotate_2_degrees">degrees</a> about a point at (<a href="#SkCanvas_rotate_2_px">px</a>, <a href="#SkCanvas_rotate_2_py">py</a>). Positive <a href="#SkCanvas_rotate_2_degrees">degrees</a> rotates +Rotate <a href='#Matrix'>Matrix</a> by <a href='#SkCanvas_rotate_2_degrees'>degrees</a> about a point at (<a href='#SkCanvas_rotate_2_px'>px</a>, <a href='#SkCanvas_rotate_2_py'>py</a>). Positive <a href='#SkCanvas_rotate_2_degrees'>degrees</a> rotates clockwise. -Mathematically, construct a rotation matrix. <a href="undocumented#Premultiply">Premultiply</a> the rotation matrix by -a translation matrix, then replace <a href="#Matrix">Matrix</a> with the resulting matrix -<a href="undocumented#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. +Mathematically, construct a rotation matrix. <a href='undocumented#Premultiply'>Premultiply</a> the rotation matrix by +a translation matrix, then replace <a href='#Matrix'>Matrix</a> with the resulting matrix +<a href='undocumented#Premultiply'>Premultiplied</a> with <a href='#Matrix'>Matrix</a>. This has the effect of rotating the drawing about a given point before -transforming the result with <a href="#Matrix">Matrix</a>. +transforming the result with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_rotate_2_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -amount to rotate, in <a href="#SkCanvas_rotate_2_degrees">degrees</a></td> - </tr> <tr> <td><a name="SkCanvas_rotate_2_px"> <code><strong>px </strong></code> </a></td> <td> -x-coordinate of the point to rotate about</td> - </tr> <tr> <td><a name="SkCanvas_rotate_2_py"> <code><strong>py </strong></code> </a></td> <td> -y-coordinate of the point to rotate about</td> +<table> <tr> <td><a name='SkCanvas_rotate_2_degrees'><code><strong>degrees</strong></code></a></td> + <td>amount to rotate, in <a href='#SkCanvas_rotate_2_degrees'>degrees</a></td> + </tr> + <tr> <td><a name='SkCanvas_rotate_2_px'><code><strong>px</strong></code></a></td> + <td>x-coordinate of the point to rotate about</td> + </tr> + <tr> <td><a name='SkCanvas_rotate_2_py'><code><strong>py</strong></code></a></td> + <td>y-coordinate of the point to rotate about</td> </tr> </table> @@ -2164,32 +2812,33 @@ y-coordinate of the point to rotate about</td> ### See Also -<a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_skew">skew</a> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_setMatrix">setMatrix</a> +<a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_skew'>skew</a> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_setMatrix'>setMatrix</a> --- -<a name="SkCanvas_skew"></a> +<a name='SkCanvas_skew'></a> ## skew -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void skew(SkScalar sx, SkScalar sy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_skew'>skew</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy) </pre> -Skew <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_skew_sx">sx</a> on the x-axis and <a href="#SkCanvas_skew_sy">sy</a> on the y-axis. A positive value of <a href="#SkCanvas_skew_sx">sx</a> -skews the drawing right as y increases; a positive value of <a href="#SkCanvas_skew_sy">sy</a> skews the drawing +Skew <a href='#Matrix'>Matrix</a> by <a href='#SkCanvas_skew_sx'>sx</a> on the x-axis and <a href='#SkCanvas_skew_sy'>sy</a> on the y-axis. A positive value of <a href='#SkCanvas_skew_sx'>sx</a> +skews the drawing right as y increases; a positive value of <a href='#SkCanvas_skew_sy'>sy</a> skews the drawing down as x increases. -Mathematically, replace <a href="#Matrix">Matrix</a> with a skew matrix <a href="undocumented#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. +Mathematically, replace <a href='#Matrix'>Matrix</a> with a skew matrix <a href='undocumented#Premultiply'>Premultiplied</a> with <a href='#Matrix'>Matrix</a>. -This has the effect of skewing the drawing by (<a href="#SkCanvas_skew_sx">sx</a>, <a href="#SkCanvas_skew_sy">sy</a>) before transforming -the result with <a href="#Matrix">Matrix</a>. +This has the effect of skewing the drawing by (<a href='#SkCanvas_skew_sx'>sx</a>, <a href='#SkCanvas_skew_sy'>sy</a>) before transforming +the result with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_skew_sx"> <code><strong>sx </strong></code> </a></td> <td> -amount to skew in x</td> - </tr> <tr> <td><a name="SkCanvas_skew_sy"> <code><strong>sy </strong></code> </a></td> <td> -amount to skew in y</td> +<table> <tr> <td><a name='SkCanvas_skew_sx'><code><strong>sx</strong></code></a></td> + <td>amount to skew in x</td> + </tr> + <tr> <td><a name='SkCanvas_skew_sy'><code><strong>sy</strong></code></a></td> + <td>amount to skew in y</td> </tr> </table> @@ -2197,33 +2846,33 @@ amount to skew in y</td> <div><fiddle-embed name="2e2acc21d7774df7e0940a30ad2ca99e"><div>Black text mimics an oblique text style by using a negative skew in x that shifts the geometry to the right as the y values decrease. -<a href="SkColor_Reference#RGB_Red">Red</a> text uses a positive skew in y to shift the geometry down as the x values +<a href='SkColor_Reference#RGB_Red'>Red</a> text uses a positive skew in y to shift the geometry down as the x values increase. -<a href="SkColor_Reference#RGB_Blue">Blue</a> text combines x and y skew to rotate and scale. +<a href='SkColor_Reference#RGB_Blue'>Blue</a> text combines x and y skew to rotate and scale. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_rotate">rotate</a><sup><a href="#SkCanvas_rotate_2">[2]</a></sup> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_setMatrix">setMatrix</a> +<a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_rotate'>rotate</a><sup><a href='#SkCanvas_rotate_2'>[2]</a></sup> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_setMatrix'>setMatrix</a> --- -<a name="SkCanvas_concat"></a> +<a name='SkCanvas_concat'></a> ## concat -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void concat(const SkMatrix& matrix) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_concat'>concat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix) </pre> -Replace <a href="#Matrix">Matrix</a> with <a href="#SkCanvas_concat_matrix">matrix</a> <a href="undocumented#Premultiply">Premultiplied</a> with existing <a href="#Matrix">Matrix</a>. +Replace <a href='#Matrix'>Matrix</a> with <a href='#SkCanvas_concat_matrix'>matrix</a> <a href='undocumented#Premultiply'>Premultiplied</a> with existing <a href='#Matrix'>Matrix</a>. -This has the effect of transforming the drawn geometry by <a href="#SkCanvas_concat_matrix">matrix</a>, before -transforming the result with existing <a href="#Matrix">Matrix</a>. +This has the effect of transforming the drawn geometry by <a href='#SkCanvas_concat_matrix'>matrix</a>, before +transforming the result with existing <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_concat_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="#SkCanvas_concat_matrix">matrix</a> to <a href="undocumented#Premultiply">Premultiply</a> with existing <a href="#Matrix">Matrix</a></td> +<table> <tr> <td><a name='SkCanvas_concat_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='#SkCanvas_concat_matrix'>matrix</a> to <a href='undocumented#Premultiply'>Premultiply</a> with existing <a href='#Matrix'>Matrix</a></td> </tr> </table> @@ -2233,24 +2882,24 @@ transforming the result with existing <a href="#Matrix">Matrix</a>. ### See Also -<a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_rotate">rotate</a><sup><a href="#SkCanvas_rotate_2">[2]</a></sup> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_skew">skew</a> <a href="#SkCanvas_setMatrix">setMatrix</a> +<a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_rotate'>rotate</a><sup><a href='#SkCanvas_rotate_2'>[2]</a></sup> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_skew'>skew</a> <a href='#SkCanvas_setMatrix'>setMatrix</a> --- -<a name="SkCanvas_setMatrix"></a> +<a name='SkCanvas_setMatrix'></a> ## setMatrix -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setMatrix(const SkMatrix& matrix) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_setMatrix'>setMatrix</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix) </pre> -Replace <a href="#Matrix">Matrix</a> with <a href="#SkCanvas_setMatrix_matrix">matrix</a>. -Unlike <a href="#SkCanvas_concat">concat</a>, any prior <a href="#SkCanvas_setMatrix_matrix">matrix</a> state is overwritten. +Replace <a href='#Matrix'>Matrix</a> with <a href='#SkCanvas_setMatrix_matrix'>matrix</a>. +Unlike <a href='#SkCanvas_concat'>concat</a>, any prior <a href='#SkCanvas_setMatrix_matrix'>matrix</a> state is overwritten. ### Parameters -<table> <tr> <td><a name="SkCanvas_setMatrix_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="#SkCanvas_setMatrix_matrix">matrix</a> to copy, replacing existing <a href="#Matrix">Matrix</a></td> +<table> <tr> <td><a name='SkCanvas_setMatrix_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='#SkCanvas_setMatrix_matrix'>matrix</a> to copy, replacing existing <a href='#Matrix'>Matrix</a></td> </tr> </table> @@ -2260,18 +2909,18 @@ Unlike <a href="#SkCanvas_concat">concat</a>, any prior <a href="#SkCanvas_setMa ### See Also -<a href="#SkCanvas_resetMatrix">resetMatrix</a> <a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_rotate">rotate</a><sup><a href="#SkCanvas_rotate_2">[2]</a></sup> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_skew">skew</a> +<a href='#SkCanvas_resetMatrix'>resetMatrix</a> <a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_rotate'>rotate</a><sup><a href='#SkCanvas_rotate_2'>[2]</a></sup> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_skew'>skew</a> --- -<a name="SkCanvas_resetMatrix"></a> +<a name='SkCanvas_resetMatrix'></a> ## resetMatrix -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void resetMatrix() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_resetMatrix'>resetMatrix</a>() </pre> -Sets <a href="#Matrix">Matrix</a> to the identity matrix. +Sets <a href='#Matrix'>Matrix</a> to the identity matrix. Any prior matrix state is overwritten. ### Example @@ -2280,23 +2929,23 @@ Any prior matrix state is overwritten. ### See Also -<a href="#SkCanvas_setMatrix">setMatrix</a> <a href="#SkCanvas_concat">concat</a> <a href="#SkCanvas_translate">translate</a> <a href="#SkCanvas_rotate">rotate</a><sup><a href="#SkCanvas_rotate_2">[2]</a></sup> <a href="#SkCanvas_scale">scale</a> <a href="#SkCanvas_skew">skew</a> +<a href='#SkCanvas_setMatrix'>setMatrix</a> <a href='#SkCanvas_concat'>concat</a> <a href='#SkCanvas_translate'>translate</a> <a href='#SkCanvas_rotate'>rotate</a><sup><a href='#SkCanvas_rotate_2'>[2]</a></sup> <a href='#SkCanvas_scale'>scale</a> <a href='#SkCanvas_skew'>skew</a> --- -<a name="SkCanvas_getTotalMatrix"></a> +<a name='SkCanvas_getTotalMatrix'></a> ## getTotalMatrix -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkMatrix& getTotalMatrix() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkCanvas_getTotalMatrix'>getTotalMatrix</a>() const </pre> -Returns <a href="#Matrix">Matrix</a>. -This does not account for translation by <a href="undocumented#Device">Device</a> or <a href="SkSurface_Reference#Surface">Surface</a>. +Returns <a href='#Matrix'>Matrix</a>. +This does not account for translation by <a href='undocumented#Device'>Device</a> or <a href='SkSurface_Reference#Surface'>Surface</a>. ### Return Value -<a href="#Matrix">Matrix</a> in <a href="#Canvas">Canvas</a> +<a href='#Matrix'>Matrix</a> in <a href='#Canvas'>Canvas</a> ### Example @@ -2312,66 +2961,68 @@ isIdentity true ### See Also -<a href="#SkCanvas_setMatrix">setMatrix</a> <a href="#SkCanvas_resetMatrix">resetMatrix</a> <a href="#SkCanvas_concat">concat</a> +<a href='#SkCanvas_setMatrix'>setMatrix</a> <a href='#SkCanvas_resetMatrix'>resetMatrix</a> <a href='#SkCanvas_concat'>concat</a> --- -## <a name="Clip"></a> Clip +## <a name='Clip'>Clip</a> -<a href="#Clip">Clip</a> is built from a stack of clipping paths. Each <a href="SkPath_Reference#Path">Path</a> in the -stack can be constructed from one or more <a href="SkPath_Reference#Contour">Path Contour</a> elements. The -<a href="SkPath_Reference#Contour">Path Contour</a> may be composed of any number of <a href="SkPath_Reference#Verb">Path Verb</a> segments. Each -<a href="SkPath_Reference#Contour">Path Contour</a> forms a closed area; <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> defines the area enclosed -by <a href="SkPath_Reference#Contour">Path Contour</a>. +<a href='#Clip'>Clip</a> is built from a stack of clipping paths. Each <a href='SkPath_Reference#Path'>Path</a> in the +stack can be constructed from one or more <a href='SkPath_Reference#Contour'>Path Contour</a> elements. The +<a href='SkPath_Reference#Contour'>Path Contour</a> may be composed of any number of <a href='SkPath_Reference#Verb'>Path Verb</a> segments. Each +<a href='SkPath_Reference#Contour'>Path Contour</a> forms a closed area; <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> defines the area enclosed +by <a href='SkPath_Reference#Contour'>Path Contour</a>. -<a href="#Clip">Clip</a> stack of <a href="SkPath_Reference#Path">Path</a> elements successfully restrict the <a href="SkPath_Reference#Path">Path</a> area. Each -<a href="SkPath_Reference#Path">Path</a> is transformed by <a href="#Matrix">Matrix</a>, then intersected with or subtracted from the -prior <a href="#Clip">Clip</a> to form the replacement <a href="#Clip">Clip</a>. Use <a href="undocumented#SkClipOp_kDifference">SkClipOp::kDifference</a> -to subtract <a href="SkPath_Reference#Path">Path</a> from <a href="#Clip">Clip</a>; use <a href="undocumented#SkClipOp_kIntersect">SkClipOp::kIntersect</a> to intersect <a href="SkPath_Reference#Path">Path</a> -with <a href="#Clip">Clip</a>. +<a href='#Clip'>Clip</a> stack of <a href='SkPath_Reference#Path'>Path</a> elements successfully restrict the <a href='SkPath_Reference#Path'>Path</a> area. Each +<a href='SkPath_Reference#Path'>Path</a> is transformed by <a href='#Matrix'>Matrix</a>, then intersected with or subtracted from the +prior <a href='#Clip'>Clip</a> to form the replacement <a href='#Clip'>Clip</a>. Use <a href='undocumented#SkClipOp_kDifference'>SkClipOp::kDifference</a> +to subtract <a href='SkPath_Reference#Path'>Path</a> from <a href='#Clip'>Clip</a>; use <a href='undocumented#SkClipOp_kIntersect'>SkClipOp::kIntersect</a> to intersect <a href='SkPath_Reference#Path'>Path</a> +with <a href='#Clip'>Clip</a>. -A clipping <a href="SkPath_Reference#Path">Path</a> may be Anti-aliased; if <a href="SkPath_Reference#Path">Path</a>, after transformation, is +A clipping <a href='SkPath_Reference#Path'>Path</a> may be Anti-aliased; if <a href='SkPath_Reference#Path'>Path</a>, after transformation, is composed of horizontal and vertical lines, clearing Anti-alias allows whole pixels -to either be inside or outside the clip. The fastest drawing has a <a href="undocumented#Alias">Aliased</a>, +to either be inside or outside the clip. The fastest drawing has a <a href='undocumented#Alias'>Aliased</a>, rectangular clip. -If clipping <a href="SkPath_Reference#Path">Path</a> has Anti-alias set, clip may partially clip a pixel, requiring +If clipping <a href='SkPath_Reference#Path'>Path</a> has Anti-alias set, clip may partially clip a pixel, requiring that drawing blend partially with the destination along the edge. A rotated rectangular Anti-aliased clip looks smoother but draws slower. -<a href="#Clip">Clip</a> can combine with <a href="SkRect_Reference#Rect">Rect</a> and <a href="undocumented#Round_Rect">Round Rect</a> primitives; like -<a href="SkPath_Reference#Path">Path</a>, these are transformed by <a href="#Matrix">Matrix</a> before they are combined with <a href="#Clip">Clip</a>. +<a href='#Clip'>Clip</a> can combine with <a href='SkRect_Reference#Rect'>Rect</a> and <a href='undocumented#Round_Rect'>Round Rect</a> primitives; like +<a href='SkPath_Reference#Path'>Path</a>, these are transformed by <a href='#Matrix'>Matrix</a> before they are combined with <a href='#Clip'>Clip</a>. -<a href="#Clip">Clip</a> can combine with <a href="undocumented#Region">Region</a>. <a href="undocumented#Region">Region</a> is assumed to be in <a href="undocumented#Device">Device</a> coordinates -and is unaffected by <a href="#Matrix">Matrix</a>. +<a href='#Clip'>Clip</a> can combine with <a href='undocumented#Region'>Region</a>. <a href='undocumented#Region'>Region</a> is assumed to be in <a href='undocumented#Device'>Device</a> coordinates +and is unaffected by <a href='#Matrix'>Matrix</a>. ### Example -<div><fiddle-embed name="862cc026601a41a58df49c0b9f0d7777"><div><a href="#Draw">Draw</a> a red circle with an <a href="undocumented#Alias">Aliased</a> clip and an Anti-aliased clip. +<div><fiddle-embed name="862cc026601a41a58df49c0b9f0d7777"><div><a href='#Draw'>Draw</a> a red circle with an <a href='undocumented#Alias'>Aliased</a> clip and an Anti-aliased clip. Use an image filter to zoom into the pixels drawn. -The edge of the <a href="undocumented#Alias">Aliased</a> clip fully draws pixels in the red circle. +The edge of the <a href='undocumented#Alias'>Aliased</a> clip fully draws pixels in the red circle. The edge of the Anti-aliased clip partially draws pixels in the red circle. </div></fiddle-embed></div> -<a name="SkCanvas_clipRect"></a> +<a name='SkCanvas_clipRect'></a> ## clipRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRect(const SkRect& rect, SkClipOp op, bool doAntiAlias) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRect'>clipRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkClipOp'>SkClipOp</a> op, bool doAntiAlias) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRect_rect">rect</a>, -with an <a href="undocumented#Alias">Aliased</a> or Anti-aliased clip edge. <a href="#SkCanvas_clipRect_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> -before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipRect_rect'>rect</a>, +with an <a href='undocumented#Alias'>Aliased</a> or Anti-aliased clip edge. <a href='#SkCanvas_clipRect_rect'>rect</a> is transformed by <a href='#Matrix'>Matrix</a> +before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRect_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRect_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> +<table> <tr> <td><a name='SkCanvas_clipRect_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRect_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRect_doAntiAlias'><code><strong>doAntiAlias</strong></code></a></td> + <td>true if <a href='#Clip'>Clip</a> is to be Anti-aliased</td> </tr> </table> @@ -2381,26 +3032,27 @@ true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> ### See Also -<a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipRect_2"></a> +<a name='SkCanvas_clipRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRect(const SkRect& rect, SkClipOp op) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRect'>clipRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkClipOp'>SkClipOp</a> op) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRect_2_rect">rect</a>. -Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; pixels are fully contained by the clip. -<a href="#SkCanvas_clipRect_2_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipRect_2_rect'>rect</a>. +Resulting <a href='#Clip'>Clip</a> is <a href='undocumented#Alias'>Aliased</a>; pixels are fully contained by the clip. +<a href='#SkCanvas_clipRect_2_rect'>rect</a> is transformed by <a href='#Matrix'>Matrix</a> before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRect_2_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> +<table> <tr> <td><a name='SkCanvas_clipRect_2_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRect_2_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> </tr> </table> @@ -2410,86 +3062,91 @@ Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; ### See Also -<a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipRect_3"></a> +<a name='SkCanvas_clipRect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRect(const SkRect& rect, bool doAntiAlias = false) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRect'>clipRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, bool doAntiAlias = false) </pre> -Replace <a href="#Clip">Clip</a> with the intersection of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRect_3_rect">rect</a>. -Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; pixels are fully contained by the clip. -<a href="#SkCanvas_clipRect_3_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> -before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipRect_3_rect'>rect</a>. +Resulting <a href='#Clip'>Clip</a> is <a href='undocumented#Alias'>Aliased</a>; pixels are fully contained by the clip. +<a href='#SkCanvas_clipRect_3_rect'>rect</a> is transformed by <a href='#Matrix'>Matrix</a> +before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRect_3_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRect_3_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> +<table> <tr> <td><a name='SkCanvas_clipRect_3_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRect_3_doAntiAlias'><code><strong>doAntiAlias</strong></code></a></td> + <td>true if <a href='#Clip'>Clip</a> is to be Anti-aliased</td> </tr> </table> ### Example -<div><fiddle-embed name="1d4e0632c97e42692775d834fe10aa99"><div>A circle drawn in pieces looks uniform when drawn <a href="undocumented#Alias">Aliased</a>. +<div><fiddle-embed name="1d4e0632c97e42692775d834fe10aa99"><div>A circle drawn in pieces looks uniform when drawn <a href='undocumented#Alias'>Aliased</a>. The same circle pieces blend with pixels more than once when Anti-aliased, visible as a thin pair of lines through the right circle. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_androidFramework_setDeviceClipRestriction"></a> +<a name='SkCanvas_androidFramework_setDeviceClipRestriction'></a> ## androidFramework_setDeviceClipRestriction -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void androidFramework_setDeviceClipRestriction(const SkIRect& rect) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_androidFramework_setDeviceClipRestriction'>androidFramework setDeviceClipRestriction</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect) </pre> -Sets the maximum clip rectangle, which can be set by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a> and -<a href="#SkCanvas_clipPath">clipPath</a> and intersect the current clip with the specified <a href="#SkCanvas_androidFramework_setDeviceClipRestriction_rect">rect</a>. +Sets the maximum clip rectangle, which can be set by <a href='#SkCanvas_clipRect'>clipRect</a>, <a href='#SkCanvas_clipRRect'>clipRRect</a> and +<a href='#SkCanvas_clipPath'>clipPath</a> and intersect the current clip with the specified <a href='#SkCanvas_androidFramework_setDeviceClipRestriction_rect'>rect</a>. The maximum clip affects only future clipping operations; it is not retroactive. The clip restriction is not recorded in pictures. -Pass an empty <a href="#SkCanvas_androidFramework_setDeviceClipRestriction_rect">rect</a> to disable maximum clip. +Pass an empty <a href='#SkCanvas_androidFramework_setDeviceClipRestriction_rect'>rect</a> to disable maximum clip. + +This is private API to be used only by Android framework. ### Parameters -<table> <tr> <td><a name="SkCanvas_androidFramework_setDeviceClipRestriction_rect"> <code><strong>rect </strong></code> </a></td> <td> -maximum allowed clip in device coordinates</td> +<table> <tr> <td><a name='SkCanvas_androidFramework_setDeviceClipRestriction_rect'><code><strong>rect</strong></code></a></td> + <td>maximum allowed clip in device coordinates</td> </tr> # --- -<a name="SkCanvas_clipRRect"></a> +<a name='SkCanvas_clipRRect'></a> ## clipRRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRRect'>clipRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& rrect, <a href='undocumented#SkClipOp'>SkClipOp</a> op, bool doAntiAlias) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRRect_rrect">rrect</a>, -with an <a href="undocumented#Alias">Aliased</a> or Anti-aliased clip edge. -<a href="#SkCanvas_clipRRect_rrect">rrect</a> is transformed by <a href="#Matrix">Matrix</a> -before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipRRect_rrect'>rrect</a>, +with an <a href='undocumented#Alias'>Aliased</a> or Anti-aliased clip edge. +<a href='#SkCanvas_clipRRect_rrect'>rrect</a> is transformed by <a href='#Matrix'>Matrix</a> +before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -<a href="undocumented#Round_Rect">Round Rect</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRRect_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRRect_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> +<table> <tr> <td><a name='SkCanvas_clipRRect_rrect'><code><strong>rrect</strong></code></a></td> + <td><a href='undocumented#Round_Rect'>Round Rect</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRRect_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRRect_doAntiAlias'><code><strong>doAntiAlias</strong></code></a></td> + <td>true if <a href='#Clip'>Clip</a> is to be Anti-aliased</td> </tr> </table> @@ -2499,26 +3156,27 @@ true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipRRect_2"></a> +<a name='SkCanvas_clipRRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRRect(const SkRRect& rrect, SkClipOp op) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRRect'>clipRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& rrect, <a href='undocumented#SkClipOp'>SkClipOp</a> op) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRRect_2_rrect">rrect</a>. -Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; pixels are fully contained by the clip. -<a href="#SkCanvas_clipRRect_2_rrect">rrect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipRRect_2_rrect'>rrect</a>. +Resulting <a href='#Clip'>Clip</a> is <a href='undocumented#Alias'>Aliased</a>; pixels are fully contained by the clip. +<a href='#SkCanvas_clipRRect_2_rrect'>rrect</a> is transformed by <a href='#Matrix'>Matrix</a> before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRRect_2_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -<a href="undocumented#Round_Rect">Round Rect</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRRect_2_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> +<table> <tr> <td><a name='SkCanvas_clipRRect_2_rrect'><code><strong>rrect</strong></code></a></td> + <td><a href='undocumented#Round_Rect'>Round Rect</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRRect_2_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> </tr> </table> @@ -2528,26 +3186,27 @@ Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipRRect_3"></a> +<a name='SkCanvas_clipRRect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRRect'>clipRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& rrect, bool doAntiAlias = false) </pre> -Replace <a href="#Clip">Clip</a> with the intersection of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRRect_3_rrect">rrect</a>, -with an <a href="undocumented#Alias">Aliased</a> or Anti-aliased clip edge. -<a href="#SkCanvas_clipRRect_3_rrect">rrect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipRRect_3_rrect'>rrect</a>, +with an <a href='undocumented#Alias'>Aliased</a> or Anti-aliased clip edge. +<a href='#SkCanvas_clipRRect_3_rrect'>rrect</a> is transformed by <a href='#Matrix'>Matrix</a> before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRRect_3_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -<a href="undocumented#Round_Rect">Round Rect</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRRect_3_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> +<table> <tr> <td><a name='SkCanvas_clipRRect_3_rrect'><code><strong>rrect</strong></code></a></td> + <td><a href='undocumented#Round_Rect'>Round Rect</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRRect_3_doAntiAlias'><code><strong>doAntiAlias</strong></code></a></td> + <td>true if <a href='#Clip'>Clip</a> is to be Anti-aliased</td> </tr> </table> @@ -2557,187 +3216,193 @@ true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipPath"></a> +<a name='SkCanvas_clipPath'></a> ## clipPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipPath(const SkPath& path, SkClipOp op, bool doAntiAlias) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipPath'>clipPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, <a href='undocumented#SkClipOp'>SkClipOp</a> op, bool doAntiAlias) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipPath_path">path</a>, -with an <a href="undocumented#Alias">Aliased</a> or Anti-aliased clip edge. <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_path">path</a> -describes the area inside or outside its contours; and if <a href="SkPath_Reference#Contour">Path Contour</a> overlaps -itself or another <a href="SkPath_Reference#Contour">Path Contour</a>, whether the overlaps form part of the area. -<a href="#SkCanvas_clipPath_path">path</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipPath_path'>path</a>, +with an <a href='undocumented#Alias'>Aliased</a> or Anti-aliased clip edge. <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> determines if <a href='#SkCanvas_clipPath_path'>path</a> +describes the area inside or outside its contours; and if <a href='SkPath_Reference#Contour'>Path Contour</a> overlaps +itself or another <a href='SkPath_Reference#Contour'>Path Contour</a>, whether the overlaps form part of the area. +<a href='#SkCanvas_clipPath_path'>path</a> is transformed by <a href='#Matrix'>Matrix</a> before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipPath_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipPath_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipPath_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> +<table> <tr> <td><a name='SkCanvas_clipPath_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipPath_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipPath_doAntiAlias'><code><strong>doAntiAlias</strong></code></a></td> + <td>true if <a href='#Clip'>Clip</a> is to be Anti-aliased</td> </tr> </table> ### Example -<div><fiddle-embed name="ee47ae6b813bfaa55e1a7b7c053ed60d"><div>Top figure uses <a href="SkPath_Reference#SkPath_kInverseWinding_FillType">SkPath::kInverseWinding FillType</a> and <a href="undocumented#SkClipOp_kDifference">SkClipOp::kDifference</a>; +<div><fiddle-embed name="ee47ae6b813bfaa55e1a7b7c053ed60d"><div>Top figure uses <a href='SkPath_Reference#SkPath_kInverseWinding_FillType'>SkPath::kInverseWinding FillType</a> and <a href='undocumented#SkClipOp_kDifference'>SkClipOp::kDifference</a>; area outside clip is subtracted from circle. -Bottom figure uses <a href="SkPath_Reference#SkPath_kWinding_FillType">SkPath::kWinding FillType</a> and <a href="undocumented#SkClipOp_kIntersect">SkClipOp::kIntersect</a>; +Bottom figure uses <a href='SkPath_Reference#SkPath_kWinding_FillType'>SkPath::kWinding FillType</a> and <a href='undocumented#SkClipOp_kIntersect'>SkClipOp::kIntersect</a>; area inside clip is intersected with circle. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipPath_2"></a> +<a name='SkCanvas_clipPath_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipPath(const SkPath& path, SkClipOp op) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipPath'>clipPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, <a href='undocumented#SkClipOp'>SkClipOp</a> op) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipPath_2_path">path</a>. -Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; pixels are fully contained by the clip. -<a href="SkPath_Reference#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_2_path">path</a> -describes the area inside or outside its contours; and if <a href="SkPath_Reference#Contour">Path Contour</a> overlaps -itself or another <a href="SkPath_Reference#Contour">Path Contour</a>, whether the overlaps form part of the area. -<a href="#SkCanvas_clipPath_2_path">path</a> is transformed by <a href="#Matrix">Matrix</a> -before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipPath_2_path'>path</a>. +Resulting <a href='#Clip'>Clip</a> is <a href='undocumented#Alias'>Aliased</a>; pixels are fully contained by the clip. +<a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> determines if <a href='#SkCanvas_clipPath_2_path'>path</a> +describes the area inside or outside its contours; and if <a href='SkPath_Reference#Contour'>Path Contour</a> overlaps +itself or another <a href='SkPath_Reference#Contour'>Path Contour</a>, whether the overlaps form part of the area. +<a href='#SkCanvas_clipPath_2_path'>path</a> is transformed by <a href='#Matrix'>Matrix</a> +before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipPath_2_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipPath_2_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> +<table> <tr> <td><a name='SkCanvas_clipPath_2_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipPath_2_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> </tr> </table> ### Example -<div><fiddle-embed name="7856755c1bf8431c286c734b353345ad"><div>Overlapping <a href="SkRect_Reference#Rect">Rects</a> form a clip. When clip <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> is set to -<a href="SkPath_Reference#SkPath_kWinding_FillType">SkPath::kWinding FillType</a>, the overlap is included. Set to -<a href="SkPath_Reference#SkPath_kEvenOdd_FillType">SkPath::kEvenOdd FillType</a>, the overlap is excluded and forms a hole. +<div><fiddle-embed name="7856755c1bf8431c286c734b353345ad"><div>Overlapping <a href='SkRect_Reference#Rect'>Rects</a> form a clip. When clip <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> is set to +<a href='SkPath_Reference#SkPath_kWinding_FillType'>SkPath::kWinding FillType</a>, the overlap is included. Set to +<a href='SkPath_Reference#SkPath_kEvenOdd_FillType'>SkPath::kEvenOdd FillType</a>, the overlap is excluded and forms a hole. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_clipPath_3"></a> +<a name='SkCanvas_clipPath_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipPath(const SkPath& path, bool doAntiAlias = false) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipPath'>clipPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, bool doAntiAlias = false) </pre> -Replace <a href="#Clip">Clip</a> with the intersection of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipPath_3_path">path</a>. -Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; pixels are fully contained by the clip. -<a href="SkPath_Reference#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_3_path">path</a> -describes the area inside or outside its contours; and if <a href="SkPath_Reference#Contour">Path Contour</a> overlaps -itself or another <a href="SkPath_Reference#Contour">Path Contour</a>, whether the overlaps form part of the area. -<a href="#SkCanvas_clipPath_3_path">path</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. +Replace <a href='#Clip'>Clip</a> with the intersection of <a href='#Clip'>Clip</a> and <a href='#SkCanvas_clipPath_3_path'>path</a>. +Resulting <a href='#Clip'>Clip</a> is <a href='undocumented#Alias'>Aliased</a>; pixels are fully contained by the clip. +<a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> determines if <a href='#SkCanvas_clipPath_3_path'>path</a> +describes the area inside or outside its contours; and if <a href='SkPath_Reference#Contour'>Path Contour</a> overlaps +itself or another <a href='SkPath_Reference#Contour'>Path Contour</a>, whether the overlaps form part of the area. +<a href='#SkCanvas_clipPath_3_path'>path</a> is transformed by <a href='#Matrix'>Matrix</a> before it is combined with <a href='#Clip'>Clip</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipPath_3_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipPath_3_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be Anti-aliased</td> +<table> <tr> <td><a name='SkCanvas_clipPath_3_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipPath_3_doAntiAlias'><code><strong>doAntiAlias</strong></code></a></td> + <td>true if <a href='#Clip'>Clip</a> is to be Anti-aliased</td> </tr> </table> ### Example -<div><fiddle-embed name="187a7ae77a8176e417181411988534b6"><div><a href="#Clip">Clip</a> loops over itself covering its center twice. When clip <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> -is set to <a href="SkPath_Reference#SkPath_kWinding_FillType">SkPath::kWinding FillType</a>, the overlap is included. Set to -<a href="SkPath_Reference#SkPath_kEvenOdd_FillType">SkPath::kEvenOdd FillType</a>, the overlap is excluded and forms a hole. +<div><fiddle-embed name="187a7ae77a8176e417181411988534b6"><div><a href='#Clip'>Clip</a> loops over itself covering its center twice. When clip <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> +is set to <a href='SkPath_Reference#SkPath_kWinding_FillType'>SkPath::kWinding FillType</a>, the overlap is included. Set to +<a href='SkPath_Reference#SkPath_kEvenOdd_FillType'>SkPath::kEvenOdd FillType</a>, the overlap is excluded and forms a hole. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipRegion">clipRegion</a> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRegion'>clipRegion</a> --- -<a name="SkCanvas_setAllowSimplifyClip"></a> +<a name='SkCanvas_setAllowSimplifyClip'></a> ## setAllowSimplifyClip -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAllowSimplifyClip(bool allow) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_setAllowSimplifyClip'>setAllowSimplifyClip</a>(bool allow) </pre> -Only used for testing. -Set to simplify clip stack using <a href="undocumented#PathOps">PathOps</a>. +Experimental. + +testingSet to simplify clip stack using <a href='undocumented#PathOps'>PathOps</a>. --- -<a name="SkCanvas_clipRegion"></a> +<a name='SkCanvas_clipRegion'></a> ## clipRegion -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clipRegion(const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clipRegion'>clipRegion</a>(const <a href='undocumented#SkRegion'>SkRegion</a>& deviceRgn, <a href='undocumented#SkClipOp'>SkClipOp</a> op = <a href='undocumented#SkClipOp_kIntersect'>SkClipOp::kIntersect</a>) </pre> -Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="undocumented#Region">Region</a> <a href="#SkCanvas_clipRegion_deviceRgn">deviceRgn</a>. -Resulting <a href="#Clip">Clip</a> is <a href="undocumented#Alias">Aliased</a>; pixels are fully contained by the clip. -<a href="#SkCanvas_clipRegion_deviceRgn">deviceRgn</a> is unaffected by <a href="#Matrix">Matrix</a>. +Replace <a href='#Clip'>Clip</a> with the intersection or difference of <a href='#Clip'>Clip</a> and <a href='undocumented#Region'>Region</a> <a href='#SkCanvas_clipRegion_deviceRgn'>deviceRgn</a>. +Resulting <a href='#Clip'>Clip</a> is <a href='undocumented#Alias'>Aliased</a>; pixels are fully contained by the clip. +<a href='#SkCanvas_clipRegion_deviceRgn'>deviceRgn</a> is unaffected by <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clipRegion_deviceRgn"> <code><strong>deviceRgn </strong></code> </a></td> <td> -<a href="undocumented#Region">Region</a> to combine with <a href="#Clip">Clip</a></td> - </tr> <tr> <td><a name="SkCanvas_clipRegion_op"> <code><strong>op </strong></code> </a></td> <td> -<a href="undocumented#Clip_Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> +<table> <tr> <td><a name='SkCanvas_clipRegion_deviceRgn'><code><strong>deviceRgn</strong></code></a></td> + <td><a href='undocumented#Region'>Region</a> to combine with <a href='#Clip'>Clip</a></td> + </tr> + <tr> <td><a name='SkCanvas_clipRegion_op'><code><strong>op</strong></code></a></td> + <td><a href='undocumented#Clip_Op'>Clip Op</a> to apply to <a href='#Clip'>Clip</a></td> </tr> </table> ### Example <div><fiddle-embed name="7bb57c0e456c5fda2c2cca4abb68b19e"><div>region is unaffected by canvas rotation; iRect is affected by canvas rotation. -Both clips are <a href="undocumented#Alias">Aliased</a>; this is not noticeable on <a href="undocumented#Region">Region</a> clip because it +Both clips are <a href='undocumented#Alias'>Aliased</a>; this is not noticeable on <a href='undocumented#Region'>Region</a> clip because it aligns to pixel boundaries. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_clipRect">clipRect</a><sup><a href="#SkCanvas_clipRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRect_3">[3]</a></sup> <a href="#SkCanvas_clipRRect">clipRRect</a><sup><a href="#SkCanvas_clipRRect_2">[2]</a></sup><sup><a href="#SkCanvas_clipRRect_3">[3]</a></sup> <a href="#SkCanvas_clipPath">clipPath</a><sup><a href="#SkCanvas_clipPath_2">[2]</a></sup><sup><a href="#SkCanvas_clipPath_3">[3]</a></sup> +<a href='#SkCanvas_clipRect'>clipRect</a><sup><a href='#SkCanvas_clipRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRect_3'>[3]</a></sup> <a href='#SkCanvas_clipRRect'>clipRRect</a><sup><a href='#SkCanvas_clipRRect_2'>[2]</a></sup><sup><a href='#SkCanvas_clipRRect_3'>[3]</a></sup> <a href='#SkCanvas_clipPath'>clipPath</a><sup><a href='#SkCanvas_clipPath_2'>[2]</a></sup><sup><a href='#SkCanvas_clipPath_3'>[3]</a></sup> --- -<a name="SkCanvas_quickReject"></a> +<a name='SkCanvas_quickReject'></a> ## quickReject -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool quickReject(const SkRect& rect) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_quickReject'>quickReject</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect) const </pre> -Return true if <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_quickReject_rect">rect</a>, transformed by <a href="#Matrix">Matrix</a>, can be quickly determined to be -outside of <a href="#Clip">Clip</a>. May return false even though <a href="#SkCanvas_quickReject_rect">rect</a> is outside of <a href="#Clip">Clip</a>. +Return true if <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_quickReject_rect'>rect</a>, transformed by <a href='#Matrix'>Matrix</a>, can be quickly determined to be +outside of <a href='#Clip'>Clip</a>. May return false even though <a href='#SkCanvas_quickReject_rect'>rect</a> is outside of <a href='#Clip'>Clip</a>. Use to check if an area to be drawn is clipped out, to skip subsequent draw calls. ### Parameters -<table> <tr> <td><a name="SkCanvas_quickReject_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to compare with <a href="#Clip">Clip</a></td> +<table> <tr> <td><a name='SkCanvas_quickReject_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to compare with <a href='#Clip'>Clip</a></td> </tr> </table> ### Return Value -true if <a href="#SkCanvas_quickReject_rect">rect</a>, transformed by <a href="#Matrix">Matrix</a>, does not intersect <a href="#Clip">Clip</a> +true if <a href='#SkCanvas_quickReject_rect'>rect</a>, transformed by <a href='#Matrix'>Matrix</a>, does not intersect <a href='#Clip'>Clip</a> ### Example @@ -2754,31 +3419,31 @@ quickReject false ### See Also -<a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a><sup><a href="#SkCanvas_getLocalClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getTotalMatrix">getTotalMatrix</a> <a href="SkBitmap_Reference#SkBitmap_drawsNothing">SkBitmap::drawsNothing</a> +<a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a><sup><a href='#SkCanvas_getLocalClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getTotalMatrix'>getTotalMatrix</a> <a href='SkBitmap_Reference#SkBitmap_drawsNothing'>SkBitmap::drawsNothing</a> --- -<a name="SkCanvas_quickReject_2"></a> +<a name='SkCanvas_quickReject_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool quickReject(const SkPath& path) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_quickReject'>quickReject</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& path) const </pre> -Return true if <a href="#SkCanvas_quickReject_2_path">path</a>, transformed by <a href="#Matrix">Matrix</a>, can be quickly determined to be -outside of <a href="#Clip">Clip</a>. May return false even though <a href="#SkCanvas_quickReject_2_path">path</a> is outside of <a href="#Clip">Clip</a>. +Return true if <a href='#SkCanvas_quickReject_2_path'>path</a>, transformed by <a href='#Matrix'>Matrix</a>, can be quickly determined to be +outside of <a href='#Clip'>Clip</a>. May return false even though <a href='#SkCanvas_quickReject_2_path'>path</a> is outside of <a href='#Clip'>Clip</a>. Use to check if an area to be drawn is clipped out, to skip subsequent draw calls. ### Parameters -<table> <tr> <td><a name="SkCanvas_quickReject_2_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> to compare with <a href="#Clip">Clip</a></td> +<table> <tr> <td><a name='SkCanvas_quickReject_2_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> to compare with <a href='#Clip'>Clip</a></td> </tr> </table> ### Return Value -true if <a href="#SkCanvas_quickReject_2_path">path</a>, transformed by <a href="#Matrix">Matrix</a>, does not intersect <a href="#Clip">Clip</a> +true if <a href='#SkCanvas_quickReject_2_path'>path</a>, transformed by <a href='#Matrix'>Matrix</a>, does not intersect <a href='#Clip'>Clip</a> ### Example @@ -2795,31 +3460,31 @@ quickReject false ### See Also -<a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a><sup><a href="#SkCanvas_getLocalClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getTotalMatrix">getTotalMatrix</a> <a href="SkBitmap_Reference#SkBitmap_drawsNothing">SkBitmap::drawsNothing</a> +<a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a><sup><a href='#SkCanvas_getLocalClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getTotalMatrix'>getTotalMatrix</a> <a href='SkBitmap_Reference#SkBitmap_drawsNothing'>SkBitmap::drawsNothing</a> --- -<a name="SkCanvas_getLocalClipBounds"></a> +<a name='SkCanvas_getLocalClipBounds'></a> ## getLocalClipBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect getLocalClipBounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a>() const </pre> -Return bounds of <a href="#Clip">Clip</a>, transformed by inverse of <a href="#Matrix">Matrix</a>. If <a href="#Clip">Clip</a> is empty, -return <a href="SkRect_Reference#SkRect_MakeEmpty">SkRect::MakeEmpty</a>, where all <a href="SkRect_Reference#Rect">Rect</a> sides equal zero. +Return bounds of <a href='#Clip'>Clip</a>, transformed by inverse of <a href='#Matrix'>Matrix</a>. If <a href='#Clip'>Clip</a> is empty, +return <a href='SkRect_Reference#SkRect_MakeEmpty'>SkRect::MakeEmpty</a>, where all <a href='SkRect_Reference#Rect'>Rect</a> sides equal zero. -<a href="SkRect_Reference#Rect">Rect</a> returned is outset by one to account for partial pixel coverage if <a href="#Clip">Clip</a> +<a href='SkRect_Reference#Rect'>Rect</a> returned is outset by one to account for partial pixel coverage if <a href='#Clip'>Clip</a> is Anti-aliased. ### Return Value -bounds of <a href="#Clip">Clip</a> in local coordinates +bounds of <a href='#Clip'>Clip</a> in local coordinates ### Example <div><fiddle-embed name="7f60cb030d3f9b2473adbe3e34b19d91"><div>Initial bounds is device bounds outset by 1 on all sides. -Clipped bounds is <a href="#SkCanvas_clipPath">clipPath</a> bounds outset by 1 on all sides. +Clipped bounds is <a href='#SkCanvas_clipPath'>clipPath</a> bounds outset by 1 on all sides. Scaling the canvas by two in x and y scales the local bounds by 1/2 in x and y. </div> @@ -2835,32 +3500,32 @@ left:14.5 top:64.5 right:60.5 bottom:115.5 ### See Also -<a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a><sup><a href="#SkCanvas_getDeviceClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> <a href="#SkCanvas_quickReject">quickReject</a><sup><a href="#SkCanvas_quickReject_2">[2]</a></sup> +<a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a><sup><a href='#SkCanvas_getDeviceClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a> <a href='#SkCanvas_quickReject'>quickReject</a><sup><a href='#SkCanvas_quickReject_2'>[2]</a></sup> --- -<a name="SkCanvas_getLocalClipBounds_2"></a> +<a name='SkCanvas_getLocalClipBounds_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getLocalClipBounds(SkRect* bounds) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* bounds) const </pre> -Return <a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> of <a href="#Clip">Clip</a>, transformed by inverse of <a href="#Matrix">Matrix</a>. If <a href="#Clip">Clip</a> is empty, -return false, and set <a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> to <a href="SkRect_Reference#SkRect_MakeEmpty">SkRect::MakeEmpty</a>, where all <a href="SkRect_Reference#Rect">Rect</a> sides equal zero. +Return <a href='#SkCanvas_getLocalClipBounds_2_bounds'>bounds</a> of <a href='#Clip'>Clip</a>, transformed by inverse of <a href='#Matrix'>Matrix</a>. If <a href='#Clip'>Clip</a> is empty, +return false, and set <a href='#SkCanvas_getLocalClipBounds_2_bounds'>bounds</a> to <a href='SkRect_Reference#SkRect_MakeEmpty'>SkRect::MakeEmpty</a>, where all <a href='SkRect_Reference#Rect'>Rect</a> sides equal zero. -<a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> is outset by one to account for partial pixel coverage if <a href="#Clip">Clip</a> +<a href='#SkCanvas_getLocalClipBounds_2_bounds'>bounds</a> is outset by one to account for partial pixel coverage if <a href='#Clip'>Clip</a> is Anti-aliased. ### Parameters -<table> <tr> <td><a name="SkCanvas_getLocalClipBounds_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> of <a href="#Clip">Clip</a> in local coordinates</td> +<table> <tr> <td><a name='SkCanvas_getLocalClipBounds_2_bounds'><code><strong>bounds</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> of <a href='#Clip'>Clip</a> in local coordinates</td> </tr> </table> ### Return Value -true if <a href="#Clip">Clip</a> <a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> is not empty +true if <a href='#Clip'>Clip</a> <a href='#SkCanvas_getLocalClipBounds_2_bounds'>bounds</a> is not empty ### Example @@ -2877,30 +3542,30 @@ local bounds empty = true ### See Also -<a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a><sup><a href="#SkCanvas_getDeviceClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> <a href="#SkCanvas_quickReject">quickReject</a><sup><a href="#SkCanvas_quickReject_2">[2]</a></sup> +<a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a><sup><a href='#SkCanvas_getDeviceClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a> <a href='#SkCanvas_quickReject'>quickReject</a><sup><a href='#SkCanvas_quickReject_2'>[2]</a></sup> --- -<a name="SkCanvas_getDeviceClipBounds"></a> +<a name='SkCanvas_getDeviceClipBounds'></a> ## getDeviceClipBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect getDeviceClipBounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a>() const </pre> -Return <a href="SkIRect_Reference#IRect">IRect</a> bounds of <a href="#Clip">Clip</a>, unaffected by <a href="#Matrix">Matrix</a>. If <a href="#Clip">Clip</a> is empty, -return <a href="SkRect_Reference#SkRect_MakeEmpty">SkRect::MakeEmpty</a>, where all <a href="SkRect_Reference#Rect">Rect</a> sides equal zero. +Return <a href='SkIRect_Reference#IRect'>IRect</a> bounds of <a href='#Clip'>Clip</a>, unaffected by <a href='#Matrix'>Matrix</a>. If <a href='#Clip'>Clip</a> is empty, +return <a href='SkRect_Reference#SkRect_MakeEmpty'>SkRect::MakeEmpty</a>, where all <a href='SkRect_Reference#Rect'>Rect</a> sides equal zero. -Unlike <a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a>, returned <a href="SkIRect_Reference#IRect">IRect</a> is not outset. +Unlike <a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a>, returned <a href='SkIRect_Reference#IRect'>IRect</a> is not outset. ### Return Value -bounds of <a href="#Clip">Clip</a> in <a href="undocumented#Device">Device</a> coordinates +bounds of <a href='#Clip'>Clip</a> in <a href='undocumented#Device'>Device</a> coordinates ### Example <div><fiddle-embed name="556832ac5711af662a98c21c547185e9"><div>Initial bounds is device bounds, not outset. -Clipped bounds is <a href="#SkCanvas_clipPath">clipPath</a> bounds, not outset. +Clipped bounds is <a href='#SkCanvas_clipPath'>clipPath</a> bounds, not outset. Scaling the canvas by 1/2 in x and y scales the device bounds by 1/2 in x and y. </div> @@ -2916,31 +3581,31 @@ left:15 top:65 right:60 bottom:115 ### See Also -<a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a><sup><a href="#SkCanvas_getLocalClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> <a href="#SkCanvas_quickReject">quickReject</a><sup><a href="#SkCanvas_quickReject_2">[2]</a></sup> +<a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a><sup><a href='#SkCanvas_getLocalClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a> <a href='#SkCanvas_quickReject'>quickReject</a><sup><a href='#SkCanvas_quickReject_2'>[2]</a></sup> --- -<a name="SkCanvas_getDeviceClipBounds_2"></a> +<a name='SkCanvas_getDeviceClipBounds_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getDeviceClipBounds(SkIRect* bounds) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a>(<a href='SkIRect_Reference#SkIRect'>SkIRect</a>* bounds) const </pre> -Return <a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_getDeviceClipBounds_2_bounds">bounds</a> of <a href="#Clip">Clip</a>, unaffected by <a href="#Matrix">Matrix</a>. If <a href="#Clip">Clip</a> is empty, -return false, and set <a href="#SkCanvas_getDeviceClipBounds_2_bounds">bounds</a> to <a href="SkRect_Reference#SkRect_MakeEmpty">SkRect::MakeEmpty</a>, where all <a href="SkRect_Reference#Rect">Rect</a> sides equal zero. +Return <a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_getDeviceClipBounds_2_bounds'>bounds</a> of <a href='#Clip'>Clip</a>, unaffected by <a href='#Matrix'>Matrix</a>. If <a href='#Clip'>Clip</a> is empty, +return false, and set <a href='#SkCanvas_getDeviceClipBounds_2_bounds'>bounds</a> to <a href='SkRect_Reference#SkRect_MakeEmpty'>SkRect::MakeEmpty</a>, where all <a href='SkRect_Reference#Rect'>Rect</a> sides equal zero. -Unlike <a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a>, <a href="#SkCanvas_getDeviceClipBounds_2_bounds">bounds</a> is not outset. +Unlike <a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a>, <a href='#SkCanvas_getDeviceClipBounds_2_bounds'>bounds</a> is not outset. ### Parameters -<table> <tr> <td><a name="SkCanvas_getDeviceClipBounds_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> of <a href="#Clip">Clip</a> in device coordinates</td> +<table> <tr> <td><a name='SkCanvas_getDeviceClipBounds_2_bounds'><code><strong>bounds</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> of <a href='#Clip'>Clip</a> in device coordinates</td> </tr> </table> ### Return Value -true if <a href="#Clip">Clip</a> <a href="#SkCanvas_getDeviceClipBounds_2_bounds">bounds</a> is not empty +true if <a href='#Clip'>Clip</a> <a href='#SkCanvas_getDeviceClipBounds_2_bounds'>bounds</a> is not empty ### Example @@ -2957,75 +3622,212 @@ device bounds empty = true ### See Also -<a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a><sup><a href="#SkCanvas_getLocalClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> <a href="#SkCanvas_quickReject">quickReject</a><sup><a href="#SkCanvas_quickReject_2">[2]</a></sup> - ---- - -## <a name="Draw"></a> Draw - -| name | description | -| --- | --- | -| <a href="#SkCanvas_clear">clear</a> | fills <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> | -| <a href="#SkCanvas_drawAnnotation">drawAnnotation</a> | associates a <a href="SkRect_Reference#Rect">Rect</a> with a key-value pair | -| | <a href="#SkCanvas_drawAnnotation">drawAnnotation(const SkRect& rect, const char key[], SkData* value)</a> | -| | <a href="#SkCanvas_drawAnnotation_2">drawAnnotation(const SkRect& rect, const char key[], const sk sp<SkData>& value)</a> | -| <a href="#SkCanvas_drawArc">drawArc</a> | draws <a href="undocumented#Arc">Arc</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawAtlas">drawAtlas</a> | draws sprites using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| | <a href="#SkCanvas_drawAtlas">drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, const SkPaint* paint)</a> | -| | <a href="#SkCanvas_drawAtlas_2">drawAtlas(const sk sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, const SkPaint* paint)</a> | -| | <a href="#SkCanvas_drawAtlas_3">drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], int count, const SkRect* cullRect, const SkPaint* paint)</a> | -| | <a href="#SkCanvas_drawAtlas_4">drawAtlas(const sk sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], int count, const SkRect* cullRect, const SkPaint* paint)</a> | -| <a href="#SkCanvas_drawCircle">drawCircle</a> | draws <a href="undocumented#Circle">Circle</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| | <a href="#SkCanvas_drawCircle">drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawCircle_2">drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint)</a> | -| <a href="#SkCanvas_drawColor">drawColor</a> | fills <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> and <a href="undocumented#Blend_Mode">Blend Mode</a> | -| <a href="#SkCanvas_drawDRRect">drawDRRect</a> | draws double <a href="undocumented#Round_Rect">Round Rect</a> stroked or filled | -| <a href="#SkCanvas_drawDrawable">drawDrawable</a> | draws <a href="undocumented#Drawable">Drawable</a>, encapsulated drawing commands | -| | <a href="#SkCanvas_drawDrawable">drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr)</a> | -| | <a href="#SkCanvas_drawDrawable_2">drawDrawable(SkDrawable* drawable, SkScalar x, SkScalar y)</a> | -| <a href="#SkCanvas_drawIRect">drawIRect</a> | draws <a href="SkIRect_Reference#IRect">IRect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawLine">drawLine</a> | draws line segment between two points | -| | <a href="#SkCanvas_drawLine">drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawLine_2">drawLine(SkPoint p0, SkPoint p1, const SkPaint& paint)</a> | -| <a href="#SkCanvas_drawOval">drawOval</a> | draws <a href="undocumented#Oval">Oval</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawPaint">drawPaint</a> | fills <a href="#Clip">Clip</a> with <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawPatch">drawPatch</a> | draws Coons_Patch | -| | <a href="#SkCanvas_drawPatch">drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawPatch_2">drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], const SkPaint& paint)</a> | -| <a href="#SkCanvas_drawPath">drawPath</a> | draws <a href="SkPath_Reference#Path">Path</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawPicture">drawPicture</a> | draws <a href="undocumented#Picture">Picture</a> using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> | -| | <a href="#SkCanvas_drawPicture">drawPicture(const SkPicture* picture)</a> | -| | <a href="#SkCanvas_drawPicture_2">drawPicture(const sk sp<SkPicture>& picture)</a> | -| | <a href="#SkCanvas_drawPicture_3">drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)</a> | -| | <a href="#SkCanvas_drawPicture_4">drawPicture(const sk sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint)</a> | -| <a href="#SkCanvas_drawPoint">drawPoint</a> | draws point at (x, y) position | -| | <a href="#SkCanvas_drawPoint">drawPoint(SkScalar x, SkScalar y, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawPoint_2">drawPoint(SkPoint p, const SkPaint& paint)</a> | -| <a href="#SkCanvas_drawPoints">drawPoints</a> | draws array as points, lines, polygon | -| <a href="#SkCanvas_drawRRect">drawRRect</a> | draws <a href="undocumented#Round_Rect">Round Rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawRect">drawRect</a> | draws <a href="SkRect_Reference#Rect">Rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawRegion">drawRegion</a> | draws <a href="undocumented#Region">Region</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> | draws <a href="undocumented#Round_Rect">Round Rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> | -| <a href="#SkCanvas_drawVertices">drawVertices</a> | draws <a href="undocumented#Vertices">Vertices</a>, a triangle mesh | -| | <a href="#SkCanvas_drawVertices">drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawVertices_2">drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint)</a> | - -<a name="SkCanvas_drawColor"></a> +<a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a><sup><a href='#SkCanvas_getLocalClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getBaseLayerSize'>getBaseLayerSize</a> <a href='#SkCanvas_quickReject'>quickReject</a><sup><a href='#SkCanvas_quickReject_2'>[2]</a></sup> + +--- + +## <a name='Draw'>Draw</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_clear'>clear</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fills <a href='#Clip'>Clip</a> with <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAnnotation'>drawAnnotation</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>associates a <a href='SkRect_Reference#Rect'>Rect</a> with a key-value pair</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAnnotation'>drawAnnotation(const SkRect& rect, const char key[], SkData* value)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAnnotation_2'>drawAnnotation(const SkRect& rect, const char key[], const sk sp<SkData>& value)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawArc'>drawArc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Arc'>Arc</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAtlas'>drawAtlas</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws sprites using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAtlas'>drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, const SkPaint* paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAtlas_2'>drawAtlas(const sk sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, const SkPaint* paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAtlas_3'>drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], int count, const SkRect* cullRect, const SkPaint* paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawAtlas_4'>drawAtlas(const sk sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], int count, const SkRect* cullRect, const SkPaint* paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawCircle'>drawCircle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Circle'>Circle</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawCircle'>drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawCircle_2'>drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawColor'>drawColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fills <a href='#Clip'>Clip</a> with <a href='SkColor_Reference#Color'>Color</a> and <a href='undocumented#Blend_Mode'>Blend Mode</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawDRRect'>drawDRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws double <a href='undocumented#Round_Rect'>Round Rect</a> stroked or filled</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawDrawable'>drawDrawable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Drawable'>Drawable</a>, encapsulated drawing commands</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawDrawable'>drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawDrawable_2'>drawDrawable(SkDrawable* drawable, SkScalar x, SkScalar y)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawIRect'>drawIRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkIRect_Reference#IRect'>IRect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawLine'>drawLine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws line segment between two points</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawLine'>drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawLine_2'>drawLine(SkPoint p0, SkPoint p1, const SkPaint& paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawOval'>drawOval</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Oval'>Oval</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPaint'>drawPaint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fills <a href='#Clip'>Clip</a> with <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPatch'>drawPatch</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws Coons_Patch</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPatch'>drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint& paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPatch_2'>drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPath'>drawPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkPath_Reference#Path'>Path</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPicture'>drawPicture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Picture'>Picture</a> using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPicture'>drawPicture(const SkPicture* picture)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPicture_2'>drawPicture(const sk sp<SkPicture>& picture)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPicture_3'>drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPicture_4'>drawPicture(const sk sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPoint'>drawPoint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws point at (x, y) position</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPoint'>drawPoint(SkScalar x, SkScalar y, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPoint_2'>drawPoint(SkPoint p, const SkPaint& paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPoints'>drawPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws array as points, lines, polygon</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRRect'>drawRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Round_Rect'>Round Rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRect'>drawRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='SkRect_Reference#Rect'>Rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRegion'>drawRegion</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Region'>Region</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawRoundRect'>drawRoundRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Round_Rect'>Round Rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices'>drawVertices</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='undocumented#Vertices'>Vertices</a>, a triangle mesh</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices'>drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawVertices_2'>drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint)</a></td> + </tr> +</table> + + +<a name='SkCanvas_drawColor'></a> ## drawColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawColor'>drawColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> color, <a href='undocumented#SkBlendMode'>SkBlendMode</a> mode = <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a>) </pre> -Fill <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> <a href="#SkCanvas_drawColor_color">color</a>. -<a href="#SkCanvas_drawColor_mode">mode</a> determines how <a href="SkColor_Reference#ARGB">Color ARGB</a> is combined with destination. +Fill <a href='#Clip'>Clip</a> with <a href='SkColor_Reference#Color'>Color</a> <a href='#SkCanvas_drawColor_color'>color</a>. +<a href='#SkCanvas_drawColor_mode'>mode</a> determines how <a href='SkColor_Reference#ARGB'>Color ARGB</a> is combined with destination. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawColor_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#ARGB">Color ARGB</a></td> - </tr> <tr> <td><a name="SkCanvas_drawColor_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="undocumented#SkBlendMode">SkBlendMode</a> used to combine source <a href="#SkCanvas_drawColor_color">color</a> and destination</td> +<table> <tr> <td><a name='SkCanvas_drawColor_color'><code><strong>color</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#ARGB'>Color ARGB</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawColor_mode'><code><strong>mode</strong></code></a></td> + <td><a href='undocumented#SkBlendMode'>SkBlendMode</a> used to combine source <a href='#SkCanvas_drawColor_color'>color</a> and destination</td> </tr> </table> @@ -3035,24 +3837,24 @@ Fill <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> < ### See Also -<a href="#SkCanvas_clear">clear</a> <a href="SkBitmap_Reference#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_drawPaint">drawPaint</a> +<a href='#SkCanvas_clear'>clear</a> <a href='SkBitmap_Reference#SkBitmap_erase'>SkBitmap::erase</a> <a href='#SkCanvas_drawPaint'>drawPaint</a> --- -<a name="SkCanvas_clear"></a> +<a name='SkCanvas_clear'></a> ## clear -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void clear(SkColor color) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_clear'>clear</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> color) </pre> -Fill <a href="#Clip">Clip</a> with <a href="SkColor_Reference#Color">Color</a> <a href="#SkCanvas_clear_color">color</a> using <a href="undocumented#SkBlendMode_kSrc">SkBlendMode::kSrc</a>. -This has the effect of replacing all pixels contained by <a href="#Clip">Clip</a> with <a href="#SkCanvas_clear_color">color</a>. +Fill <a href='#Clip'>Clip</a> with <a href='SkColor_Reference#Color'>Color</a> <a href='#SkCanvas_clear_color'>color</a> using <a href='undocumented#SkBlendMode_kSrc'>SkBlendMode::kSrc</a>. +This has the effect of replacing all pixels contained by <a href='#Clip'>Clip</a> with <a href='#SkCanvas_clear_color'>color</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_clear_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#ARGB">Color ARGB</a></td> +<table> <tr> <td><a name='SkCanvas_clear_color'><code><strong>color</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#ARGB'>Color ARGB</a></td> </tr> </table> @@ -3062,50 +3864,50 @@ This has the effect of replacing all pixels contained by <a href="#Clip">Clip</a ### See Also -<a href="#SkCanvas_drawColor">drawColor</a> <a href="SkBitmap_Reference#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_drawPaint">drawPaint</a> +<a href='#SkCanvas_drawColor'>drawColor</a> <a href='SkBitmap_Reference#SkBitmap_erase'>SkBitmap::erase</a> <a href='#SkCanvas_drawPaint'>drawPaint</a> --- -<a name="SkCanvas_discard"></a> +<a name='SkCanvas_discard'></a> ## discard -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void discard() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_discard'>discard</a>() </pre> -Make <a href="#Canvas">Canvas</a> contents undefined. Subsequent calls that read <a href="#Canvas">Canvas</a> pixels, -such as drawing with <a href="undocumented#SkBlendMode">SkBlendMode</a>, return undefined results. <a href="#SkCanvas_discard">discard</a> does -not change <a href="#Clip">Clip</a> or <a href="#Matrix">Matrix</a>. +Make <a href='#Canvas'>Canvas</a> contents undefined. Subsequent calls that read <a href='#Canvas'>Canvas</a> pixels, +such as drawing with <a href='undocumented#SkBlendMode'>SkBlendMode</a>, return undefined results. <a href='#SkCanvas_discard'>discard</a> does +not change <a href='#Clip'>Clip</a> or <a href='#Matrix'>Matrix</a>. -<a href="#SkCanvas_discard">discard</a> may do nothing, depending on the implementation of <a href="SkSurface_Reference#Surface">Surface</a> or <a href="undocumented#Device">Device</a> -that created <a href="#Canvas">Canvas</a>. +<a href='#SkCanvas_discard'>discard</a> may do nothing, depending on the implementation of <a href='SkSurface_Reference#Surface'>Surface</a> or <a href='undocumented#Device'>Device</a> +that created <a href='#Canvas'>Canvas</a>. -<a href="#SkCanvas_discard">discard</a> allows optimized performance on subsequent draws by removing -cached data associated with <a href="SkSurface_Reference#Surface">Surface</a> or <a href="undocumented#Device">Device</a>. -It is not necessary to call <a href="#SkCanvas_discard">discard</a> once done with <a href="#Canvas">Canvas</a>; -any cached data is deleted when owning <a href="SkSurface_Reference#Surface">Surface</a> or <a href="undocumented#Device">Device</a> is deleted. +<a href='#SkCanvas_discard'>discard</a> allows optimized performance on subsequent draws by removing +cached data associated with <a href='SkSurface_Reference#Surface'>Surface</a> or <a href='undocumented#Device'>Device</a>. +It is not necessary to call <a href='#SkCanvas_discard'>discard</a> once done with <a href='#Canvas'>Canvas</a>; +any cached data is deleted when owning <a href='SkSurface_Reference#Surface'>Surface</a> or <a href='undocumented#Device'>Device</a> is deleted. ### See Also -<a href="#SkCanvas_flush">flush</a> <a href="SkSurface_Reference#SkSurface_prepareForExternalIO">SkSurface::prepareForExternalIO</a> GrContext::abandonContext +<a href='#SkCanvas_flush'>flush</a> <a href='SkSurface_Reference#SkSurface_prepareForExternalIO'>SkSurface::prepareForExternalIO</a> GrContext::abandonContext --- -<a name="SkCanvas_drawPaint"></a> +<a name='SkCanvas_drawPaint'></a> ## drawPaint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPaint(const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPaint'>drawPaint</a>(const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -Fill <a href="#Clip">Clip</a> with <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPaint_paint">paint</a>. <a href="SkPaint_Reference#Paint">Paint</a> components <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a> affect drawing; -<a href="undocumented#Path_Effect">Path Effect</a> in <a href="#SkCanvas_drawPaint_paint">paint</a> is ignored. +Fill <a href='#Clip'>Clip</a> with <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPaint_paint'>paint</a>. <a href='SkPaint_Reference#Paint'>Paint</a> components <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a> affect drawing; +<a href='undocumented#Path_Effect'>Path Effect</a> in <a href='#SkCanvas_drawPaint_paint'>paint</a> is ignored. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPaint_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state used to fill <a href="#Canvas">Canvas</a></td> +<table> <tr> <td><a name='SkCanvas_drawPaint_paint'><code><strong>paint</strong></code></a></td> + <td>graphics state used to fill <a href='#Canvas'>Canvas</a></td> </tr> </table> @@ -3115,17 +3917,17 @@ graphics state used to fill <a href="#Canvas">Canvas</a></td> ### See Also -<a href="#SkCanvas_clear">clear</a> <a href="#SkCanvas_drawColor">drawColor</a> <a href="SkBitmap_Reference#SkBitmap_erase">SkBitmap::erase</a> +<a href='#SkCanvas_clear'>clear</a> <a href='#SkCanvas_drawColor'>drawColor</a> <a href='SkBitmap_Reference#SkBitmap_erase'>SkBitmap::erase</a> --- -## <a name="SkCanvas_PointMode"></a> Enum SkCanvas::PointMode +## <a name='SkCanvas_PointMode'>Enum SkCanvas::PointMode</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkCanvas_PointMode">PointMode</a> { - <a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>, - <a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>, - <a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>, + enum <a href='#SkCanvas_PointMode'>PointMode</a> { + <a href='#SkCanvas_kPoints_PointMode'>kPoints PointMode</a>, + <a href='#SkCanvas_kLines_PointMode'>kLines PointMode</a>, + <a href='#SkCanvas_kPolygon_PointMode'>kPolygon PointMode</a>, }; </pre> @@ -3134,18 +3936,27 @@ an open polygon. ### Constants -<table> - <tr> - <td><a name="SkCanvas_kPoints_PointMode"> <code><strong>SkCanvas::kPoints_PointMode </strong></code> </a></td><td>0</td><td><a href="#Draw">Draw</a> each point separately. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kPoints_PointMode'><code>SkCanvas::kPoints_PointMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +draw each point separately</td> </tr> <tr> - <td><a name="SkCanvas_kLines_PointMode"> <code><strong>SkCanvas::kLines_PointMode </strong></code> </a></td><td>1</td><td><a href="#Draw">Draw</a> each pair of points as a line segment. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kLines_PointMode'><code>SkCanvas::kLines_PointMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +draw each pair of points as a line segment</td> </tr> - <tr> - <td><a name="SkCanvas_kPolygon_PointMode"> <code><strong>SkCanvas::kPolygon_PointMode </strong></code> </a></td><td>2</td><td><a href="#Draw">Draw</a> the array of points as a open polygon. -</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kPolygon_PointMode'><code>SkCanvas::kPolygon_PointMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +draw the array of points as a open polygon</td> </tr> </table> @@ -3159,51 +3970,52 @@ The lower left corner shows two lines with a miter when path contains polygon. ### See Also -<a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> <a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawPath">drawPath</a> - - +<a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> <a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawPath'>drawPath</a> -<a name="SkCanvas_drawPoints"></a> +<a name='SkCanvas_drawPoints'></a> ## drawPoints -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPoints'>drawPoints</a>(<a href='#SkCanvas_PointMode'>PointMode</a> mode, size_t count, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="#SkCanvas_drawPoints_pts">pts</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPoints_paint">paint</a>. -<a href="#SkCanvas_drawPoints_count">count</a> is the number of points; if <a href="#SkCanvas_drawPoints_count">count</a> is less than one, has no effect. -<a href="#SkCanvas_drawPoints_mode">mode</a> may be one of: <a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>, <a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>, or <a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>. +<a href='#Draw'>Draw</a> <a href='#SkCanvas_drawPoints_pts'>pts</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPoints_paint'>paint</a>. +<a href='#SkCanvas_drawPoints_count'>count</a> is the number of points; if <a href='#SkCanvas_drawPoints_count'>count</a> is less than one, has no effect. +<a href='#SkCanvas_drawPoints_mode'>mode</a> may be one of: <a href='#SkCanvas_kPoints_PointMode'>kPoints PointMode</a>, <a href='#SkCanvas_kLines_PointMode'>kLines PointMode</a>, or <a href='#SkCanvas_kPolygon_PointMode'>kPolygon PointMode</a>. -If <a href="#SkCanvas_drawPoints_mode">mode</a> is <a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>, the shape of point drawn depends on <a href="#SkCanvas_drawPoints_paint">paint</a> -<a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a>. If <a href="#SkCanvas_drawPoints_paint">paint</a> is set to <a href="SkPaint_Reference#SkPaint_kRound_Cap">SkPaint::kRound Cap</a>, each point draws a -circle of diameter <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. If <a href="#SkCanvas_drawPoints_paint">paint</a> is set to <a href="SkPaint_Reference#SkPaint_kSquare_Cap">SkPaint::kSquare Cap</a> -or <a href="SkPaint_Reference#SkPaint_kButt_Cap">SkPaint::kButt Cap</a>, each point draws a square of width and height -<a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. +If <a href='#SkCanvas_drawPoints_mode'>mode</a> is <a href='#SkCanvas_kPoints_PointMode'>kPoints PointMode</a>, the shape of point drawn depends on <a href='#SkCanvas_drawPoints_paint'>paint</a> +<a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a>. If <a href='#SkCanvas_drawPoints_paint'>paint</a> is set to <a href='SkPaint_Reference#SkPaint_kRound_Cap'>SkPaint::kRound Cap</a>, each point draws a +circle of diameter <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. If <a href='#SkCanvas_drawPoints_paint'>paint</a> is set to <a href='SkPaint_Reference#SkPaint_kSquare_Cap'>SkPaint::kSquare Cap</a> +or <a href='SkPaint_Reference#SkPaint_kButt_Cap'>SkPaint::kButt Cap</a>, each point draws a square of width and height +<a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. -If <a href="#SkCanvas_drawPoints_mode">mode</a> is <a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>, each pair of points draws a line segment. -One line is drawn for every two points; each point is used once. If <a href="#SkCanvas_drawPoints_count">count</a> is odd, +If <a href='#SkCanvas_drawPoints_mode'>mode</a> is <a href='#SkCanvas_kLines_PointMode'>kLines PointMode</a>, each pair of points draws a line segment. +One line is drawn for every two points; each point is used once. If <a href='#SkCanvas_drawPoints_count'>count</a> is odd, the final point is ignored. -If <a href="#SkCanvas_drawPoints_mode">mode</a> is <a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>, each adjacent pair of points draws a line segment. -<a href="#SkCanvas_drawPoints_count">count</a> minus one lines are drawn; the first and last point are used once. +If <a href='#SkCanvas_drawPoints_mode'>mode</a> is <a href='#SkCanvas_kPolygon_PointMode'>kPolygon PointMode</a>, each adjacent pair of points draws a line segment. +<a href='#SkCanvas_drawPoints_count'>count</a> minus one lines are drawn; the first and last point are used once. -Each line segment respects <a href="#SkCanvas_drawPoints_paint">paint</a> <a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> and <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. -<a href="SkPaint_Reference#Style">Paint Style</a> is ignored, as if were set to <a href="SkPaint_Reference#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>. +Each line segment respects <a href='#SkCanvas_drawPoints_paint'>paint</a> <a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> and <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. +<a href='SkPaint_Reference#Style'>Paint Style</a> is ignored, as if were set to <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a>. Always draws each element one at a time; is not affected by -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a>, and unlike <a href="#SkCanvas_drawPath">drawPath</a>, does not create a mask from all points +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a>, and unlike <a href='#SkCanvas_drawPath'>drawPath</a>, does not create a mask from all points and lines before drawing. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPoints_mode"> <code><strong>mode </strong></code> </a></td> <td> -whether <a href="#SkCanvas_drawPoints_pts">pts</a> draws points or lines</td> - </tr> <tr> <td><a name="SkCanvas_drawPoints_count"> <code><strong>count </strong></code> </a></td> <td> -number of points in the array</td> - </tr> <tr> <td><a name="SkCanvas_drawPoints_pts"> <code><strong>pts </strong></code> </a></td> <td> -array of points to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawPoints_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawPoints_mode'><code><strong>mode</strong></code></a></td> + <td>whether <a href='#SkCanvas_drawPoints_pts'>pts</a> draws points or lines</td> + </tr> + <tr> <td><a name='SkCanvas_drawPoints_count'><code><strong>count</strong></code></a></td> + <td>number of points in the array</td> + </tr> + <tr> <td><a name='SkCanvas_drawPoints_pts'><code><strong>pts</strong></code></a></td> + <td>array of points to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawPoints_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> @@ -3212,13 +4024,20 @@ stroke, blend, color, and so on, used to draw</td> <div><fiddle-embed name="635d54b4716e226e93dfbc21ad40e77d"><div> <table> <tr> - <td>The first column draws points.</td> </tr> <tr> - <td>The second column draws points as lines.</td> </tr> <tr> - <td>The third column draws points as a polygon.</td> </tr> <tr> - <td>The fourth column draws points as a polygonal path.</td> </tr> <tr> - <td>The first row uses a round cap and round join.</td> </tr> <tr> - <td>The second row uses a square cap and a miter join.</td> </tr> <tr> - <td>The third row uses a butt cap and a bevel join.</td> </tr> + <td>The first column draws points.</td> + </tr> <tr> + <td>The second column draws points as lines.</td> + </tr> <tr> + <td>The third column draws points as a polygon.</td> + </tr> <tr> + <td>The fourth column draws points as a polygonal path.</td> + </tr> <tr> + <td>The first row uses a round cap and round join.</td> + </tr> <tr> + <td>The second row uses a square cap and a miter join.</td> + </tr> <tr> + <td>The third row uses a butt cap and a bevel join.</td> + </tr> </table> The transparent color makes multiple line draws visible; @@ -3227,33 +4046,35 @@ the path is drawn all at once. ### See Also -<a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> <a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> <a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawPoint"></a> +<a name='SkCanvas_drawPoint'></a> ## drawPoint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPoint'>drawPoint</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> point at (<a href="#SkCanvas_drawPoint_x">x</a>, <a href="#SkCanvas_drawPoint_y">y</a>) using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPoint_paint">paint</a>. +<a href='#Draw'>Draw</a> point at (<a href='#SkCanvas_drawPoint_x'>x</a>, <a href='#SkCanvas_drawPoint_y'>y</a>) using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPoint_paint'>paint</a>. -The shape of point drawn depends on <a href="#SkCanvas_drawPoint_paint">paint</a> <a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a>. -If <a href="#SkCanvas_drawPoint_paint">paint</a> is set to <a href="SkPaint_Reference#SkPaint_kRound_Cap">SkPaint::kRound Cap</a>, draw a circle of diameter -<a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. If <a href="#SkCanvas_drawPoint_paint">paint</a> is set to <a href="SkPaint_Reference#SkPaint_kSquare_Cap">SkPaint::kSquare Cap</a> or <a href="SkPaint_Reference#SkPaint_kButt_Cap">SkPaint::kButt Cap</a>, -draw a square of width and height <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. -<a href="SkPaint_Reference#Style">Paint Style</a> is ignored, as if were set to <a href="SkPaint_Reference#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>. +The shape of point drawn depends on <a href='#SkCanvas_drawPoint_paint'>paint</a> <a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a>. +If <a href='#SkCanvas_drawPoint_paint'>paint</a> is set to <a href='SkPaint_Reference#SkPaint_kRound_Cap'>SkPaint::kRound Cap</a>, draw a circle of diameter +<a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. If <a href='#SkCanvas_drawPoint_paint'>paint</a> is set to <a href='SkPaint_Reference#SkPaint_kSquare_Cap'>SkPaint::kSquare Cap</a> or <a href='SkPaint_Reference#SkPaint_kButt_Cap'>SkPaint::kButt Cap</a>, +draw a square of width and height <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. +<a href='SkPaint_Reference#Style'>Paint Style</a> is ignored, as if were set to <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPoint_x"> <code><strong>x </strong></code> </a></td> <td> -left edge of circle or square</td> - </tr> <tr> <td><a name="SkCanvas_drawPoint_y"> <code><strong>y </strong></code> </a></td> <td> -top edge of circle or square</td> - </tr> <tr> <td><a name="SkCanvas_drawPoint_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawPoint_x'><code><strong>x</strong></code></a></td> + <td>left edge of circle or square</td> + </tr> + <tr> <td><a name='SkCanvas_drawPoint_y'><code><strong>y</strong></code></a></td> + <td>top edge of circle or square</td> + </tr> + <tr> <td><a name='SkCanvas_drawPoint_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> @@ -3263,30 +4084,31 @@ stroke, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawPoints">drawPoints</a> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawPoints'>drawPoints</a> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawPoint_2"></a> +<a name='SkCanvas_drawPoint_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPoint(SkPoint p, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPoint'>drawPoint</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> p, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> point <a href="#SkCanvas_drawPoint_2_p">p</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPoint_2_paint">paint</a>. +<a href='#Draw'>Draw</a> point <a href='#SkCanvas_drawPoint_2_p'>p</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPoint_2_paint'>paint</a>. -The shape of point drawn depends on <a href="#SkCanvas_drawPoint_2_paint">paint</a> <a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a>. -If <a href="#SkCanvas_drawPoint_2_paint">paint</a> is set to <a href="SkPaint_Reference#SkPaint_kRound_Cap">SkPaint::kRound Cap</a>, draw a circle of diameter -<a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. If <a href="#SkCanvas_drawPoint_2_paint">paint</a> is set to <a href="SkPaint_Reference#SkPaint_kSquare_Cap">SkPaint::kSquare Cap</a> or <a href="SkPaint_Reference#SkPaint_kButt_Cap">SkPaint::kButt Cap</a>, -draw a square of width and height <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a>. -<a href="SkPaint_Reference#Style">Paint Style</a> is ignored, as if were set to <a href="SkPaint_Reference#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>. +The shape of point drawn depends on <a href='#SkCanvas_drawPoint_2_paint'>paint</a> <a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a>. +If <a href='#SkCanvas_drawPoint_2_paint'>paint</a> is set to <a href='SkPaint_Reference#SkPaint_kRound_Cap'>SkPaint::kRound Cap</a>, draw a circle of diameter +<a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. If <a href='#SkCanvas_drawPoint_2_paint'>paint</a> is set to <a href='SkPaint_Reference#SkPaint_kSquare_Cap'>SkPaint::kSquare Cap</a> or <a href='SkPaint_Reference#SkPaint_kButt_Cap'>SkPaint::kButt Cap</a>, +draw a square of width and height <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a>. +<a href='SkPaint_Reference#Style'>Paint Style</a> is ignored, as if were set to <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPoint_2_p"> <code><strong>p </strong></code> </a></td> <td> -top-left edge of circle or square</td> - </tr> <tr> <td><a name="SkCanvas_drawPoint_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawPoint_2_p'><code><strong>p</strong></code></a></td> + <td>top-left edge of circle or square</td> + </tr> + <tr> <td><a name='SkCanvas_drawPoint_2_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> @@ -3296,34 +4118,38 @@ stroke, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawPoints">drawPoints</a> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawPoints'>drawPoints</a> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawLine"></a> +<a name='SkCanvas_drawLine'></a> ## drawLine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawLine'>drawLine</a>(<a href='undocumented#SkScalar'>SkScalar</a> x0, <a href='undocumented#SkScalar'>SkScalar</a> y0, <a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -Draws line segment from (<a href="#SkCanvas_drawLine_x0">x0</a>, <a href="#SkCanvas_drawLine_y0">y0</a>) to (<a href="#SkCanvas_drawLine_x1">x1</a>, <a href="#SkCanvas_drawLine_y1">y1</a>) using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawLine_paint">paint</a>. -In <a href="#SkCanvas_drawLine_paint">paint</a>: <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness; -<a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> draws the end rounded or square; -<a href="SkPaint_Reference#Style">Paint Style</a> is ignored, as if were set to <a href="SkPaint_Reference#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>. +Draws line segment from (<a href='#SkCanvas_drawLine_x0'>x0</a>, <a href='#SkCanvas_drawLine_y0'>y0</a>) to (<a href='#SkCanvas_drawLine_x1'>x1</a>, <a href='#SkCanvas_drawLine_y1'>y1</a>) using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawLine_paint'>paint</a>. +In <a href='#SkCanvas_drawLine_paint'>paint</a>: <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness; +<a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> draws the end rounded or square; +<a href='SkPaint_Reference#Style'>Paint Style</a> is ignored, as if were set to <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawLine_x0"> <code><strong>x0 </strong></code> </a></td> <td> -start of line segment on x-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawLine_y0"> <code><strong>y0 </strong></code> </a></td> <td> -start of line segment on y-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawLine_x1"> <code><strong>x1 </strong></code> </a></td> <td> -end of line segment on x-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawLine_y1"> <code><strong>y1 </strong></code> </a></td> <td> -end of line segment on y-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawLine_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawLine_x0'><code><strong>x0</strong></code></a></td> + <td>start of line segment on x-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawLine_y0'><code><strong>y0</strong></code></a></td> + <td>start of line segment on y-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawLine_x1'><code><strong>x1</strong></code></a></td> + <td>end of line segment on x-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawLine_y1'><code><strong>y1</strong></code></a></td> + <td>end of line segment on y-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawLine_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> @@ -3333,29 +4159,31 @@ stroke, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawLine_2"></a> +<a name='SkCanvas_drawLine_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawLine(SkPoint p0, SkPoint p1, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawLine'>drawLine</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> p0, <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p1, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -Draws line segment from <a href="#SkCanvas_drawLine_2_p0">p0</a> to <a href="#SkCanvas_drawLine_2_p1">p1</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawLine_2_paint">paint</a>. -In <a href="#SkCanvas_drawLine_2_paint">paint</a>: <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness; -<a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> draws the end rounded or square; -<a href="SkPaint_Reference#Style">Paint Style</a> is ignored, as if were set to <a href="SkPaint_Reference#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>. +Draws line segment from <a href='#SkCanvas_drawLine_2_p0'>p0</a> to <a href='#SkCanvas_drawLine_2_p1'>p1</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawLine_2_paint'>paint</a>. +In <a href='#SkCanvas_drawLine_2_paint'>paint</a>: <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness; +<a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> draws the end rounded or square; +<a href='SkPaint_Reference#Style'>Paint Style</a> is ignored, as if were set to <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawLine_2_p0"> <code><strong>p0 </strong></code> </a></td> <td> -start of line segment</td> - </tr> <tr> <td><a name="SkCanvas_drawLine_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> -end of line segment</td> - </tr> <tr> <td><a name="SkCanvas_drawLine_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawLine_2_p0'><code><strong>p0</strong></code></a></td> + <td>start of line segment</td> + </tr> + <tr> <td><a name='SkCanvas_drawLine_2_p1'><code><strong>p1</strong></code></a></td> + <td>end of line segment</td> + </tr> + <tr> <td><a name='SkCanvas_drawLine_2_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> @@ -3365,28 +4193,29 @@ stroke, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawRect"></a> +<a name='SkCanvas_drawRect'></a> ## drawRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawRect(const SkRect& rect, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawRect'>drawRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawRect_rect">rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawRect_paint">paint</a>. -In <a href="#SkCanvas_drawRect_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if rectangle is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness, and -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> draws the corners rounded or square. +<a href='#Draw'>Draw</a> <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawRect_rect'>rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawRect_paint'>paint</a>. +In <a href='#SkCanvas_drawRect_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if rectangle is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness, and +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> draws the corners rounded or square. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -rectangle to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawRect_rect'><code><strong>rect</strong></code></a></td> + <td>rectangle to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawRect_paint'><code><strong>paint</strong></code></a></td> + <td>stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3396,28 +4225,29 @@ stroke or fill, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawIRect">drawIRect</a> <a href="#SkCanvas_drawRRect">drawRRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> <a href="#SkCanvas_drawRegion">drawRegion</a> <a href="#SkCanvas_drawPath">drawPath</a> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> +<a href='#SkCanvas_drawIRect'>drawIRect</a> <a href='#SkCanvas_drawRRect'>drawRRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> <a href='#SkCanvas_drawRegion'>drawRegion</a> <a href='#SkCanvas_drawPath'>drawPath</a> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawIRect"></a> +<a name='SkCanvas_drawIRect'></a> ## drawIRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawIRect(const SkIRect& rect, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawIRect'>drawIRect</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& rect, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawIRect_rect">rect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawIRect_paint">paint</a>. -In <a href="#SkCanvas_drawIRect_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if rectangle is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness, and -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> draws the corners rounded or square. +<a href='#Draw'>Draw</a> <a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawIRect_rect'>rect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawIRect_paint'>paint</a>. +In <a href='#SkCanvas_drawIRect_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if rectangle is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness, and +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> draws the corners rounded or square. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawIRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -rectangle to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawIRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawIRect_rect'><code><strong>rect</strong></code></a></td> + <td>rectangle to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawIRect_paint'><code><strong>paint</strong></code></a></td> + <td>stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3427,28 +4257,29 @@ stroke or fill, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawRRect">drawRRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> <a href="#SkCanvas_drawRegion">drawRegion</a> <a href="#SkCanvas_drawPath">drawPath</a> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> +<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawRRect'>drawRRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> <a href='#SkCanvas_drawRegion'>drawRegion</a> <a href='#SkCanvas_drawPath'>drawPath</a> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawRegion"></a> +<a name='SkCanvas_drawRegion'></a> ## drawRegion -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawRegion(const SkRegion& region, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawRegion'>drawRegion</a>(const <a href='undocumented#SkRegion'>SkRegion</a>& region, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Region">Region</a> <a href="#SkCanvas_drawRegion_region">region</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawRegion_paint">paint</a>. -In <a href="#SkCanvas_drawRegion_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if rectangle is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness, and -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> draws the corners rounded or square. +<a href='#Draw'>Draw</a> <a href='undocumented#Region'>Region</a> <a href='#SkCanvas_drawRegion_region'>region</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawRegion_paint'>paint</a>. +In <a href='#SkCanvas_drawRegion_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if rectangle is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness, and +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> draws the corners rounded or square. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawRegion_region"> <code><strong>region </strong></code> </a></td> <td> -<a href="#SkCanvas_drawRegion_region">region</a> to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawRegion_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawRegion_region'><code><strong>region</strong></code></a></td> + <td><a href='#SkCanvas_drawRegion_region'>region</a> to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawRegion_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3458,27 +4289,28 @@ if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> desc ### See Also -<a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawIRect">drawIRect</a> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawIRect'>drawIRect</a> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawOval"></a> +<a name='SkCanvas_drawOval'></a> ## drawOval -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawOval(const SkRect& oval, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawOval'>drawOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Oval">Oval</a> <a href="#SkCanvas_drawOval_oval">oval</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. -In <a href="#SkCanvas_drawOval_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="undocumented#Oval">Oval</a> is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness. +<a href='#Draw'>Draw</a> <a href='undocumented#Oval'>Oval</a> <a href='#SkCanvas_drawOval_oval'>oval</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a>. +In <a href='#SkCanvas_drawOval_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='undocumented#Oval'>Oval</a> is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawOval_oval"> <code><strong>oval </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> bounds of <a href="undocumented#Oval">Oval</a></td> - </tr> <tr> <td><a name="SkCanvas_drawOval_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawOval_oval'><code><strong>oval</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds of <a href='undocumented#Oval'>Oval</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawOval_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3488,30 +4320,31 @@ if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> desc ### See Also -<a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawPath">drawPath</a> <a href="#SkCanvas_drawRRect">drawRRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> +<a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawPath'>drawPath</a> <a href='#SkCanvas_drawRRect'>drawRRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> --- -<a name="SkCanvas_drawRRect"></a> +<a name='SkCanvas_drawRRect'></a> ## drawRRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawRRect(const SkRRect& rrect, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawRRect'>drawRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& rrect, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkCanvas_drawRRect_rrect">rrect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawRRect_paint">paint</a>. -In <a href="#SkCanvas_drawRRect_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="#SkCanvas_drawRRect_rrect">rrect</a> is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness. +<a href='#Draw'>Draw</a> <a href='undocumented#Round_Rect'>Round Rect</a> <a href='#SkCanvas_drawRRect_rrect'>rrect</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawRRect_paint'>paint</a>. +In <a href='#SkCanvas_drawRRect_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='#SkCanvas_drawRRect_rrect'>rrect</a> is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness. -<a href="#SkCanvas_drawRRect_rrect">rrect</a> may represent a rectangle, circle, oval, uniformly rounded rectangle, or +<a href='#SkCanvas_drawRRect_rrect'>rrect</a> may represent a rectangle, circle, oval, uniformly rounded rectangle, or may have any combination of positive non-square radii for the four corners. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -<a href="undocumented#Round_Rect">Round Rect</a> with up to eight corner radii to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawRRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawRRect_rrect'><code><strong>rrect</strong></code></a></td> + <td><a href='undocumented#Round_Rect'>Round Rect</a> with up to eight corner radii to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawRRect_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3521,37 +4354,39 @@ may have any combination of positive non-square radii for the four corners. ### See Also -<a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> <a href="#SkCanvas_drawDRRect">drawDRRect</a> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawOval">drawOval</a> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> <a href='#SkCanvas_drawDRRect'>drawDRRect</a> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawDRRect"></a> +<a name='SkCanvas_drawDRRect'></a> ## drawDRRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawDRRect'>drawDRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& outer, const <a href='undocumented#SkRRect'>SkRRect</a>& inner, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkCanvas_drawDRRect_outer">outer</a> and <a href="#SkCanvas_drawDRRect_inner">inner</a> -using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawDRRect_paint">paint</a>. -<a href="#SkCanvas_drawDRRect_outer">outer</a> must contain <a href="#SkCanvas_drawDRRect_inner">inner</a> or the drawing is undefined. -In <a href="#SkCanvas_drawDRRect_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="undocumented#Round_Rect">Round Rect</a> is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness. -If stroked and <a href="undocumented#Round_Rect">Round Rect</a> corner has zero length radii, <a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> can +<a href='#Draw'>Draw</a> <a href='undocumented#Round_Rect'>Round Rect</a> <a href='#SkCanvas_drawDRRect_outer'>outer</a> and <a href='#SkCanvas_drawDRRect_inner'>inner</a> +using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawDRRect_paint'>paint</a>. +<a href='#SkCanvas_drawDRRect_outer'>outer</a> must contain <a href='#SkCanvas_drawDRRect_inner'>inner</a> or the drawing is undefined. +In <a href='#SkCanvas_drawDRRect_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='undocumented#Round_Rect'>Round Rect</a> is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness. +If stroked and <a href='undocumented#Round_Rect'>Round Rect</a> corner has zero length radii, <a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> can draw corners rounded or square. -GPU-backed platforms optimize drawing when both <a href="#SkCanvas_drawDRRect_outer">outer</a> and <a href="#SkCanvas_drawDRRect_inner">inner</a> are -concave and <a href="#SkCanvas_drawDRRect_outer">outer</a> contains <a href="#SkCanvas_drawDRRect_inner">inner</a>. These platforms may not be able to draw -<a href="SkPath_Reference#Path">Path</a> built with identical data as fast. +GPU-backed platforms optimize drawing when both <a href='#SkCanvas_drawDRRect_outer'>outer</a> and <a href='#SkCanvas_drawDRRect_inner'>inner</a> are +concave and <a href='#SkCanvas_drawDRRect_outer'>outer</a> contains <a href='#SkCanvas_drawDRRect_inner'>inner</a>. These platforms may not be able to draw +<a href='SkPath_Reference#Path'>Path</a> built with identical data as fast. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawDRRect_outer"> <code><strong>outer </strong></code> </a></td> <td> -<a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkCanvas_drawDRRect_outer">outer</a> bounds to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawDRRect_inner"> <code><strong>inner </strong></code> </a></td> <td> -<a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkCanvas_drawDRRect_inner">inner</a> bounds to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawDRRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawDRRect_outer'><code><strong>outer</strong></code></a></td> + <td><a href='undocumented#Round_Rect'>Round Rect</a> <a href='#SkCanvas_drawDRRect_outer'>outer</a> bounds to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawDRRect_inner'><code><strong>inner</strong></code></a></td> + <td><a href='undocumented#Round_Rect'>Round Rect</a> <a href='#SkCanvas_drawDRRect_inner'>inner</a> bounds to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawDRRect_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3561,39 +4396,42 @@ concave and <a href="#SkCanvas_drawDRRect_outer">outer</a> contains <a href="#Sk ### Example -<div><fiddle-embed name="30823cb4edf884d330285ea161664931"><div>Outer <a href="SkRect_Reference#Rect">Rect</a> has no corner radii, but stroke join is rounded. -Inner <a href="undocumented#Round_Rect">Round Rect</a> has corner radii; outset stroke increases radii of corners. -Stroke join does not affect <a href="#SkCanvas_drawDRRect_inner">inner</a> <a href="undocumented#Round_Rect">Round Rect</a> since it has no sharp corners. +<div><fiddle-embed name="30823cb4edf884d330285ea161664931"><div>Outer <a href='SkRect_Reference#Rect'>Rect</a> has no corner radii, but stroke join is rounded. +Inner <a href='undocumented#Round_Rect'>Round Rect</a> has corner radii; outset stroke increases radii of corners. +Stroke join does not affect <a href='#SkCanvas_drawDRRect_inner'>inner</a> <a href='undocumented#Round_Rect'>Round Rect</a> since it has no sharp corners. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> <a href="#SkCanvas_drawRRect">drawRRect</a> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawOval">drawOval</a> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> <a href='#SkCanvas_drawRRect'>drawRRect</a> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawCircle"></a> +<a name='SkCanvas_drawCircle'></a> ## drawCircle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawCircle'>drawCircle</a>(<a href='undocumented#SkScalar'>SkScalar</a> cx, <a href='undocumented#SkScalar'>SkScalar</a> cy, <a href='undocumented#SkScalar'>SkScalar</a> radius, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Circle">Circle</a> at (<a href="#SkCanvas_drawCircle_cx">cx</a>, <a href="#SkCanvas_drawCircle_cy">cy</a>) with <a href="#SkCanvas_drawCircle_radius">radius</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawCircle_paint">paint</a>. -If <a href="#SkCanvas_drawCircle_radius">radius</a> is zero or less, nothing is drawn. -In <a href="#SkCanvas_drawCircle_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="undocumented#Circle">Circle</a> is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness. +<a href='#Draw'>Draw</a> <a href='undocumented#Circle'>Circle</a> at (<a href='#SkCanvas_drawCircle_cx'>cx</a>, <a href='#SkCanvas_drawCircle_cy'>cy</a>) with <a href='#SkCanvas_drawCircle_radius'>radius</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawCircle_paint'>paint</a>. +If <a href='#SkCanvas_drawCircle_radius'>radius</a> is zero or less, nothing is drawn. +In <a href='#SkCanvas_drawCircle_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='undocumented#Circle'>Circle</a> is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawCircle_cx"> <code><strong>cx </strong></code> </a></td> <td> -<a href="undocumented#Circle">Circle</a> center on the x-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawCircle_cy"> <code><strong>cy </strong></code> </a></td> <td> -<a href="undocumented#Circle">Circle</a> center on the y-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawCircle_radius"> <code><strong>radius </strong></code> </a></td> <td> -half the diameter of <a href="undocumented#Circle">Circle</a></td> - </tr> <tr> <td><a name="SkCanvas_drawCircle_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawCircle_cx'><code><strong>cx</strong></code></a></td> + <td><a href='undocumented#Circle'>Circle</a> center on the x-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawCircle_cy'><code><strong>cy</strong></code></a></td> + <td><a href='undocumented#Circle'>Circle</a> center on the y-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawCircle_radius'><code><strong>radius</strong></code></a></td> + <td>half the diameter of <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawCircle_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3603,29 +4441,31 @@ half the diameter of <a href="undocumented#Circle">Circle</a></td> ### See Also -<a href="#SkCanvas_drawOval">drawOval</a> <a href="#SkCanvas_drawRRect">drawRRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> <a href="#SkCanvas_drawPath">drawPath</a> <a href="#SkCanvas_drawArc">drawArc</a> <a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> +<a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkCanvas_drawRRect'>drawRRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> <a href='#SkCanvas_drawPath'>drawPath</a> <a href='#SkCanvas_drawArc'>drawArc</a> <a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawCircle_2"></a> +<a name='SkCanvas_drawCircle_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawCircle'>drawCircle</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> center, <a href='undocumented#SkScalar'>SkScalar</a> radius, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Circle">Circle</a> at <a href="#SkCanvas_drawCircle_2_center">center</a> with <a href="#SkCanvas_drawCircle_2_radius">radius</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawCircle_2_paint">paint</a>. -If <a href="#SkCanvas_drawCircle_2_radius">radius</a> is zero or less, nothing is drawn. -In <a href="#SkCanvas_drawCircle_2_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="undocumented#Circle">Circle</a> is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness. +<a href='#Draw'>Draw</a> <a href='undocumented#Circle'>Circle</a> at <a href='#SkCanvas_drawCircle_2_center'>center</a> with <a href='#SkCanvas_drawCircle_2_radius'>radius</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawCircle_2_paint'>paint</a>. +If <a href='#SkCanvas_drawCircle_2_radius'>radius</a> is zero or less, nothing is drawn. +In <a href='#SkCanvas_drawCircle_2_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='undocumented#Circle'>Circle</a> is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawCircle_2_center"> <code><strong>center </strong></code> </a></td> <td> -<a href="undocumented#Circle">Circle</a> <a href="#SkCanvas_drawCircle_2_center">center</a></td> - </tr> <tr> <td><a name="SkCanvas_drawCircle_2_radius"> <code><strong>radius </strong></code> </a></td> <td> -half the diameter of <a href="undocumented#Circle">Circle</a></td> - </tr> <tr> <td><a name="SkCanvas_drawCircle_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawCircle_2_center'><code><strong>center</strong></code></a></td> + <td><a href='undocumented#Circle'>Circle</a> <a href='#SkCanvas_drawCircle_2_center'>center</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawCircle_2_radius'><code><strong>radius</strong></code></a></td> + <td>half the diameter of <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawCircle_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3635,44 +4475,48 @@ half the diameter of <a href="undocumented#Circle">Circle</a></td> ### See Also -<a href="#SkCanvas_drawOval">drawOval</a> <a href="#SkCanvas_drawRRect">drawRRect</a> <a href="#SkCanvas_drawRoundRect">drawRoundRect</a> <a href="#SkCanvas_drawPath">drawPath</a> <a href="#SkCanvas_drawArc">drawArc</a> <a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> +<a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkCanvas_drawRRect'>drawRRect</a> <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> <a href='#SkCanvas_drawPath'>drawPath</a> <a href='#SkCanvas_drawArc'>drawArc</a> <a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawArc"></a> +<a name='SkCanvas_drawArc'></a> ## drawArc -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, - const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawArc'>drawArc</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle, bool useCenter, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Arc">Arc</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawArc_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Arc'>Arc</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawArc_paint'>paint</a>. -<a href="undocumented#Arc">Arc</a> is part of <a href="undocumented#Oval">Oval</a> bounded by <a href="#SkCanvas_drawArc_oval">oval</a>, sweeping from <a href="#SkCanvas_drawArc_startAngle">startAngle</a> to <a href="#SkCanvas_drawArc_startAngle">startAngle</a> plus -<a href="#SkCanvas_drawArc_sweepAngle">sweepAngle</a>. <a href="#SkCanvas_drawArc_startAngle">startAngle</a> and <a href="#SkCanvas_drawArc_sweepAngle">sweepAngle</a> are in degrees. +<a href='undocumented#Arc'>Arc</a> is part of <a href='undocumented#Oval'>Oval</a> bounded by <a href='#SkCanvas_drawArc_oval'>oval</a>, sweeping from <a href='#SkCanvas_drawArc_startAngle'>startAngle</a> to <a href='#SkCanvas_drawArc_startAngle'>startAngle</a> plus +<a href='#SkCanvas_drawArc_sweepAngle'>sweepAngle</a>. <a href='#SkCanvas_drawArc_startAngle'>startAngle</a> and <a href='#SkCanvas_drawArc_sweepAngle'>sweepAngle</a> are in degrees. -<a href="#SkCanvas_drawArc_startAngle">startAngle</a> of zero places start point at the right middle edge of <a href="#SkCanvas_drawArc_oval">oval</a>. -A positive <a href="#SkCanvas_drawArc_sweepAngle">sweepAngle</a> places <a href="undocumented#Arc">Arc</a> end point clockwise from start point; -a negative <a href="#SkCanvas_drawArc_sweepAngle">sweepAngle</a> places <a href="undocumented#Arc">Arc</a> end point counterclockwise from start point. -<a href="#SkCanvas_drawArc_sweepAngle">sweepAngle</a> may exceed 360 degrees, a full circle. -If <a href="#SkCanvas_drawArc_useCenter">useCenter</a> is true, draw a wedge that includes lines from <a href="#SkCanvas_drawArc_oval">oval</a> -center to <a href="undocumented#Arc">Arc</a> end points. If <a href="#SkCanvas_drawArc_useCenter">useCenter</a> is false, draw <a href="undocumented#Arc">Arc</a> between end points. +<a href='#SkCanvas_drawArc_startAngle'>startAngle</a> of zero places start point at the right middle edge of <a href='#SkCanvas_drawArc_oval'>oval</a>. +A positive <a href='#SkCanvas_drawArc_sweepAngle'>sweepAngle</a> places <a href='undocumented#Arc'>Arc</a> end point clockwise from start point; +a negative <a href='#SkCanvas_drawArc_sweepAngle'>sweepAngle</a> places <a href='undocumented#Arc'>Arc</a> end point counterclockwise from start point. +<a href='#SkCanvas_drawArc_sweepAngle'>sweepAngle</a> may exceed 360 degrees, a full circle. +If <a href='#SkCanvas_drawArc_useCenter'>useCenter</a> is true, draw a wedge that includes lines from <a href='#SkCanvas_drawArc_oval'>oval</a> +center to <a href='undocumented#Arc'>Arc</a> end points. If <a href='#SkCanvas_drawArc_useCenter'>useCenter</a> is false, draw <a href='undocumented#Arc'>Arc</a> between end points. -If <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawArc_oval">oval</a> is empty or <a href="#SkCanvas_drawArc_sweepAngle">sweepAngle</a> is zero, nothing is drawn. +If <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawArc_oval'>oval</a> is empty or <a href='#SkCanvas_drawArc_sweepAngle'>sweepAngle</a> is zero, nothing is drawn. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawArc_oval"> <code><strong>oval </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> bounds of <a href="undocumented#Oval">Oval</a> containing <a href="undocumented#Arc">Arc</a> to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawArc_startAngle"> <code><strong>startAngle </strong></code> </a></td> <td> -angle in degrees where <a href="undocumented#Arc">Arc</a> begins</td> - </tr> <tr> <td><a name="SkCanvas_drawArc_sweepAngle"> <code><strong>sweepAngle </strong></code> </a></td> <td> -sweep angle in degrees; positive is clockwise</td> - </tr> <tr> <td><a name="SkCanvas_drawArc_useCenter"> <code><strong>useCenter </strong></code> </a></td> <td> -if true, include the center of the <a href="#SkCanvas_drawArc_oval">oval</a></td> - </tr> <tr> <td><a name="SkCanvas_drawArc_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> stroke or fill, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawArc_oval'><code><strong>oval</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds of <a href='undocumented#Oval'>Oval</a> containing <a href='undocumented#Arc'>Arc</a> to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawArc_startAngle'><code><strong>startAngle</strong></code></a></td> + <td>angle in degrees where <a href='undocumented#Arc'>Arc</a> begins</td> + </tr> + <tr> <td><a name='SkCanvas_drawArc_sweepAngle'><code><strong>sweepAngle</strong></code></a></td> + <td>sweep angle in degrees; positive is clockwise</td> + </tr> + <tr> <td><a name='SkCanvas_drawArc_useCenter'><code><strong>useCenter</strong></code></a></td> + <td>if true, include the center of the <a href='#SkCanvas_drawArc_oval'>oval</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawArc_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> stroke or fill, blend, color, and so on, used to draw</td> </tr> </table> @@ -3686,37 +4530,40 @@ if true, include the center of the <a href="#SkCanvas_drawArc_oval">oval</a></td ### See Also -<a href="SkPath_Reference#SkPath_arcTo">SkPath::arcTo</a><sup><a href="SkPath_Reference#SkPath_arcTo_2">[2]</a></sup><sup><a href="SkPath_Reference#SkPath_arcTo_3">[3]</a></sup><sup><a href="SkPath_Reference#SkPath_arcTo_4">[4]</a></sup><sup><a href="SkPath_Reference#SkPath_arcTo_5">[5]</a></sup> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawOval">drawOval</a> <a href="#SkCanvas_drawPath">drawPath</a> +<a href='SkPath_Reference#SkPath_arcTo'>SkPath::arcTo</a><sup><a href='SkPath_Reference#SkPath_arcTo_2'>[2]</a></sup><sup><a href='SkPath_Reference#SkPath_arcTo_3'>[3]</a></sup><sup><a href='SkPath_Reference#SkPath_arcTo_4'>[4]</a></sup><sup><a href='SkPath_Reference#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkCanvas_drawPath'>drawPath</a> --- -<a name="SkCanvas_drawRoundRect"></a> +<a name='SkCanvas_drawRoundRect'></a> ## drawRoundRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawRoundRect'>drawRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Round_Rect">Round Rect</a> bounded by <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawRoundRect_rect">rect</a>, with corner radii (<a href="#SkCanvas_drawRoundRect_rx">rx</a>, <a href="#SkCanvas_drawRoundRect_ry">ry</a>) using <a href="#Clip">Clip</a>, -<a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawRoundRect_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Round_Rect'>Round Rect</a> bounded by <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawRoundRect_rect'>rect</a>, with corner radii (<a href='#SkCanvas_drawRoundRect_rx'>rx</a>, <a href='#SkCanvas_drawRoundRect_ry'>ry</a>) using <a href='#Clip'>Clip</a>, +<a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawRoundRect_paint'>paint</a>. -In <a href="#SkCanvas_drawRoundRect_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="undocumented#Round_Rect">Round Rect</a> is stroked or filled; -if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness. -If <a href="#SkCanvas_drawRoundRect_rx">rx</a> or <a href="#SkCanvas_drawRoundRect_ry">ry</a> are less than zero, they are treated as if they are zero. -If <a href="#SkCanvas_drawRoundRect_rx">rx</a> plus <a href="#SkCanvas_drawRoundRect_ry">ry</a> exceeds <a href="#SkCanvas_drawRoundRect_rect">rect</a> width or <a href="#SkCanvas_drawRoundRect_rect">rect</a> height, radii are scaled down to fit. -If <a href="#SkCanvas_drawRoundRect_rx">rx</a> and <a href="#SkCanvas_drawRoundRect_ry">ry</a> are zero, <a href="undocumented#Round_Rect">Round Rect</a> is drawn as <a href="SkRect_Reference#Rect">Rect</a> and if stroked is affected by -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a>. +In <a href='#SkCanvas_drawRoundRect_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='undocumented#Round_Rect'>Round Rect</a> is stroked or filled; +if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness. +If <a href='#SkCanvas_drawRoundRect_rx'>rx</a> or <a href='#SkCanvas_drawRoundRect_ry'>ry</a> are less than zero, they are treated as if they are zero. +If <a href='#SkCanvas_drawRoundRect_rx'>rx</a> plus <a href='#SkCanvas_drawRoundRect_ry'>ry</a> exceeds <a href='#SkCanvas_drawRoundRect_rect'>rect</a> width or <a href='#SkCanvas_drawRoundRect_rect'>rect</a> height, radii are scaled down to fit. +If <a href='#SkCanvas_drawRoundRect_rx'>rx</a> and <a href='#SkCanvas_drawRoundRect_ry'>ry</a> are zero, <a href='undocumented#Round_Rect'>Round Rect</a> is drawn as <a href='SkRect_Reference#Rect'>Rect</a> and if stroked is affected by +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawRoundRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> bounds of <a href="undocumented#Round_Rect">Round Rect</a> to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawRoundRect_rx"> <code><strong>rx </strong></code> </a></td> <td> -axis length in x of oval describing rounded corners</td> - </tr> <tr> <td><a name="SkCanvas_drawRoundRect_ry"> <code><strong>ry </strong></code> </a></td> <td> -axis length in y of oval describing rounded corners</td> - </tr> <tr> <td><a name="SkCanvas_drawRoundRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawRoundRect_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds of <a href='undocumented#Round_Rect'>Round Rect</a> to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawRoundRect_rx'><code><strong>rx</strong></code></a></td> + <td>axis length in x of oval describing rounded corners</td> + </tr> + <tr> <td><a name='SkCanvas_drawRoundRect_ry'><code><strong>ry</strong></code></a></td> + <td>axis length in y of oval describing rounded corners</td> + </tr> + <tr> <td><a name='SkCanvas_drawRoundRect_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> @@ -3730,38 +4577,39 @@ Fourth row radii sum exceeds sides; radii are scaled to fit. ### See Also -DrawRRect <a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawDRRect">drawDRRect</a> <a href="#SkCanvas_drawPath">drawPath</a> <a href="#SkCanvas_drawCircle">drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkCanvas_drawOval">drawOval</a> <a href="#SkCanvas_drawPoint">drawPoint</a><sup><a href="#SkCanvas_drawPoint_2">[2]</a></sup> +DrawRRect <a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawDRRect'>drawDRRect</a> <a href='#SkCanvas_drawPath'>drawPath</a> <a href='#SkCanvas_drawCircle'>drawCircle</a><sup><a href='#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkCanvas_drawPoint'>drawPoint</a><sup><a href='#SkCanvas_drawPoint_2'>[2]</a></sup> --- -<a name="SkCanvas_drawPath"></a> +<a name='SkCanvas_drawPath'></a> ## drawPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPath(const SkPath& path, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPath'>drawPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="SkPath_Reference#Path">Path</a> <a href="#SkCanvas_drawPath_path">path</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPath_paint">paint</a>. -<a href="SkPath_Reference#Path">Path</a> contains an array of <a href="SkPath_Reference#Contour">Path Contour</a>, each of which may be open or closed. +<a href='#Draw'>Draw</a> <a href='SkPath_Reference#Path'>Path</a> <a href='#SkCanvas_drawPath_path'>path</a> using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPath_paint'>paint</a>. +<a href='SkPath_Reference#Path'>Path</a> contains an array of <a href='SkPath_Reference#Contour'>Path Contour</a>, each of which may be open or closed. -In <a href="#SkCanvas_drawPath_paint">paint</a>: <a href="SkPaint_Reference#Style">Paint Style</a> determines if <a href="undocumented#Round_Rect">Round Rect</a> is stroked or filled: -if filled, <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> determines whether <a href="SkPath_Reference#Contour">Path Contour</a> describes inside or -outside of fill; if stroked, <a href="SkPaint_Reference#Stroke_Width">Paint Stroke Width</a> describes the line thickness, -<a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> describes line ends, and <a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> describes how +In <a href='#SkCanvas_drawPath_paint'>paint</a>: <a href='SkPaint_Reference#Style'>Paint Style</a> determines if <a href='undocumented#Round_Rect'>Round Rect</a> is stroked or filled: +if filled, <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> determines whether <a href='SkPath_Reference#Contour'>Path Contour</a> describes inside or +outside of fill; if stroked, <a href='SkPaint_Reference#Stroke_Width'>Paint Stroke Width</a> describes the line thickness, +<a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> describes line ends, and <a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> describes how corners are drawn. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPath_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawPath_paint"> <code><strong>paint </strong></code> </a></td> <td> -stroke, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawPath_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawPath_paint'><code><strong>paint</strong></code></a></td> + <td>stroke, blend, color, and so on, used to draw</td> </tr> </table> ### Example -<div><fiddle-embed name="fe2294131f422b8d6752f6a880f98ad9"><div>Top rows draw stroked <a href="#SkCanvas_drawPath_path">path</a> with combinations of joins and caps. The open contour +<div><fiddle-embed name="fe2294131f422b8d6752f6a880f98ad9"><div>Top rows draw stroked <a href='#SkCanvas_drawPath_path'>path</a> with combinations of joins and caps. The open contour is affected by caps; the closed contour is affected by joins. Bottom row draws fill the same for open and closed contour. First bottom column shows winding fills overlap. @@ -3771,42 +4619,45 @@ Third bottom column shows inverse winding fills area outside both contours. ### See Also -<a href="SkPath_Reference#SkPath">SkPath</a> <a href="#SkCanvas_drawLine">drawLine</a><sup><a href="#SkCanvas_drawLine_2">[2]</a></sup> <a href="#SkCanvas_drawArc">drawArc</a> <a href="#SkCanvas_drawRect">drawRect</a> <a href="#SkCanvas_drawPoints">drawPoints</a> +<a href='SkPath_Reference#SkPath'>SkPath</a> <a href='#SkCanvas_drawLine'>drawLine</a><sup><a href='#SkCanvas_drawLine_2'>[2]</a></sup> <a href='#SkCanvas_drawArc'>drawArc</a> <a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkCanvas_drawPoints'>drawPoints</a> --- -## <a name="Draw_Image"></a> Draw Image +## <a name='Draw_Image'>Draw Image</a> -<a href="#SkCanvas_drawImage">drawImage</a>, <a href="#SkCanvas_drawImageRect">drawImageRect</a>, and <a href="#SkCanvas_drawImageNine">drawImageNine</a> can be called with a bare pointer or +<a href='#SkCanvas_drawImage'>drawImage</a>, <a href='#SkCanvas_drawImageRect'>drawImageRect</a>, and <a href='#SkCanvas_drawImageNine'>drawImageNine</a> can be called with a bare pointer or a smart pointer as a convenience. The pairs of calls are otherwise identical. -<a name="SkCanvas_drawImage"></a> +<a name='SkCanvas_drawImage'></a> ## drawImage -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImage'>drawImage</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* image, <a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImage_image">image</a>, with its <a href="#SkCanvas_drawImage_top">top</a>-<a href="#SkCanvas_drawImage_left">left</a> corner at (<a href="#SkCanvas_drawImage_left">left</a>, <a href="#SkCanvas_drawImage_top">top</a>), -using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImage_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImage_image'>image</a>, with its <a href='#SkCanvas_drawImage_top'>top</a>-<a href='#SkCanvas_drawImage_left'>left</a> corner at (<a href='#SkCanvas_drawImage_left'>left</a>, <a href='#SkCanvas_drawImage_top'>top</a>), +using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImage_paint'>paint</a>. -If <a href="#SkCanvas_drawImage_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, -and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImage_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImage_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImage_image">image</a> bounds. If generated -mask extends beyond <a href="#SkCanvas_drawImage_image">image</a> bounds, replicate <a href="#SkCanvas_drawImage_image">image</a> edge colors, just as <a href="undocumented#Shader">Shader</a> -made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the -<a href="#SkCanvas_drawImage_image">image</a> edge color when it samples outside of its bounds. +If <a href='#SkCanvas_drawImage_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, +and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImage_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImage_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImage_image'>image</a> bounds. If generated +mask extends beyond <a href='#SkCanvas_drawImage_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImage_image'>image</a> edge colors, just as <a href='undocumented#Shader'>Shader</a> +made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the +<a href='#SkCanvas_drawImage_image'>image</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImage_image"> <code><strong>image </strong></code> </a></td> <td> -uncompressed rectangular map of pixels</td> - </tr> <tr> <td><a name="SkCanvas_drawImage_left"> <code><strong>left </strong></code> </a></td> <td> -<a href="#SkCanvas_drawImage_left">left</a> side of <a href="#SkCanvas_drawImage_image">image</a></td> - </tr> <tr> <td><a name="SkCanvas_drawImage_top"> <code><strong>top </strong></code> </a></td> <td> -<a href="#SkCanvas_drawImage_top">top</a> side of <a href="#SkCanvas_drawImage_image">image</a></td> - </tr> <tr> <td><a name="SkCanvas_drawImage_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImage_image'><code><strong>image</strong></code></a></td> + <td>uncompressed rectangular map of pixels</td> + </tr> + <tr> <td><a name='SkCanvas_drawImage_left'><code><strong>left</strong></code></a></td> + <td><a href='#SkCanvas_drawImage_left'>left</a> side of <a href='#SkCanvas_drawImage_image'>image</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawImage_top'><code><strong>top</strong></code></a></td> + <td><a href='#SkCanvas_drawImage_top'>top</a> side of <a href='#SkCanvas_drawImage_image'>image</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawImage_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> @@ -3817,37 +4668,40 @@ and so on; or nullptr</td> ### See Also -<a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> <a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> <a href="SkPaint_Reference#SkPaint_setImageFilter">SkPaint::setImageFilter</a> +<a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> <a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> <a href='SkPaint_Reference#SkPaint_setImageFilter'>SkPaint::setImageFilter</a> --- -<a name="SkCanvas_drawImage_2"></a> +<a name='SkCanvas_drawImage_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImage(const sk_sp<SkImage>& image, SkScalar left, SkScalar top, - const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImage'>drawImage</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& image, <a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImage_2_image">image</a>, with its <a href="#SkCanvas_drawImage_2_top">top</a>-<a href="#SkCanvas_drawImage_2_left">left</a> corner at (<a href="#SkCanvas_drawImage_2_left">left</a>, <a href="#SkCanvas_drawImage_2_top">top</a>), -using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImage_2_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImage_2_image'>image</a>, with its <a href='#SkCanvas_drawImage_2_top'>top</a>-<a href='#SkCanvas_drawImage_2_left'>left</a> corner at (<a href='#SkCanvas_drawImage_2_left'>left</a>, <a href='#SkCanvas_drawImage_2_top'>top</a>), +using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImage_2_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImage_2_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImage_2_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImage_2_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImage_2_image">image</a> bounds. If generated -mask extends beyond <a href="#SkCanvas_drawImage_2_image">image</a> bounds, replicate <a href="#SkCanvas_drawImage_2_image">image</a> edge colors, just as <a href="undocumented#Shader">Shader</a> -made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the -<a href="#SkCanvas_drawImage_2_image">image</a> edge color when it samples outside of its bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImage_2_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImage_2_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImage_2_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImage_2_image'>image</a> bounds. If generated +mask extends beyond <a href='#SkCanvas_drawImage_2_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImage_2_image'>image</a> edge colors, just as <a href='undocumented#Shader'>Shader</a> +made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the +<a href='#SkCanvas_drawImage_2_image'>image</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImage_2_image"> <code><strong>image </strong></code> </a></td> <td> -uncompressed rectangular map of pixels</td> - </tr> <tr> <td><a name="SkCanvas_drawImage_2_left"> <code><strong>left </strong></code> </a></td> <td> -<a href="#SkCanvas_drawImage_2_left">left</a> side of <a href="#SkCanvas_drawImage_2_image">image</a></td> - </tr> <tr> <td><a name="SkCanvas_drawImage_2_top"> <code><strong>top </strong></code> </a></td> <td> -pop side of <a href="#SkCanvas_drawImage_2_image">image</a></td> - </tr> <tr> <td><a name="SkCanvas_drawImage_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImage_2_image'><code><strong>image</strong></code></a></td> + <td>uncompressed rectangular map of pixels</td> + </tr> + <tr> <td><a name='SkCanvas_drawImage_2_left'><code><strong>left</strong></code></a></td> + <td><a href='#SkCanvas_drawImage_2_left'>left</a> side of <a href='#SkCanvas_drawImage_2_image'>image</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawImage_2_top'><code><strong>top</strong></code></a></td> + <td>pop side of <a href='#SkCanvas_drawImage_2_image'>image</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawImage_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> @@ -3858,37 +4712,48 @@ and so on; or nullptr</td> ### See Also -<a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> <a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> <a href="SkPaint_Reference#SkPaint_setImageFilter">SkPaint::setImageFilter</a> +<a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> <a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> <a href='SkPaint_Reference#SkPaint_setImageFilter'>SkPaint::setImageFilter</a> --- -## <a name="SkCanvas_SrcRectConstraint"></a> Enum SkCanvas::SrcRectConstraint +## <a name='SkCanvas_SrcRectConstraint'>Enum SkCanvas::SrcRectConstraint</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> { - <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a>, - <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a>, + enum <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> { + <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>, + <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a>, }; </pre> -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> controls the behavior at the edge of source <a href="SkRect_Reference#Rect">Rect</a>, -provided to <a href="#SkCanvas_drawImageRect">drawImageRect</a>, trading off speed for precision. +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> controls the behavior at the edge of source <a href='SkRect_Reference#Rect'>Rect</a>, +provided to <a href='#SkCanvas_drawImageRect'>drawImageRect</a>, trading off speed for precision. -<a href="undocumented#Image_Filter">Image Filter</a> in <a href="SkPaint_Reference#Paint">Paint</a> may sample multiple pixels in the image. Source <a href="SkRect_Reference#Rect">Rect</a> -restricts the bounds of pixels that may be read. <a href="undocumented#Image_Filter">Image Filter</a> may slow down if -it cannot read outside the bounds, when sampling near the edge of source <a href="SkRect_Reference#Rect">Rect</a>. -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> specifies whether an <a href="undocumented#Image_Filter">Image Filter</a> is allowed to read pixels -outside source <a href="SkRect_Reference#Rect">Rect</a>. +<a href='undocumented#Image_Filter'>Image Filter</a> in <a href='SkPaint_Reference#Paint'>Paint</a> may sample multiple pixels in the image. Source <a href='SkRect_Reference#Rect'>Rect</a> +restricts the bounds of pixels that may be read. <a href='undocumented#Image_Filter'>Image Filter</a> may slow down if +it cannot read outside the bounds, when sampling near the edge of source <a href='SkRect_Reference#Rect'>Rect</a>. +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> specifies whether an <a href='undocumented#Image_Filter'>Image Filter</a> is allowed to read pixels +outside source <a href='SkRect_Reference#Rect'>Rect</a>. ### Constants -<table> - <tr> - <td><a name="SkCanvas_kStrict_SrcRectConstraint"> <code><strong>SkCanvas::kStrict_SrcRectConstraint </strong></code> </a></td><td>Requires Image_Filter to respect source Rect,</td><td>sampling only inside of its bounds, possibly with a performance penalty. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kStrict_SrcRectConstraint'><code>SkCanvas::kStrict_SrcRectConstraint</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Requires <a href='undocumented#Image_Filter'>Image Filter</a> to respect source <a href='SkRect_Reference#Rect'>Rect</a>, +sampling only inside of its bounds, possibly with a performance penalty. </td> </tr> <tr> - <td><a name="SkCanvas_kFast_SrcRectConstraint"> <code><strong>SkCanvas::kFast_SrcRectConstraint </strong></code> </a></td><td>Permits Image_Filter to sample outside of source Rect</td><td>by half the width of <a href="undocumented#Image_Filter">Image Filter</a>, permitting it to run faster but with + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_kFast_SrcRectConstraint'><code>SkCanvas::kFast_SrcRectConstraint</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Permits <a href='undocumented#Image_Filter'>Image Filter</a> to sample outside of source <a href='SkRect_Reference#Rect'>Rect</a> +by half the width of <a href='undocumented#Image_Filter'>Image Filter</a>, permitting it to run faster but with error at the image edges. </td> </tr> @@ -3899,107 +4764,113 @@ error at the image edges. <div><fiddle-embed name="5df49d1f4da37275a1f10ef7f1a749f0"><div>redBorder contains a black and white checkerboard bordered by red. redBorder is drawn scaled by 16 on the left. The middle and right bitmaps are filtered checkerboards. -Drawing the checkerboard with <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> shows only a blur of black and white. -Drawing the checkerboard with <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows red to bleed in the corners. +Drawing the checkerboard with <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> shows only a blur of black and white. +Drawing the checkerboard with <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows red to bleed in the corners. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="SkPaint_Reference#SkPaint_setImageFilter">SkPaint::setImageFilter</a> - - +<a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='SkPaint_Reference#SkPaint_setImageFilter'>SkPaint::setImageFilter</a> -<a name="SkCanvas_drawImageRect"></a> +<a name='SkCanvas_drawImageRect'></a> ## drawImageRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageRect(const SkImage* image, const SkRect& src, const SkRect& dst, const SkPaint* paint, - SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageRect'>drawImageRect</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* image, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, + <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_src">src</a> of <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageRect_image">image</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_dst">dst</a>. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_src'>src</a> of <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageRect_image'>image</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_dst'>dst</a>. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageRect_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageRect_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageRect_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageRect_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageRect_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageRect_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageRect_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageRect_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageRect_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageRect_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageRect_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageRect_image'>image</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawImageRect_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawImageRect_src">src</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawImageRect_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawImageRect_src'>src</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageRect_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_src"> <code><strong>src </strong></code> </a></td> <td> -source <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_image">image</a> to draw from</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageRect_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_src'><code><strong>src</strong></code></a></td> + <td>source <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_image'>image</a> to draw from</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawImageRect_src">src</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawImageRect_src'>src</a> or draw faster</td> </tr> </table> ### Example -<div><fiddle-embed name="bfd18e9cac896cdf94c9f154ccf94be8"><div>The left bitmap draws with <a href="SkPaint_Reference#Paint">Paint</a> default <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a>, and stays within -its bounds; there is no bleeding with <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a>. -the middle and right bitmaps draw with <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a>; with -<a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a>, the filter remains within the checkerboard, and -with <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> red bleeds on the edges. +<div><fiddle-embed name="bfd18e9cac896cdf94c9f154ccf94be8"><div>The left bitmap draws with <a href='SkPaint_Reference#Paint'>Paint</a> default <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, and stays within +its bounds; there is no bleeding with <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a>. +the middle and right bitmaps draw with <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a>; with +<a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>, the filter remains within the checkerboard, and +with <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> red bleeds on the edges. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawImageRect_2"></a> +<a name='SkCanvas_drawImageRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageRect(const SkImage* image, const SkIRect& isrc, const SkRect& dst, const SkPaint* paint, - SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageRect'>drawImageRect</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* image, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& isrc, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, + <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a> of <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageRect_2_image">image</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_2_dst">dst</a>. -Note that <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a> is on integer pixel boundaries; <a href="#SkCanvas_drawImageRect_2_dst">dst</a> may include fractional -boundaries. Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> -<a href="#SkCanvas_drawImageRect_2_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawImageRect_2_isrc'>isrc</a> of <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageRect_2_image'>image</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_2_dst'>dst</a>. +Note that <a href='#SkCanvas_drawImageRect_2_isrc'>isrc</a> is on integer pixel boundaries; <a href='#SkCanvas_drawImageRect_2_dst'>dst</a> may include fractional +boundaries. Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> +<a href='#SkCanvas_drawImageRect_2_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_2_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageRect_2_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageRect_2_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageRect_2_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_2_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageRect_2_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageRect_2_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageRect_2_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageRect_2_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageRect_2_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageRect_2_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageRect_2_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageRect_2_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageRect_2_image'>image</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawImageRect_2_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawImageRect_2_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawImageRect_2_isrc'>isrc</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageRect_2_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_2_isrc"> <code><strong>isrc </strong></code> </a></td> <td> -source <a href="SkIRect_Reference#IRect">IRect</a> of <a href="#SkCanvas_drawImageRect_2_image">image</a> to draw from</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_2_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageRect_2_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_2_isrc'><code><strong>isrc</strong></code></a></td> + <td>source <a href='SkIRect_Reference#IRect'>IRect</a> of <a href='#SkCanvas_drawImageRect_2_image'>image</a> to draw from</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_2_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_2_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_2_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_2_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawImageRect_2_isrc'>isrc</a> or draw faster</td> </tr> </table> @@ -4009,43 +4880,46 @@ filter strictly within <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a> or draw ### See Also -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawImageRect_3"></a> +<a name='SkCanvas_drawImageRect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageRect(const SkImage* image, const SkRect& dst, const SkPaint* paint, - SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageRect'>drawImageRect</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* image, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, + <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageRect_3_image">image</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_3_dst">dst</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, -and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_3_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageRect_3_image'>image</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_3_dst'>dst</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, +and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_3_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_3_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageRect_3_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageRect_3_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageRect_3_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_3_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageRect_3_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageRect_3_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageRect_3_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageRect_3_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageRect_3_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageRect_3_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageRect_3_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageRect_3_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageRect_3_image'>image</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawImageRect_3_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawImageRect_3_image">image</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawImageRect_3_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawImageRect_3_image'>image</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageRect_3_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_3_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_3_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageRect_3_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_3_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_3_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_3_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_3_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawImageRect_3_image">image</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_3_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawImageRect_3_image'>image</a> or draw faster</td> </tr> </table> @@ -4055,96 +4929,104 @@ filter strictly within <a href="#SkCanvas_drawImageRect_3_image">image</a> or dr ### See Also -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawImageRect_4"></a> +<a name='SkCanvas_drawImageRect_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageRect(const sk_sp<SkImage>& image, const SkRect& src, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageRect'>drawImageRect</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& image, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_4_src">src</a> of <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageRect_4_image">image</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_4_dst">dst</a>. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_4_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_4_src'>src</a> of <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageRect_4_image'>image</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_4_dst'>dst</a>. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_4_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_4_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageRect_4_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageRect_4_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageRect_4_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_4_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageRect_4_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageRect_4_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageRect_4_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageRect_4_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageRect_4_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageRect_4_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageRect_4_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageRect_4_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageRect_4_image'>image</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawImageRect_4_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawImageRect_4_src">src</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawImageRect_4_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawImageRect_4_src'>src</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageRect_4_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_4_src"> <code><strong>src </strong></code> </a></td> <td> -source <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_4_image">image</a> to draw from</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_4_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_4_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_4_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageRect_4_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_4_src'><code><strong>src</strong></code></a></td> + <td>source <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_4_image'>image</a> to draw from</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_4_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_4_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_4_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_4_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawImageRect_4_src">src</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_4_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawImageRect_4_src'>src</a> or draw faster</td> </tr> </table> ### Example -<div><fiddle-embed name="d4b35a9d24c32c042bd1f529b8de3c0d"><div><a href="#Canvas">Canvas</a> scales and translates; transformation from <a href="#SkCanvas_drawImageRect_4_src">src</a> to <a href="#SkCanvas_drawImageRect_4_dst">dst</a> also scales. +<div><fiddle-embed name="d4b35a9d24c32c042bd1f529b8de3c0d"><div><a href='#Canvas'>Canvas</a> scales and translates; transformation from <a href='#SkCanvas_drawImageRect_4_src'>src</a> to <a href='#SkCanvas_drawImageRect_4_dst'>dst</a> also scales. The two matrices are concatenated to create the final transformation. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawImageRect_5"></a> +<a name='SkCanvas_drawImageRect_5'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageRect(const sk_sp<SkImage>& image, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageRect'>drawImageRect</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& image, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& isrc, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawImageRect_5_isrc">isrc</a> of <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageRect_5_image">image</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_5_dst">dst</a>. -<a href="#SkCanvas_drawImageRect_5_isrc">isrc</a> is on integer pixel boundaries; <a href="#SkCanvas_drawImageRect_5_dst">dst</a> may include fractional boundaries. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_5_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawImageRect_5_isrc'>isrc</a> of <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageRect_5_image'>image</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_5_dst'>dst</a>. +<a href='#SkCanvas_drawImageRect_5_isrc'>isrc</a> is on integer pixel boundaries; <a href='#SkCanvas_drawImageRect_5_dst'>dst</a> may include fractional boundaries. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_5_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_5_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageRect_5_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageRect_5_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageRect_5_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_5_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageRect_5_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageRect_5_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageRect_5_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageRect_5_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageRect_5_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageRect_5_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageRect_5_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageRect_5_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageRect_5_image'>image</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawImageRect_5_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawImageRect_5_image">image</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawImageRect_5_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawImageRect_5_image'>image</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageRect_5_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_5_isrc"> <code><strong>isrc </strong></code> </a></td> <td> -source <a href="SkIRect_Reference#IRect">IRect</a> of <a href="#SkCanvas_drawImageRect_5_image">image</a> to draw from</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_5_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_5_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_5_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageRect_5_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_5_isrc'><code><strong>isrc</strong></code></a></td> + <td>source <a href='SkIRect_Reference#IRect'>IRect</a> of <a href='#SkCanvas_drawImageRect_5_image'>image</a> to draw from</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_5_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_5_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_5_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_5_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawImageRect_5_image">image</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_5_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawImageRect_5_image'>image</a> or draw faster</td> </tr> </table> @@ -4154,43 +5036,46 @@ filter strictly within <a href="#SkCanvas_drawImageRect_5_image">image</a> or dr ### See Also -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawImageRect_6"></a> +<a name='SkCanvas_drawImageRect_6'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageRect(const sk_sp<SkImage>& image, const SkRect& dst, const SkPaint* paint, - SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageRect'>drawImageRect</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& image, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, + <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageRect_6_image">image</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageRect_6_dst">dst</a>, -using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_6_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageRect_6_image'>image</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageRect_6_dst'>dst</a>, +using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_6_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageRect_6_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageRect_6_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageRect_6_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageRect_6_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageRect_6_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageRect_6_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageRect_6_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageRect_6_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageRect_6_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageRect_6_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageRect_6_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageRect_6_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageRect_6_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageRect_6_image'>image</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawImageRect_6_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawImageRect_6_image">image</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawImageRect_6_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawImageRect_6_image'>image</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageRect_6_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_6_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageRect_6_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_6_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageRect_6_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_6_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageRect_6_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_6_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawImageRect_6_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawImageRect_6_image">image</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageRect_6_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawImageRect_6_image'>image</a> or draw faster</td> </tr> </table> @@ -4200,142 +5085,151 @@ filter strictly within <a href="#SkCanvas_drawImageRect_6_image">image</a> or dr ### See Also -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> +<a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> --- -<a name="SkCanvas_drawImageNine"></a> +<a name='SkCanvas_drawImageNine'></a> ## drawImageNine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, - const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageNine'>drawImageNine</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* image, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& center, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageNine_image">image</a> stretched proportionally to fit into <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_dst">dst</a>. -<a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_center">center</a> divides the <a href="#SkCanvas_drawImageNine_image">image</a> into nine sections: four sides, four corners, and -the <a href="#SkCanvas_drawImageNine_center">center</a>. Corners are unmodified or scaled down proportionately if their sides -are larger than <a href="#SkCanvas_drawImageNine_dst">dst</a>; <a href="#SkCanvas_drawImageNine_center">center</a> and four sides are scaled to fit remaining space, if any. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageNine_image'>image</a> stretched proportionally to fit into <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageNine_dst'>dst</a>. +<a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawImageNine_center'>center</a> divides the <a href='#SkCanvas_drawImageNine_image'>image</a> into nine sections: four sides, four corners, and +the <a href='#SkCanvas_drawImageNine_center'>center</a>. Corners are unmodified or scaled down proportionately if their sides +are larger than <a href='#SkCanvas_drawImageNine_dst'>dst</a>; <a href='#SkCanvas_drawImageNine_center'>center</a> and four sides are scaled to fit remaining space, if any. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageNine_paint">paint</a>. - -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageNine_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageNine_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageNine_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageNine_image">image</a> bounds. - -If generated mask extends beyond <a href="#SkCanvas_drawImageNine_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageNine_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageNine_image">image</a> edge color when it samples outside of its bounds. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageNine_paint'>paint</a>. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageNine_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If image is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageNine_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from image bounds. If <a href='#SkCanvas_drawImageNine_paint'>paint</a> +<a href='undocumented#Filter_Quality'>Filter Quality</a> set to <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, disable pixel filtering. For all +other values of <a href='#SkCanvas_drawImageNine_paint'>paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a>, use <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a> to filter pixels. +If generated mask extends beyond <a href='#SkCanvas_drawImageNine_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageNine_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageNine_image'>image</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageNine_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageNine_center"> <code><strong>center </strong></code> </a></td> <td> -<a href="SkIRect_Reference#IRect">IRect</a> edge of <a href="#SkCanvas_drawImageNine_image">image</a> corners and sides</td> - </tr> <tr> <td><a name="SkCanvas_drawImageNine_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageNine_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageNine_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageNine_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageNine_center'><code><strong>center</strong></code></a></td> + <td><a href='SkIRect_Reference#IRect'>IRect</a> edge of <a href='#SkCanvas_drawImageNine_image'>image</a> corners and sides</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageNine_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageNine_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageNine_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> ### Example -<div><fiddle-embed name="4f153cf1d0dbe1a95acf5badeec14dae"><div>The leftmost <a href="#SkCanvas_drawImageNine_image">image</a> is smaller than <a href="#SkCanvas_drawImageNine_center">center</a>; only corners are drawn, all scaled to fit. -The second <a href="#SkCanvas_drawImageNine_image">image</a> equals the size of <a href="#SkCanvas_drawImageNine_center">center</a>; only corners are drawn without scaling. -The remaining images are larger than <a href="#SkCanvas_drawImageNine_center">center</a>. All corners draw without scaling. -The sides and <a href="#SkCanvas_drawImageNine_center">center</a> are scaled if needed to take up the remaining space. +<div><fiddle-embed name="4f153cf1d0dbe1a95acf5badeec14dae"><div>The leftmost <a href='#SkCanvas_drawImageNine_image'>image</a> is smaller than <a href='#SkCanvas_drawImageNine_center'>center</a>; only corners are drawn, all scaled to fit. +The second <a href='#SkCanvas_drawImageNine_image'>image</a> equals the size of <a href='#SkCanvas_drawImageNine_center'>center</a>; only corners are drawn without scaling. +The remaining images are larger than <a href='#SkCanvas_drawImageNine_center'>center</a>. All corners draw without scaling. +The sides and <a href='#SkCanvas_drawImageNine_center'>center</a> are scaled if needed to take up the remaining space. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> +<a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> --- -<a name="SkCanvas_drawImageNine_2"></a> +<a name='SkCanvas_drawImageNine_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageNine(const sk_sp<SkImage>& image, const SkIRect& center, const SkRect& dst, - const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageNine'>drawImageNine</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& image, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& center, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageNine_2_image">image</a> stretched proportionally to fit into <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_2_dst">dst</a>. -<a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_2_center">center</a> divides the <a href="#SkCanvas_drawImageNine_2_image">image</a> into nine sections: four sides, four corners, and -the <a href="#SkCanvas_drawImageNine_2_center">center</a>. Corners are not scaled, or scaled down proportionately if their sides -are larger than <a href="#SkCanvas_drawImageNine_2_dst">dst</a>; <a href="#SkCanvas_drawImageNine_2_center">center</a> and four sides are scaled to fit remaining space, if any. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageNine_2_image'>image</a> stretched proportionally to fit into <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageNine_2_dst'>dst</a>. +<a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawImageNine_2_center'>center</a> divides the <a href='#SkCanvas_drawImageNine_2_image'>image</a> into nine sections: four sides, four corners, and +the <a href='#SkCanvas_drawImageNine_2_center'>center</a>. Corners are not scaled, or scaled down proportionately if their sides +are larger than <a href='#SkCanvas_drawImageNine_2_dst'>dst</a>; <a href='#SkCanvas_drawImageNine_2_center'>center</a> and four sides are scaled to fit remaining space, if any. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageNine_2_paint">paint</a>. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageNine_2_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageNine_2_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawImageNine_2_image">image</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageNine_2_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawImageNine_2_image">image</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageNine_2_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawImageNine_2_image'>image</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageNine_2_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawImageNine_2_image'>image</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawImageNine_2_image">image</a> bounds, replicate <a href="#SkCanvas_drawImageNine_2_image">image</a> edge colors, just -as <a href="undocumented#Shader">Shader</a> made from <a href="SkImage_Reference#SkImage_makeShader">SkImage::makeShader</a> with <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set -replicates the <a href="#SkCanvas_drawImageNine_2_image">image</a> edge color when it samples outside of its bounds. +If generated mask extends beyond <a href='#SkCanvas_drawImageNine_2_image'>image</a> bounds, replicate <a href='#SkCanvas_drawImageNine_2_image'>image</a> edge colors, just +as <a href='undocumented#Shader'>Shader</a> made from <a href='SkImage_Reference#SkImage_makeShader'>SkImage::makeShader</a> with <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set +replicates the <a href='#SkCanvas_drawImageNine_2_image'>image</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageNine_2_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageNine_2_center"> <code><strong>center </strong></code> </a></td> <td> -<a href="SkIRect_Reference#IRect">IRect</a> edge of <a href="#SkCanvas_drawImageNine_2_image">image</a> corners and sides</td> - </tr> <tr> <td><a name="SkCanvas_drawImageNine_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageNine_2_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageNine_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageNine_2_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageNine_2_center'><code><strong>center</strong></code></a></td> + <td><a href='SkIRect_Reference#IRect'>IRect</a> edge of <a href='#SkCanvas_drawImageNine_2_image'>image</a> corners and sides</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageNine_2_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageNine_2_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageNine_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> ### Example -<div><fiddle-embed name="d597d9af8d17fd93e634dd12017058e2"><div>The two leftmost images has four corners and sides to the left and right of <a href="#SkCanvas_drawImageNine_2_center">center</a>. -The leftmost <a href="#SkCanvas_drawImageNine_2_image">image</a> scales the width of corners proportionately to fit. -The third and fourth <a href="#SkCanvas_drawImageNine_2_image">image</a> corners are not scaled; the sides and <a href="#SkCanvas_drawImageNine_2_center">center</a> are scaled to +<div><fiddle-embed name="d597d9af8d17fd93e634dd12017058e2"><div>The two leftmost images has four corners and sides to the left and right of <a href='#SkCanvas_drawImageNine_2_center'>center</a>. +The leftmost <a href='#SkCanvas_drawImageNine_2_image'>image</a> scales the width of corners proportionately to fit. +The third and fourth <a href='#SkCanvas_drawImageNine_2_image'>image</a> corners are not scaled; the sides and <a href='#SkCanvas_drawImageNine_2_center'>center</a> are scaled to fill the remaining space. -The rightmost <a href="#SkCanvas_drawImageNine_2_image">image</a> has four corners scaled vertically to fit, and uses sides above -and below <a href="#SkCanvas_drawImageNine_2_center">center</a> to fill the remaining space. +The rightmost <a href='#SkCanvas_drawImageNine_2_image'>image</a> has four corners scaled vertically to fit, and uses sides above +and below <a href='#SkCanvas_drawImageNine_2_center'>center</a> to fill the remaining space. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> +<a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> --- -<a name="SkCanvas_drawBitmap"></a> +<a name='SkCanvas_drawBitmap'></a> ## drawBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawBitmap'>drawBitmap</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, <a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a>, with its <a href="#SkCanvas_drawBitmap_top">top</a>-<a href="#SkCanvas_drawBitmap_left">left</a> corner at (<a href="#SkCanvas_drawBitmap_left">left</a>, <a href="#SkCanvas_drawBitmap_top">top</a>), -using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmap_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a>, with its <a href='#SkCanvas_drawBitmap_top'>top</a>-<a href='#SkCanvas_drawBitmap_left'>left</a> corner at (<a href='#SkCanvas_drawBitmap_left'>left</a>, <a href='#SkCanvas_drawBitmap_top'>top</a>), +using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmap_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmap_paint">paint</a> is not nullptr, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawBitmap_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmap_paint'>paint</a> is not nullptr, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawBitmap_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a> bounds, replicate <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a> edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a> edge color when it samples +If generated mask extends beyond <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a> bounds, replicate <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a> edge colors, +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawBitmap_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmap_left"> <code><strong>left </strong></code> </a></td> <td> -<a href="#SkCanvas_drawBitmap_left">left</a> side of <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a></td> - </tr> <tr> <td><a name="SkCanvas_drawBitmap_top"> <code><strong>top </strong></code> </a></td> <td> -<a href="#SkCanvas_drawBitmap_top">top</a> side of <a href="#SkCanvas_drawBitmap_bitmap">bitmap</a></td> - </tr> <tr> <td><a name="SkCanvas_drawBitmap_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawBitmap_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkBitmap_Reference#Bitmap'>Bitmap</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmap_left'><code><strong>left</strong></code></a></td> + <td><a href='#SkCanvas_drawBitmap_left'>left</a> side of <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmap_top'><code><strong>top</strong></code></a></td> + <td><a href='#SkCanvas_drawBitmap_top'>top</a> side of <a href='#SkCanvas_drawBitmap_bitmap'>bitmap</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmap_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> @@ -4346,47 +5240,51 @@ and so on; or nullptr</td> ### See Also -<a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> <a href="#SkCanvas_drawBitmapRect">drawBitmapRect</a><sup><a href="#SkCanvas_drawBitmapRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawBitmapRect_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkBitmap_Reference#SkBitmap_writePixels">SkBitmap::writePixels</a><sup><a href="SkBitmap_Reference#SkBitmap_writePixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_writePixels_3">[3]</a></sup> +<a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> <a href='#SkCanvas_drawBitmapRect'>drawBitmapRect</a><sup><a href='#SkCanvas_drawBitmapRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawBitmapRect_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkBitmap_Reference#SkBitmap_writePixels'>SkBitmap::writePixels</a><sup><a href='SkBitmap_Reference#SkBitmap_writePixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_writePixels_3'>[3]</a></sup> --- -<a name="SkCanvas_drawBitmapRect"></a> +<a name='SkCanvas_drawBitmapRect'></a> ## drawBitmapRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawBitmapRect(const SkBitmap& bitmap, const SkRect& src, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawBitmapRect'>drawBitmapRect</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawBitmapRect_src">src</a> of <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapRect_bitmap">bitmap</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawBitmapRect_dst">dst</a>. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawBitmapRect_src'>src</a> of <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkCanvas_drawBitmapRect_bitmap'>bitmap</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawBitmapRect_dst'>dst</a>. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapRect_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawBitmapRect_bitmap">bitmap</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawBitmapRect_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawBitmapRect_bitmap">bitmap</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapRect_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawBitmapRect_bitmap'>bitmap</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawBitmapRect_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawBitmapRect_bitmap'>bitmap</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawBitmapRect_bitmap">bitmap</a> bounds, replicate <a href="#SkCanvas_drawBitmapRect_bitmap">bitmap</a> edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the <a href="#SkCanvas_drawBitmapRect_bitmap">bitmap</a> edge color when it samples +If generated mask extends beyond <a href='#SkCanvas_drawBitmapRect_bitmap'>bitmap</a> bounds, replicate <a href='#SkCanvas_drawBitmapRect_bitmap'>bitmap</a> edge colors, +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the <a href='#SkCanvas_drawBitmapRect_bitmap'>bitmap</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawBitmapRect_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawBitmapRect_src">src</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawBitmapRect_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawBitmapRect_src'>src</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawBitmapRect_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_src"> <code><strong>src </strong></code> </a></td> <td> -source <a href="SkRect_Reference#Rect">Rect</a> of image to draw from</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of image to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawBitmapRect_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkBitmap_Reference#Bitmap'>Bitmap</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_src'><code><strong>src</strong></code></a></td> + <td>source <a href='SkRect_Reference#Rect'>Rect</a> of image to draw from</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of image to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawBitmapRect_src">src</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawBitmapRect_src'>src</a> or draw faster</td> </tr> </table> @@ -4396,47 +5294,51 @@ filter strictly within <a href="#SkCanvas_drawBitmapRect_src">src</a> or draw fa ### See Also -<a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> +<a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> --- -<a name="SkCanvas_drawBitmapRect_2"></a> +<a name='SkCanvas_drawBitmapRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawBitmapRect'>drawBitmapRect</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& isrc, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a> of <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapRect_2_bitmap">bitmap</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawBitmapRect_2_dst">dst</a>. -<a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a> is on integer pixel boundaries; <a href="#SkCanvas_drawBitmapRect_2_dst">dst</a> may include fractional boundaries. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_2_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawBitmapRect_2_isrc'>isrc</a> of <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkCanvas_drawBitmapRect_2_bitmap'>bitmap</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawBitmapRect_2_dst'>dst</a>. +<a href='#SkCanvas_drawBitmapRect_2_isrc'>isrc</a> is on integer pixel boundaries; <a href='#SkCanvas_drawBitmapRect_2_dst'>dst</a> may include fractional boundaries. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapRect_2_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_2_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawBitmapRect_2_bitmap">bitmap</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawBitmapRect_2_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawBitmapRect_2_bitmap">bitmap</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapRect_2_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawBitmapRect_2_bitmap'>bitmap</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawBitmapRect_2_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawBitmapRect_2_bitmap'>bitmap</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawBitmapRect_2_bitmap">bitmap</a> bounds, replicate <a href="#SkCanvas_drawBitmapRect_2_bitmap">bitmap</a> edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the <a href="#SkCanvas_drawBitmapRect_2_bitmap">bitmap</a> edge color when it samples +If generated mask extends beyond <a href='#SkCanvas_drawBitmapRect_2_bitmap'>bitmap</a> bounds, replicate <a href='#SkCanvas_drawBitmapRect_2_bitmap'>bitmap</a> edge colors, +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the <a href='#SkCanvas_drawBitmapRect_2_bitmap'>bitmap</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawBitmapRect_2_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawBitmapRect_2_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawBitmapRect_2_isrc'>isrc</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawBitmapRect_2_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_2_isrc"> <code><strong>isrc </strong></code> </a></td> <td> -source <a href="SkIRect_Reference#IRect">IRect</a> of image to draw from</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of image to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawBitmapRect_2_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkBitmap_Reference#Bitmap'>Bitmap</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_2_isrc'><code><strong>isrc</strong></code></a></td> + <td>source <a href='SkIRect_Reference#IRect'>IRect</a> of image to draw from</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_2_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of image to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_2_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -sample strictly within <a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a>, or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_2_constraint'><code><strong>constraint</strong></code></a></td> + <td>sample strictly within <a href='#SkCanvas_drawBitmapRect_2_isrc'>isrc</a>, or draw faster</td> </tr> </table> @@ -4446,45 +5348,48 @@ sample strictly within <a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a>, or dr ### See Also -<a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> +<a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> --- -<a name="SkCanvas_drawBitmapRect_3"></a> +<a name='SkCanvas_drawBitmapRect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint* paint, - SrcRectConstraint constraint = kStrict_SrcRectConstraint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawBitmapRect'>drawBitmapRect</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, + <a href='#SkCanvas_SrcRectConstraint'>SrcRectConstraint</a> constraint = <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a>) </pre> -<a href="#Draw">Draw</a> <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a>, scaled and translated to fill <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawBitmapRect_3_dst">dst</a>. -<a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> bounds is on integer pixel boundaries; <a href="#SkCanvas_drawBitmapRect_3_dst">dst</a> may include fractional boundaries. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_3_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a>, scaled and translated to fill <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawBitmapRect_3_dst'>dst</a>. +<a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> bounds is on integer pixel boundaries; <a href='#SkCanvas_drawBitmapRect_3_dst'>dst</a> may include fractional boundaries. +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapRect_3_paint'>paint</a>. -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_3_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawBitmapRect_3_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> bounds. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapRect_3_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawBitmapRect_3_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> bounds. -If generated mask extends beyond <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> bounds, replicate <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> edge color when it samples +If generated mask extends beyond <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> bounds, replicate <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> edge colors, +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> edge color when it samples outside of its bounds. -<a href="#SkCanvas_drawBitmapRect_3_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +<a href='#SkCanvas_drawBitmapRect_3_constraint'>constraint</a> set to <a href='#SkCanvas_kStrict_SrcRectConstraint'>kStrict SrcRectConstraint</a> limits <a href='SkPaint_Reference#Paint'>Paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a> to +sample within <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a>; set to <a href='#SkCanvas_kFast_SrcRectConstraint'>kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawBitmapRect_3_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_3_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of image to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawBitmapRect_3_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkBitmap_Reference#Bitmap'>Bitmap</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_3_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of image to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_3_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_3_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> or draw faster</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapRect_3_constraint'><code><strong>constraint</strong></code></a></td> + <td>filter strictly within <a href='#SkCanvas_drawBitmapRect_3_bitmap'>bitmap</a> or draw faster</td> </tr> </table> @@ -4494,82 +5399,72 @@ filter strictly within <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> or ### See Also -<a href="#SkCanvas_drawImageRect">drawImageRect</a><sup><a href="#SkCanvas_drawImageRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawImageRect_3">[3]</a></sup><sup><a href="#SkCanvas_drawImageRect_4">[4]</a></sup><sup><a href="#SkCanvas_drawImageRect_5">[5]</a></sup><sup><a href="#SkCanvas_drawImageRect_6">[6]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> +<a href='#SkCanvas_drawImageRect'>drawImageRect</a><sup><a href='#SkCanvas_drawImageRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawImageRect_3'>[3]</a></sup><sup><a href='#SkCanvas_drawImageRect_4'>[4]</a></sup><sup><a href='#SkCanvas_drawImageRect_5'>[5]</a></sup><sup><a href='#SkCanvas_drawImageRect_6'>[6]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> --- -<a name="SkCanvas_drawBitmapNine"></a> +<a name='SkCanvas_drawBitmapNine'></a> ## drawBitmapNine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, - const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& center, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> stretched proportionally to fit into <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawBitmapNine_dst">dst</a>. -<a href="SkIRect_Reference#IRect">IRect</a> <a href="#SkCanvas_drawBitmapNine_center">center</a> divides the <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> into nine sections: four sides, four corners, -and the <a href="#SkCanvas_drawBitmapNine_center">center</a>. Corners are not scaled, or scaled down proportionately if their -sides are larger than <a href="#SkCanvas_drawBitmapNine_dst">dst</a>; <a href="#SkCanvas_drawBitmapNine_center">center</a> and four sides are scaled to fit remaining +<a href='#Draw'>Draw</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> stretched proportionally to fit into <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawBitmapNine_dst'>dst</a>. +<a href='SkIRect_Reference#IRect'>IRect</a> <a href='#SkCanvas_drawBitmapNine_center'>center</a> divides the <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> into nine sections: four sides, four corners, +and the <a href='#SkCanvas_drawBitmapNine_center'>center</a>. Corners are not scaled, or scaled down proportionately if their +sides are larger than <a href='#SkCanvas_drawBitmapNine_dst'>dst</a>; <a href='#SkCanvas_drawBitmapNine_center'>center</a> and four sides are scaled to fit remaining space, if any. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapNine_paint">paint</a>. - -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapNine_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawBitmapNine_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> bounds. - -If generated mask extends beyond <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> bounds, replicate <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> edge color when it samples +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapNine_paint'>paint</a>. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapNine_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If bitmap is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawBitmapNine_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from bitmap bounds. If <a href='#SkCanvas_drawBitmapNine_paint'>paint</a> +<a href='undocumented#Filter_Quality'>Filter Quality</a> set to <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, disable pixel filtering. For all +other values of <a href='#SkCanvas_drawBitmapNine_paint'>paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a>, use <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a> to filter pixels. +If generated mask extends beyond <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> bounds, replicate <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> edge colors, +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawBitmapNine_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapNine_center"> <code><strong>center </strong></code> </a></td> <td> -<a href="SkIRect_Reference#IRect">IRect</a> edge of image corners and sides</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapNine_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of image to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapNine_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawBitmapNine_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkBitmap_Reference#Bitmap'>Bitmap</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapNine_center'><code><strong>center</strong></code></a></td> + <td><a href='SkIRect_Reference#IRect'>IRect</a> edge of image corners and sides</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapNine_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of image to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapNine_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> ### Example -<div><fiddle-embed name="e99e7be0d8f67dfacbecf85df585433d"><div>The two leftmost <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> draws has four corners and sides to the left and right of <a href="#SkCanvas_drawBitmapNine_center">center</a>. -The leftmost <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> draw scales the width of corners proportionately to fit. -The third and fourth draw corners are not scaled; the sides and <a href="#SkCanvas_drawBitmapNine_center">center</a> are scaled to +<div><fiddle-embed name="e99e7be0d8f67dfacbecf85df585433d"><div>The two leftmost <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> draws has four corners and sides to the left and right of <a href='#SkCanvas_drawBitmapNine_center'>center</a>. +The leftmost <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> draw scales the width of corners proportionately to fit. +The third and fourth draw corners are not scaled; the sides and <a href='#SkCanvas_drawBitmapNine_center'>center</a> are scaled to fill the remaining space. -The rightmost <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> draw has four corners scaled vertically to fit, and uses sides above -and below <a href="#SkCanvas_drawBitmapNine_center">center</a> to fill the remaining space. +The rightmost <a href='#SkCanvas_drawBitmapNine_bitmap'>bitmap</a> draw has four corners scaled vertically to fit, and uses sides above +and below <a href='#SkCanvas_drawBitmapNine_center'>center</a> to fill the remaining space. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> <a href="#SkCanvas_drawBitmapRect">drawBitmapRect</a><sup><a href="#SkCanvas_drawBitmapRect_2">[2]</a></sup><sup><a href="#SkCanvas_drawBitmapRect_3">[3]</a></sup> +<a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a> <a href='#SkCanvas_drawBitmapRect'>drawBitmapRect</a><sup><a href='#SkCanvas_drawBitmapRect_2'>[2]</a></sup><sup><a href='#SkCanvas_drawBitmapRect_3'>[3]</a></sup> --- -# <a name="SkCanvas_Lattice"></a> Struct SkCanvas::Lattice - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - struct <a href="#SkCanvas_Lattice">Lattice</a> { - enum <a href="#SkCanvas_Lattice_RectType">RectType</a> ... - - const int* <a href="#SkCanvas_Lattice_fXDivs">fXDivs</a>; - const int* <a href="#SkCanvas_Lattice_fYDivs">fYDivs</a>; - const <a href="#SkCanvas_Lattice_RectType">RectType</a>* <a href="#SkCanvas_Lattice_fRectTypes">fRectTypes</a>; - int <a href="#SkCanvas_Lattice_fXCount">fXCount</a>; - int <a href="#SkCanvas_Lattice_fYCount">fYCount</a>; - const <a href="SkIRect_Reference#SkIRect">SkIRect</a>* <a href="#SkCanvas_Lattice_fBounds">fBounds</a>; - const <a href="SkColor_Reference#SkColor">SkColor</a>* <a href="#SkCanvas_Lattice_fColors">fColors</a>; - }; -</pre> +## <a name='Draw_Image_Lattice'>Draw Image Lattice</a> -<a href="#SkCanvas_Lattice">Lattice</a> divides <a href="SkBitmap_Reference#Bitmap">Bitmap</a> or <a href="SkImage_Reference#Image">Image</a> into a rectangular grid. +# <a name='SkCanvas_Lattice'>Struct SkCanvas::Lattice</a> +<a href='#SkCanvas_Lattice'>Lattice</a> divides <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> or <a href='SkImage_Reference#Image'>Image</a> 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 @@ -4577,13 +5472,52 @@ 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. -## <a name="SkCanvas_Lattice_RectType"></a> Enum SkCanvas::Lattice::RectType +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> + struct <a href='#SkCanvas_Lattice'>Lattice</a> { + enum <a href='#SkCanvas_Lattice_RectType'>RectType</a> ... + + const int* <a href='#SkCanvas_Lattice_fXDivs'>fXDivs</a>; + const int* <a href='#SkCanvas_Lattice_fYDivs'>fYDivs</a>; + const <a href='#SkCanvas_Lattice_RectType'>RectType</a>* <a href='#SkCanvas_Lattice_fRectTypes'>fRectTypes</a>; + int <a href='#SkCanvas_Lattice_fXCount'>fXCount</a>; + int <a href='#SkCanvas_Lattice_fYCount'>fYCount</a>; + const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>* <a href='#SkCanvas_Lattice_fBounds'>fBounds</a>; + const <a href='SkColor_Reference#SkColor'>SkColor</a>* <a href='#SkCanvas_Lattice_fColors'>fColors</a>; + }; +</pre> + +## <a name='Draw_Image_Lattice_Overview'>Draw Image Lattice Overview</a> + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw_Image_Lattice_Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw_Image_Lattice_Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> +</table> + + +## <a name='Draw_Image_Lattice_Constant'>Draw Image Lattice Constant</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> + + +## <a name='SkCanvas_Lattice_RectType'>Enum SkCanvas::Lattice::RectType</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkCanvas_Lattice_RectType">RectType</a> : uint8_t { - <a href="#SkCanvas_Lattice_kDefault">kDefault</a> = 0, - <a href="#SkCanvas_Lattice_kTransparent">kTransparent</a>, - <a href="#SkCanvas_Lattice_kFixedColor">kFixedColor</a>, + enum <a href='#SkCanvas_Lattice_RectType'>RectType</a> : uint8_t { + <a href='#SkCanvas_Lattice_kDefault'>kDefault</a> = 0, + <a href='#SkCanvas_Lattice_kTransparent'>kTransparent</a>, + <a href='#SkCanvas_Lattice_kFixedColor'>kFixedColor</a>, }; </pre> @@ -4592,283 +5526,381 @@ or to fill the grid entry with a color. ### Constants -<table> - <tr> - <td><a name="SkCanvas_Lattice_kDefault"> <code><strong>SkCanvas::Lattice::kDefault </strong></code> </a></td><td>0</td><td>Draws <a href="SkBitmap_Reference#Bitmap">Bitmap</a> into lattice rectangle. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_kDefault'><code>SkCanvas::Lattice::kDefault</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +draws Bitmap into lattice rectangle</td> </tr> <tr> - <td><a name="SkCanvas_Lattice_kTransparent"> <code><strong>SkCanvas::Lattice::kTransparent </strong></code> </a></td><td>1</td><td>Skips lattice rectangle by making it transparent. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_kTransparent'><code>SkCanvas::Lattice::kTransparent</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +skips lattice rectangle by making it transparent</td> </tr> - <tr> - <td><a name="SkCanvas_Lattice_kFixedColor"> <code><strong>SkCanvas::Lattice::kFixedColor </strong></code> </a></td><td>2</td><td>Draws one of <a href="#SkCanvas_Lattice_fColors">fColors</a> into lattice rectangle. -</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_kFixedColor'><code>SkCanvas::Lattice::kFixedColor</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +draws one of fColors into lattice rectangle</td> </tr> +</table> +## <a name='Draw_Image_Lattice_Member'>Draw Image Lattice Member</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> -<a name="SkCanvas_Lattice_fXDivs"> <code><strong>const int* fXDivs</strong></code> </a> +### Members +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const int*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fXDivs'><code>fXDivs</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Array of x-coordinates that divide the bitmap vertically. Array entries must be unique, increasing, greater than or equal to -<a href="#SkCanvas_Lattice_fBounds">fBounds</a> left edge, and less than <a href="#SkCanvas_Lattice_fBounds">fBounds</a> right edge. -Set the first element to <a href="#SkCanvas_Lattice_fBounds">fBounds</a> left to collapse the left column of +<a href='#SkCanvas_Lattice_fBounds'>fBounds</a> left edge, and less than <a href='#SkCanvas_Lattice_fBounds'>fBounds</a> right edge. +Set the first element to <a href='#SkCanvas_Lattice_fBounds'>fBounds</a> left to collapse the left column of fixed grid entries. - -<a name="SkCanvas_Lattice_fYDivs"> <code><strong>const int* fYDivs</strong></code> </a> - +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const int*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fYDivs'><code>fYDivs</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Array of y-coordinates that divide the bitmap horizontally. Array entries must be unique, increasing, greater than or equal to -<a href="#SkCanvas_Lattice_fBounds">fBounds</a> top edge, and less than <a href="#SkCanvas_Lattice_fBounds">fBounds</a> bottom edge. -Set the first element to <a href="#SkCanvas_Lattice_fBounds">fBounds</a> top to collapse the top row of fixed +<a href='#SkCanvas_Lattice_fBounds'>fBounds</a> top edge, and less than <a href='#SkCanvas_Lattice_fBounds'>fBounds</a> bottom edge. +Set the first element to <a href='#SkCanvas_Lattice_fBounds'>fBounds</a> top to collapse the top row of fixed grid entries. - -<a name="SkCanvas_Lattice_fRectTypes"> <code><strong>const RectType* fRectTypes</strong></code> </a> - +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const RectType*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fRectTypes'><code>fRectTypes</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Optional array of fill types, one per rectangular grid entry: -array length must be( <a href="#SkCanvas_Lattice_fXCount">fXCount</a> + 1) * (<a href="#SkCanvas_Lattice_fYCount">fYCount</a> + 1) +array length must be( <a href='#SkCanvas_Lattice_fXCount'>fXCount</a> + 1) * (<a href='#SkCanvas_Lattice_fYCount'>fYCount</a> + 1) . -Each <a href="#SkCanvas_Lattice_RectType">RectType</a> is one of: <a href="#SkCanvas_Lattice_kDefault">kDefault</a>, <a href="#SkCanvas_Lattice_kTransparent">kTransparent</a>, <a href="#SkCanvas_Lattice_kFixedColor">kFixedColor</a>. +Each <a href='#SkCanvas_Lattice_RectType'>RectType</a> is one of: <a href='#SkCanvas_Lattice_kDefault'>kDefault</a>, <a href='#SkCanvas_Lattice_kTransparent'>kTransparent</a>, <a href='#SkCanvas_Lattice_kFixedColor'>kFixedColor</a>. Array entries correspond to the rectangular grid entries, ascending left to right and then top to bottom. - -<a name="SkCanvas_Lattice_fXCount"> <code><strong>int fXCount</strong></code> </a> - -Number of entries in <a href="#SkCanvas_Lattice_fXDivs">fXDivs</a> array; one less than the number of +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fXCount'><code>fXCount</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Number of entries in <a href='#SkCanvas_Lattice_fXDivs'>fXDivs</a> array; one less than the number of horizontal divisions. - -<a name="SkCanvas_Lattice_fYCount"> <code><strong>int fYCount</strong></code> </a> - -Number of entries in <a href="#SkCanvas_Lattice_fYDivs">fYDivs</a> array; one less than the number of vertical +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fYCount'><code>fYCount</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Number of entries in <a href='#SkCanvas_Lattice_fYDivs'>fYDivs</a> array; one less than the number of vertical divisions. - -<a name="SkCanvas_Lattice_fBounds"> <code><strong>const SkIRect* fBounds</strong></code> </a> - -Optional subset <a href="SkIRect_Reference#IRect">IRect</a> source to draw from. -If nullptr, source bounds is dimensions of <a href="SkBitmap_Reference#Bitmap">Bitmap</a> or <a href="SkImage_Reference#Image">Image</a>. - -<a name="SkCanvas_Lattice_fColors"> <code><strong>const SkColor* fColors</strong></code> </a> - +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkIRect*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fBounds'><code>fBounds</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Optional subset <a href='SkIRect_Reference#IRect'>IRect</a> source to draw from. +If nullptr, source bounds is dimensions of <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> or <a href='SkImage_Reference#Image'>Image</a>. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>const SkColor*</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkCanvas_Lattice_fColors'><code>fColors</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Optional array of colors, one per rectangular grid entry. -Array length must be( <a href="#SkCanvas_Lattice_fXCount">fXCount</a> + 1) * (<a href="#SkCanvas_Lattice_fYCount">fYCount</a> + 1) +Array length must be( <a href='#SkCanvas_Lattice_fXCount'>fXCount</a> + 1) * (<a href='#SkCanvas_Lattice_fYCount'>fYCount</a> + 1) . Array entries correspond to the rectangular grid entries, ascending left to right, then top to bottom. +</td> + </tr> +</table> -<a name="SkCanvas_drawBitmapLattice"></a> +<a name='SkCanvas_drawBitmapLattice'></a> ## drawBitmapLattice -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst, - const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap, const <a href='#SkCanvas_Lattice'>Lattice</a>& lattice, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> stretched proportionally to fit into <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawBitmapLattice_dst">dst</a>. +<a href='#Draw'>Draw</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> stretched proportionally to fit into <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawBitmapLattice_dst'>dst</a>. -<a href="#SkCanvas_Lattice">Lattice</a> <a href="#SkCanvas_drawBitmapLattice_lattice">lattice</a> divides <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> into a rectangular grid. +<a href='#SkCanvas_Lattice'>Lattice</a> <a href='#SkCanvas_drawBitmapLattice_lattice'>lattice</a> divides <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> into a rectangular grid. Each intersection of an even-numbered row and column is fixed; like the corners -of <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a>, fixed <a href="#SkCanvas_drawBitmapLattice_lattice">lattice</a> elements never scale larger than their initial -size and shrink proportionately when all fixed elements exceed the <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> +of <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a>, fixed <a href='#SkCanvas_drawBitmapLattice_lattice'>lattice</a> elements never scale larger than their initial +size and shrink proportionately when all fixed elements exceed the <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> dimension. All other grid elements scale to fill the available space, if any. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapLattice_paint">paint</a>. - -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapLattice_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawBitmapLattice_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> bounds. - -If generated mask extends beyond <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> bounds, replicate <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> edge color when it samples +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapLattice_paint'>paint</a>. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawBitmapLattice_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If bitmap is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawBitmapLattice_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from bitmap bounds. If <a href='#SkCanvas_drawBitmapLattice_paint'>paint</a> +<a href='undocumented#Filter_Quality'>Filter Quality</a> set to <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, disable pixel filtering. For all +other values of <a href='#SkCanvas_drawBitmapLattice_paint'>paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a>, use <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a> to filter pixels. +If generated mask extends beyond <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> bounds, replicate <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> edge colors, +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawBitmapLattice_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapLattice_lattice"> <code><strong>lattice </strong></code> </a></td> <td> -division of <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> into fixed and variable rectangles</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapLattice_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of image to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawBitmapLattice_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawBitmapLattice_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkBitmap_Reference#Bitmap'>Bitmap</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapLattice_lattice'><code><strong>lattice</strong></code></a></td> + <td>division of <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> into fixed and variable rectangles</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapLattice_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of image to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawBitmapLattice_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> ### Example -<div><fiddle-embed name="c5bfa944e17ba4a4400dc799f032069c"><div>The two leftmost <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> draws has four corners and sides to the left and right of center. -The leftmost <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> draw scales the width of corners proportionately to fit. +<div><fiddle-embed name="c5bfa944e17ba4a4400dc799f032069c"><div>The two leftmost <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> draws has four corners and sides to the left and right of center. +The leftmost <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> draw scales the width of corners proportionately to fit. The third and fourth draw corners are not scaled; the sides are scaled to fill the remaining space; the center is transparent. -The rightmost <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> draw has four corners scaled vertically to fit, and uses sides above +The rightmost <a href='#SkCanvas_drawBitmapLattice_bitmap'>bitmap</a> draw has four corners scaled vertically to fit, and uses sides above and below center to fill the remaining space. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawImageLattice">drawImageLattice</a> <a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> <a href="#SkCanvas_Lattice">Lattice</a> +<a href='#SkCanvas_drawImageLattice'>drawImageLattice</a> <a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a> <a href='#SkCanvas_Lattice'>Lattice</a> --- -<a name="SkCanvas_drawImageLattice"></a> +<a name='SkCanvas_drawImageLattice'></a> ## drawImageLattice -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst, - const SkPaint* paint = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawImageLattice'>drawImageLattice</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* image, const <a href='#SkCanvas_Lattice'>Lattice</a>& lattice, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="SkImage_Reference#Image">Image</a> <a href="#SkCanvas_drawImageLattice_image">image</a> stretched proportionally to fit into <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawImageLattice_dst">dst</a>. +<a href='#Draw'>Draw</a> <a href='SkImage_Reference#Image'>Image</a> <a href='#SkCanvas_drawImageLattice_image'>image</a> stretched proportionally to fit into <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawImageLattice_dst'>dst</a>. -<a href="#SkCanvas_Lattice">Lattice</a> <a href="#SkCanvas_drawImageLattice_lattice">lattice</a> divides <a href="#SkCanvas_drawImageLattice_image">image</a> into a rectangular grid. +<a href='#SkCanvas_Lattice'>Lattice</a> <a href='#SkCanvas_drawImageLattice_lattice'>lattice</a> divides <a href='#SkCanvas_drawImageLattice_image'>image</a> into a rectangular grid. Each intersection of an even-numbered row and column is fixed; like the corners -of <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a>, fixed <a href="#SkCanvas_drawImageLattice_lattice">lattice</a> elements never scale larger than their initial +of <a href='#SkCanvas_drawBitmapNine'>drawBitmapNine</a>, fixed <a href='#SkCanvas_drawImageLattice_lattice'>lattice</a> elements never scale larger than their initial size and shrink proportionately when all fixed elements exceed the bitmap dimension. All other grid elements scale to fill the available space, if any. -Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageLattice_paint">paint</a>. - -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageLattice_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. If bitmap is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, apply <a href="undocumented#Shader">Shader</a>. -If <a href="#SkCanvas_drawImageLattice_paint">paint</a> contains <a href="undocumented#Mask_Filter">Mask Filter</a>, generate mask from bitmap bounds. - +Additionally transform draw using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageLattice_paint'>paint</a>. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawImageLattice_paint'>paint</a> is supplied, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. If image is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, apply <a href='undocumented#Shader'>Shader</a>. +If <a href='#SkCanvas_drawImageLattice_paint'>paint</a> contains <a href='undocumented#Mask_Filter'>Mask Filter</a>, generate mask from image bounds. If <a href='#SkCanvas_drawImageLattice_paint'>paint</a> +<a href='undocumented#Filter_Quality'>Filter Quality</a> set to <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, disable pixel filtering. For all +other values of <a href='#SkCanvas_drawImageLattice_paint'>paint</a> <a href='undocumented#Filter_Quality'>Filter Quality</a>, use <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a> to filter pixels. If generated mask extends beyond bitmap bounds, replicate bitmap edge colors, -just as <a href="undocumented#Shader">Shader</a> made from <a href="undocumented#SkShader_MakeBitmapShader">SkShader::MakeBitmapShader</a> with -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> set replicates the bitmap edge color when it samples +just as <a href='undocumented#Shader'>Shader</a> made from <a href='undocumented#SkShader_MakeBitmapShader'>SkShader::MakeBitmapShader</a> with +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> set replicates the bitmap edge color when it samples outside of its bounds. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawImageLattice_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing pixels, dimensions, and format</td> - </tr> <tr> <td><a name="SkCanvas_drawImageLattice_lattice"> <code><strong>lattice </strong></code> </a></td> <td> -division of bitmap into fixed and variable rectangles</td> - </tr> <tr> <td><a name="SkCanvas_drawImageLattice_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkRect_Reference#Rect">Rect</a> of <a href="#SkCanvas_drawImageLattice_image">image</a> to draw to</td> - </tr> <tr> <td><a name="SkCanvas_drawImageLattice_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkCanvas_drawImageLattice_image'><code><strong>image</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing pixels, dimensions, and format</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageLattice_lattice'><code><strong>lattice</strong></code></a></td> + <td>division of bitmap into fixed and variable rectangles</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageLattice_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkRect_Reference#Rect'>Rect</a> of <a href='#SkCanvas_drawImageLattice_image'>image</a> to draw to</td> + </tr> + <tr> <td><a name='SkCanvas_drawImageLattice_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> ### Example -<div><fiddle-embed name="4f153cf1d0dbe1a95acf5badeec14dae"><div>The leftmost <a href="#SkCanvas_drawImageLattice_image">image</a> is smaller than center; only corners are drawn, all scaled to fit. -The second <a href="#SkCanvas_drawImageLattice_image">image</a> equals the size of center; only corners are drawn without scaling. +<div><fiddle-embed name="4f153cf1d0dbe1a95acf5badeec14dae"><div>The leftmost <a href='#SkCanvas_drawImageLattice_image'>image</a> is smaller than center; only corners are drawn, all scaled to fit. +The second <a href='#SkCanvas_drawImageLattice_image'>image</a> equals the size of center; only corners are drawn without scaling. The remaining images are larger than center. All corners draw without scaling. The sides are scaled if needed to take up the remaining space; the center is transparent. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkCanvas_drawImageNine">drawImageNine</a><sup><a href="#SkCanvas_drawImageNine_2">[2]</a></sup> <a href="#SkCanvas_Lattice">Lattice</a> +<a href='#SkCanvas_drawBitmapLattice'>drawBitmapLattice</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkCanvas_drawImageNine'>drawImageNine</a><sup><a href='#SkCanvas_drawImageNine_2'>[2]</a></sup> <a href='#SkCanvas_Lattice'>Lattice</a> --- -## <a name="Draw_Text"></a> Draw Text +## <a name='Draw_Text'>Draw Text</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPosText'>drawPosText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text at array of (x, y) positions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawPosTextH'>drawPosTextH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text at x positions with common baseline</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawString'>drawString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws null terminated string at (x, y) using font advance</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawString'>drawString(const char* string, SkScalar x, SkScalar y, const SkPaint& paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawString_2'>drawString(const SkString& string, SkScalar x, SkScalar y, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawText'>drawText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text at (x, y), using font advance</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextBlob'>drawTextBlob</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text with arrays of positions and <a href='SkPaint_Reference#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextBlob'>drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextBlob_2'>drawTextBlob(const sk sp<SkTextBlob>& blob, SkScalar x, SkScalar y, const SkPaint& paint)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text following <a href='SkPath_Reference#Path'>Path</a> contour</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextOnPathHV'>drawTextOnPathHV</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text following <a href='SkPath_Reference#Path'>Path</a> with offsets</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws text with array of <a href='undocumented#RSXform'>RSXform</a></td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkCanvas_drawPosText">drawPosText</a> | draws text at array of (x, y) positions | -| <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> | draws text at x positions with common baseline | -| <a href="#SkCanvas_drawString">drawString</a> | draws null terminated string at (x, y) using font advance | -| | <a href="#SkCanvas_drawString">drawString(const char* string, SkScalar x, SkScalar y, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawString_2">drawString(const SkString& string, SkScalar x, SkScalar y, const SkPaint& paint)</a> | -| <a href="#SkCanvas_drawText">drawText</a> | draws text at (x, y), using font advance | -| <a href="#SkCanvas_drawTextBlob">drawTextBlob</a> | draws text with arrays of positions and <a href="SkPaint_Reference#Paint">Paint</a> | -| | <a href="#SkCanvas_drawTextBlob">drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint)</a> | -| | <a href="#SkCanvas_drawTextBlob_2">drawTextBlob(const sk sp<SkTextBlob>& blob, SkScalar x, SkScalar y, const SkPaint& paint)</a> | -| <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> | draws text following <a href="SkPath_Reference#Path">Path</a> contour | -| <a href="#SkCanvas_drawTextOnPathHV">drawTextOnPathHV</a> | draws text following <a href="SkPath_Reference#Path">Path</a> with offsets | -| <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> | draws text with array of <a href="undocumented#RSXform">RSXform</a> | -<a name="SkCanvas_drawText"></a> +<a name='SkCanvas_drawText'></a> ## drawText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawText'>drawText</a>(const void* text, size_t byteLength, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="#SkCanvas_drawText_text">text</a>, with origin at (<a href="#SkCanvas_drawText_x">x</a>, <a href="#SkCanvas_drawText_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawText_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='#SkCanvas_drawText_text'>text</a>, with origin at (<a href='#SkCanvas_drawText_x'>x</a>, <a href='#SkCanvas_drawText_y'>y</a>), using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawText_paint'>paint</a>. -<a href="#SkCanvas_drawText_text">text</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawText_text">text</a> is encoded as +<a href='#SkCanvas_drawText_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawText_text'>text</a> is encoded as UTF-8. -<a href="#SkCanvas_drawText_x">x</a> and <a href="#SkCanvas_drawText_y">y</a> meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; by default -<a href="#SkCanvas_drawText_text">text</a> draws left to right, positioning the first glyph left side bearing at <a href="#SkCanvas_drawText_x">x</a> -and its baseline at <a href="#SkCanvas_drawText_y">y</a>. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +<a href='#SkCanvas_drawText_x'>x</a> and <a href='#SkCanvas_drawText_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default +<a href='#SkCanvas_drawText_text'>text</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawText_x'>x</a> +and its baseline at <a href='#SkCanvas_drawText_y'>y</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawText_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawText_text">text</a>. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawText_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawText_text'>text</a>. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawText_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn</td> - </tr> <tr> <td><a name="SkCanvas_drawText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -byte length of <a href="#SkCanvas_drawText_text">text</a> array</td> - </tr> <tr> <td><a name="SkCanvas_drawText_x"> <code><strong>x </strong></code> </a></td> <td> -start of <a href="#SkCanvas_drawText_text">text</a> on <a href="#SkCanvas_drawText_x">x</a>-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawText_y"> <code><strong>y </strong></code> </a></td> <td> -start of <a href="#SkCanvas_drawText_text">text</a> on <a href="#SkCanvas_drawText_y">y</a>-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawText_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="#SkCanvas_drawText_text">text</a> size, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawText_text'><code><strong>text</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn</td> + </tr> + <tr> <td><a name='SkCanvas_drawText_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>byte length of <a href='#SkCanvas_drawText_text'>text</a> array</td> + </tr> + <tr> <td><a name='SkCanvas_drawText_x'><code><strong>x</strong></code></a></td> + <td>start of <a href='#SkCanvas_drawText_text'>text</a> on <a href='#SkCanvas_drawText_x'>x</a>-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawText_y'><code><strong>y</strong></code></a></td> + <td>start of <a href='#SkCanvas_drawText_text'>text</a> on <a href='#SkCanvas_drawText_y'>y</a>-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawText_paint'><code><strong>paint</strong></code></a></td> + <td><a href='#SkCanvas_drawText_text'>text</a> size, blend, color, and so on, used to draw</td> </tr> </table> ### Example -<div><fiddle-embed name="55f5e59350622c5e2834d1c85789f732"><div>The same <a href="#SkCanvas_drawText_text">text</a> is drawn varying <a href="SkPaint_Reference#Text_Size">Paint Text Size</a> and varying -<a href="#Matrix">Matrix</a>. +<div><fiddle-embed name="55f5e59350622c5e2834d1c85789f732"><div>The same <a href='#SkCanvas_drawText_text'>text</a> is drawn varying <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a> and varying +<a href='#Matrix'>Matrix</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawString">drawString</a><sup><a href="#SkCanvas_drawString_2">[2]</a></sup> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawString'>drawString</a><sup><a href='#SkCanvas_drawString_2'>[2]</a></sup> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawString"></a> +<a name='SkCanvas_drawString'></a> ## drawString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawString(const char* string, SkScalar x, SkScalar y, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawString'>drawString</a>(const char* string, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> null terminated <a href="#SkCanvas_drawString_string">string</a>, with origin at (<a href="#SkCanvas_drawString_x">x</a>, <a href="#SkCanvas_drawString_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and -<a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawString_paint">paint</a>. Note that this per-glyph xform does not affect the shader (if present) -on the <a href="#SkCanvas_drawString_paint">paint</a>, just the glyph's geometry. +Draws null terminated <a href='#SkCanvas_drawString_string'>string</a>, with origin at (<a href='#SkCanvas_drawString_x'>x</a>, <a href='#SkCanvas_drawString_y'>y</a>), using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and +<a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawString_paint'>paint</a>. -<a href="#SkCanvas_drawString_string">string</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, strings are encoded -as UTF-8. Other values of <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a> are unlikely to produce the desired -results, since zero bytes may be embedded in the <a href="#SkCanvas_drawString_string">string</a>. +<a href='#SkCanvas_drawString_string'>string</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, strings are encoded +as UTF-8. Other values of <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> are unlikely to produce the desired +results, since zero bytes may be embedded in the <a href='#SkCanvas_drawString_string'>string</a>. -<a href="#SkCanvas_drawString_x">x</a> and <a href="#SkCanvas_drawString_y">y</a> meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; by default -<a href="#SkCanvas_drawString_string">string</a> draws left to right, positioning the first glyph left side bearing at <a href="#SkCanvas_drawString_x">x</a> -and its baseline at <a href="#SkCanvas_drawString_y">y</a>. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +<a href='#SkCanvas_drawString_x'>x</a> and <a href='#SkCanvas_drawString_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default +<a href='#SkCanvas_drawString_string'>string</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawString_x'>x</a> +and its baseline at <a href='#SkCanvas_drawString_y'>y</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawString_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to text. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawString_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to text. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawString_string"> <code><strong>string </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn, +<table> <tr> <td><a name='SkCanvas_drawString_string'><code><strong>string</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn, ending with a char value of zero</td> - </tr> <tr> <td><a name="SkCanvas_drawString_x"> <code><strong>x </strong></code> </a></td> <td> -start of <a href="#SkCanvas_drawString_string">string</a> on <a href="#SkCanvas_drawString_x">x</a>-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawString_y"> <code><strong>y </strong></code> </a></td> <td> -start of <a href="#SkCanvas_drawString_string">string</a> on <a href="#SkCanvas_drawString_y">y</a>-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawString_paint"> <code><strong>paint </strong></code> </a></td> <td> -text size, blend, color, and so on, used to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawString_x'><code><strong>x</strong></code></a></td> + <td>start of <a href='#SkCanvas_drawString_string'>string</a> on <a href='#SkCanvas_drawString_x'>x</a>-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawString_y'><code><strong>y</strong></code></a></td> + <td>start of <a href='#SkCanvas_drawString_string'>string</a> on <a href='#SkCanvas_drawString_y'>y</a>-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawString_paint'><code><strong>paint</strong></code></a></td> + <td>text size, blend, color, and so on, used to draw</td> </tr> </table> @@ -4878,42 +5910,45 @@ text size, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawString_2"></a> +<a name='SkCanvas_drawString_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawString(const SkString& string, SkScalar x, SkScalar y, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawString'>drawString</a>(const <a href='undocumented#SkString'>SkString</a>& string, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> null terminated <a href="#SkCanvas_drawString_2_string">string</a>, with origin at (<a href="#SkCanvas_drawString_2_x">x</a>, <a href="#SkCanvas_drawString_2_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and -<a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawString_2_paint">paint</a>. +<a href='#Draw'>Draw</a> null terminated <a href='#SkCanvas_drawString_2_string'>string</a>, with origin at (<a href='#SkCanvas_drawString_2_x'>x</a>, <a href='#SkCanvas_drawString_2_y'>y</a>), using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and +<a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawString_2_paint'>paint</a>. -<a href="#SkCanvas_drawString_2_string">string</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, strings are encoded -as UTF-8. Other values of <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a> are unlikely to produce the desired -results, since zero bytes may be embedded in the <a href="#SkCanvas_drawString_2_string">string</a>. +<a href='#SkCanvas_drawString_2_string'>string</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, strings are encoded +as UTF-8. Other values of <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> are unlikely to produce the desired +results, since zero bytes may be embedded in the <a href='#SkCanvas_drawString_2_string'>string</a>. -<a href="#SkCanvas_drawString_2_x">x</a> and <a href="#SkCanvas_drawString_2_y">y</a> meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; by default -<a href="#SkCanvas_drawString_2_string">string</a> draws left to right, positioning the first glyph left side bearing at <a href="#SkCanvas_drawString_2_x">x</a> -and its baseline at <a href="#SkCanvas_drawString_2_y">y</a>. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +<a href='#SkCanvas_drawString_2_x'>x</a> and <a href='#SkCanvas_drawString_2_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default +<a href='#SkCanvas_drawString_2_string'>string</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawString_2_x'>x</a> +and its baseline at <a href='#SkCanvas_drawString_2_y'>y</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawString_2_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to text. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawString_2_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to text. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawString_2_string"> <code><strong>string </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn, +<table> <tr> <td><a name='SkCanvas_drawString_2_string'><code><strong>string</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn, ending with a char value of zero</td> - </tr> <tr> <td><a name="SkCanvas_drawString_2_x"> <code><strong>x </strong></code> </a></td> <td> -start of <a href="#SkCanvas_drawString_2_string">string</a> on <a href="#SkCanvas_drawString_2_x">x</a>-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawString_2_y"> <code><strong>y </strong></code> </a></td> <td> -start of <a href="#SkCanvas_drawString_2_string">string</a> on <a href="#SkCanvas_drawString_2_y">y</a>-axis</td> - </tr> <tr> <td><a name="SkCanvas_drawString_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -text size, blend, color, and so on, used to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawString_2_x'><code><strong>x</strong></code></a></td> + <td>start of <a href='#SkCanvas_drawString_2_string'>string</a> on <a href='#SkCanvas_drawString_2_x'>x</a>-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawString_2_y'><code><strong>y</strong></code></a></td> + <td>start of <a href='#SkCanvas_drawString_2_string'>string</a> on <a href='#SkCanvas_drawString_2_y'>y</a>-axis</td> + </tr> + <tr> <td><a name='SkCanvas_drawString_2_paint'><code><strong>paint</strong></code></a></td> + <td>text size, blend, color, and so on, used to draw</td> </tr> </table> @@ -4923,44 +5958,47 @@ text size, blend, color, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawPosText"></a> +<a name='SkCanvas_drawPosText'></a> ## drawPosText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPosText'>drawPosText</a>(const void* text, size_t byteLength, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pos[], const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> each glyph in <a href="#SkCanvas_drawPosText_text">text</a> with the origin in <a href="#SkCanvas_drawPosText_pos">pos</a> array, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and -<a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPosText_paint">paint</a>. The number of entries in <a href="#SkCanvas_drawPosText_pos">pos</a> array must match the number of <a href="undocumented#Glyph">Glyphs</a> -described by <a href="#SkCanvas_drawPosText_byteLength">byteLength</a> of <a href="#SkCanvas_drawPosText_text">text</a>. +<a href='#Draw'>Draw</a> each glyph in <a href='#SkCanvas_drawPosText_text'>text</a> with the origin in <a href='#SkCanvas_drawPosText_pos'>pos</a> array, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and +<a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPosText_paint'>paint</a>. The number of entries in <a href='#SkCanvas_drawPosText_pos'>pos</a> array must match the number of <a href='undocumented#Glyph'>Glyphs</a> +described by <a href='#SkCanvas_drawPosText_byteLength'>byteLength</a> of <a href='#SkCanvas_drawPosText_text'>text</a>. -<a href="#SkCanvas_drawPosText_text">text</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawPosText_text">text</a> is encoded as -UTF-8. <a href="#SkCanvas_drawPosText_pos">pos</a> elements' meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; +<a href='#SkCanvas_drawPosText_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawPosText_text'>text</a> is encoded as +UTF-8. <a href='#SkCanvas_drawPosText_pos'>pos</a> elements' meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default each glyph left side bearing is positioned at x and its -baseline is positioned at y. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and -<a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +baseline is positioned at y. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and +<a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawPosText_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawPosText_text">text</a>. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawPosText_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawPosText_text'>text</a>. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. Layout engines such as Harfbuzz typically position each glyph rather than using the font advance widths. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPosText_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn</td> - </tr> <tr> <td><a name="SkCanvas_drawPosText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -byte length of <a href="#SkCanvas_drawPosText_text">text</a> array</td> - </tr> <tr> <td><a name="SkCanvas_drawPosText_pos"> <code><strong>pos </strong></code> </a></td> <td> -array of glyph origins</td> - </tr> <tr> <td><a name="SkCanvas_drawPosText_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="#SkCanvas_drawPosText_text">text</a> size, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawPosText_text'><code><strong>text</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosText_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>byte length of <a href='#SkCanvas_drawPosText_text'>text</a> array</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosText_pos'><code><strong>pos</strong></code></a></td> + <td>array of glyph origins</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosText_paint'><code><strong>paint</strong></code></a></td> + <td><a href='#SkCanvas_drawPosText_text'>text</a> size, blend, color, and so on, used to draw</td> </tr> </table> @@ -4970,48 +6008,52 @@ array of glyph origins</td> ### See Also -<a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawPosTextH"></a> +<a name='SkCanvas_drawPosTextH'></a> ## drawPosTextH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, - const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a>(const void* text, size_t byteLength, const <a href='undocumented#SkScalar'>SkScalar</a> xpos[], <a href='undocumented#SkScalar'>SkScalar</a> constY, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> each glyph in <a href="#SkCanvas_drawPosTextH_text">text</a> with its (x, y) origin composed from <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> array and -<a href="#SkCanvas_drawPosTextH_constY">constY</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPosTextH_paint">paint</a>. The number of entries in <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> array -must match the number of <a href="undocumented#Glyph">Glyphs</a> described by <a href="#SkCanvas_drawPosTextH_byteLength">byteLength</a> of <a href="#SkCanvas_drawPosTextH_text">text</a>. +<a href='#Draw'>Draw</a> each glyph in <a href='#SkCanvas_drawPosTextH_text'>text</a> with its (x, y) origin composed from <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> array and +<a href='#SkCanvas_drawPosTextH_constY'>constY</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPosTextH_paint'>paint</a>. The number of entries in <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> array +must match the number of <a href='undocumented#Glyph'>Glyphs</a> described by <a href='#SkCanvas_drawPosTextH_byteLength'>byteLength</a> of <a href='#SkCanvas_drawPosTextH_text'>text</a>. -<a href="#SkCanvas_drawPosTextH_text">text</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawPosTextH_text">text</a> is encoded as -UTF-8. <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> elements' meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; -by default each glyph left side bearing is positioned at an <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> element and -its baseline is positioned at <a href="#SkCanvas_drawPosTextH_constY">constY</a>. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and -<a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +<a href='#SkCanvas_drawPosTextH_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawPosTextH_text'>text</a> is encoded as +UTF-8. <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> elements' meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; +by default each glyph left side bearing is positioned at an <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> element and +its baseline is positioned at <a href='#SkCanvas_drawPosTextH_constY'>constY</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and +<a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawPosTextH_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawPosTextH_text">text</a>. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawPosTextH_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawPosTextH_text'>text</a>. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. Layout engines such as Harfbuzz typically position each glyph -rather than using the font advance widths if all <a href="undocumented#Glyph">Glyphs</a> share the same +rather than using the font advance widths if all <a href='undocumented#Glyph'>Glyphs</a> share the same baseline. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPosTextH_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn</td> - </tr> <tr> <td><a name="SkCanvas_drawPosTextH_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -byte length of <a href="#SkCanvas_drawPosTextH_text">text</a> array</td> - </tr> <tr> <td><a name="SkCanvas_drawPosTextH_xpos"> <code><strong>xpos </strong></code> </a></td> <td> -array of x positions, used to position each glyph</td> - </tr> <tr> <td><a name="SkCanvas_drawPosTextH_constY"> <code><strong>constY </strong></code> </a></td> <td> -shared y coordinate for all of x positions</td> - </tr> <tr> <td><a name="SkCanvas_drawPosTextH_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="#SkCanvas_drawPosTextH_text">text</a> size, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawPosTextH_text'><code><strong>text</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosTextH_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>byte length of <a href='#SkCanvas_drawPosTextH_text'>text</a> array</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosTextH_xpos'><code><strong>xpos</strong></code></a></td> + <td>array of x positions, used to position each glyph</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosTextH_constY'><code><strong>constY</strong></code></a></td> + <td>shared y coordinate for all of x positions</td> + </tr> + <tr> <td><a name='SkCanvas_drawPosTextH_paint'><code><strong>paint</strong></code></a></td> + <td><a href='#SkCanvas_drawPosTextH_text'>text</a> size, blend, color, and so on, used to draw</td> </tr> </table> @@ -5021,49 +6063,54 @@ shared y coordinate for all of x positions</td> ### See Also -<a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawTextOnPathHV"></a> +<a name='SkCanvas_drawTextOnPathHV'></a> ## drawTextOnPathHV -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawTextOnPathHV(const void* text, size_t byteLength, const SkPath& path, SkScalar hOffset, - SkScalar vOffset, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawTextOnPathHV'>drawTextOnPathHV</a>(const void* text, size_t byteLength, const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, <a href='undocumented#SkScalar'>SkScalar</a> hOffset, + <a href='undocumented#SkScalar'>SkScalar</a> vOffset, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="#SkCanvas_drawTextOnPathHV_text">text</a> on <a href="SkPath_Reference#Path">Path</a> <a href="#SkCanvas_drawTextOnPathHV_path">path</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextOnPathHV_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> on <a href='SkPath_Reference#Path'>Path</a> <a href='#SkCanvas_drawTextOnPathHV_path'>path</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawTextOnPathHV_paint'>paint</a>. -Origin of <a href="#SkCanvas_drawTextOnPathHV_text">text</a> is at distance <a href="#SkCanvas_drawTextOnPathHV_hOffset">hOffset</a> along the <a href="#SkCanvas_drawTextOnPathHV_path">path</a>, offset by a perpendicular -vector of length <a href="#SkCanvas_drawTextOnPathHV_vOffset">vOffset</a>. If the <a href="#SkCanvas_drawTextOnPathHV_path">path</a> section corresponding the glyph advance is +Origin of <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> is at distance <a href='#SkCanvas_drawTextOnPathHV_hOffset'>hOffset</a> along the <a href='#SkCanvas_drawTextOnPathHV_path'>path</a>, offset by a perpendicular +vector of length <a href='#SkCanvas_drawTextOnPathHV_vOffset'>vOffset</a>. If the <a href='#SkCanvas_drawTextOnPathHV_path'>path</a> 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 <a href="#SkCanvas_drawTextOnPathHV_path">path</a>. If the <a href="#SkCanvas_drawTextOnPathHV_text">text</a> advance is larger -than the <a href="#SkCanvas_drawTextOnPathHV_path">path</a> length, the excess <a href="#SkCanvas_drawTextOnPathHV_text">text</a> is clipped. +mapped to projected points parallel to the <a href='#SkCanvas_drawTextOnPathHV_path'>path</a>. If the <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> advance is larger +than the <a href='#SkCanvas_drawTextOnPathHV_path'>path</a> length, the excess <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> is clipped. -<a href="#SkCanvas_drawTextOnPathHV_text">text</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawTextOnPathHV_text">text</a> is encoded as -UTF-8. Origin meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; by -default <a href="#SkCanvas_drawTextOnPathHV_text">text</a> positions the first glyph left side bearing at origin x and its -baseline at origin y. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +<a href='#SkCanvas_drawTextOnPathHV_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> is encoded as +UTF-8. Origin meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by +default <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> positions the first glyph left side bearing at origin x and its +baseline at origin y. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawTextOnPathHV_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextOnPathHV_text">text</a>. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawTextOnPathHV_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawTextOnPathHV_text'>text</a>. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawTextOnPathHV_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -byte length of <a href="#SkCanvas_drawTextOnPathHV_text">text</a> array</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> providing <a href="#SkCanvas_drawTextOnPathHV_text">text</a> baseline</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_hOffset"> <code><strong>hOffset </strong></code> </a></td> <td> -distance along <a href="#SkCanvas_drawTextOnPathHV_path">path</a> to offset origin</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_vOffset"> <code><strong>vOffset </strong></code> </a></td> <td> -offset of <a href="#SkCanvas_drawTextOnPathHV_text">text</a> above (if negative) or below (if positive) the <a href="#SkCanvas_drawTextOnPathHV_path">path</a></td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="#SkCanvas_drawTextOnPathHV_text">text</a> size, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawTextOnPathHV_text'><code><strong>text</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPathHV_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>byte length of <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> array</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPathHV_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> providing <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> baseline</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPathHV_hOffset'><code><strong>hOffset</strong></code></a></td> + <td>distance along <a href='#SkCanvas_drawTextOnPathHV_path'>path</a> to offset origin</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPathHV_vOffset'><code><strong>vOffset</strong></code></a></td> + <td>offset of <a href='#SkCanvas_drawTextOnPathHV_text'>text</a> above (if negative) or below (if positive) the <a href='#SkCanvas_drawTextOnPathHV_path'>path</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPathHV_paint'><code><strong>paint</strong></code></a></td> + <td><a href='#SkCanvas_drawTextOnPathHV_text'>text</a> size, blend, color, and so on, used to draw</td> </tr> </table> @@ -5073,48 +6120,54 @@ offset of <a href="#SkCanvas_drawTextOnPathHV_text">text</a> above (if negative) ### See Also -<a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawTextOnPath"></a> +<a name='SkCanvas_drawTextOnPath'></a> ## drawTextOnPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawTextOnPath(const void* text, size_t byteLength, const SkPath& path, const SkMatrix* matrix, - const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a>(const void* text, size_t byteLength, const <a href='SkPath_Reference#SkPath'>SkPath</a>& path, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* matrix, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="#SkCanvas_drawTextOnPath_text">text</a> on <a href="SkPath_Reference#Path">Path</a> <a href="#SkCanvas_drawTextOnPath_path">path</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextOnPath_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='#SkCanvas_drawTextOnPath_text'>text</a> on <a href='SkPath_Reference#Path'>Path</a> <a href='#SkCanvas_drawTextOnPath_path'>path</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawTextOnPath_paint'>paint</a>. -Origin of <a href="#SkCanvas_drawTextOnPath_text">text</a> is at beginning of <a href="#SkCanvas_drawTextOnPath_path">path</a> offset by <a href="#SkCanvas_drawTextOnPath_matrix">matrix</a>, if provided, before it -is mapped to <a href="#SkCanvas_drawTextOnPath_path">path</a>. If the <a href="#SkCanvas_drawTextOnPath_path">path</a> 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 <a href="#SkCanvas_drawTextOnPath_path">path</a>. If the <a href="#SkCanvas_drawTextOnPath_text">text</a> advance is larger -than the <a href="#SkCanvas_drawTextOnPath_path">path</a> length, the excess <a href="#SkCanvas_drawTextOnPath_text">text</a> is clipped. +Origin of <a href='#SkCanvas_drawTextOnPath_text'>text</a> is at beginning of <a href='#SkCanvas_drawTextOnPath_path'>path</a> offset by <a href='#SkCanvas_drawTextOnPath_matrix'>matrix</a>, if not nullptr. +<a href='#SkCanvas_drawTextOnPath_matrix'>matrix</a> also transforms <a href='#SkCanvas_drawTextOnPath_text'>text</a> before <a href='#SkCanvas_drawTextOnPath_text'>text</a> is mapped to <a href='#SkCanvas_drawTextOnPath_path'>path</a>. If the <a href='#SkCanvas_drawTextOnPath_path'>path</a> 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 <a href='#SkCanvas_drawTextOnPath_path'>path</a>. +If the <a href='#SkCanvas_drawTextOnPath_text'>text</a> advance is larger than the <a href='#SkCanvas_drawTextOnPath_path'>path</a> length, the excess <a href='#SkCanvas_drawTextOnPath_text'>text</a> is clipped. -<a href="#SkCanvas_drawTextOnPath_text">text</a> meaning depends on <a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawTextOnPath_text">text</a> is encoded as -UTF-8. Origin meaning depends on <a href="SkPaint_Reference#Text_Align">Paint Text Align</a> and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>; by -default <a href="#SkCanvas_drawTextOnPath_text">text</a> positions the first glyph left side bearing at origin x and its -baseline at origin y. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>. +<a href='#SkCanvas_drawTextOnPath_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawTextOnPath_text'>text</a> is encoded as +UTF-8. Origin meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by +default <a href='#SkCanvas_drawTextOnPath_text'>text</a> positions the first glyph left side bearing at origin x and its +baseline at origin y. <a href='undocumented#Text'>Text</a> size is affected by <a href='#SkCanvas_drawTextOnPath_matrix'>matrix</a> parameter, <a href='#Matrix'>Canvas Matrix</a>, +and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>. -All elements of <a href="#SkCanvas_drawTextOnPath_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextOnPath_text">text</a>. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawTextOnPath_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawTextOnPath_text'>text</a>. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. <a href='#Canvas'>Canvas</a> <a href='#Matrix'>Matrix</a> does effect <a href='#SkCanvas_drawTextOnPath_paint'>paint</a> <a href='undocumented#Shader'>Shader</a>, but +<a href='#SkCanvas_drawTextOnPath_matrix'>matrix</a> parameter does not. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawTextOnPath_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -byte length of <a href="#SkCanvas_drawTextOnPath_text">text</a> array</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> providing <a href="#SkCanvas_drawTextOnPath_text">text</a> baseline</td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -transform of <a href="undocumented#Glyph">Glyphs</a> before mapping to <a href="#SkCanvas_drawTextOnPath_path">path</a>; may be nullptr -to use identity <a href="#Matrix">Matrix</a></td> - </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="#SkCanvas_drawTextOnPath_text">text</a> size, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawTextOnPath_text'><code><strong>text</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPath_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>byte length of <a href='#SkCanvas_drawTextOnPath_text'>text</a> array</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPath_path'><code><strong>path</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> providing <a href='#SkCanvas_drawTextOnPath_text'>text</a> baseline</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPath_matrix'><code><strong>matrix</strong></code></a></td> + <td>transform of <a href='undocumented#Glyph'>Glyphs</a> before mapping to <a href='#SkCanvas_drawTextOnPath_path'>path</a>; may be nullptr +to use identity <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawTextOnPath_paint'><code><strong>paint</strong></code></a></td> + <td><a href='#SkCanvas_drawTextOnPath_text'>text</a> size, blend, color, and so on, used to draw</td> </tr> </table> @@ -5124,43 +6177,47 @@ to use identity <a href="#Matrix">Matrix</a></td> ### See Also -<a href="#SkCanvas_drawTextOnPathHV">drawTextOnPathHV</a> <a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> <a href="#SkCanvas_drawTextRSXform">drawTextRSXform</a> +<a href='#SkCanvas_drawTextOnPathHV'>drawTextOnPathHV</a> <a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a> --- -<a name="SkCanvas_drawTextRSXform"></a> +<a name='SkCanvas_drawTextRSXform'></a> ## drawTextRSXform -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[], - const SkRect* cullRect, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawTextRSXform'>drawTextRSXform</a>(const void* text, size_t byteLength, const <a href='undocumented#SkRSXform'>SkRSXform</a> xform[], + const <a href='SkRect_Reference#SkRect'>SkRect</a>* cullRect, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="#SkCanvas_drawTextRSXform_text">text</a>, transforming each glyph by the corresponding <a href="undocumented#SkRSXform">SkRSXform</a>, -using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextRSXform_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='#SkCanvas_drawTextRSXform_text'>text</a>, transforming each glyph by the corresponding <a href='undocumented#SkRSXform'>SkRSXform</a>, +using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawTextRSXform_paint'>paint</a>. -<a href="undocumented#RSXform">RSXform</a> array specifies a separate square scale, rotation, and translation for +<a href='undocumented#RSXform'>RSXform</a> array specifies a separate square scale, rotation, and translation for each glyph. -Optional <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawTextRSXform_cullRect">cullRect</a> is a conservative bounds of <a href="#SkCanvas_drawTextRSXform_text">text</a>, taking into account -<a href="undocumented#RSXform">RSXform</a> and <a href="#SkCanvas_drawTextRSXform_paint">paint</a>. If <a href="#SkCanvas_drawTextRSXform_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +Optional <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawTextRSXform_cullRect'>cullRect</a> is a conservative bounds of <a href='#SkCanvas_drawTextRSXform_text'>text</a>, taking into account +<a href='undocumented#RSXform'>RSXform</a> and <a href='#SkCanvas_drawTextRSXform_paint'>paint</a>. If <a href='#SkCanvas_drawTextRSXform_cullRect'>cullRect</a> is outside of <a href='#Clip'>Clip</a>, canvas can skip drawing. -All elements of <a href="#SkCanvas_drawTextRSXform_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextRSXform_text">text</a>. By default, draws -filled 12 point black <a href="undocumented#Glyph">Glyphs</a>. +All elements of <a href='#SkCanvas_drawTextRSXform_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawTextRSXform_text'>text</a>. By default, draws +filled 12 point black <a href='undocumented#Glyph'>Glyphs</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawTextRSXform_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or <a href="undocumented#Glyph">Glyphs</a> drawn</td> - </tr> <tr> <td><a name="SkCanvas_drawTextRSXform_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -byte length of <a href="#SkCanvas_drawTextRSXform_text">text</a> array</td> - </tr> <tr> <td><a name="SkCanvas_drawTextRSXform_xform"> <code><strong>xform </strong></code> </a></td> <td> -<a href="undocumented#RSXform">RSXform</a> rotates, scales, and translates each glyph individually</td> - </tr> <tr> <td><a name="SkCanvas_drawTextRSXform_cullRect"> <code><strong>cullRect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> bounds of <a href="#SkCanvas_drawTextRSXform_text">text</a> for efficient clipping; or nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawTextRSXform_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="#SkCanvas_drawTextRSXform_text">text</a> size, blend, color, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawTextRSXform_text'><code><strong>text</strong></code></a></td> + <td>character code points or <a href='undocumented#Glyph'>Glyphs</a> drawn</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextRSXform_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>byte length of <a href='#SkCanvas_drawTextRSXform_text'>text</a> array</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextRSXform_xform'><code><strong>xform</strong></code></a></td> + <td><a href='undocumented#RSXform'>RSXform</a> rotates, scales, and translates each glyph individually</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextRSXform_cullRect'><code><strong>cullRect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds of <a href='#SkCanvas_drawTextRSXform_text'>text</a> for efficient clipping; or nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextRSXform_paint'><code><strong>paint</strong></code></a></td> + <td><a href='#SkCanvas_drawTextRSXform_text'>text</a> size, blend, color, and so on, used to draw</td> </tr> </table> @@ -5170,40 +6227,43 @@ byte length of <a href="#SkCanvas_drawTextRSXform_text">text</a> array</td> ### See Also -<a href="#SkCanvas_drawTextOnPath">drawTextOnPath</a> <a href="#SkCanvas_drawTextOnPathHV">drawTextOnPathHV</a> <a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawTextBlob">drawTextBlob</a><sup><a href="#SkCanvas_drawTextBlob_2">[2]</a></sup> +<a href='#SkCanvas_drawTextOnPath'>drawTextOnPath</a> <a href='#SkCanvas_drawTextOnPathHV'>drawTextOnPathHV</a> <a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a><sup><a href='#SkCanvas_drawTextBlob_2'>[2]</a></sup> --- -<a name="SkCanvas_drawTextBlob"></a> +<a name='SkCanvas_drawTextBlob'></a> ## drawTextBlob -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a>(const <a href='undocumented#SkTextBlob'>SkTextBlob</a>* blob, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Text_Blob">Text Blob</a> <a href="#SkCanvas_drawTextBlob_blob">blob</a> at (<a href="#SkCanvas_drawTextBlob_x">x</a>, <a href="#SkCanvas_drawTextBlob_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextBlob_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Text_Blob'>Text Blob</a> <a href='#SkCanvas_drawTextBlob_blob'>blob</a> at (<a href='#SkCanvas_drawTextBlob_x'>x</a>, <a href='#SkCanvas_drawTextBlob_y'>y</a>), using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawTextBlob_paint'>paint</a>. -<a href="#SkCanvas_drawTextBlob_blob">blob</a> contains <a href="undocumented#Glyph">Glyphs</a>, their positions, and <a href="#SkCanvas_drawTextBlob_paint">paint</a> attributes specific to text: -<a href="undocumented#Typeface">Typeface</a>, <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>, <a href="SkPaint_Reference#Text_Scale_X">Paint Text Scale X</a>, <a href="SkPaint_Reference#Text_Skew_X">Paint Text Skew X</a>, -<a href="SkPaint_Reference#Text_Align">Paint Text Align</a>, <a href="SkPaint_Reference#Hinting">Paint Hinting</a>, Anti-alias, <a href="SkPaint_Reference#Fake_Bold">Paint Fake Bold</a>, -<a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a>, <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a>, <a href="SkPaint_Reference#LCD_Text">LCD Text</a>, <a href="SkPaint_Reference#Linear_Text">Linear Text</a>, -<a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a>, and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>. +<a href='#SkCanvas_drawTextBlob_blob'>blob</a> contains <a href='undocumented#Glyph'>Glyphs</a>, their positions, and <a href='#SkCanvas_drawTextBlob_paint'>paint</a> attributes specific to text: +<a href='undocumented#Typeface'>Typeface</a>, <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>, <a href='SkPaint_Reference#Text_Scale_X'>Paint Text Scale X</a>, <a href='SkPaint_Reference#Text_Skew_X'>Paint Text Skew X</a>, +<a href='SkPaint_Reference#Text_Align'>Paint Text Align</a>, <a href='SkPaint_Reference#Hinting'>Paint Hinting</a>, Anti-alias, <a href='SkPaint_Reference#Fake_Bold'>Paint Fake Bold</a>, +<a href='SkPaint_Reference#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a>, <a href='SkPaint_Reference#Full_Hinting_Spacing'>Full Hinting Spacing</a>, <a href='SkPaint_Reference#LCD_Text'>LCD Text</a>, <a href='SkPaint_Reference#Linear_Text'>Linear Text</a>, +<a href='SkPaint_Reference#Subpixel_Text'>Subpixel Text</a>, and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>. -<a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a> must be set to <a href="SkPaint_Reference#SkPaint_kGlyphID_TextEncoding">SkPaint::kGlyphID TextEncoding</a>. +<a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> must be set to <a href='SkPaint_Reference#SkPaint_kGlyphID_TextEncoding'>SkPaint::kGlyphID TextEncoding</a>. -Elements of <a href="#SkCanvas_drawTextBlob_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextBlob_blob">blob</a>. +Elements of <a href='#SkCanvas_drawTextBlob_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawTextBlob_blob'>blob</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawTextBlob_blob"> <code><strong>blob </strong></code> </a></td> <td> -<a href="undocumented#Glyph">Glyphs</a>, positions, and their paints' text size, typeface, and so on</td> - </tr> <tr> <td><a name="SkCanvas_drawTextBlob_x"> <code><strong>x </strong></code> </a></td> <td> -horizontal offset applied to <a href="#SkCanvas_drawTextBlob_blob">blob</a></td> - </tr> <tr> <td><a name="SkCanvas_drawTextBlob_y"> <code><strong>y </strong></code> </a></td> <td> -vertical offset applied to <a href="#SkCanvas_drawTextBlob_blob">blob</a></td> - </tr> <tr> <td><a name="SkCanvas_drawTextBlob_paint"> <code><strong>paint </strong></code> </a></td> <td> -blend, color, stroking, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawTextBlob_blob'><code><strong>blob</strong></code></a></td> + <td><a href='undocumented#Glyph'>Glyphs</a>, positions, and their paints' text size, typeface, and so on</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextBlob_x'><code><strong>x</strong></code></a></td> + <td>horizontal offset applied to <a href='#SkCanvas_drawTextBlob_blob'>blob</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawTextBlob_y'><code><strong>y</strong></code></a></td> + <td>vertical offset applied to <a href='#SkCanvas_drawTextBlob_blob'>blob</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawTextBlob_paint'><code><strong>paint</strong></code></a></td> + <td>blend, color, stroking, and so on, used to draw</td> </tr> </table> @@ -5213,71 +6273,74 @@ blend, color, stroking, and so on, used to draw</td> ### See Also -<a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> +<a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> --- -<a name="SkCanvas_drawTextBlob_2"></a> +<a name='SkCanvas_drawTextBlob_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawTextBlob(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkTextBlob'>SkTextBlob</a>>& blob, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Text_Blob">Text Blob</a> <a href="#SkCanvas_drawTextBlob_2_blob">blob</a> at (<a href="#SkCanvas_drawTextBlob_2_x">x</a>, <a href="#SkCanvas_drawTextBlob_2_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextBlob_2_paint">paint</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Text_Blob'>Text Blob</a> <a href='#SkCanvas_drawTextBlob_2_blob'>blob</a> at (<a href='#SkCanvas_drawTextBlob_2_x'>x</a>, <a href='#SkCanvas_drawTextBlob_2_y'>y</a>), using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawTextBlob_2_paint'>paint</a>. -<a href="#SkCanvas_drawTextBlob_2_blob">blob</a> contains <a href="undocumented#Glyph">Glyphs</a>, their positions, and <a href="#SkCanvas_drawTextBlob_2_paint">paint</a> attributes specific to text: -<a href="undocumented#Typeface">Typeface</a>, <a href="SkPaint_Reference#Text_Size">Paint Text Size</a>, <a href="SkPaint_Reference#Text_Scale_X">Paint Text Scale X</a>, <a href="SkPaint_Reference#Text_Skew_X">Paint Text Skew X</a>, -<a href="SkPaint_Reference#Text_Align">Paint Text Align</a>, <a href="SkPaint_Reference#Hinting">Paint Hinting</a>, Anti-alias, <a href="SkPaint_Reference#Fake_Bold">Paint Fake Bold</a>, -<a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a>, <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a>, <a href="SkPaint_Reference#LCD_Text">LCD Text</a>, <a href="SkPaint_Reference#Linear_Text">Linear Text</a>, -<a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a>, and <a href="SkPaint_Reference#Vertical_Text">Paint Vertical Text</a>. +<a href='#SkCanvas_drawTextBlob_2_blob'>blob</a> contains <a href='undocumented#Glyph'>Glyphs</a>, their positions, and <a href='#SkCanvas_drawTextBlob_2_paint'>paint</a> attributes specific to text: +<a href='undocumented#Typeface'>Typeface</a>, <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>, <a href='SkPaint_Reference#Text_Scale_X'>Paint Text Scale X</a>, <a href='SkPaint_Reference#Text_Skew_X'>Paint Text Skew X</a>, +<a href='SkPaint_Reference#Text_Align'>Paint Text Align</a>, <a href='SkPaint_Reference#Hinting'>Paint Hinting</a>, Anti-alias, <a href='SkPaint_Reference#Fake_Bold'>Paint Fake Bold</a>, +<a href='SkPaint_Reference#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a>, <a href='SkPaint_Reference#Full_Hinting_Spacing'>Full Hinting Spacing</a>, <a href='SkPaint_Reference#LCD_Text'>LCD Text</a>, <a href='SkPaint_Reference#Linear_Text'>Linear Text</a>, +<a href='SkPaint_Reference#Subpixel_Text'>Subpixel Text</a>, and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>. -<a href="SkPaint_Reference#Text_Encoding">Paint Text Encoding</a> must be set to <a href="SkPaint_Reference#SkPaint_kGlyphID_TextEncoding">SkPaint::kGlyphID TextEncoding</a>. +<a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> must be set to <a href='SkPaint_Reference#SkPaint_kGlyphID_TextEncoding'>SkPaint::kGlyphID TextEncoding</a>. -Elements of <a href="#SkCanvas_drawTextBlob_2_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextBlob_2_blob">blob</a>. +Elements of <a href='#SkCanvas_drawTextBlob_2_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>; apply to <a href='#SkCanvas_drawTextBlob_2_blob'>blob</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawTextBlob_2_blob"> <code><strong>blob </strong></code> </a></td> <td> -<a href="undocumented#Glyph">Glyphs</a>, positions, and their paints' text size, typeface, and so on</td> - </tr> <tr> <td><a name="SkCanvas_drawTextBlob_2_x"> <code><strong>x </strong></code> </a></td> <td> -horizontal offset applied to <a href="#SkCanvas_drawTextBlob_2_blob">blob</a></td> - </tr> <tr> <td><a name="SkCanvas_drawTextBlob_2_y"> <code><strong>y </strong></code> </a></td> <td> -vertical offset applied to <a href="#SkCanvas_drawTextBlob_2_blob">blob</a></td> - </tr> <tr> <td><a name="SkCanvas_drawTextBlob_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -blend, color, stroking, and so on, used to draw</td> +<table> <tr> <td><a name='SkCanvas_drawTextBlob_2_blob'><code><strong>blob</strong></code></a></td> + <td><a href='undocumented#Glyph'>Glyphs</a>, positions, and their paints' text size, typeface, and so on</td> + </tr> + <tr> <td><a name='SkCanvas_drawTextBlob_2_x'><code><strong>x</strong></code></a></td> + <td>horizontal offset applied to <a href='#SkCanvas_drawTextBlob_2_blob'>blob</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawTextBlob_2_y'><code><strong>y</strong></code></a></td> + <td>vertical offset applied to <a href='#SkCanvas_drawTextBlob_2_blob'>blob</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawTextBlob_2_paint'><code><strong>paint</strong></code></a></td> + <td>blend, color, stroking, and so on, used to draw</td> </tr> </table> ### Example -<div><fiddle-embed name="af4c69fbbd165c8b0eb0c9bd49ccbd8d"><div><a href="SkPaint_Reference#Paint">Paint</a> attributes unrelated to text, like color, have no effect on <a href="#SkCanvas_drawTextBlob_2_paint">paint</a> in allocated <a href="undocumented#Text_Blob">Text Blob</a>. -<a href="SkPaint_Reference#Paint">Paint</a> attributes related to text, like text size, have no effect on <a href="#SkCanvas_drawTextBlob_2_paint">paint</a> passed to <a href="#SkCanvas_drawTextBlob">drawTextBlob</a>. +<div><fiddle-embed name="af4c69fbbd165c8b0eb0c9bd49ccbd8d"><div><a href='SkPaint_Reference#Paint'>Paint</a> attributes unrelated to text, like color, have no effect on <a href='#SkCanvas_drawTextBlob_2_paint'>paint</a> in allocated <a href='undocumented#Text_Blob'>Text Blob</a>. +<a href='SkPaint_Reference#Paint'>Paint</a> attributes related to text, like text size, have no effect on <a href='#SkCanvas_drawTextBlob_2_paint'>paint</a> passed to <a href='#SkCanvas_drawTextBlob'>drawTextBlob</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkCanvas_drawText">drawText</a> <a href="#SkCanvas_drawPosText">drawPosText</a> <a href="#SkCanvas_drawPosTextH">drawPosTextH</a> +<a href='#SkCanvas_drawText'>drawText</a> <a href='#SkCanvas_drawPosText'>drawPosText</a> <a href='#SkCanvas_drawPosTextH'>drawPosTextH</a> --- -<a name="SkCanvas_drawPicture"></a> +<a name='SkCanvas_drawPicture'></a> ## drawPicture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPicture(const SkPicture* picture) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPicture'>drawPicture</a>(const <a href='undocumented#SkPicture'>SkPicture</a>* picture) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Picture">Picture</a> <a href="#SkCanvas_drawPicture_picture">picture</a>, using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>. -<a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> are unchanged by <a href="#SkCanvas_drawPicture_picture">picture</a> contents, as if -<a href="#SkCanvas_save">save</a> was called before and <a href="#SkCanvas_restore">restore</a> was called after <a href="#SkCanvas_drawPicture">drawPicture</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Picture'>Picture</a> <a href='#SkCanvas_drawPicture_picture'>picture</a>, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>. +<a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> are unchanged by <a href='#SkCanvas_drawPicture_picture'>picture</a> contents, as if +<a href='#SkCanvas_save'>save</a> was called before and <a href='#SkCanvas_restore'>restore</a> was called after <a href='#SkCanvas_drawPicture'>drawPicture</a>. -<a href="undocumented#Picture">Picture</a> records a series of draw commands for later playback. +<a href='undocumented#Picture'>Picture</a> records a series of draw commands for later playback. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPicture_picture"> <code><strong>picture </strong></code> </a></td> <td> -recorded drawing commands to play</td> +<table> <tr> <td><a name='SkCanvas_drawPicture_picture'><code><strong>picture</strong></code></a></td> + <td>recorded drawing commands to play</td> </tr> </table> @@ -5287,26 +6350,26 @@ recorded drawing commands to play</td> ### See Also -<a href="#SkCanvas_drawDrawable">drawDrawable</a><sup><a href="#SkCanvas_drawDrawable_2">[2]</a></sup> <a href="undocumented#SkPicture">SkPicture</a> <a href="undocumented#SkPicture_playback">SkPicture::playback</a> +<a href='#SkCanvas_drawDrawable'>drawDrawable</a><sup><a href='#SkCanvas_drawDrawable_2'>[2]</a></sup> <a href='undocumented#SkPicture'>SkPicture</a> <a href='undocumented#SkPicture_playback'>SkPicture::playback</a> --- -<a name="SkCanvas_drawPicture_2"></a> +<a name='SkCanvas_drawPicture_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPicture(const sk_sp<SkPicture>& picture) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPicture'>drawPicture</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkPicture'>SkPicture</a>>& picture) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Picture">Picture</a> <a href="#SkCanvas_drawPicture_2_picture">picture</a>, using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>. -<a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> are unchanged by <a href="#SkCanvas_drawPicture_2_picture">picture</a> contents, as if -<a href="#SkCanvas_save">save</a> was called before and <a href="#SkCanvas_restore">restore</a> was called after <a href="#SkCanvas_drawPicture">drawPicture</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Picture'>Picture</a> <a href='#SkCanvas_drawPicture_2_picture'>picture</a>, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>. +<a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a> are unchanged by <a href='#SkCanvas_drawPicture_2_picture'>picture</a> contents, as if +<a href='#SkCanvas_save'>save</a> was called before and <a href='#SkCanvas_restore'>restore</a> was called after <a href='#SkCanvas_drawPicture'>drawPicture</a>. -<a href="undocumented#Picture">Picture</a> records a series of draw commands for later playback. +<a href='undocumented#Picture'>Picture</a> records a series of draw commands for later playback. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPicture_2_picture"> <code><strong>picture </strong></code> </a></td> <td> -recorded drawing commands to play</td> +<table> <tr> <td><a name='SkCanvas_drawPicture_2_picture'><code><strong>picture</strong></code></a></td> + <td>recorded drawing commands to play</td> </tr> </table> @@ -5316,31 +6379,33 @@ recorded drawing commands to play</td> ### See Also -<a href="#SkCanvas_drawDrawable">drawDrawable</a><sup><a href="#SkCanvas_drawDrawable_2">[2]</a></sup> <a href="undocumented#SkPicture">SkPicture</a> <a href="undocumented#SkPicture_playback">SkPicture::playback</a> +<a href='#SkCanvas_drawDrawable'>drawDrawable</a><sup><a href='#SkCanvas_drawDrawable_2'>[2]</a></sup> <a href='undocumented#SkPicture'>SkPicture</a> <a href='undocumented#SkPicture_playback'>SkPicture::playback</a> --- -<a name="SkCanvas_drawPicture_3"></a> +<a name='SkCanvas_drawPicture_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPicture'>drawPicture</a>(const <a href='undocumented#SkPicture'>SkPicture</a>* picture, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* matrix, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Picture">Picture</a> <a href="#SkCanvas_drawPicture_3_picture">picture</a>, using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>; transforming <a href="#SkCanvas_drawPicture_3_picture">picture</a> with -<a href="#Matrix">Matrix</a> <a href="#SkCanvas_drawPicture_3_matrix">matrix</a>, if provided; and use <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPicture_3_paint">paint</a> <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a>, if provided. +<a href='#Draw'>Draw</a> <a href='undocumented#Picture'>Picture</a> <a href='#SkCanvas_drawPicture_3_picture'>picture</a>, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>; transforming <a href='#SkCanvas_drawPicture_3_picture'>picture</a> with +<a href='#Matrix'>Matrix</a> <a href='#SkCanvas_drawPicture_3_matrix'>matrix</a>, if provided; and use <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPicture_3_paint'>paint</a> <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a>, if provided. -<a href="#SkCanvas_drawPicture_3_matrix">matrix</a> transformation is equivalent to: <a href="#SkCanvas_save">save</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_drawPicture">drawPicture</a>, <a href="#SkCanvas_restore">restore</a>. -<a href="#SkCanvas_drawPicture_3_paint">paint</a> use is equivalent to: <a href="#SkCanvas_saveLayer">saveLayer</a>, <a href="#SkCanvas_drawPicture">drawPicture</a>, <a href="#SkCanvas_restore">restore</a>. +<a href='#SkCanvas_drawPicture_3_matrix'>matrix</a> transformation is equivalent to: <a href='#SkCanvas_save'>save</a>, <a href='#SkCanvas_concat'>concat</a>, <a href='#SkCanvas_drawPicture'>drawPicture</a>, <a href='#SkCanvas_restore'>restore</a>. +<a href='#SkCanvas_drawPicture_3_paint'>paint</a> use is equivalent to: <a href='#SkCanvas_saveLayer'>saveLayer</a>, <a href='#SkCanvas_drawPicture'>drawPicture</a>, <a href='#SkCanvas_restore'>restore</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPicture_3_picture"> <code><strong>picture </strong></code> </a></td> <td> -recorded drawing commands to play</td> - </tr> <tr> <td><a name="SkCanvas_drawPicture_3_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to rotate, scale, translate, and so on; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawPicture_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> to apply transparency, filtering, and so on; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawPicture_3_picture'><code><strong>picture</strong></code></a></td> + <td>recorded drawing commands to play</td> + </tr> + <tr> <td><a name='SkCanvas_drawPicture_3_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to rotate, scale, translate, and so on; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawPicture_3_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> to apply transparency, filtering, and so on; may be nullptr</td> </tr> </table> @@ -5350,31 +6415,33 @@ recorded drawing commands to play</td> ### See Also -<a href="#SkCanvas_drawDrawable">drawDrawable</a><sup><a href="#SkCanvas_drawDrawable_2">[2]</a></sup> <a href="undocumented#SkPicture">SkPicture</a> <a href="undocumented#SkPicture_playback">SkPicture::playback</a> +<a href='#SkCanvas_drawDrawable'>drawDrawable</a><sup><a href='#SkCanvas_drawDrawable_2'>[2]</a></sup> <a href='undocumented#SkPicture'>SkPicture</a> <a href='undocumented#SkPicture_playback'>SkPicture::playback</a> --- -<a name="SkCanvas_drawPicture_4"></a> +<a name='SkCanvas_drawPicture_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPicture(const sk_sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPicture'>drawPicture</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkPicture'>SkPicture</a>>& picture, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* matrix, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Picture">Picture</a> <a href="#SkCanvas_drawPicture_4_picture">picture</a>, using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>; transforming <a href="#SkCanvas_drawPicture_4_picture">picture</a> with -<a href="#Matrix">Matrix</a> <a href="#SkCanvas_drawPicture_4_matrix">matrix</a>, if provided; and use <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPicture_4_paint">paint</a> <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a>, if provided. +<a href='#Draw'>Draw</a> <a href='undocumented#Picture'>Picture</a> <a href='#SkCanvas_drawPicture_4_picture'>picture</a>, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>; transforming <a href='#SkCanvas_drawPicture_4_picture'>picture</a> with +<a href='#Matrix'>Matrix</a> <a href='#SkCanvas_drawPicture_4_matrix'>matrix</a>, if provided; and use <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawPicture_4_paint'>paint</a> <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a>, if provided. -<a href="#SkCanvas_drawPicture_4_matrix">matrix</a> transformation is equivalent to: <a href="#SkCanvas_save">save</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_drawPicture">drawPicture</a>, <a href="#SkCanvas_restore">restore</a>. -<a href="#SkCanvas_drawPicture_4_paint">paint</a> use is equivalent to: <a href="#SkCanvas_saveLayer">saveLayer</a>, <a href="#SkCanvas_drawPicture">drawPicture</a>, <a href="#SkCanvas_restore">restore</a>. +<a href='#SkCanvas_drawPicture_4_matrix'>matrix</a> transformation is equivalent to: <a href='#SkCanvas_save'>save</a>, <a href='#SkCanvas_concat'>concat</a>, <a href='#SkCanvas_drawPicture'>drawPicture</a>, <a href='#SkCanvas_restore'>restore</a>. +<a href='#SkCanvas_drawPicture_4_paint'>paint</a> use is equivalent to: <a href='#SkCanvas_saveLayer'>saveLayer</a>, <a href='#SkCanvas_drawPicture'>drawPicture</a>, <a href='#SkCanvas_restore'>restore</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPicture_4_picture"> <code><strong>picture </strong></code> </a></td> <td> -recorded drawing commands to play</td> - </tr> <tr> <td><a name="SkCanvas_drawPicture_4_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to rotate, scale, translate, and so on; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawPicture_4_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> to apply transparency, filtering, and so on; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawPicture_4_picture'><code><strong>picture</strong></code></a></td> + <td>recorded drawing commands to play</td> + </tr> + <tr> <td><a name='SkCanvas_drawPicture_4_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to rotate, scale, translate, and so on; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawPicture_4_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> to apply transparency, filtering, and so on; may be nullptr</td> </tr> </table> @@ -5384,29 +6451,31 @@ recorded drawing commands to play</td> ### See Also -<a href="#SkCanvas_drawDrawable">drawDrawable</a><sup><a href="#SkCanvas_drawDrawable_2">[2]</a></sup> <a href="undocumented#SkPicture">SkPicture</a> <a href="undocumented#SkPicture_playback">SkPicture::playback</a> +<a href='#SkCanvas_drawDrawable'>drawDrawable</a><sup><a href='#SkCanvas_drawDrawable_2'>[2]</a></sup> <a href='undocumented#SkPicture'>SkPicture</a> <a href='undocumented#SkPicture_playback'>SkPicture::playback</a> --- -<a name="SkCanvas_drawVertices"></a> +<a name='SkCanvas_drawVertices'></a> ## drawVertices -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawVertices'>drawVertices</a>(const <a href='undocumented#SkVertices'>SkVertices</a>* vertices, <a href='undocumented#SkBlendMode'>SkBlendMode</a> mode, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Vertices">Vertices</a> <a href="#SkCanvas_drawVertices_vertices">vertices</a>, a triangle mesh, using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>. -If <a href="undocumented#Texs">Vertices Texs</a> and <a href="undocumented#Colors">Vertices Colors</a> are defined in <a href="#SkCanvas_drawVertices_vertices">vertices</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawVertices_paint">paint</a> -contains <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Blend_Mode">Blend Mode</a> <a href="#SkCanvas_drawVertices_mode">mode</a> combines <a href="undocumented#Colors">Vertices Colors</a> with <a href="undocumented#Shader">Shader</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Vertices'>Vertices</a> <a href='#SkCanvas_drawVertices_vertices'>vertices</a>, a triangle mesh, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>. +If <a href='undocumented#Texs'>Vertices Texs</a> and <a href='undocumented#Colors'>Vertices Colors</a> are defined in <a href='#SkCanvas_drawVertices_vertices'>vertices</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawVertices_paint'>paint</a> +contains <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a> <a href='#SkCanvas_drawVertices_mode'>mode</a> combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawVertices_vertices"> <code><strong>vertices </strong></code> </a></td> <td> -triangle mesh to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawVertices_mode"> <code><strong>mode </strong></code> </a></td> <td> -combines <a href="undocumented#Colors">Vertices Colors</a> with <a href="undocumented#Shader">Shader</a>, if both are present</td> - </tr> <tr> <td><a name="SkCanvas_drawVertices_paint"> <code><strong>paint </strong></code> </a></td> <td> -specifies the <a href="undocumented#Shader">Shader</a>, used as <a href="undocumented#Vertices">Vertices</a> texture; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawVertices_vertices'><code><strong>vertices</strong></code></a></td> + <td>triangle mesh to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_mode'><code><strong>mode</strong></code></a></td> + <td>combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>, if both are present</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_paint'><code><strong>paint</strong></code></a></td> + <td>specifies the <a href='undocumented#Shader'>Shader</a>, used as <a href='undocumented#Vertices'>Vertices</a> texture; may be nullptr</td> </tr> </table> @@ -5416,28 +6485,30 @@ specifies the <a href="undocumented#Shader">Shader</a>, used as <a href="undocum ### See Also -<a href="#SkCanvas_drawPatch">drawPatch</a><sup><a href="#SkCanvas_drawPatch_2">[2]</a></sup> <a href="#SkCanvas_drawPicture">drawPicture</a><sup><a href="#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="#SkCanvas_drawPicture_4">[4]</a></sup> +<a href='#SkCanvas_drawPatch'>drawPatch</a><sup><a href='#SkCanvas_drawPatch_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkCanvas_drawVertices_2"></a> +<a name='SkCanvas_drawVertices_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawVertices(const sk_sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawVertices'>drawVertices</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkVertices'>SkVertices</a>>& vertices, <a href='undocumented#SkBlendMode'>SkBlendMode</a> mode, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Vertices">Vertices</a> <a href="#SkCanvas_drawVertices_2_vertices">vertices</a>, a triangle mesh, using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>. -If <a href="undocumented#Texs">Vertices Texs</a> and <a href="undocumented#Colors">Vertices Colors</a> are defined in <a href="#SkCanvas_drawVertices_2_vertices">vertices</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawVertices_2_paint">paint</a> -contains <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Blend_Mode">Blend Mode</a> <a href="#SkCanvas_drawVertices_2_mode">mode</a> combines <a href="undocumented#Colors">Vertices Colors</a> with <a href="undocumented#Shader">Shader</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Vertices'>Vertices</a> <a href='#SkCanvas_drawVertices_2_vertices'>vertices</a>, a triangle mesh, using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>. +If <a href='undocumented#Texs'>Vertices Texs</a> and <a href='undocumented#Colors'>Vertices Colors</a> are defined in <a href='#SkCanvas_drawVertices_2_vertices'>vertices</a>, and <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawVertices_2_paint'>paint</a> +contains <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a> <a href='#SkCanvas_drawVertices_2_mode'>mode</a> combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawVertices_2_vertices"> <code><strong>vertices </strong></code> </a></td> <td> -triangle mesh to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawVertices_2_mode"> <code><strong>mode </strong></code> </a></td> <td> -combines <a href="undocumented#Colors">Vertices Colors</a> with <a href="undocumented#Shader">Shader</a>, if both are present</td> - </tr> <tr> <td><a name="SkCanvas_drawVertices_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -specifies the <a href="undocumented#Shader">Shader</a>, used as <a href="undocumented#Vertices">Vertices</a> texture, may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawVertices_2_vertices'><code><strong>vertices</strong></code></a></td> + <td>triangle mesh to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_2_mode'><code><strong>mode</strong></code></a></td> + <td>combines <a href='undocumented#Colors'>Vertices Colors</a> with <a href='undocumented#Shader'>Shader</a>, if both are present</td> + </tr> + <tr> <td><a name='SkCanvas_drawVertices_2_paint'><code><strong>paint</strong></code></a></td> + <td>specifies the <a href='undocumented#Shader'>Shader</a>, used as <a href='undocumented#Vertices'>Vertices</a> texture, may be nullptr</td> </tr> </table> @@ -5447,50 +6518,53 @@ specifies the <a href="undocumented#Shader">Shader</a>, used as <a href="undocum ### See Also -<a href="#SkCanvas_drawPatch">drawPatch</a><sup><a href="#SkCanvas_drawPatch_2">[2]</a></sup> <a href="#SkCanvas_drawPicture">drawPicture</a><sup><a href="#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="#SkCanvas_drawPicture_4">[4]</a></sup> +<a href='#SkCanvas_drawPatch'>drawPatch</a><sup><a href='#SkCanvas_drawPatch_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkCanvas_drawPatch"></a> +<a name='SkCanvas_drawPatch'></a> ## drawPatch -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], - SkBlendMode mode, const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPatch'>drawPatch</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> cubics[12], const <a href='SkColor_Reference#SkColor'>SkColor</a> colors[4], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> texCoords[4], + <a href='undocumented#SkBlendMode'>SkBlendMode</a> mode, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -Draws a Coons_Patch: the interpolation of four <a href="#SkCanvas_drawPatch_cubics">cubics</a> with shared corners, +Draws a Coons_Patch: the interpolation of four <a href='#SkCanvas_drawPatch_cubics'>cubics</a> with shared corners, associating a color, and optionally a texture coordinate, with each corner. -Coons_Patch uses <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, <a href="#SkCanvas_drawPatch_paint">paint</a> <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a>. If <a href="undocumented#Shader">Shader</a> is provided it is treated -as Coons_Patch texture; <a href="undocumented#Blend_Mode">Blend Mode</a> <a href="#SkCanvas_drawPatch_mode">mode</a> combines <a href="SkColor_Reference#Color">Color</a> <a href="#SkCanvas_drawPatch_colors">colors</a> and <a href="undocumented#Shader">Shader</a> if +Coons_Patch uses <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>, <a href='#SkCanvas_drawPatch_paint'>paint</a> <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a>. If <a href='undocumented#Shader'>Shader</a> is provided it is treated +as Coons_Patch texture; <a href='undocumented#Blend_Mode'>Blend Mode</a> <a href='#SkCanvas_drawPatch_mode'>mode</a> combines <a href='SkColor_Reference#Color'>Color</a> <a href='#SkCanvas_drawPatch_colors'>colors</a> and <a href='undocumented#Shader'>Shader</a> if both are provided. -<a href="SkPoint_Reference#Point">Point</a> array <a href="#SkCanvas_drawPatch_cubics">cubics</a> specifies four <a href="SkPath_Reference#Cubic">Cubics</a> starting at the top-left corner, -in clockwise order, sharing every fourth point. The last <a href="SkPath_Reference#Cubic">Cubic</a> ends at the +<a href='SkPoint_Reference#Point'>Point</a> array <a href='#SkCanvas_drawPatch_cubics'>cubics</a> specifies four <a href='SkPath_Reference#Cubic'>Cubics</a> starting at the top-left corner, +in clockwise order, sharing every fourth point. The last <a href='SkPath_Reference#Cubic'>Cubic</a> ends at the first point. -<a href="SkColor_Reference#Color">Color</a> array color associates <a href="#SkCanvas_drawPatch_colors">colors</a> with corners in top-left, top-right, +<a href='SkColor_Reference#Color'>Color</a> array color associates <a href='#SkCanvas_drawPatch_colors'>colors</a> with corners in top-left, top-right, bottom-right, bottom-left order. -If <a href="#SkCanvas_drawPatch_paint">paint</a> contains <a href="undocumented#Shader">Shader</a>, <a href="SkPoint_Reference#Point">Point</a> array <a href="#SkCanvas_drawPatch_texCoords">texCoords</a> maps <a href="undocumented#Shader">Shader</a> as texture to +If <a href='#SkCanvas_drawPatch_paint'>paint</a> contains <a href='undocumented#Shader'>Shader</a>, <a href='SkPoint_Reference#Point'>Point</a> array <a href='#SkCanvas_drawPatch_texCoords'>texCoords</a> maps <a href='undocumented#Shader'>Shader</a> as texture to corners in top-left, top-right, bottom-right, bottom-left order. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPatch_cubics"> <code><strong>cubics </strong></code> </a></td> <td> -<a href="SkPath_Reference#Cubic">Path Cubic</a> array, sharing common points</td> - </tr> <tr> <td><a name="SkCanvas_drawPatch_colors"> <code><strong>colors </strong></code> </a></td> <td> -<a href="SkColor_Reference#Color">Color</a> array, one for each corner</td> - </tr> <tr> <td><a name="SkCanvas_drawPatch_texCoords"> <code><strong>texCoords </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> array of texture coordinates, mapping <a href="undocumented#Shader">Shader</a> to corners; +<table> <tr> <td><a name='SkCanvas_drawPatch_cubics'><code><strong>cubics</strong></code></a></td> + <td><a href='SkPath_Reference#Cubic'>Path Cubic</a> array, sharing common points</td> + </tr> + <tr> <td><a name='SkCanvas_drawPatch_colors'><code><strong>colors</strong></code></a></td> + <td><a href='SkColor_Reference#Color'>Color</a> array, one for each corner</td> + </tr> + <tr> <td><a name='SkCanvas_drawPatch_texCoords'><code><strong>texCoords</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> array of texture coordinates, mapping <a href='undocumented#Shader'>Shader</a> to corners; may be nullptr</td> </tr> -# <tr> <td><a name="SkCanvas_drawPatch_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="undocumented#Blend_Mode">Blend Mode</a> for <a href="#SkCanvas_drawPatch_colors">colors</a>, and for <a href="undocumented#Shader">Shader</a> if <a href="#SkCanvas_drawPatch_paint">paint</a> has one</td> - </tr> <tr> <td><a name="SkCanvas_drawPatch_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, used to draw</td> +# <tr> <td><a name='SkCanvas_drawPatch_mode'><code><strong>mode</strong></code></a></td> + <td><a href='undocumented#Blend_Mode'>Blend Mode</a> for <a href='#SkCanvas_drawPatch_colors'>colors</a>, and for <a href='undocumented#Shader'>Shader</a> if <a href='#SkCanvas_drawPatch_paint'>paint</a> has one</td> + </tr> + <tr> <td><a name='SkCanvas_drawPatch_paint'><code><strong>paint</strong></code></a></td> + <td><a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, used to draw</td> </tr> </table> @@ -5500,47 +6574,49 @@ may be nullptr</td> ### See Also -SeeAlso <a href="#SkCanvas_drawVertices">drawVertices</a><sup><a href="#SkCanvas_drawVertices_2">[2]</a></sup> <a href="#SkCanvas_drawPicture">drawPicture</a><sup><a href="#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="#SkCanvas_drawPicture_4">[4]</a></sup> +SeeAlso <a href='#SkCanvas_drawVertices'>drawVertices</a><sup><a href='#SkCanvas_drawVertices_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkCanvas_drawPatch_2"></a> +<a name='SkCanvas_drawPatch_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], - const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawPatch'>drawPatch</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> cubics[12], const <a href='SkColor_Reference#SkColor'>SkColor</a> colors[4], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> texCoords[4], + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>& paint) </pre> -Draws <a href="SkPath_Reference#Cubic">Cubic</a> Coons_Patch: the interpolation of four <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> with shared corners, +Draws <a href='SkPath_Reference#Cubic'>Cubic</a> Coons_Patch: the interpolation of four <a href='#SkCanvas_drawPatch_2_cubics'>cubics</a> with shared corners, associating a color, and optionally a texture coordinate, with each corner. -Coons_Patch uses <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, <a href="#SkCanvas_drawPatch_2_paint">paint</a> <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a>. If <a href="undocumented#Shader">Shader</a> is provided it is treated -as Coons_Patch texture; <a href="undocumented#Blend_Mode">Blend Mode</a> mode combines <a href="SkColor_Reference#Color">Color</a> <a href="#SkCanvas_drawPatch_2_colors">colors</a> and <a href="undocumented#Shader">Shader</a> if +Coons_Patch uses <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>, <a href='#SkCanvas_drawPatch_2_paint'>paint</a> <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a>. If <a href='undocumented#Shader'>Shader</a> is provided it is treated +as Coons_Patch texture; <a href='undocumented#Blend_Mode'>Blend Mode</a> mode combines <a href='SkColor_Reference#Color'>Color</a> <a href='#SkCanvas_drawPatch_2_colors'>colors</a> and <a href='undocumented#Shader'>Shader</a> if both are provided. -<a href="SkPoint_Reference#Point">Point</a> array <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> specifies four <a href="SkPath_Reference#Cubic">Cubics</a> starting at the top-left corner, -in clockwise order, sharing every fourth point. The last <a href="SkPath_Reference#Cubic">Cubic</a> ends at the +<a href='SkPoint_Reference#Point'>Point</a> array <a href='#SkCanvas_drawPatch_2_cubics'>cubics</a> specifies four <a href='SkPath_Reference#Cubic'>Cubics</a> starting at the top-left corner, +in clockwise order, sharing every fourth point. The last <a href='SkPath_Reference#Cubic'>Cubic</a> ends at the first point. -<a href="SkColor_Reference#Color">Color</a> array color associates <a href="#SkCanvas_drawPatch_2_colors">colors</a> with corners in top-left, top-right, +<a href='SkColor_Reference#Color'>Color</a> array color associates <a href='#SkCanvas_drawPatch_2_colors'>colors</a> with corners in top-left, top-right, bottom-right, bottom-left order. -If <a href="#SkCanvas_drawPatch_2_paint">paint</a> contains <a href="undocumented#Shader">Shader</a>, <a href="SkPoint_Reference#Point">Point</a> array <a href="#SkCanvas_drawPatch_2_texCoords">texCoords</a> maps <a href="undocumented#Shader">Shader</a> as texture to +If <a href='#SkCanvas_drawPatch_2_paint'>paint</a> contains <a href='undocumented#Shader'>Shader</a>, <a href='SkPoint_Reference#Point'>Point</a> array <a href='#SkCanvas_drawPatch_2_texCoords'>texCoords</a> maps <a href='undocumented#Shader'>Shader</a> as texture to corners in top-left, top-right, bottom-right, bottom-left order. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawPatch_2_cubics"> <code><strong>cubics </strong></code> </a></td> <td> -<a href="SkPath_Reference#Cubic">Path Cubic</a> array, sharing common points</td> - </tr> <tr> <td><a name="SkCanvas_drawPatch_2_colors"> <code><strong>colors </strong></code> </a></td> <td> -<a href="SkColor_Reference#Color">Color</a> array, one for each corner</td> - </tr> <tr> <td><a name="SkCanvas_drawPatch_2_texCoords"> <code><strong>texCoords </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> array of texture coordinates, mapping <a href="undocumented#Shader">Shader</a> to corners; +<table> <tr> <td><a name='SkCanvas_drawPatch_2_cubics'><code><strong>cubics</strong></code></a></td> + <td><a href='SkPath_Reference#Cubic'>Path Cubic</a> array, sharing common points</td> + </tr> + <tr> <td><a name='SkCanvas_drawPatch_2_colors'><code><strong>colors</strong></code></a></td> + <td><a href='SkColor_Reference#Color'>Color</a> array, one for each corner</td> + </tr> + <tr> <td><a name='SkCanvas_drawPatch_2_texCoords'><code><strong>texCoords</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> array of texture coordinates, mapping <a href='undocumented#Shader'>Shader</a> to corners; may be nullptr</td> </tr> -# <tr> <td><a name="SkCanvas_drawPatch_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, used to draw</td> +# <tr> <td><a name='SkCanvas_drawPatch_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, used to draw</td> </tr> </table> @@ -5554,47 +6630,54 @@ may be nullptr</td> ### See Also -SeeAlso <a href="#SkCanvas_drawVertices">drawVertices</a><sup><a href="#SkCanvas_drawVertices_2">[2]</a></sup> <a href="#SkCanvas_drawPicture">drawPicture</a><sup><a href="#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="#SkCanvas_drawPicture_4">[4]</a></sup> +SeeAlso <a href='#SkCanvas_drawVertices'>drawVertices</a><sup><a href='#SkCanvas_drawVertices_2'>[2]</a></sup> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkCanvas_drawAtlas"></a> +<a name='SkCanvas_drawAtlas'></a> ## drawAtlas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], - const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, - const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawAtlas'>drawAtlas</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* atlas, const <a href='undocumented#SkRSXform'>SkRSXform</a> xform[], const <a href='SkRect_Reference#SkRect'>SkRect</a> tex[], + const <a href='SkColor_Reference#SkColor'>SkColor</a> colors[], int count, <a href='undocumented#SkBlendMode'>SkBlendMode</a> mode, const <a href='SkRect_Reference#SkRect'>SkRect</a>* cullRect, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -<a href="#Draw">Draw</a> a set of sprites from <a href="#SkCanvas_drawAtlas_atlas">atlas</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawAtlas_paint">paint</a>. -<a href="#SkCanvas_drawAtlas_paint">paint</a> uses Anti-alias, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a> -to draw, if present. For each entry in the array, <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawAtlas_tex">tex</a> locates sprite in -<a href="#SkCanvas_drawAtlas_atlas">atlas</a>, and <a href="undocumented#RSXform">RSXform</a> <a href="#SkCanvas_drawAtlas_xform">xform</a> transforms it into destination space. +<a href='#Draw'>Draw</a> a set of sprites from <a href='#SkCanvas_drawAtlas_atlas'>atlas</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawAtlas_paint'>paint</a>. +<a href='#SkCanvas_drawAtlas_paint'>paint</a> uses Anti-alias, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a> +to draw, if present. For each entry in the array, <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawAtlas_tex'>tex</a> locates sprite in +<a href='#SkCanvas_drawAtlas_atlas'>atlas</a>, and <a href='undocumented#RSXform'>RSXform</a> <a href='#SkCanvas_drawAtlas_xform'>xform</a> transforms it into destination space. -<a href="#SkCanvas_drawAtlas_xform">xform</a>, text, and <a href="#SkCanvas_drawAtlas_colors">colors</a> if present, must contain <a href="#SkCanvas_drawAtlas_count">count</a> entries. -Optional <a href="#SkCanvas_drawAtlas_colors">colors</a> are applied for each sprite using <a href="undocumented#Blend_Mode">Blend Mode</a>. -Optional <a href="#SkCanvas_drawAtlas_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If <a href="#SkCanvas_drawAtlas_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +<a href='#SkCanvas_drawAtlas_xform'>xform</a>, text, and <a href='#SkCanvas_drawAtlas_colors'>colors</a> if present, must contain <a href='#SkCanvas_drawAtlas_count'>count</a> entries. +Optional <a href='#SkCanvas_drawAtlas_colors'>colors</a> are applied for each sprite using <a href='undocumented#Blend_Mode'>Blend Mode</a>. +Optional <a href='#SkCanvas_drawAtlas_cullRect'>cullRect</a> is a conservative bounds of all transformed sprites. +If <a href='#SkCanvas_drawAtlas_cullRect'>cullRect</a> is outside of <a href='#Clip'>Clip</a>, canvas can skip drawing. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawAtlas_atlas"> <code><strong>atlas </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing sprites</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_xform"> <code><strong>xform </strong></code> </a></td> <td> -<a href="undocumented#RSXform">RSXform</a> mappings for sprites in <a href="#SkCanvas_drawAtlas_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_tex"> <code><strong>tex </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> locations of sprites in <a href="#SkCanvas_drawAtlas_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_colors"> <code><strong>colors </strong></code> </a></td> <td> -one per sprite, blended with sprite using <a href="undocumented#Blend_Mode">Blend Mode</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_count"> <code><strong>count </strong></code> </a></td> <td> -number of sprites to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="undocumented#Blend_Mode">Blend Mode</a> combining <a href="#SkCanvas_drawAtlas_colors">colors</a> and sprites</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_cullRect"> <code><strong>cullRect </strong></code> </a></td> <td> -bounds of transformed sprites for efficient clipping; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, and so on; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawAtlas_atlas'><code><strong>atlas</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing sprites</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_xform'><code><strong>xform</strong></code></a></td> + <td><a href='undocumented#RSXform'>RSXform</a> mappings for sprites in <a href='#SkCanvas_drawAtlas_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_tex'><code><strong>tex</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> locations of sprites in <a href='#SkCanvas_drawAtlas_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_colors'><code><strong>colors</strong></code></a></td> + <td>one per sprite, blended with sprite using <a href='undocumented#Blend_Mode'>Blend Mode</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_count'><code><strong>count</strong></code></a></td> + <td>number of sprites to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_mode'><code><strong>mode</strong></code></a></td> + <td><a href='undocumented#Blend_Mode'>Blend Mode</a> combining <a href='#SkCanvas_drawAtlas_colors'>colors</a> and sprites</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_cullRect'><code><strong>cullRect</strong></code></a></td> + <td>bounds of transformed sprites for efficient clipping; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_paint'><code><strong>paint</strong></code></a></td> + <td><a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, and so on; may be nullptr</td> </tr> </table> @@ -5604,46 +6687,53 @@ bounds of transformed sprites for efficient clipping; may be nullptr</td> ### See Also -<a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> +<a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> --- -<a name="SkCanvas_drawAtlas_2"></a> +<a name='SkCanvas_drawAtlas_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawAtlas(const sk_sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], - const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, - const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawAtlas'>drawAtlas</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& atlas, const <a href='undocumented#SkRSXform'>SkRSXform</a> xform[], const <a href='SkRect_Reference#SkRect'>SkRect</a> tex[], + const <a href='SkColor_Reference#SkColor'>SkColor</a> colors[], int count, <a href='undocumented#SkBlendMode'>SkBlendMode</a> mode, const <a href='SkRect_Reference#SkRect'>SkRect</a>* cullRect, + const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -<a href="#Draw">Draw</a> a set of sprites from <a href="#SkCanvas_drawAtlas_2_atlas">atlas</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawAtlas_2_paint">paint</a>. -<a href="#SkCanvas_drawAtlas_2_paint">paint</a> uses Anti-alias, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a> -to draw, if present. For each entry in the array, <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawAtlas_2_tex">tex</a> locates sprite in -<a href="#SkCanvas_drawAtlas_2_atlas">atlas</a>, and <a href="undocumented#RSXform">RSXform</a> <a href="#SkCanvas_drawAtlas_2_xform">xform</a> transforms it into destination space. +<a href='#Draw'>Draw</a> a set of sprites from <a href='#SkCanvas_drawAtlas_2_atlas'>atlas</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawAtlas_2_paint'>paint</a>. +<a href='#SkCanvas_drawAtlas_2_paint'>paint</a> uses Anti-alias, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a> +to draw, if present. For each entry in the array, <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawAtlas_2_tex'>tex</a> locates sprite in +<a href='#SkCanvas_drawAtlas_2_atlas'>atlas</a>, and <a href='undocumented#RSXform'>RSXform</a> <a href='#SkCanvas_drawAtlas_2_xform'>xform</a> transforms it into destination space. -<a href="#SkCanvas_drawAtlas_2_xform">xform</a>, text, and <a href="#SkCanvas_drawAtlas_2_colors">colors</a> if present, must contain <a href="#SkCanvas_drawAtlas_2_count">count</a> entries. -Optional <a href="#SkCanvas_drawAtlas_2_colors">colors</a> is applied for each sprite using <a href="undocumented#Blend_Mode">Blend Mode</a>. -Optional <a href="#SkCanvas_drawAtlas_2_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If <a href="#SkCanvas_drawAtlas_2_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +<a href='#SkCanvas_drawAtlas_2_xform'>xform</a>, text, and <a href='#SkCanvas_drawAtlas_2_colors'>colors</a> if present, must contain <a href='#SkCanvas_drawAtlas_2_count'>count</a> entries. +Optional <a href='#SkCanvas_drawAtlas_2_colors'>colors</a> is applied for each sprite using <a href='undocumented#Blend_Mode'>Blend Mode</a>. +Optional <a href='#SkCanvas_drawAtlas_2_cullRect'>cullRect</a> is a conservative bounds of all transformed sprites. +If <a href='#SkCanvas_drawAtlas_2_cullRect'>cullRect</a> is outside of <a href='#Clip'>Clip</a>, canvas can skip drawing. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawAtlas_2_atlas"> <code><strong>atlas </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing sprites</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_xform"> <code><strong>xform </strong></code> </a></td> <td> -<a href="undocumented#RSXform">RSXform</a> mappings for sprites in <a href="#SkCanvas_drawAtlas_2_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_tex"> <code><strong>tex </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> locations of sprites in <a href="#SkCanvas_drawAtlas_2_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_colors"> <code><strong>colors </strong></code> </a></td> <td> -one per sprite, blended with sprite using <a href="undocumented#Blend_Mode">Blend Mode</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_count"> <code><strong>count </strong></code> </a></td> <td> -number of sprites to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="undocumented#Blend_Mode">Blend Mode</a> combining <a href="#SkCanvas_drawAtlas_2_colors">colors</a> and sprites</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_cullRect"> <code><strong>cullRect </strong></code> </a></td> <td> -bounds of transformed sprites for efficient clipping; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, and so on; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawAtlas_2_atlas'><code><strong>atlas</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing sprites</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_xform'><code><strong>xform</strong></code></a></td> + <td><a href='undocumented#RSXform'>RSXform</a> mappings for sprites in <a href='#SkCanvas_drawAtlas_2_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_tex'><code><strong>tex</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> locations of sprites in <a href='#SkCanvas_drawAtlas_2_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_colors'><code><strong>colors</strong></code></a></td> + <td>one per sprite, blended with sprite using <a href='undocumented#Blend_Mode'>Blend Mode</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_count'><code><strong>count</strong></code></a></td> + <td>number of sprites to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_mode'><code><strong>mode</strong></code></a></td> + <td><a href='undocumented#Blend_Mode'>Blend Mode</a> combining <a href='#SkCanvas_drawAtlas_2_colors'>colors</a> and sprites</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_cullRect'><code><strong>cullRect</strong></code></a></td> + <td>bounds of transformed sprites for efficient clipping; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_2_paint'><code><strong>paint</strong></code></a></td> + <td><a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, and so on; may be nullptr</td> </tr> </table> @@ -5653,40 +6743,45 @@ bounds of transformed sprites for efficient clipping; may be nullptr</td> ### See Also -<a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> +<a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> --- -<a name="SkCanvas_drawAtlas_3"></a> +<a name='SkCanvas_drawAtlas_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], int count, - const SkRect* cullRect, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawAtlas'>drawAtlas</a>(const <a href='SkImage_Reference#SkImage'>SkImage</a>* atlas, const <a href='undocumented#SkRSXform'>SkRSXform</a> xform[], const <a href='SkRect_Reference#SkRect'>SkRect</a> tex[], int count, + const <a href='SkRect_Reference#SkRect'>SkRect</a>* cullRect, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -<a href="#Draw">Draw</a> a set of sprites from <a href="#SkCanvas_drawAtlas_3_atlas">atlas</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawAtlas_3_paint">paint</a>. -<a href="#SkCanvas_drawAtlas_3_paint">paint</a> uses Anti-alias, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a> -to draw, if present. For each entry in the array, <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawAtlas_3_tex">tex</a> locates sprite in -<a href="#SkCanvas_drawAtlas_3_atlas">atlas</a>, and <a href="undocumented#RSXform">RSXform</a> <a href="#SkCanvas_drawAtlas_3_xform">xform</a> transforms it into destination space. +<a href='#Draw'>Draw</a> a set of sprites from <a href='#SkCanvas_drawAtlas_3_atlas'>atlas</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawAtlas_3_paint'>paint</a>. +<a href='#SkCanvas_drawAtlas_3_paint'>paint</a> uses Anti-alias, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a> +to draw, if present. For each entry in the array, <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawAtlas_3_tex'>tex</a> locates sprite in +<a href='#SkCanvas_drawAtlas_3_atlas'>atlas</a>, and <a href='undocumented#RSXform'>RSXform</a> <a href='#SkCanvas_drawAtlas_3_xform'>xform</a> transforms it into destination space. -<a href="#SkCanvas_drawAtlas_3_xform">xform</a> and text must contain <a href="#SkCanvas_drawAtlas_3_count">count</a> entries. -Optional <a href="#SkCanvas_drawAtlas_3_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If <a href="#SkCanvas_drawAtlas_3_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +<a href='#SkCanvas_drawAtlas_3_xform'>xform</a> and text must contain <a href='#SkCanvas_drawAtlas_3_count'>count</a> entries. +Optional <a href='#SkCanvas_drawAtlas_3_cullRect'>cullRect</a> is a conservative bounds of all transformed sprites. +If <a href='#SkCanvas_drawAtlas_3_cullRect'>cullRect</a> is outside of <a href='#Clip'>Clip</a>, canvas can skip drawing. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawAtlas_3_atlas"> <code><strong>atlas </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing sprites</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_3_xform"> <code><strong>xform </strong></code> </a></td> <td> -<a href="undocumented#RSXform">RSXform</a> mappings for sprites in <a href="#SkCanvas_drawAtlas_3_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_3_tex"> <code><strong>tex </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> locations of sprites in <a href="#SkCanvas_drawAtlas_3_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_3_count"> <code><strong>count </strong></code> </a></td> <td> -number of sprites to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_3_cullRect"> <code><strong>cullRect </strong></code> </a></td> <td> -bounds of transformed sprites for efficient clipping; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, and so on; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawAtlas_3_atlas'><code><strong>atlas</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing sprites</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_3_xform'><code><strong>xform</strong></code></a></td> + <td><a href='undocumented#RSXform'>RSXform</a> mappings for sprites in <a href='#SkCanvas_drawAtlas_3_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_3_tex'><code><strong>tex</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> locations of sprites in <a href='#SkCanvas_drawAtlas_3_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_3_count'><code><strong>count</strong></code></a></td> + <td>number of sprites to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_3_cullRect'><code><strong>cullRect</strong></code></a></td> + <td>bounds of transformed sprites for efficient clipping; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_3_paint'><code><strong>paint</strong></code></a></td> + <td><a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, and so on; may be nullptr</td> </tr> </table> @@ -5696,40 +6791,45 @@ bounds of transformed sprites for efficient clipping; may be nullptr</td> ### See Also -<a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> +<a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> --- -<a name="SkCanvas_drawAtlas_4"></a> +<a name='SkCanvas_drawAtlas_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawAtlas(const sk_sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], int count, - const SkRect* cullRect, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawAtlas'>drawAtlas</a>(const <a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>>& atlas, const <a href='undocumented#SkRSXform'>SkRSXform</a> xform[], const <a href='SkRect_Reference#SkRect'>SkRect</a> tex[], int count, + const <a href='SkRect_Reference#SkRect'>SkRect</a>* cullRect, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -<a href="#Draw">Draw</a> a set of sprites from <a href="#SkCanvas_drawAtlas_4_atlas">atlas</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawAtlas_4_paint">paint</a>. -<a href="#SkCanvas_drawAtlas_4_paint">paint</a> uses Anti-alias, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a> -to draw, if present. For each entry in the array, <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkCanvas_drawAtlas_4_tex">tex</a> locates sprite in -<a href="#SkCanvas_drawAtlas_4_atlas">atlas</a>, and <a href="undocumented#RSXform">RSXform</a> <a href="#SkCanvas_drawAtlas_4_xform">xform</a> transforms it into destination space. +<a href='#Draw'>Draw</a> a set of sprites from <a href='#SkCanvas_drawAtlas_4_atlas'>atlas</a>, using <a href='#Clip'>Clip</a>, <a href='#Matrix'>Matrix</a>, and optional <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkCanvas_drawAtlas_4_paint'>paint</a>. +<a href='#SkCanvas_drawAtlas_4_paint'>paint</a> uses Anti-alias, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and <a href='undocumented#Blend_Mode'>Blend Mode</a> +to draw, if present. For each entry in the array, <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkCanvas_drawAtlas_4_tex'>tex</a> locates sprite in +<a href='#SkCanvas_drawAtlas_4_atlas'>atlas</a>, and <a href='undocumented#RSXform'>RSXform</a> <a href='#SkCanvas_drawAtlas_4_xform'>xform</a> transforms it into destination space. -<a href="#SkCanvas_drawAtlas_4_xform">xform</a> and text must contain <a href="#SkCanvas_drawAtlas_4_count">count</a> entries. -Optional <a href="#SkCanvas_drawAtlas_4_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If <a href="#SkCanvas_drawAtlas_4_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +<a href='#SkCanvas_drawAtlas_4_xform'>xform</a> and text must contain <a href='#SkCanvas_drawAtlas_4_count'>count</a> entries. +Optional <a href='#SkCanvas_drawAtlas_4_cullRect'>cullRect</a> is a conservative bounds of all transformed sprites. +If <a href='#SkCanvas_drawAtlas_4_cullRect'>cullRect</a> is outside of <a href='#Clip'>Clip</a>, canvas can skip drawing. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawAtlas_4_atlas"> <code><strong>atlas </strong></code> </a></td> <td> -<a href="SkImage_Reference#Image">Image</a> containing sprites</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_4_xform"> <code><strong>xform </strong></code> </a></td> <td> -<a href="undocumented#RSXform">RSXform</a> mappings for sprites in <a href="#SkCanvas_drawAtlas_4_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_4_tex"> <code><strong>tex </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> locations of sprites in <a href="#SkCanvas_drawAtlas_4_atlas">atlas</a></td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_4_count"> <code><strong>count </strong></code> </a></td> <td> -number of sprites to draw</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_4_cullRect"> <code><strong>cullRect </strong></code> </a></td> <td> -bounds of transformed sprites for efficient clipping; may be nullptr</td> - </tr> <tr> <td><a name="SkCanvas_drawAtlas_4_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, and so on; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawAtlas_4_atlas'><code><strong>atlas</strong></code></a></td> + <td><a href='SkImage_Reference#Image'>Image</a> containing sprites</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_4_xform'><code><strong>xform</strong></code></a></td> + <td><a href='undocumented#RSXform'>RSXform</a> mappings for sprites in <a href='#SkCanvas_drawAtlas_4_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_4_tex'><code><strong>tex</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> locations of sprites in <a href='#SkCanvas_drawAtlas_4_atlas'>atlas</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_4_count'><code><strong>count</strong></code></a></td> + <td>number of sprites to draw</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_4_cullRect'><code><strong>cullRect</strong></code></a></td> + <td>bounds of transformed sprites for efficient clipping; may be nullptr</td> + </tr> + <tr> <td><a name='SkCanvas_drawAtlas_4_paint'><code><strong>paint</strong></code></a></td> + <td><a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, <a href='undocumented#Blend_Mode'>Blend Mode</a>, and so on; may be nullptr</td> </tr> </table> @@ -5739,31 +6839,32 @@ bounds of transformed sprites for efficient clipping; may be nullptr</td> ### See Also -<a href="#SkCanvas_drawBitmap">drawBitmap</a> <a href="#SkCanvas_drawImage">drawImage</a><sup><a href="#SkCanvas_drawImage_2">[2]</a></sup> +<a href='#SkCanvas_drawBitmap'>drawBitmap</a> <a href='#SkCanvas_drawImage'>drawImage</a><sup><a href='#SkCanvas_drawImage_2'>[2]</a></sup> --- -<a name="SkCanvas_drawDrawable"></a> +<a name='SkCanvas_drawDrawable'></a> ## drawDrawable -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawDrawable'>drawDrawable</a>(<a href='undocumented#SkDrawable'>SkDrawable</a>* drawable, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* matrix = nullptr) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Drawable">Drawable</a> <a href="#SkCanvas_drawDrawable_drawable">drawable</a> using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, concatenated with -optional <a href="#SkCanvas_drawDrawable_matrix">matrix</a>. +<a href='#Draw'>Draw</a> <a href='undocumented#Drawable'>Drawable</a> <a href='#SkCanvas_drawDrawable_drawable'>drawable</a> using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>, concatenated with +optional <a href='#SkCanvas_drawDrawable_matrix'>matrix</a>. -If <a href="#Canvas">Canvas</a> has an asynchronous implementation, as is the case -when it is recording into <a href="undocumented#Picture">Picture</a>, then <a href="#SkCanvas_drawDrawable_drawable">drawable</a> will be referenced, -so that <a href="undocumented#SkDrawable_draw">SkDrawable::draw()</a> can be called when the operation is finalized. To force -immediate drawing, call <a href="undocumented#SkDrawable_draw">SkDrawable::draw()</a> instead. +If <a href='#Canvas'>Canvas</a> has an asynchronous implementation, as is the case +when it is recording into <a href='undocumented#Picture'>Picture</a>, then <a href='#SkCanvas_drawDrawable_drawable'>drawable</a> will be referenced, +so that <a href='undocumented#SkDrawable_draw'>SkDrawable::draw()</a> can be called when the operation is finalized. To force +immediate drawing, call <a href='undocumented#SkDrawable_draw'>SkDrawable::draw()</a> instead. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawDrawable_drawable"> <code><strong>drawable </strong></code> </a></td> <td> -custom struct encapsulating drawing commands</td> - </tr> <tr> <td><a name="SkCanvas_drawDrawable_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -transformation applied to drawing; may be nullptr</td> +<table> <tr> <td><a name='SkCanvas_drawDrawable_drawable'><code><strong>drawable</strong></code></a></td> + <td>custom struct encapsulating drawing commands</td> + </tr> + <tr> <td><a name='SkCanvas_drawDrawable_matrix'><code><strong>matrix</strong></code></a></td> + <td>transformation applied to drawing; may be nullptr</td> </tr> </table> @@ -5773,31 +6874,33 @@ transformation applied to drawing; may be nullptr</td> ### See Also -<a href="undocumented#SkDrawable">SkDrawable</a> <a href="#SkCanvas_drawPicture">drawPicture</a><sup><a href="#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="#SkCanvas_drawPicture_4">[4]</a></sup> +<a href='undocumented#SkDrawable'>SkDrawable</a> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkCanvas_drawDrawable_2"></a> +<a name='SkCanvas_drawDrawable_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawDrawable(SkDrawable* drawable, SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawDrawable'>drawDrawable</a>(<a href='undocumented#SkDrawable'>SkDrawable</a>* drawable, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -<a href="#Draw">Draw</a> <a href="undocumented#Drawable">Drawable</a> <a href="#SkCanvas_drawDrawable_2_drawable">drawable</a> using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, offset by (<a href="#SkCanvas_drawDrawable_2_x">x</a>, <a href="#SkCanvas_drawDrawable_2_y">y</a>). +<a href='#Draw'>Draw</a> <a href='undocumented#Drawable'>Drawable</a> <a href='#SkCanvas_drawDrawable_2_drawable'>drawable</a> using <a href='#Clip'>Clip</a> and <a href='#Matrix'>Matrix</a>, offset by (<a href='#SkCanvas_drawDrawable_2_x'>x</a>, <a href='#SkCanvas_drawDrawable_2_y'>y</a>). -If <a href="#Canvas">Canvas</a> has an asynchronous implementation, as is the case -when it is recording into <a href="undocumented#Picture">Picture</a>, then <a href="#SkCanvas_drawDrawable_2_drawable">drawable</a> will be referenced, -so that <a href="undocumented#SkDrawable_draw">SkDrawable::draw()</a> can be called when the operation is finalized. To force -immediate drawing, call <a href="undocumented#SkDrawable_draw">SkDrawable::draw()</a> instead. +If <a href='#Canvas'>Canvas</a> has an asynchronous implementation, as is the case +when it is recording into <a href='undocumented#Picture'>Picture</a>, then <a href='#SkCanvas_drawDrawable_2_drawable'>drawable</a> will be referenced, +so that <a href='undocumented#SkDrawable_draw'>SkDrawable::draw()</a> can be called when the operation is finalized. To force +immediate drawing, call <a href='undocumented#SkDrawable_draw'>SkDrawable::draw()</a> instead. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawDrawable_2_drawable"> <code><strong>drawable </strong></code> </a></td> <td> -custom struct encapsulating drawing commands</td> - </tr> <tr> <td><a name="SkCanvas_drawDrawable_2_x"> <code><strong>x </strong></code> </a></td> <td> -offset into <a href="#Canvas">Canvas</a> writable pixels in <a href="#SkCanvas_drawDrawable_2_x">x</a></td> - </tr> <tr> <td><a name="SkCanvas_drawDrawable_2_y"> <code><strong>y </strong></code> </a></td> <td> -offset into <a href="#Canvas">Canvas</a> writable pixels in <a href="#SkCanvas_drawDrawable_2_y">y</a></td> +<table> <tr> <td><a name='SkCanvas_drawDrawable_2_drawable'><code><strong>drawable</strong></code></a></td> + <td>custom struct encapsulating drawing commands</td> + </tr> + <tr> <td><a name='SkCanvas_drawDrawable_2_x'><code><strong>x</strong></code></a></td> + <td>offset into <a href='#Canvas'>Canvas</a> writable pixels in <a href='#SkCanvas_drawDrawable_2_x'>x</a></td> + </tr> + <tr> <td><a name='SkCanvas_drawDrawable_2_y'><code><strong>y</strong></code></a></td> + <td>offset into <a href='#Canvas'>Canvas</a> writable pixels in <a href='#SkCanvas_drawDrawable_2_y'>y</a></td> </tr> </table> @@ -5807,31 +6910,33 @@ offset into <a href="#Canvas">Canvas</a> writable pixels in <a href="#SkCanvas_d ### See Also -<a href="undocumented#SkDrawable">SkDrawable</a> <a href="#SkCanvas_drawPicture">drawPicture</a><sup><a href="#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="#SkCanvas_drawPicture_4">[4]</a></sup> +<a href='undocumented#SkDrawable'>SkDrawable</a> <a href='#SkCanvas_drawPicture'>drawPicture</a><sup><a href='#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkCanvas_drawAnnotation"></a> +<a name='SkCanvas_drawAnnotation'></a> ## drawAnnotation -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawAnnotation(const SkRect& rect, const char key[], SkData* value) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawAnnotation'>drawAnnotation</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, const char key[], <a href='undocumented#SkData'>SkData</a>* value) </pre> -Associate <a href="SkRect_Reference#Rect">Rect</a> on <a href="#Canvas">Canvas</a> with an annotation; a <a href="#SkCanvas_drawAnnotation_key">key</a>-<a href="#SkCanvas_drawAnnotation_value">value</a> pair, where the <a href="#SkCanvas_drawAnnotation_key">key</a> is -a null-terminated utf8 string, and optional <a href="#SkCanvas_drawAnnotation_value">value</a> is stored as <a href="undocumented#Data">Data</a>. +Associate <a href='SkRect_Reference#Rect'>Rect</a> on <a href='#Canvas'>Canvas</a> with an annotation; a <a href='#SkCanvas_drawAnnotation_key'>key</a>-<a href='#SkCanvas_drawAnnotation_value'>value</a> pair, where the <a href='#SkCanvas_drawAnnotation_key'>key</a> is +a null-terminated utf8 string, and optional <a href='#SkCanvas_drawAnnotation_value'>value</a> is stored as <a href='undocumented#Data'>Data</a>. -Only some canvas implementations, such as recording to <a href="undocumented#Picture">Picture</a>, or drawing to -<a href="undocumented#PDF">Document PDF</a>, use annotations. +Only some canvas implementations, such as recording to <a href='undocumented#Picture'>Picture</a>, or drawing to +<a href='undocumented#PDF'>Document PDF</a>, use annotations. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawAnnotation_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> extent of canvas to annotate</td> - </tr> <tr> <td><a name="SkCanvas_drawAnnotation_key"> <code><strong>key </strong></code> </a></td> <td> -string used for lookup</td> - </tr> <tr> <td><a name="SkCanvas_drawAnnotation_value"> <code><strong>value </strong></code> </a></td> <td> -data holding <a href="#SkCanvas_drawAnnotation_value">value</a> stored in annotation</td> +<table> <tr> <td><a name='SkCanvas_drawAnnotation_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> extent of canvas to annotate</td> + </tr> + <tr> <td><a name='SkCanvas_drawAnnotation_key'><code><strong>key</strong></code></a></td> + <td>string used for lookup</td> + </tr> + <tr> <td><a name='SkCanvas_drawAnnotation_value'><code><strong>value</strong></code></a></td> + <td>data holding <a href='#SkCanvas_drawAnnotation_value'>value</a> stored in annotation</td> </tr> </table> @@ -5841,30 +6946,32 @@ data holding <a href="#SkCanvas_drawAnnotation_value">value</a> stored in annota ### See Also -<a href="undocumented#SkPicture">SkPicture</a> <a href="undocumented#SkDocument">SkDocument</a> +<a href='undocumented#SkPicture'>SkPicture</a> <a href='undocumented#SkDocument'>SkDocument</a> --- -<a name="SkCanvas_drawAnnotation_2"></a> +<a name='SkCanvas_drawAnnotation_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void drawAnnotation(const SkRect& rect, const char key[], const sk_sp<SkData>& value) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkCanvas_drawAnnotation'>drawAnnotation</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, const char key[], const <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>>& value) </pre> -Associate <a href="SkRect_Reference#Rect">Rect</a> on <a href="#Canvas">Canvas</a> when an annotation; a <a href="#SkCanvas_drawAnnotation_2_key">key</a>-<a href="#SkCanvas_drawAnnotation_2_value">value</a> pair, where the <a href="#SkCanvas_drawAnnotation_2_key">key</a> is -a null-terminated utf8 string, and optional <a href="#SkCanvas_drawAnnotation_2_value">value</a> is stored as <a href="undocumented#Data">Data</a>. +Associate <a href='SkRect_Reference#Rect'>Rect</a> on <a href='#Canvas'>Canvas</a> when an annotation; a <a href='#SkCanvas_drawAnnotation_2_key'>key</a>-<a href='#SkCanvas_drawAnnotation_2_value'>value</a> pair, where the <a href='#SkCanvas_drawAnnotation_2_key'>key</a> is +a null-terminated utf8 string, and optional <a href='#SkCanvas_drawAnnotation_2_value'>value</a> is stored as <a href='undocumented#Data'>Data</a>. -Only some canvas implementations, such as recording to <a href="undocumented#Picture">Picture</a>, or drawing to -<a href="undocumented#PDF">Document PDF</a>, use annotations. +Only some canvas implementations, such as recording to <a href='undocumented#Picture'>Picture</a>, or drawing to +<a href='undocumented#PDF'>Document PDF</a>, use annotations. ### Parameters -<table> <tr> <td><a name="SkCanvas_drawAnnotation_2_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> extent of canvas to annotate</td> - </tr> <tr> <td><a name="SkCanvas_drawAnnotation_2_key"> <code><strong>key </strong></code> </a></td> <td> -string used for lookup</td> - </tr> <tr> <td><a name="SkCanvas_drawAnnotation_2_value"> <code><strong>value </strong></code> </a></td> <td> -data holding <a href="#SkCanvas_drawAnnotation_2_value">value</a> stored in annotation</td> +<table> <tr> <td><a name='SkCanvas_drawAnnotation_2_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> extent of canvas to annotate</td> + </tr> + <tr> <td><a name='SkCanvas_drawAnnotation_2_key'><code><strong>key</strong></code></a></td> + <td>string used for lookup</td> + </tr> + <tr> <td><a name='SkCanvas_drawAnnotation_2_value'><code><strong>value</strong></code></a></td> + <td>data holding <a href='#SkCanvas_drawAnnotation_2_value'>value</a> stored in annotation</td> </tr> </table> @@ -5874,48 +6981,52 @@ data holding <a href="#SkCanvas_drawAnnotation_2_value">value</a> stored in anno ### See Also -<a href="undocumented#SkPicture">SkPicture</a> <a href="undocumented#SkDocument">SkDocument</a> +<a href='undocumented#SkPicture'>SkPicture</a> <a href='undocumented#SkDocument'>SkDocument</a> --- -<a name="SkCanvas_getDrawFilter"></a> +<a name='SkCanvas_getDrawFilter'></a> ## getDrawFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkDrawFilter* getDrawFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkDrawFilter'>SkDrawFilter</a>* <a href='#SkCanvas_getDrawFilter'>getDrawFilter</a>() const </pre> +Deprecated. + soon --- -<a name="SkCanvas_setDrawFilter"></a> +<a name='SkCanvas_setDrawFilter'></a> ## setDrawFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual <a href='undocumented#SkDrawFilter'>SkDrawFilter</a>* <a href='#SkCanvas_setDrawFilter'>setDrawFilter</a>(<a href='undocumented#SkDrawFilter'>SkDrawFilter</a>* filter) </pre> +Deprecated. + soon --- -<a name="SkCanvas_isClipEmpty"></a> +<a name='SkCanvas_isClipEmpty'></a> ## isClipEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual bool isClipEmpty() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual bool <a href='#SkCanvas_isClipEmpty'>isClipEmpty</a>() const </pre> -Returns true if <a href="#Clip">Clip</a> is empty; that is, nothing will draw. +Returns true if <a href='#Clip'>Clip</a> is empty; that is, nothing will draw. May do work when called; it should not be called more often than needed. However, once called, subsequent calls perform no -work until <a href="#Clip">Clip</a> changes. +work until <a href='#Clip'>Clip</a> changes. ### Return Value -true if <a href="#Clip">Clip</a> is empty +true if <a href='#Clip'>Clip</a> is empty ### Example @@ -5932,23 +7043,23 @@ clip is empty ### See Also -<a href="#SkCanvas_isClipRect">isClipRect</a> <a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a><sup><a href="#SkCanvas_getLocalClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a><sup><a href="#SkCanvas_getDeviceClipBounds_2">[2]</a></sup> +<a href='#SkCanvas_isClipRect'>isClipRect</a> <a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a><sup><a href='#SkCanvas_getLocalClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a><sup><a href='#SkCanvas_getDeviceClipBounds_2'>[2]</a></sup> --- -<a name="SkCanvas_isClipRect"></a> +<a name='SkCanvas_isClipRect'></a> ## isClipRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual bool isClipRect() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual bool <a href='#SkCanvas_isClipRect'>isClipRect</a>() const </pre> -Returns true if <a href="#Clip">Clip</a> is <a href="SkRect_Reference#Rect">Rect</a> and not empty. -Returns false if the clip is empty, or if it is not <a href="SkRect_Reference#Rect">Rect</a>. +Returns true if <a href='#Clip'>Clip</a> is <a href='SkRect_Reference#Rect'>Rect</a> and not empty. +Returns false if the clip is empty, or if it is not <a href='SkRect_Reference#Rect'>Rect</a>. ### Return Value -true if <a href="#Clip">Clip</a> is <a href="SkRect_Reference#Rect">Rect</a> and not empty +true if <a href='#Clip'>Clip</a> is <a href='SkRect_Reference#Rect'>Rect</a> and not empty ### Example @@ -5965,7 +7076,7 @@ clip is not rect ### See Also -<a href="#SkCanvas_isClipEmpty">isClipEmpty</a> <a href="#SkCanvas_getLocalClipBounds">getLocalClipBounds</a><sup><a href="#SkCanvas_getLocalClipBounds_2">[2]</a></sup> <a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a><sup><a href="#SkCanvas_getDeviceClipBounds_2">[2]</a></sup> +<a href='#SkCanvas_isClipEmpty'>isClipEmpty</a> <a href='#SkCanvas_getLocalClipBounds'>getLocalClipBounds</a><sup><a href='#SkCanvas_getLocalClipBounds_2'>[2]</a></sup> <a href='#SkCanvas_getDeviceClipBounds'>getDeviceClipBounds</a><sup><a href='#SkCanvas_getDeviceClipBounds_2'>[2]</a></sup> --- diff --git a/site/user/api/SkColor4f_Reference.md b/site/user/api/SkColor4f_Reference.md index 9717ec4781..425b8c271c 100644 --- a/site/user/api/SkColor4f_Reference.md +++ b/site/user/api/SkColor4f_Reference.md @@ -1,58 +1,147 @@ SkColor4f Reference === -# <a name="Color4f"></a> Color4f +# <a name='Color4f'>Color4f</a> -# <a name="SkColor4f"></a> Struct SkColor4f -The float values are 0...1 unpremultiplied +# <a name='SkColor4f'>Struct SkColor4f</a> -## <a name="Overview"></a> Overview +## <a name='Member'>Member</a> -## <a name="Overview_Subtopic"></a> Overview Subtopic -| name | description | -| --- | --- | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| Member | member values | -| <a href="#Operator">Operator</a> | operator overloading methods | +SkColor4f members may be read and written directly without using a member function. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fA'>fA</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fB'>fB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fG'>fG</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_fR'>fR</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> +</table> +The float values are 0...1 <a href='undocumented#Unpremultiply'>Unpremultiplied</a> + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> +</table> -## <a name="Operator"></a> Operator -| name | description | -| --- | --- | -| <a href="#SkColor4f_notequal1_operator">operator!=(const SkColor4f& other) const</a> | incomplete | -| <a href="#SkColor4f_equal1_operator">operator==(const SkColor4f& other) const</a> | incomplete | +## <a name='Operator'>Operator</a> -## <a name="Member_Function"></a> Member Function -| name | description | -| --- | --- | -| <a href="#SkColor4f_FromColor">FromColor</a> | incomplete | -| <a href="#SkColor4f_Pin">Pin</a> | incomplete | -| <a href="#SkColor4f_pin">pin</a> | incomplete | -| <a href="#SkColor4f_premul">premul</a> | incomplete | -| <a href="#SkColor4f_toSkColor">toSkColor</a> | incomplete | -| <a href="#SkColor4f_vec">vec</a> | incomplete | +SkColor4f operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_notequal1_operator'>operator!=(const SkColor4f& other) const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_equal1_operator'>operator==(const SkColor4f& other) const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> +</table> -<a name="SkColor4f_fR"> <code><strong>float fR</strong></code> </a> -<a name="SkColor4f_fG"> <code><strong>float fG</strong></code> </a> +## <a name='Member_Function'>Member Function</a> -<a name="SkColor4f_fB"> <code><strong>float fB</strong></code> </a> -<a name="SkColor4f_fA"> <code><strong>float fA</strong></code> </a> +SkColor4f member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_FromColor'>FromColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_Pin'>Pin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_pin'>pin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_toSkColor'>toSkColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor4f_vec'>vec</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> +</table> + + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fR'><code>fR</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fG'><code>fG</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +incomplete</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fB'><code>fB</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>float</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkColor4f_fA'><code>fA</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +incomplete</td> + </tr> +</table> -<a name="SkColor4f_equal1_operator"></a> +<a name='SkColor4f_equal1_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> bool operator==(const SkColor4f& other) _const </pre> ### Parameters -<table> <tr> <td><a name="SkColor4f_equal1_operator_other"> <code><strong>other </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColor4f_equal1_operator_other'><code><strong>other</strong></code></a></td> + <td>incomplete</td> </tr> </table> @@ -70,17 +159,17 @@ incomplete --- -<a name="SkColor4f_notequal1_operator"></a> +<a name='SkColor4f_notequal1_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> bool operator!=(const SkColor4f& other) _const </pre> ### Parameters -<table> <tr> <td><a name="SkColor4f_notequal1_operator_other"> <code><strong>other </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColor4f_notequal1_operator_other'><code><strong>other</strong></code></a></td> + <td>incomplete</td> </tr> </table> @@ -98,11 +187,11 @@ incomplete --- -<a name="SkColor4f_vec"></a> +<a name='SkColor4f_vec'></a> ## vec -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const float* vec() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const float* <a href='#SkColor4f_vec'>vec</a>() const </pre> ### Return Value @@ -119,10 +208,10 @@ incomplete --- -<a name="SkColor4f_vec_2"></a> +<a name='SkColor4f_vec_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -float* vec() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +float* <a href='#SkColor4f_vec'>vec</a>() </pre> ### Return Value @@ -139,23 +228,26 @@ incomplete --- -<a name="SkColor4f_Pin"></a> +<a name='SkColor4f_Pin'></a> ## Pin -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkColor4f Pin(float r, float g, float b, float a) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_Pin'>Pin</a>(float r, float g, float b, float a) </pre> ### Parameters -<table> <tr> <td><a name="SkColor4f_Pin_r"> <code><strong>r </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColor4f_Pin_g"> <code><strong>g </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColor4f_Pin_b"> <code><strong>b </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColor4f_Pin_a"> <code><strong>a </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColor4f_Pin_r'><code><strong>r</strong></code></a></td> + <td>incomplete</td> + </tr> + <tr> <td><a name='SkColor4f_Pin_g'><code><strong>g</strong></code></a></td> + <td>incomplete</td> + </tr> + <tr> <td><a name='SkColor4f_Pin_b'><code><strong>b</strong></code></a></td> + <td>incomplete</td> + </tr> + <tr> <td><a name='SkColor4f_Pin_a'><code><strong>a</strong></code></a></td> + <td>incomplete</td> </tr> </table> @@ -173,19 +265,19 @@ incomplete --- -<a name="SkColor4f_FromColor"></a> +<a name='SkColor4f_FromColor'></a> ## FromColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkColor4f FromColor(SkColor) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_FromColor'>FromColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a>) </pre> -Convert to <a href="#SkColor4f">SkColor4f</a>, assuming <a href="SkColor_Reference#SkColor">SkColor</a> is sRGB +Convert to <a href='#SkColor4f'>SkColor4f</a>, assuming <a href='SkColor_Reference#SkColor'>SkColor</a> is sRGB ### Parameters -<table> <tr> <td><a name="SkColor4f_FromColor_SkColor"> <code><strong>SkColor </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColor4f_FromColor_SkColor'><code><strong>SkColor</strong></code></a></td> + <td>incomplete</td> </tr> </table> @@ -203,11 +295,11 @@ incomplete --- -<a name="SkColor4f_toSkColor"></a> +<a name='SkColor4f_toSkColor'></a> ## toSkColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColor toSkColor() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkColor4f_toSkColor'>toSkColor</a>() const </pre> ### Return Value @@ -224,11 +316,11 @@ incomplete --- -<a name="SkColor4f_pin"></a> +<a name='SkColor4f_pin'></a> ## pin -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColor4f pin() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkColor4f'>SkColor4f</a> <a href='#SkColor4f_pin'>pin</a>() const </pre> ### Return Value @@ -245,24 +337,17 @@ incomplete --- -<a name="SkColor4f_premul"></a> +<a name='SkColor4f_premul'></a> ## premul -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPM4f premul() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPM4f'>SkPM4f</a> <a href='#SkColor4f_premul'>premul</a>() const </pre> -### Return Value - -incomplete - -### Example - -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> - -### See Also - -incomplete +Deprecated. --- +# <a name='SkPM4f'>Struct SkPM4f</a> +Deprecated. + diff --git a/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md index 42de657ae3..f2a1475e1c 100644 --- a/site/user/api/SkColor_Reference.md +++ b/site/user/api/SkColor_Reference.md @@ -1,187 +1,334 @@ SkColor Reference === -# <a name="Color"></a> Color +# <a name='Color'>Color</a> -## <a name="Overview"></a> Overview +## Overview -## <a name="Overview_Subtopic"></a> Overview Subtopic - -| name | description | -| --- | --- | - -## <a name="Define"></a> Define +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Define'>Defines</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preprocessor definitions of functions, values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Typedef'>Typedef Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>types defined by other types</td> + </tr> +</table> -| name | description | -| --- | --- | -## <a name="Function"></a> Function +## <a name='Define'>Define</a> -| name | description | -| --- | --- | -## <a name="Typedef"></a> Typedef +SkColor uses preprocessor definitions to inline code and constants, and to abstract platform-specific functionality. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetA'>SkColorGetA</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha'>Alpha</a> component</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetB'>SkColorGetB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetG'>SkColorGetG</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorGetR'>SkColorGetR</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorSetRGB'>SkColorSetRGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns opaque <a href='#Color'>Color</a></td> + </tr> +</table> +<a href='#Color'>Color</a> constants can be helpful to write code, documenting the meaning of values +the represent transparency and color values. The use of <a href='#Color'>Color</a> constants is not +required. -| name | description | -| --- | --- | +## <a name='Constant'>Constant</a> -## <a name="Alpha"></a> Alpha -## <a name="RGB"></a> RGB +SkColor related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_AlphaOPAQUE'>SK AlphaOPAQUE</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fully opaque <a href='#SkAlpha'>SkAlpha</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_AlphaTRANSPARENT'>SK AlphaTRANSPARENT</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fully transparent <a href='#SkAlpha'>SkAlpha</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorBLACK'>SK ColorBLACK</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>black <a href='#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorBLUE'>SK ColorBLUE</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>blue <a href='#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorCYAN'>SK ColorCYAN</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>cyan <a href='#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorDKGRAY'>SK ColorDKGRAY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>dark gray <a href='#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorGRAY'>SK ColorGRAY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>gray <a href='#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorGREEN'>SK ColorGREEN</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>green <a href='#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorLTGRAY'>SK ColorLTGRAY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>light gray <a href='#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorMAGENTA'>SK ColorMAGENTA</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>magenta <a href='#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorRED'>SK ColorRED</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>red <a href='#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>transparent <a href='#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorWHITE'>SK ColorWHITE</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>white <a href='#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SK_ColorYELLOW'>SK ColorYELLOW</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>yellow <a href='#Color'>Color</a></td> + </tr> +</table> -## <a name="RGB_Red"></a> RGB Red -## <a name="RGB_Blue"></a> RGB Blue +## <a name='Function'>Function</a> -## <a name="RGB_Green"></a> RGB Green -## <a name="ARGB"></a> ARGB +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorSetA'>SkColorSetA</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorSetARGB'>SkColorSetARGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha'>Color Alpha</a> and <a href='#RGB'>Color RGB</a> combined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorToHSV'>SkColorToHSV</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts RGB to <a href='#HSV'>HSV</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkHSVToColor'>SkHSVToColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#HSV'>HSV</a> with <a href='#Alpha'>Alpha</a> to RGB</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkHSVToColor'>SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPreMultiplyARGB'>SkPreMultiplyARGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='#ARGB'>ARGB</a> to <a href='undocumented#Premultiply'>Premultiplied</a> <a href='#PMColor'>PMColor</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPreMultiplyColor'>SkPreMultiplyColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='#Color'>Color</a> to <a href='undocumented#Premultiply'>Premultiplied</a> <a href='#PMColor'>PMColor</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRGBToHSV'>SkRGBToHSV</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + </tr> +</table> -## <a name="RBG"></a> RBG -## <a name="RGB-565"></a> RGB-565 +## <a name='Typedef'>Typedef</a> -## <a name="Gray"></a> Gray -<a href="undocumented#Types">Types</a> and macros for colors -8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent. -32 bit <a href="#ARGB">ARGB</a> color value, not premultiplied. The color components are always in -a known order. This is different from <a href="#SkPMColor">SkPMColor</a>, which has its bytes in a configuration -dependent order, to match the format of <a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a> bitmaps. <a href="#SkColor">SkColor</a> -is the type used to specify colors in <a href="SkPaint_Reference#SkPaint">SkPaint</a> and in gradients. +SkColor <code>typedef</code> define a data type. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlpha'>SkAlpha</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines <a href='#Alpha'>Alpha</a> as eight bits</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColor'>SkColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines <a href='#Color'>Color</a> as 32 bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPMColor'>SkPMColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>defines <a href='undocumented#Premultiply'>Premultiplied</a> <a href='#Color'>Color</a> as 32 bits</td> + </tr> +</table> -<a name="SkColorSetARGB"></a> -## SkColorSetARGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) -</pre> +## <a name='RGB'>RGB</a> -Return <a href="#SkColorSetARGB_a">a</a> <a href="#SkColor">SkColor</a> value from 8 bit component values +## <a name='RGB_Red'>RGB Red</a> -### Parameters +## <a name='RGB_Blue'>RGB Blue</a> -<table> <tr> <td><a name="SkColorSetARGB_a"> <code><strong>a </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColorSetARGB_r"> <code><strong>r </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColorSetARGB_g"> <code><strong>g </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColorSetARGB_b"> <code><strong>b </strong></code> </a></td> <td> -incomplete</td> - </tr> -</table> +## <a name='RGB_Green'>RGB Green</a> -### Return Value +## <a name='ARGB'>ARGB</a> -incomplete +## <a name='RBG'>RBG</a> -### Example +## <a name='RGB-565'>RGB-565</a> -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +## <a name='Gray'>Gray</a> -### See Also +## <a name='Alpha'>Alpha</a> -incomplete +<a href='#Alpha'>Alpha</a> represents the transparency of <a href='#Color'>Color</a>. <a href='#Color'>Color</a> with <a href='#Alpha'>Alpha</a> of zero is fully +transparent. <a href='#Color'>Color</a> with <a href='#Alpha'>Alpha</a> of 255 is fully opaque. Some, but not all pixel +formats contain <a href='#Alpha'>Alpha</a>. Pixels with <a href='#Alpha'>Alpha</a> may store it as unsigned integers or +floating point values. Unsigned integer <a href='#Alpha'>Alpha</a> ranges from zero, fully +transparent, to all bits set, fully opaque. Floating point <a href='#Alpha'>Alpha</a> ranges from +zero, fully transparent, to one, fully opaque. ---- +# <a name='SkAlpha'>Typedef SkAlpha</a> +8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent. -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SkColorSetARGBInline">SkColorSetARGBInline</a> <a href="#SkColorSetARGB">SkColorSetARGB</a> -</pre> +# <a name='SkColor'>Typedef SkColor</a> +32-bit <a href='#ARGB'>ARGB</a> <a href='#Color'>Color</a> value, <a href='undocumented#Unpremultiply'>Unpremultiplied</a>. <a href='#Color'>Color</a> components are always in +a known order. This is different from <a href='#SkPMColor'>SkPMColor</a>, which has its bytes in a configuration +dependent order, to match the format of <a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a> bitmaps. <a href='#SkColor'>SkColor</a> +is the type used to specify colors in <a href='SkPaint_Reference#SkPaint'>SkPaint</a> and in gradients. -Legacy aliases. +<a href='#Color'>Color</a> that is <a href='undocumented#Premultiply'>Premultiplied</a> has the same component values as <a href='#Color'>Color</a> +that is <a href='undocumented#Unpremultiply'>Unpremultiplied</a> if <a href='#Alpha'>Alpha</a> is 255, fully opaque, although may have the +component values in a different order. ### See Also -incomplete - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SkColorSetARGBMacro">SkColorSetARGBMacro</a> <a href="#SkColorSetARGB">SkColorSetARGB</a> -</pre> +<a href='#SkPMColor'>SkPMColor</a> -### See Also - -incomplete +<a name='SkColorSetARGB'></a> +## SkColorSetARGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define SkColorSetRGB(r, g, b) <a href="#SkColorSetARGB">SkColorSetARGB(0xFF, r, g, b)</a> +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr inline <a href='#SkColor'>SkColor</a> <a href='#SkColorSetARGB'>SkColorSetARGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> a, <a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b) </pre> -Return a <a href="#SkColor">SkColor</a> value from 8 bit component values, with an implied value -of 0xFF for alpha (fully opaque) +Returns <a href='#Color'>Color</a> value from 8-bit component values. Asserts if SK_DEBUG is defined +if <a href='#SkColorSetARGB_a'>a</a>, <a href='#SkColorSetARGB_r'>r</a>, <a href='#SkColorSetARGB_g'>g</a>, or <a href='#SkColorSetARGB_b'>b</a> exceed 255. Since <a href='#Color'>Color</a> is <a href='undocumented#Unpremultiply'>Unpremultiplied</a>, <a href='#SkColorSetARGB_a'>a</a> may be smaller +than the largest of <a href='#SkColorSetARGB_r'>r</a>, <a href='#SkColorSetARGB_g'>g</a>, and <a href='#SkColorSetARGB_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkColorSetRGB_r"> <code><strong>r </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColorSetRGB_g"> <code><strong>g </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColorSetRGB_b"> <code><strong>b </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColorSetARGB_a'><code><strong>a</strong></code></a></td> + <td>amount of <a href='#Alpha'>Alpha</a>, from fully transparent (0) to fully opaque (255)</td> + </tr> + <tr> <td><a name='SkColorSetARGB_r'><code><strong>r</strong></code></a></td> + <td>amount of <a href='#RGB_Red'>RGB Red</a>, from no red (0) to full red (255)</td> + </tr> + <tr> <td><a name='SkColorSetARGB_g'><code><strong>g</strong></code></a></td> + <td>amount of <a href='#RGB_Green'>RGB Green</a>, from no green (0) to full green (255)</td> + </tr> + <tr> <td><a name='SkColorSetARGB_b'><code><strong>b</strong></code></a></td> + <td>amount of <a href='#RGB_Blue'>RGB Blue</a>, from no blue (0) to full blue (255)</td> </tr> </table> +### Return Value + +color and alpha, <a href='undocumented#Unpremultiply'>Unpremultiplied</a> + ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="35888f0869e01a6e03b5b93bba563734"></fiddle-embed></div> ### See Also -incomplete +<a href='#SkColorSetRGB'>SkColorSetRGB</a> <a href='SkPaint_Reference#SkPaint_setARGB'>SkPaint::setARGB</a> <a href='SkPaint_Reference#SkPaint_setColor'>SkPaint::setColor</a> + +--- <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define SkColorGetA(color) (((color) >> 24) & 0xFF) + #define <a href='#SkColorSetARGBInline'>SkColorSetARGBInline</a> <a href='#SkColorSetARGB'>SkColorSetARGB</a> </pre> -return the alpha byte from a <a href="#SkColor">SkColor</a> value - -### Parameters - -<table> <tr> <td><a name="SkColorGetA_color"> <code><strong>color </strong></code> </a></td> <td> -incomplete</td> - </tr> -</table> +Deprecated. -### Example +soon -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> + #define <a href='#SkColorSetARGBMacro'>SkColorSetARGBMacro</a> <a href='#SkColorSetARGB'>SkColorSetARGB</a> +</pre> -### See Also +Deprecated. -incomplete +soon <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define SkColorGetR(color) (((color) >> 16) & 0xFF) + #define <a href='#SkColorSetRGB'>SkColorSetRGB(r, g, b)</a> <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, r, g, b)</a> </pre> -return the red byte from a <a href="#SkColor">SkColor</a> value +Returns <a href='#Color'>Color</a> value from 8-bit component values, with <a href='#Alpha'>Alpha</a> set +fully opaque to 255. ### Parameters -<table> <tr> <td><a name="SkColorGetR_color"> <code><strong>color </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColorSetRGB_r'><code><strong>r</strong></code></a></td> + <td>amount of <a href='#RGB_Red'>RGB Red</a>, from no red (0) to full red (255)</td> + </tr> + <tr> <td><a name='SkColorSetRGB_g'><code><strong>g</strong></code></a></td> + <td>amount of <a href='#RGB_Green'>RGB Green</a>, from no green (0) to full green (255)</td> + </tr> + <tr> <td><a name='SkColorSetRGB_b'><code><strong>b</strong></code></a></td> + <td>amount of <a href='#RGB_Blue'>RGB Blue</a>, from no blue (0) to full blue (255)</td> </tr> </table> +### Return Value + +color with opaque alpha + ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="dad12dd912197cd5edd789ac0801bf8a"></fiddle-embed></div> ### See Also incomplete <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define SkColorGetG(color) (((color) >> 8) & 0xFF) + #define <a href='#SkColorGetA'>SkColorGetA(color)</a> (((color) >> 24) & 0xFF) </pre> -return the green byte from a <a href="#SkColor">SkColor</a> value +Returns <a href='#Alpha'>Alpha</a> byte from <a href='#Color'>Color</a> value. ### Parameters -<table> <tr> <td><a name="SkColorGetG_color"> <code><strong>color </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColorGetA_color'><code><strong>color</strong></code></a></td> + <td><a href='#SkColor'>SkColor</a>, a 32-bit unsigned int, in 0xAARRGGBB format</td> </tr> </table> @@ -194,18 +341,22 @@ incomplete</td> incomplete <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define SkColorGetB(color) (((color) >> 0) & 0xFF) + #define <a href='#SkColorGetR'>SkColorGetR(color)</a> (((color) >> 16) & 0xFF) </pre> -return the blue byte from a <a href="#SkColor">SkColor</a> value +Returns red component of <a href='#Color'>Color</a>, from zero to 255. ### Parameters -<table> <tr> <td><a name="SkColorGetB_color"> <code><strong>color </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColorGetR_color'><code><strong>color</strong></code></a></td> + <td><a href='#SkColor'>SkColor</a>, a 32-bit unsigned int, in 0xAARRGGBB format</td> </tr> </table> +### Return Value + +red byte + ### Example <div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> @@ -214,25 +365,22 @@ incomplete</td> incomplete -<a name="SkColorSetA"></a> -## SkColorSetA - <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a) + #define <a href='#SkColorGetG'>SkColorGetG(color)</a> (((color) >> 8) & 0xFF) </pre> +Returns green component of <a href='#Color'>Color</a>, from zero to 255. + ### Parameters -<table> <tr> <td><a name="SkColorSetA_c"> <code><strong>c </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkColorSetA_a"> <code><strong>a </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkColorGetG_color'><code><strong>color</strong></code></a></td> + <td><a href='#SkColor'>SkColor</a>, a 32-bit unsigned int, in 0xAARRGGBB format</td> </tr> </table> ### Return Value -incomplete +green byte ### Example @@ -242,28 +390,22 @@ incomplete incomplete ---- - <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_AlphaTRANSPARENT">SK AlphaTRANSPARENT</a> static_cast<<a href="#SkAlpha">SkAlpha</a>>(0x00) + #define <a href='#SkColorGetB'>SkColorGetB(color)</a> (((color) >> 0) & 0xFF) </pre> -common colors -transparent <a href="#SkAlpha">SkAlpha</a> value - -### Example - -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +Returns blue component of <a href='#Color'>Color</a>, from zero to 255. -### See Also +### Parameters -incomplete +<table> <tr> <td><a name='SkColorGetB_color'><code><strong>color</strong></code></a></td> + <td><a href='#SkColor'>SkColor</a>, a 32-bit unsigned int, in 0xAARRGGBB format</td> + </tr> +</table> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_AlphaOPAQUE">SK AlphaOPAQUE</a> static_cast<<a href="#SkAlpha">SkAlpha</a>>(0xFF) -</pre> +### Return Value -opaque <a href="#SkAlpha">SkAlpha</a> value +blue byte ### Example @@ -273,40 +415,29 @@ opaque <a href="#SkAlpha">SkAlpha</a> value incomplete -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorTRANSPARENT">SK ColorTRANSPARENT</a> static_cast<<a href="#SkColor">SkColor</a>>(0x00000000) -</pre> - -transparent <a href="#SkColor">SkColor</a> value - -### Example - -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> - -### See Also - -incomplete +<a name='SkColorSetA'></a> +## SkColorSetA -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorBLACK">SK ColorBLACK</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFF000000) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr inline <a href='#SkColor'>SkColor</a> <a href='#SkColorSetA'>SkColorSetA</a>(<a href='#SkColor'>SkColor</a> c, <a href='undocumented#U8CPU'>U8CPU</a> a) </pre> -black <a href="#SkColor">SkColor</a> value +Returns <a href='#Color'>Color</a> with red, blue, and green set from <a href='#SkColorSetA_c'>c</a>; and alpha set from <a href='#SkColorSetA_a'>a</a>. -### Example +### Parameters -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<table> <tr> <td><a name='SkColorSetA_c'><code><strong>c</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='#ARGB'>Color ARGB</a></td> + </tr> + <tr> <td><a name='SkColorSetA_a'><code><strong>a</strong></code></a></td> + <td>incomplete</td> + </tr> +</table> -### See Also +### Return Value incomplete -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorDKGRAY">SK ColorDKGRAY</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFF444444) -</pre> - -dark gray <a href="#SkColor">SkColor</a> value - ### Example <div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> @@ -315,169 +446,359 @@ dark gray <a href="#SkColor">SkColor</a> value incomplete -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorGRAY">SK ColorGRAY</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFF888888) -</pre> - -gray <a href="#SkColor">SkColor</a> value - -### Example - -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> - -### See Also - -incomplete +--- -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorLTGRAY">SK ColorLTGRAY</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFFCCCCCC) -</pre> +## <a name='Alpha_Constants'>Alpha Constants</a> -light gray <a href="#SkColor">SkColor</a> value -### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +### Constants -### See Also +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Alpha_Constants'><code>Alpha_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fully transparent SkAlpha</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Alpha_Constants'><code>Alpha_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fully opaque SkAlpha</td> + </tr> +</table> -incomplete <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorWHITE">SK ColorWHITE</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFFFFFFFF) + constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaTRANSPARENT'>SK AlphaTRANSPARENT</a> = 0x00; + constexpr <a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaOPAQUE'>SK AlphaOPAQUE</a> = 0xFF; </pre> -white <a href="#SkColor">SkColor</a> value +<a href='#Alpha'>Alpha</a> constants are conveniences to represent fully transparent and fully +opaque colors and masks. Their use is not required. + +### Constants + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Details</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_AlphaTRANSPARENT'><code>SK_AlphaTRANSPARENT</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x00</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Constants_Transparent'>Alpha Constants Transparent</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully transparent <a href='#SkAlpha'>SkAlpha</a> value. <a href='#SkAlpha'>SkAlpha</a> ranges from zero, +fully transparent; to 255, fully opaque. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_AlphaOPAQUE'><code>SK_AlphaOPAQUE</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Constants_Opaque'>Alpha Constants Opaque</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque <a href='#SkAlpha'>SkAlpha</a> value. <a href='#SkAlpha'>SkAlpha</a> ranges from zero, +fully transparent; to 255, fully opaque. +</td> + </tr> +</table> + +## <a name='Alpha_Constants_Transparent'>Alpha Constants Transparent</a> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="bc9c7ea424d10bbcd1e5a88770d4794e"><div><a href='#Color'>Color</a> the parts of the bitmap red if they mostly contain transparent pixels. +</div></fiddle-embed></div> ### See Also -incomplete - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorRED">SK ColorRED</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFFFF0000) -</pre> +<a href='#SkAlpha'>SkAlpha</a> <a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a> <a href='#SK_AlphaOPAQUE'>SK AlphaOPAQUE</a> -red <a href="#SkColor">SkColor</a> value +## <a name='Alpha_Constants_Opaque'>Alpha Constants Opaque</a> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="0424f67ebc2858e8fd04ae3367b115ff"></fiddle-embed></div> ### See Also -incomplete +<a href='#SkAlpha'>SkAlpha</a> <a href='#SK_AlphaTRANSPARENT'>SK AlphaTRANSPARENT</a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorGREEN">SK ColorGREEN</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFF00FF00) -</pre> +## <a name='Color_Constants'>Color Constants</a> -green <a href="#SkColor">SkColor</a> value -### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +### Constants -### See Also +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>transparent Color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>black Color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>dark gray Color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>gray Color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>light gray Color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>white Color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>red Color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>green Color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>blue Color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>yellow Color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>cyan Color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Color_Constants'><code>Color_Constants</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>magenta Color</td> + </tr> +</table> -incomplete <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorBLUE">SK ColorBLUE</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFF0000FF) + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0x00, 0x00, 0x00, 0x00)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLACK'>SK ColorBLACK</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0x00, 0x00)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorDKGRAY'>SK ColorDKGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x44, 0x44, 0x44)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGRAY'>SK ColorGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x88, 0x88, 0x88)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorLTGRAY'>SK ColorLTGRAY</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xCC, 0xCC, 0xCC)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorWHITE'>SK ColorWHITE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorRED'>SK ColorRED</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0x00, 0x00)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGREEN'>SK ColorGREEN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLUE'>SK ColorBLUE</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0x00, 0xFF)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorYELLOW'>SK ColorYELLOW</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0xFF, 0x00)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorCYAN'>SK ColorCYAN</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0x00, 0xFF, 0xFF)</a>; + constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorMAGENTA'>SK ColorMAGENTA</a> = <a href='#SkColorSetARGB'>SkColorSetARGB(0xFF, 0xFF, 0x00, 0xFF)</a>; </pre> -blue <a href="#SkColor">SkColor</a> value +<a href='#Color'>Color</a> names are provided as conveniences, but are not otherwise special. +The values chosen for names may not be the same as values used by +<a href='undocumented#SVG'>SVG</a>, HTML, CSS, or colors named by a platform. ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> - -### See Also - -incomplete - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorYELLOW">SK ColorYELLOW</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFFFFFF00) -</pre> +<div><fiddle-embed name="1c2e38321464818847f953ddd45cb5a1"></fiddle-embed></div> + +### Constants + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Details</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorTRANSPARENT'><code>SK_ColorTRANSPARENT</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x00000000</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Constants_Transparent'>Color Constants Transparent</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully transparent <a href='#SkColor'>SkColor</a>. May be used to initialize a destination +containing a mask or a non-rectangular image. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorBLACK'><code>SK_ColorBLACK</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF000000</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Constants_Black'>Color Constants Black</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque black. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorDKGRAY'><code>SK_ColorDKGRAY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF444444</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque dark gray. +Note that SVG_darkgray is equivalent to 0xFFA9A9A9. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorGRAY'><code>SK_ColorGRAY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF888888</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque gray. +Note that HTML_Gray is equivalent to 0xFF808080. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorLTGRAY'><code>SK_ColorLTGRAY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFCCCCCC</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque light gray. HTML_Silver is equivalent to 0xFFC0C0C0. +Note that SVG_lightgray is equivalent to 0xFFD3D3D3. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorWHITE'><code>SK_ColorWHITE</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFFFFFFF</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque white. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorRED'><code>SK_ColorRED</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFFF0000</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque red. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorGREEN'><code>SK_ColorGREEN</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF00FF00</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque green. HTML_Lime is equivalent. +Note that HTML_Green is equivalent to 0xFF008000. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorBLUE'><code>SK_ColorBLUE</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF0000FF</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque blue. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorYELLOW'><code>SK_ColorYELLOW</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFFFFF00</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque yellow. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorCYAN'><code>SK_ColorCYAN</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFF00FFFF</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque cyan. HTML_Aqua is equivalent. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SK_ColorMAGENTA'><code>SK_ColorMAGENTA</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFFF00FF</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Represents fully opaque magenta. HTML_Fuchsia is equivalent. +</td> + </tr> +</table> -yellow <a href="#SkColor">SkColor</a> value +## <a name='Color_Constants_Transparent'>Color Constants Transparent</a> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="cfda8cd3b435bb28e2f4b9c7f15603a6"></fiddle-embed></div> ### See Also -incomplete +<a href='#SK_AlphaTRANSPARENT'>SK AlphaTRANSPARENT</a> <a href='SkCanvas_Reference#SkCanvas_clear'>SkCanvas::clear</a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorCYAN">SK ColorCYAN</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFF00FFFF) -</pre> - -cyan <a href="#SkColor">SkColor</a> value +## <a name='Color_Constants_Black'>Color Constants Black</a> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="6971489f28291f08e429cc6ccc73b09b"></fiddle-embed></div> ### See Also -incomplete - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - #define <a href="#SK_ColorMAGENTA">SK ColorMAGENTA</a> static_cast<<a href="#SkColor">SkColor</a>>(0xFFFF00FF) -</pre> +<a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a> -magenta <a href="#SkColor">SkColor</a> value +## <a name='Color_Constants_White'>Color Constants White</a> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="fce650f997e802d4e55edf62b8437a2d"></fiddle-embed></div> ### See Also -incomplete +<a href='#SK_ColorTRANSPARENT'>SK ColorTRANSPARENT</a> -## <a name="HSV"></a> HSV +## <a name='HSV'>HSV</a> -## <a name="HSV_Hue"></a> HSV Hue +## <a name='HSV_Hue'>HSV Hue</a> -<a href="#HSV_Hue">Hue</a> represents an angle, in degrees, on a color wheel. <a href="#HSV_Hue">Hue</a> has a positive value +<a href='#HSV_Hue'>Hue</a> represents an angle, in degrees, on a color wheel. <a href='#HSV_Hue'>Hue</a> has a positive value modulo 360, where zero degrees is red. -## <a name="HSV_Saturation"></a> HSV Saturation +## <a name='HSV_Saturation'>HSV Saturation</a> -## <a name="HSV_Value"></a> HSV Value +## <a name='HSV_Value'>HSV Value</a> -<a name="SkRGBToHSV"></a> +<a name='SkRGBToHSV'></a> ## SkRGBToHSV -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SK_API void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +SK_API void <a href='#SkRGBToHSV'>SkRGBToHSV</a>(<a href='undocumented#U8CPU'>U8CPU</a> red, <a href='undocumented#U8CPU'>U8CPU</a> green, <a href='undocumented#U8CPU'>U8CPU</a> blue, <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]) </pre> -Convert RGB components to <a href="#HSV">HSV</a>. -<a href="#SkRGBToHSV_hsv">hsv</a>[0] is <a href="#HSV_Hue">Hue</a> [0 .. 360) -<a href="#SkRGBToHSV_hsv">hsv</a>[1] is <a href="#HSV_Saturation">Saturation</a> [0...1] -<a href="#SkRGBToHSV_hsv">hsv</a>[2] is <a href="#HSV_Value">Value</a> [0...1] +Converts RGB components to <a href='#HSV'>HSV</a>. +<a href='#SkRGBToHSV_hsv'>hsv</a>[0] contains <a href='#HSV_Hue'>Hue</a>, a value from zero to less than 360. +<a href='#SkRGBToHSV_hsv'>hsv</a>[1] contains <a href='#HSV_Saturation'>Saturation</a>, a value from zero to one. +<a href='#SkRGBToHSV_hsv'>hsv</a>[2] contains <a href='#HSV_Value'>Value</a>, a value from zero to one. ### Parameters -<table> <tr> <td><a name="SkRGBToHSV_red"> <code><strong>red </strong></code> </a></td> <td> -<a href="#SkRGBToHSV_red">red</a> component value [0..255] -</td> - </tr> <tr> <td><a name="SkRGBToHSV_green"> <code><strong>green </strong></code> </a></td> <td> -<a href="#SkRGBToHSV_green">green</a> component value [0..255] -</td> - </tr> <tr> <td><a name="SkRGBToHSV_blue"> <code><strong>blue </strong></code> </a></td> <td> -<a href="#SkRGBToHSV_blue">blue</a> component value [0..255] -</td> - </tr> <tr> <td><a name="SkRGBToHSV_hsv"> <code><strong>hsv </strong></code> </a></td> <td> -3 element array which holds the resulting <a href="#HSV">HSV</a> components. -</td> +<table> <tr> <td><a name='SkRGBToHSV_red'><code><strong>red</strong></code></a></td> + <td><a href='#SkRGBToHSV_red'>red</a> component value from zero to 255</td> + </tr> + <tr> <td><a name='SkRGBToHSV_green'><code><strong>green</strong></code></a></td> + <td><a href='#SkRGBToHSV_green'>green</a> component value from zero to 255</td> + </tr> + <tr> <td><a name='SkRGBToHSV_blue'><code><strong>blue</strong></code></a></td> + <td><a href='#SkRGBToHSV_blue'>blue</a> component value from zero to 255</td> + </tr> + <tr> <td><a name='SkRGBToHSV_hsv'><code><strong>hsv</strong></code></a></td> + <td>three element array which holds the resulting <a href='#HSV'>HSV</a> components</td> </tr> </table> @@ -495,26 +816,25 @@ incomplete --- -<a name="SkColorToHSV"></a> +<a name='SkColorToHSV'></a> ## SkColorToHSV -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static inline void SkColorToHSV(SkColor color, SkScalar hsv[3]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static inline void <a href='#SkColorToHSV'>SkColorToHSV</a>(<a href='#SkColor'>SkColor</a> color, <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]) </pre> -Convert the argb <a href="#SkColorToHSV_color">color</a> to its <a href="#HSV">HSV</a> components. -<a href="#SkColorToHSV_hsv">hsv</a>[0] represents <a href="#HSV_Hue">Hue</a>, and is assigned a value from zero to less than 360. -<a href="#SkColorToHSV_hsv">hsv</a>[1] is <a href="#HSV_Saturation">Saturation</a> [0...1] -<a href="#SkColorToHSV_hsv">hsv</a>[2] is <a href="#HSV_Value">Value</a> [0...1] +Converts <a href='#ARGB'>ARGB</a> to its <a href='#HSV'>HSV</a> components. <a href='#Alpha'>Alpha</a> in <a href='#ARGB'>ARGB</a> is ignored. +<a href='#SkColorToHSV_hsv'>hsv</a>[0] contains <a href='#HSV_Hue'>Hue</a>, and is assigned a value from zero to less than 360. +<a href='#SkColorToHSV_hsv'>hsv</a>[1] contains <a href='#HSV_Saturation'>Saturation</a>, a value from zero to one. +<a href='#SkColorToHSV_hsv'>hsv</a>[2] contains <a href='#HSV_Value'>Value</a>, a value from zero to one. ### Parameters -<table> <tr> <td><a name="SkColorToHSV_color"> <code><strong>color </strong></code> </a></td> <td> -the argb <a href="#SkColorToHSV_color">color</a> to convert. Note: the alpha component is ignored. -</td> - </tr> <tr> <td><a name="SkColorToHSV_hsv"> <code><strong>hsv </strong></code> </a></td> <td> -3 element array which holds the resulting <a href="#HSV">HSV</a> components. -</td> +<table> <tr> <td><a name='SkColorToHSV_color'><code><strong>color</strong></code></a></td> + <td><a href='#ARGB'>ARGB</a> <a href='#SkColorToHSV_color'>color</a> to convert</td> + </tr> + <tr> <td><a name='SkColorToHSV_hsv'><code><strong>hsv</strong></code></a></td> + <td>three element array which holds the resulting <a href='#HSV'>HSV</a> components</td> </tr> </table> @@ -532,34 +852,33 @@ incomplete --- -<a name="SkHSVToColor"></a> +<a name='SkHSVToColor'></a> ## SkHSVToColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +SK_API <a href='#SkColor'>SkColor</a> <a href='#SkHSVToColor'>SkHSVToColor</a>(<a href='undocumented#U8CPU'>U8CPU</a> alpha, const <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]) </pre> -Convert <a href="#HSV">HSV</a> components to an <a href="#ARGB">ARGB</a> color. The <a href="#SkHSVToColor_alpha">alpha</a> component is passed through unchanged. -<a href="#SkHSVToColor_hsv">hsv</a>[0] represents <a href="#HSV_Hue">Hue</a>, an angle from zero to less than 360. -<a href="#SkHSVToColor_hsv">hsv</a>[1] represents <a href="#HSV_Saturation">Saturation</a>, and varies from zero to one. -<a href="#SkHSVToColor_hsv">hsv</a>[2] represents <a href="#HSV_Value">Value</a>, and varies from zero to one. +Converts <a href='#HSV'>HSV</a> components to an <a href='#ARGB'>ARGB</a> color. The <a href='#SkHSVToColor_alpha'>alpha</a> component is passed through unchanged. +<a href='#SkHSVToColor_hsv'>hsv</a>[0] represents <a href='#HSV_Hue'>Hue</a>, an angle from zero to less than 360. +<a href='#SkHSVToColor_hsv'>hsv</a>[1] represents <a href='#HSV_Saturation'>Saturation</a>, and varies from zero to one. +<a href='#SkHSVToColor_hsv'>hsv</a>[2] represents <a href='#HSV_Value'>Value</a>, and varies from zero to one. -If <a href="#SkHSVToColor_hsv">hsv</a> values are out of range, they are pinned. +If <a href='#SkHSVToColor_hsv'>hsv</a> values are out of range, they are pinned. ### Parameters -<table> <tr> <td><a name="SkHSVToColor_alpha"> <code><strong>alpha </strong></code> </a></td> <td> -the <a href="#SkHSVToColor_alpha">alpha</a> component of the returned argb color. -</td> - </tr> <tr> <td><a name="SkHSVToColor_hsv"> <code><strong>hsv </strong></code> </a></td> <td> -3 element array which holds the input <a href="#HSV">HSV</a> components. -</td> +<table> <tr> <td><a name='SkHSVToColor_alpha'><code><strong>alpha</strong></code></a></td> + <td><a href='#Alpha'>Alpha</a> component of the returned <a href='#ARGB'>ARGB</a> color</td> + </tr> + <tr> <td><a name='SkHSVToColor_hsv'><code><strong>hsv</strong></code></a></td> + <td>three element array which holds the input <a href='#HSV'>HSV</a> components</td> </tr> </table> ### Return Value -the resulting argb color +<a href='#ARGB'>ARGB</a> equivalent to <a href='#HSV'>HSV</a> ### Example @@ -571,30 +890,30 @@ incomplete --- -<a name="SkHSVToColor_2"></a> +<a name='SkHSVToColor_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static inline SkColor SkHSVToColor(const SkScalar hsv[3]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static inline <a href='#SkColor'>SkColor</a> <a href='#SkHSVToColor'>SkHSVToColor</a>(const <a href='undocumented#SkScalar'>SkScalar</a> hsv[3]) </pre> -Convert <a href="#HSV">HSV</a> components to an <a href="#ARGB">ARGB</a> color. The alpha component set to 0xFF. -<a href="#SkHSVToColor_2_hsv">hsv</a>[0] represents <a href="#HSV_Hue">Hue</a>, an angle from zero to less than 360. -<a href="#SkHSVToColor_2_hsv">hsv</a>[1] represents <a href="#HSV_Saturation">Saturation</a>, and varies from zero to one. -<a href="#SkHSVToColor_2_hsv">hsv</a>[2] represents <a href="#HSV_Value">Value</a>, and varies from zero to one. +Convert <a href='#HSV'>HSV</a> components to an <a href='#ARGB'>ARGB</a> color. The alpha component set to 0xFF. +<a href='#SkHSVToColor_2_hsv'>hsv</a>[0] represents <a href='#HSV_Hue'>Hue</a>, an angle from zero to less than 360. +<a href='#SkHSVToColor_2_hsv'>hsv</a>[1] represents <a href='#HSV_Saturation'>Saturation</a>, and varies from zero to one. +<a href='#SkHSVToColor_2_hsv'>hsv</a>[2] represents <a href='#HSV_Value'>Value</a>, and varies from zero to one. -If <a href="#SkHSVToColor_2_hsv">hsv</a> values are out of range, they are pinned. +If <a href='#SkHSVToColor_2_hsv'>hsv</a> values are out of range, they are pinned. ### Parameters -<table> <tr> <td><a name="SkHSVToColor_2_hsv"> <code><strong>hsv </strong></code> </a></td> <td> -3 element array which holds the input <a href="#HSV">HSV</a> components. +<table> <tr> <td><a name='SkHSVToColor_2_hsv'><code><strong>hsv</strong></code></a></td> + <td>3 element array which holds the input <a href='#HSV'>HSV</a> components. </td> </tr> </table> ### Return Value -the resulting argb color +the resulting <a href='#ARGB'>ARGB</a> color ### Example @@ -606,30 +925,36 @@ incomplete --- -32 bit <a href="#ARGB">ARGB</a> color value, premultiplied. The byte order for this value is -configuration dependent, matching the format of <a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a> bitmaps. -This is different from <a href="#SkColor">SkColor</a>, which is nonpremultiplied, and is always in the +## <a name='PMColor'>PMColor</a> + +# <a name='SkPMColor'>Typedef SkPMColor</a> +32-bit <a href='#ARGB'>ARGB</a> color value, <a href='undocumented#Premultiply'>Premultiplied</a>. The byte order for this value is +configuration dependent, matching the format of <a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a> bitmaps. +This is different from <a href='#SkColor'>SkColor</a>, which is <a href='undocumented#Unpremultiply'>Unpremultiplied</a>, and is always in the same byte order. -<a name="SkPreMultiplyARGB"></a> +<a name='SkPreMultiplyARGB'></a> ## SkPreMultiplyARGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +SK_API <a href='#SkPMColor'>SkPMColor</a> <a href='#SkPreMultiplyARGB'>SkPreMultiplyARGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> a, <a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b) </pre> -Return <a href="#SkPreMultiplyARGB_a">a</a> <a href="#SkPMColor">SkPMColor</a> value from unpremultiplied 8 bit component values +Return <a href='#SkPreMultiplyARGB_a'>a</a> <a href='#SkPMColor'>SkPMColor</a> value from <a href='undocumented#Unpremultiply'>Unpremultiplied</a> 8-bit component values ### Parameters -<table> <tr> <td><a name="SkPreMultiplyARGB_a"> <code><strong>a </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkPreMultiplyARGB_r"> <code><strong>r </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkPreMultiplyARGB_g"> <code><strong>g </strong></code> </a></td> <td> -incomplete</td> - </tr> <tr> <td><a name="SkPreMultiplyARGB_b"> <code><strong>b </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkPreMultiplyARGB_a'><code><strong>a</strong></code></a></td> + <td>incomplete</td> + </tr> + <tr> <td><a name='SkPreMultiplyARGB_r'><code><strong>r</strong></code></a></td> + <td>incomplete</td> + </tr> + <tr> <td><a name='SkPreMultiplyARGB_g'><code><strong>g</strong></code></a></td> + <td>incomplete</td> + </tr> + <tr> <td><a name='SkPreMultiplyARGB_b'><code><strong>b</strong></code></a></td> + <td>incomplete</td> </tr> </table> @@ -647,21 +972,20 @@ incomplete --- -<a name="SkPreMultiplyColor"></a> +<a name='SkPreMultiplyColor'></a> ## SkPreMultiplyColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SK_API SkPMColor SkPreMultiplyColor(SkColor c) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +SK_API <a href='#SkPMColor'>SkPMColor</a> <a href='#SkPreMultiplyColor'>SkPreMultiplyColor</a>(<a href='#SkColor'>SkColor</a> c) </pre> -Return a <a href="#SkPMColor">SkPMColor</a> value from a <a href="#SkColor">SkColor</a> 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 <a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a> bitmaps. +Returns <a href='#PMColor'>PMColor</a> closest to <a href='#Color'>Color</a> <a href='#SkPreMultiplyColor_c'>c</a>. Multiplies <a href='#SkPreMultiplyColor_c'>c</a> RGB components by the <a href='#SkPreMultiplyColor_c'>c</a> <a href='#Alpha'>Alpha</a>, +and arranges the bytes to match the format of <a href='SkImageInfo_Reference#kN32_SkColorType'>kN32_SkColorType</a>. ### Parameters -<table> <tr> <td><a name="SkPreMultiplyColor_c"> <code><strong>c </strong></code> </a></td> <td> -incomplete</td> +<table> <tr> <td><a name='SkPreMultiplyColor_c'><code><strong>c</strong></code></a></td> + <td>incomplete</td> </tr> </table> diff --git a/site/user/api/SkIPoint_Reference.md b/site/user/api/SkIPoint_Reference.md index 07b6cb5d05..4648a6ca4b 100644 --- a/site/user/api/SkIPoint_Reference.md +++ b/site/user/api/SkIPoint_Reference.md @@ -1,83 +1,200 @@ SkIPoint Reference === -# <a name="IPoint"></a> IPoint +# <a name='IPoint'>IPoint</a> -## <a name="Overview"></a> Overview +# <a name='SkIPoint'>Struct SkIPoint</a> -## <a name="Overview_Subtopic"></a> Overview Subtopic +## <a name='Typedef'>Typedef</a> -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkIPoint">SkIPoint</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Member">Member</a> | member values | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -# <a name="SkIPoint"></a> Struct SkIPoint -<a href="#SkIPoint">SkIPoint</a> holds two 32 bit integer coordinates. +SkIPoint <code>typedef</code> define a data type. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> +<a href='#SkIPoint'>SkIPoint</a> holds two 32-bit integer coordinates. + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkIPoint'>SkIPoint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkIPoint global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#IVector'>IVector</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>alias for <a href='#IPoint'>IPoint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkIPoint member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from integer inputs</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_equals'>equals</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_isZero'>isZero</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fX'>fX</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fY'>fY</a></td> + </tr> +</table> -## <a name="Related_Function"></a> Related Function -| name | description | -| --- | --- | -| <a href="#Property">Property</a> | member values | -| <a href="#Set">Set</a> | replaces all values | +## <a name='Member'>Member</a> + + + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fX'><code>fX</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fY'><code>fY</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td> + </tr> +</table> -## <a name="Member_Function"></a> Member Function -| name | description | -| --- | --- | -| <a href="#SkIPoint_Make">Make</a> | constructs from integer inputs | -| <a href="#SkIPoint_equals">equals</a> | returns true if members are equal | -| <a href="#SkIPoint_isZero">isZero</a> | returns true if both members equal zero | -| <a href="#SkIPoint_set">set</a> | sets to integer input | -| <a href="#SkIPoint_x">x</a> | returns <a href="#SkIPoint_fX">fX</a> | -| <a href="#SkIPoint_y">y</a> | returns <a href="#SkIPoint_fY">fY</a> | +SkIPoint members may be read and written directly without using a member function. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_fX'>fX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_fY'>fY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td> + </tr> +</table> -## <a name="Member"></a> Member -| name | description | -| --- | --- | -| <a href="#SkIPoint_fX">fX</a> | x-axis value | -| <a href="#SkIPoint_fY">fY</a> | y-axis value | +### Members -<a name="SkIPoint_fX"> <code><strong>int32_t fX</strong></code> </a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIPoint_fX'><code>fX</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +x-axis value used by <a href='#IPoint'>IPoint</a>. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIPoint_fY'><code>fY</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +y-axis value used by <a href='#IPoint'>IPoint</a>. +</td> + </tr> -x-axis value used by <a href="#IPoint">IPoint</a>. -<a name="SkIPoint_fY"> <code><strong>int32_t fY</strong></code> </a> +## <a name='Constructor'>Constructor</a> -y-axis value used by <a href="#IPoint">IPoint</a>. -## <a name="Constructor"></a> Constructor +SkIPoint can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from integer inputs</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkIPoint_Make">Make</a> | constructs from integer inputs | -<a name="SkIPoint_Make"></a> +<a name='SkIPoint_Make'></a> ## Make -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkIPoint Make(int32_t x, int32_t y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_Make'>Make</a>(int32_t x, int32_t y) </pre> -Sets <a href="#SkIPoint_fX">fX</a> to x, <a href="#SkIPoint_fY">fY</a> to y. +Sets <a href='#SkIPoint_fX'>fX</a> to x, <a href='#SkIPoint_fY'>fY</a> to y. ### Parameters -<table> <tr> <td><a name="SkIPoint_Make_x"> <code><strong>x </strong></code> </a></td> <td> -integer x-axis value of constructed <a href="#IPoint">IPoint</a></td> - </tr> <tr> <td><a name="SkIPoint_Make_y"> <code><strong>y </strong></code> </a></td> <td> -integer y-axis value of constructed <a href="#IPoint">IPoint</a></td> +<table> <tr> <td><a name='SkIPoint_Make_x'><code><strong>x</strong></code></a></td> + <td>integer x-axis value of constructed <a href='#IPoint'>IPoint</a></td> + </tr> + <tr> <td><a name='SkIPoint_Make_y'><code><strong>y</strong></code></a></td> + <td>integer y-axis value of constructed <a href='#IPoint'>IPoint</a></td> </tr> </table> ### Return Value -<a href="#IPoint">IPoint</a> (x, y) +<a href='#IPoint'>IPoint</a> (x, y) ### Example @@ -93,30 +210,43 @@ pt1 == pt2 ### See Also -<a href="#SkIPoint_set">set</a> <a href="SkPoint_Reference#SkPoint_iset">SkPoint::iset()</a><sup><a href="SkPoint_Reference#SkPoint_iset_2">[2]</a></sup> <a href="SkPoint_Reference#SkPoint_Make">SkPoint::Make</a> +<a href='#SkIPoint_set'>set</a> <a href='SkPoint_Reference#SkPoint_iset'>SkPoint::iset()</a><sup><a href='SkPoint_Reference#SkPoint_iset_2'>[2]</a></sup> <a href='SkPoint_Reference#SkPoint_Make'>SkPoint::Make</a> --- -## <a name="Property"></a> Property +## <a name='Property'>Property</a> -| name | description | -| --- | --- | -| <a href="#SkIPoint_isZero">isZero</a> | returns true if both members equal zero | -| <a href="#SkIPoint_x">x</a> | returns <a href="#SkIPoint_fX">fX</a> | -| <a href="#SkIPoint_y">y</a> | returns <a href="#SkIPoint_fY">fY</a> | -<a name="SkIPoint_x"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_isZero'>isZero</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fX'>fX</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkIPoint_fY'>fY</a></td> + </tr> +</table> + + +<a name='SkIPoint_x'></a> ## x -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t x() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIPoint_x'>x</a>() const </pre> -Returns x-axis value of <a href="#IPoint">IPoint</a>. +Returns x-axis value of <a href='#IPoint'>IPoint</a>. ### Return Value -<a href="#SkIPoint_fX">fX</a> +<a href='#SkIPoint_fX'>fX</a> ### Example @@ -132,22 +262,22 @@ pt1.fX == pt1.x() ### See Also -<a href="#SkIPoint_y">y</a> <a href="SkPoint_Reference#SkPoint_x">SkPoint::x()</a> +<a href='#SkIPoint_y'>y</a> <a href='SkPoint_Reference#SkPoint_x'>SkPoint::x()</a> --- -<a name="SkIPoint_y"></a> +<a name='SkIPoint_y'></a> ## y -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t y() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIPoint_y'>y</a>() const </pre> -Returns y-axis value of <a href="#IPoint">IPoint</a>. +Returns y-axis value of <a href='#IPoint'>IPoint</a>. ### Return Value -<a href="#SkIPoint_fY">fY</a> +<a href='#SkIPoint_fY'>fY</a> ### Example @@ -163,22 +293,22 @@ pt1.fY == pt1.y() ### See Also -<a href="#SkIPoint_x">x</a> <a href="SkPoint_Reference#SkPoint_y">SkPoint::y()</a> +<a href='#SkIPoint_x'>x</a> <a href='SkPoint_Reference#SkPoint_y'>SkPoint::y()</a> --- -<a name="SkIPoint_isZero"></a> +<a name='SkIPoint_isZero'></a> ## isZero -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isZero() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIPoint_isZero'>isZero</a>() const </pre> -Returns true if <a href="#SkIPoint_fX">fX</a> and <a href="#SkIPoint_fY">fY</a> are both zero. +Returns true if <a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_fY'>fY</a> are both zero. ### Return Value -true if <a href="#SkIPoint_fX">fX</a> is zero and <a href="#SkIPoint_fY">fY</a> is zero +true if <a href='#SkIPoint_fX'>fX</a> is zero and <a href='#SkIPoint_fY'>fY</a> is zero ### Example @@ -194,31 +324,39 @@ pt.isZero() == true ### See Also -<a href="SkPoint_Reference#SkPoint_isZero">SkPoint::isZero</a> +<a href='SkPoint_Reference#SkPoint_isZero'>SkPoint::isZero</a> --- -## <a name="Set"></a> Set +## <a name='Set'>Set</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkIPoint_set">set</a> | sets to integer input | -<a name="SkIPoint_set"></a> +<a name='SkIPoint_set'></a> ## set -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(int32_t x, int32_t y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIPoint_set'>set</a>(int32_t x, int32_t y) </pre> -Sets <a href="#SkIPoint_fX">fX</a> to x and <a href="#SkIPoint_fY">fY</a> to y. +Sets <a href='#SkIPoint_fX'>fX</a> to x and <a href='#SkIPoint_fY'>fY</a> to y. ### Parameters -<table> <tr> <td><a name="SkIPoint_set_x"> <code><strong>x </strong></code> </a></td> <td> -new value for <a href="#SkIPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkIPoint_set_y"> <code><strong>y </strong></code> </a></td> <td> -new value for <a href="#SkIPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkIPoint_set_x'><code><strong>x</strong></code></a></td> + <td>new value for <a href='#SkIPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkIPoint_set_y'><code><strong>y</strong></code></a></td> + <td>new value for <a href='#SkIPoint_fY'>fY</a></td> </tr> </table> @@ -236,35 +374,64 @@ pt1 == pt2 ### See Also -<a href="#SkIPoint_Make">Make</a> +<a href='#SkIPoint_Make'>Make</a> --- -## <a name="Operator"></a> Operator +## <a name='Operator'>Operator</a> + + +SkIPoint operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_equals'>equals</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#IPoint'>IPoints</a> are unequal</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_add_operator'>operator+(const SkIPoint& a, const SkIVector& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#IPoint'>IPoint</a> offset by <a href='#IVector'>IVector</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_addto_operator'>operator+=(const SkIVector& v)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#IVector'>IVector</a> to <a href='#IPoint'>IPoint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_minus_operator'>operator-() const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses sign of <a href='#IPoint'>IPoint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_subtract_operator'>operator-(const SkIPoint& a, const SkIPoint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#IVector'>IVector</a> between <a href='#IPoint'>IPoints</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_subtractfrom_operator'>operator-=(const SkIVector& v)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>subtracts <a href='#IVector'>IVector</a> from <a href='#IPoint'>IPoint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#IPoint'>IPoints</a> are equal</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkIPoint_equals">equals</a> | returns true if members are equal | -| <a href="#SkIPoint_notequal_operator">operator!=(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are unequal | -| <a href="#SkIPoint_add_operator">operator+(const SkIPoint& a, const SkIVector& b)</a> | returns <a href="#IPoint">IPoint</a> offset by <a href="#IVector">IVector</a> | -| <a href="#SkIPoint_addto_operator">operator+=(const SkIVector& v)</a> | adds <a href="#IVector">IVector</a> to <a href="#IPoint">IPoint</a> | -| <a href="#SkIPoint_minus_operator">operator-() const</a> | reverses sign of <a href="#IPoint">IPoint</a> | -| <a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> | returns <a href="#IVector">IVector</a> between <a href="#IPoint">IPoints</a> | -| <a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> | subtracts <a href="#IVector">IVector</a> from <a href="#IPoint">IPoint</a> | -| <a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are equal | -<a name="SkIPoint_minus_operator"></a> +<a name='SkIPoint_minus_operator'></a> ## operator- -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIPoint operator-() _const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIPoint'>SkIPoint</a> operator-() _const </pre> -Returns <a href="#IPoint">IPoint</a> changing the signs of <a href="#SkIPoint_fX">fX</a> and <a href="#SkIPoint_fY">fY</a>. +Returns <a href='#IPoint'>IPoint</a> changing the signs of <a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_fY'>fY</a>. ### Return Value -<a href="#IPoint">IPoint</a> as (-<a href="#SkIPoint_fX">fX</a>, -<a href="#SkIPoint_fY">fY</a>) +<a href='#IPoint'>IPoint</a> as (-<a href='#SkIPoint_fX'>fX</a>, -<a href='#SkIPoint_fY'>fY</a>) ### Example @@ -283,24 +450,24 @@ pt: -2147483648, -2147483648 negate: -2147483648, -2147483648 ### See Also -<a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> <a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> <a href="SkPoint_Reference#SkPoint_minus_operator">SkPoint::operator-() const</a> +<a href='#SkIPoint_subtract_operator'>operator-(const SkIPoint& a, const SkIPoint& b)</a> <a href='#SkIPoint_subtractfrom_operator'>operator-=(const SkIVector& v)</a> <a href='SkPoint_Reference#SkPoint_minus_operator'>SkPoint::operator-() const</a> --- -<a name="SkIPoint_addto_operator"></a> +<a name='SkIPoint_addto_operator'></a> ## operator+= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void operator+=(const SkIVector& v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIPoint_addto_operator'>operator+=(const SkIVector& v)</a> </pre> -Offsets <a href="#IPoint">IPoint</a> by <a href="#IVector">IVector</a> <a href="#SkIPoint_addto_operator_v">v</a>. Sets <a href="#IPoint">IPoint</a> to(<a href="#SkIPoint_fX">fX</a> + <a href="#SkIPoint_addto_operator_v">v</a>.<a href="#SkIPoint_fX">fX</a>, <a href="#SkIPoint_fY">fY</a> + <a href="#SkIPoint_addto_operator_v">v</a>.<a href="#SkIPoint_fY">fY</a>) +Offsets <a href='#IPoint'>IPoint</a> by <a href='#IVector'>IVector</a> <a href='#SkIPoint_addto_operator_v'>v</a>. Sets <a href='#IPoint'>IPoint</a> to(<a href='#SkIPoint_fX'>fX</a> + <a href='#SkIPoint_addto_operator_v'>v</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_fY'>fY</a> + <a href='#SkIPoint_addto_operator_v'>v</a>.<a href='#SkIPoint_fY'>fY</a>) . ### Parameters -<table> <tr> <td><a name="SkIPoint_addto_operator_v"> <code><strong>v </strong></code> </a></td> <td> -<a href="#IVector">IVector</a> to add</td> +<table> <tr> <td><a name='SkIPoint_addto_operator_v'><code><strong>v</strong></code></a></td> + <td><a href='#IVector'>IVector</a> to add</td> </tr> </table> @@ -310,25 +477,25 @@ Offsets <a href="#IPoint">IPoint</a> by <a href="#IVector">IVector</a> <a href=" ### See Also -<a href="#SkIPoint_add_operator">operator+(const SkIPoint& a, const SkIVector& b)</a> <a href="SkPoint_Reference#SkPoint_addto_operator">SkPoint::operator+=(const SkVector& v)</a> +<a href='#SkIPoint_add_operator'>operator+(const SkIPoint& a, const SkIVector& b)</a> <a href='SkPoint_Reference#SkPoint_addto_operator'>SkPoint::operator+=(const SkVector& v)</a> --- -<a name="SkIPoint_subtractfrom_operator"></a> +<a name='SkIPoint_subtractfrom_operator'></a> ## operator-= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void operator-=(const SkIVector& v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIPoint_subtractfrom_operator'>operator-=(const SkIVector& v)</a> </pre> -Subtracts <a href="#IVector">IVector</a> <a href="#SkIPoint_subtractfrom_operator_v">v</a> from <a href="#IPoint">IPoint</a>. Sets <a href="#IPoint">IPoint</a> to: -(<a href="#SkIPoint_fX">fX</a> - <a href="#SkIPoint_subtractfrom_operator_v">v</a>.<a href="#SkIPoint_fX">fX</a>, <a href="#SkIPoint_fY">fY</a> - <a href="#SkIPoint_subtractfrom_operator_v">v</a>.<a href="#SkIPoint_fY">fY</a>) +Subtracts <a href='#IVector'>IVector</a> <a href='#SkIPoint_subtractfrom_operator_v'>v</a> from <a href='#IPoint'>IPoint</a>. Sets <a href='#IPoint'>IPoint</a> to: +(<a href='#SkIPoint_fX'>fX</a> - <a href='#SkIPoint_subtractfrom_operator_v'>v</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_fY'>fY</a> - <a href='#SkIPoint_subtractfrom_operator_v'>v</a>.<a href='#SkIPoint_fY'>fY</a>) . ### Parameters -<table> <tr> <td><a name="SkIPoint_subtractfrom_operator_v"> <code><strong>v </strong></code> </a></td> <td> -<a href="#IVector">IVector</a> to subtract</td> +<table> <tr> <td><a name='SkIPoint_subtractfrom_operator_v'><code><strong>v</strong></code></a></td> + <td><a href='#IVector'>IVector</a> to subtract</td> </tr> </table> @@ -338,31 +505,32 @@ Subtracts <a href="#IVector">IVector</a> <a href="#SkIPoint_subtractfrom_operato ### See Also -<a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> <a href="SkPoint_Reference#SkPoint_subtractfrom_operator">SkPoint::operator-=(const SkVector& v)</a> +<a href='#SkIPoint_subtract_operator'>operator-(const SkIPoint& a, const SkIPoint& b)</a> <a href='SkPoint_Reference#SkPoint_subtractfrom_operator'>SkPoint::operator-=(const SkVector& v)</a> --- -<a name="SkIPoint_equals"></a> +<a name='SkIPoint_equals'></a> ## equals -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool equals(int32_t x, int32_t y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIPoint_equals'>equals</a>(int32_t x, int32_t y) const </pre> -Returns true if <a href="#IPoint">IPoint</a> is equivalent to <a href="#IPoint">IPoint</a> constructed from (x, y). +Returns true if <a href='#IPoint'>IPoint</a> is equivalent to <a href='#IPoint'>IPoint</a> constructed from (x, y). ### Parameters -<table> <tr> <td><a name="SkIPoint_equals_x"> <code><strong>x </strong></code> </a></td> <td> -value compared with <a href="#SkIPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkIPoint_equals_y"> <code><strong>y </strong></code> </a></td> <td> -value compared with <a href="#SkIPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkIPoint_equals_x'><code><strong>x</strong></code></a></td> + <td>value compared with <a href='#SkIPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkIPoint_equals_y'><code><strong>y</strong></code></a></td> + <td>value compared with <a href='#SkIPoint_fY'>fY</a></td> </tr> </table> ### Return Value -true if <a href="#IPoint">IPoint</a> equals (x, y) +true if <a href='#IPoint'>IPoint</a> equals (x, y) ### Example @@ -381,31 +549,32 @@ pt: -2147483648, -1 == pt ### See Also -<a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> +<a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a> --- -<a name="SkIPoint_equal_operator"></a> +<a name='SkIPoint_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkIPoint& a, const SkIPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a> </pre> -Returns true if <a href="#SkIPoint_equal_operator_a">a</a> is equivalent to <a href="#SkIPoint_equal_operator_b">b</a>. +Returns true if <a href='#SkIPoint_equal_operator_a'>a</a> is equivalent to <a href='#SkIPoint_equal_operator_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkIPoint_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> to compare</td> - </tr> <tr> <td><a name="SkIPoint_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> to compare</td> +<table> <tr> <td><a name='SkIPoint_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> to compare</td> + </tr> + <tr> <td><a name='SkIPoint_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#SkIPoint_equal_operator_a">a</a>.<a href="#SkIPoint_fX">fX</a> == <a href="#SkIPoint_equal_operator_b">b</a>.<a href="#SkIPoint_fX">fX</a> and <a href="#SkIPoint_equal_operator_a">a</a>.<a href="#SkIPoint_fY">fY</a> == <a href="#SkIPoint_equal_operator_b">b</a>.<a href="#SkIPoint_fY">fY</a> +true if <a href='#SkIPoint_equal_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> == <a href='#SkIPoint_equal_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a> and <a href='#SkIPoint_equal_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> == <a href='#SkIPoint_equal_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a> ### Example @@ -424,31 +593,32 @@ pt: -2147483648, -1 == pt ### See Also -<a href="#SkIPoint_equals">equals</a> <a href="#SkIPoint_notequal_operator">operator!=(const SkIPoint& a, const SkIPoint& b)</a> +<a href='#SkIPoint_equals'>equals</a> <a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a> --- -<a name="SkIPoint_notequal_operator"></a> +<a name='SkIPoint_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkIPoint& a, const SkIPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIPoint_notequal_operator'>operator!=(const SkIPoint& a, const SkIPoint& b)</a> </pre> -Returns true if <a href="#SkIPoint_notequal_operator_a">a</a> is not equivalent to <a href="#SkIPoint_notequal_operator_b">b</a>. +Returns true if <a href='#SkIPoint_notequal_operator_a'>a</a> is not equivalent to <a href='#SkIPoint_notequal_operator_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkIPoint_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> to compare</td> - </tr> <tr> <td><a name="SkIPoint_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> to compare</td> +<table> <tr> <td><a name='SkIPoint_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> to compare</td> + </tr> + <tr> <td><a name='SkIPoint_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#SkIPoint_notequal_operator_a">a</a>.<a href="#SkIPoint_fX">fX</a> != <a href="#SkIPoint_notequal_operator_b">b</a>.<a href="#SkIPoint_fX">fX</a> or <a href="#SkIPoint_notequal_operator_a">a</a>.<a href="#SkIPoint_fY">fY</a> != <a href="#SkIPoint_notequal_operator_b">b</a>.<a href="#SkIPoint_fY">fY</a> +true if <a href='#SkIPoint_notequal_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> != <a href='#SkIPoint_notequal_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a> or <a href='#SkIPoint_notequal_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> != <a href='#SkIPoint_notequal_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a> ### Example @@ -467,34 +637,35 @@ pt: -2147483648, -1 == pt ### See Also -<a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> <a href="#SkIPoint_equals">equals</a> +<a href='#SkIPoint_equal_operator'>operator==(const SkIPoint& a, const SkIPoint& b)</a> <a href='#SkIPoint_equals'>equals</a> --- -<a name="SkIPoint_subtract_operator"></a> +<a name='SkIPoint_subtract_operator'></a> ## operator- -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIVector operator-(const SkIPoint& a, const SkIPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIVector'>SkIVector</a> <a href='#SkIPoint_subtract_operator'>operator-(const SkIPoint& a, const SkIPoint& b)</a> </pre> -Returns <a href="#IVector">IVector</a> from <a href="#SkIPoint_subtract_operator_b">b</a> to <a href="#SkIPoint_subtract_operator_a">a</a>; computed as(<a href="#SkIPoint_subtract_operator_a">a</a>.<a href="#SkIPoint_fX">fX</a> - <a href="#SkIPoint_subtract_operator_b">b</a>.<a href="#SkIPoint_fX">fX</a>, <a href="#SkIPoint_subtract_operator_a">a</a>.<a href="#SkIPoint_fY">fY</a> - <a href="#SkIPoint_subtract_operator_b">b</a>.<a href="#SkIPoint_fY">fY</a>) +Returns <a href='#IVector'>IVector</a> from <a href='#SkIPoint_subtract_operator_b'>b</a> to <a href='#SkIPoint_subtract_operator_a'>a</a>; computed as(<a href='#SkIPoint_subtract_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> - <a href='#SkIPoint_subtract_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_subtract_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> - <a href='#SkIPoint_subtract_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a>) . -Can also be used to subtract <a href="#IVector">IVector</a> from <a href="#IVector">IVector</a>, returning <a href="#IVector">IVector</a>. +Can also be used to subtract <a href='#IVector'>IVector</a> from <a href='#IVector'>IVector</a>, returning <a href='#IVector'>IVector</a>. ### Parameters -<table> <tr> <td><a name="SkIPoint_subtract_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> or <a href="#IVector">IVector</a> to subtract from</td> - </tr> <tr> <td><a name="SkIPoint_subtract_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IVector">IVector</a> to subtract</td> +<table> <tr> <td><a name='SkIPoint_subtract_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> or <a href='#IVector'>IVector</a> to subtract from</td> + </tr> + <tr> <td><a name='SkIPoint_subtract_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#IVector'>IVector</a> to subtract</td> </tr> </table> ### Return Value -<a href="#IVector">IVector</a> from <a href="#SkIPoint_subtract_operator_b">b</a> to <a href="#SkIPoint_subtract_operator_a">a</a> +<a href='#IVector'>IVector</a> from <a href='#SkIPoint_subtract_operator_b'>b</a> to <a href='#SkIPoint_subtract_operator_a'>a</a> ### Example @@ -502,36 +673,37 @@ Can also be used to subtract <a href="#IVector">IVector</a> from <a href="#IVect ### See Also -<a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> +<a href='#SkIPoint_subtractfrom_operator'>operator-=(const SkIVector& v)</a> --- -<a name="SkIPoint_add_operator"></a> +<a name='SkIPoint_add_operator'></a> ## operator+ -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIPoint operator+(const SkIPoint& a, const SkIVector& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIPoint'>SkIPoint</a> <a href='#SkIPoint_add_operator'>operator+(const SkIPoint& a, const SkIVector& b)</a> </pre> -Returns <a href="#IPoint">IPoint</a> resulting from <a href="#IPoint">IPoint</a> <a href="#SkIPoint_add_operator_a">a</a> offset by <a href="#IVector">IVector</a> <a href="#SkIPoint_add_operator_b">b</a>, computed as: -(<a href="#SkIPoint_add_operator_a">a</a>.<a href="#SkIPoint_fX">fX</a> + <a href="#SkIPoint_add_operator_b">b</a>.<a href="#SkIPoint_fX">fX</a>, <a href="#SkIPoint_add_operator_a">a</a>.<a href="#SkIPoint_fY">fY</a> + <a href="#SkIPoint_add_operator_b">b</a>.<a href="#SkIPoint_fY">fY</a>) +Returns <a href='#IPoint'>IPoint</a> resulting from <a href='#IPoint'>IPoint</a> <a href='#SkIPoint_add_operator_a'>a</a> offset by <a href='#IVector'>IVector</a> <a href='#SkIPoint_add_operator_b'>b</a>, computed as: +(<a href='#SkIPoint_add_operator_a'>a</a>.<a href='#SkIPoint_fX'>fX</a> + <a href='#SkIPoint_add_operator_b'>b</a>.<a href='#SkIPoint_fX'>fX</a>, <a href='#SkIPoint_add_operator_a'>a</a>.<a href='#SkIPoint_fY'>fY</a> + <a href='#SkIPoint_add_operator_b'>b</a>.<a href='#SkIPoint_fY'>fY</a>) . -Can also be used to offset <a href="#IPoint">IPoint</a> <a href="#SkIPoint_add_operator_b">b</a> by <a href="#IVector">IVector</a> <a href="#SkIPoint_add_operator_a">a</a>, returning <a href="#IPoint">IPoint</a>. -Can also be used to add <a href="#IVector">IVector</a> to <a href="#IVector">IVector</a>, returning <a href="#IVector">IVector</a>. +Can also be used to offset <a href='#IPoint'>IPoint</a> <a href='#SkIPoint_add_operator_b'>b</a> by <a href='#IVector'>IVector</a> <a href='#SkIPoint_add_operator_a'>a</a>, returning <a href='#IPoint'>IPoint</a>. +Can also be used to add <a href='#IVector'>IVector</a> to <a href='#IVector'>IVector</a>, returning <a href='#IVector'>IVector</a>. ### Parameters -<table> <tr> <td><a name="SkIPoint_add_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> or <a href="#IVector">IVector</a> to add to</td> - </tr> <tr> <td><a name="SkIPoint_add_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IPoint">IPoint</a> or <a href="#IVector">IVector</a> to add</td> +<table> <tr> <td><a name='SkIPoint_add_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> or <a href='#IVector'>IVector</a> to add to</td> + </tr> + <tr> <td><a name='SkIPoint_add_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#IPoint'>IPoint</a> or <a href='#IVector'>IVector</a> to add</td> </tr> </table> ### Return Value -<a href="#IPoint">IPoint</a> equal to <a href="#SkIPoint_add_operator_a">a</a> offset by <a href="#SkIPoint_add_operator_b">b</a> +<a href='#IPoint'>IPoint</a> equal to <a href='#SkIPoint_add_operator_a'>a</a> offset by <a href='#SkIPoint_add_operator_b'>b</a> ### Example @@ -539,8 +711,17 @@ Can also be used to add <a href="#IVector">IVector</a> to <a href="#IVector">IVe ### See Also -<a href="#SkIPoint_addto_operator">operator+=(const SkIVector& v)</a> +<a href='#SkIPoint_addto_operator'>operator+=(const SkIVector& v)</a> --- -# <a name="IVector"></a> IVector +## <a name='IVector'>IVector</a> + +# <a name='SkIVector'>Typedef SkIVector</a> + +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> + typedef <a href='#SkIPoint'>SkIPoint</a> <a href='#SkIVector'>SkIVector</a>; +</pre> + +<a href='#SkIVector'>SkIVector</a> provides an alternative name for <a href='#SkIPoint'>SkIPoint</a>. <a href='#SkIVector'>SkIVector</a> and <a href='#SkIPoint'>SkIPoint</a> +can be used interchangably for all purposes.
\ No newline at end of file diff --git a/site/user/api/SkIRect_Reference.md b/site/user/api/SkIRect_Reference.md index ab76bb24be..a728f35191 100644 --- a/site/user/api/SkIRect_Reference.md +++ b/site/user/api/SkIRect_Reference.md @@ -1,134 +1,397 @@ SkIRect Reference === -# <a name="IRect"></a> IRect +# <a name='IRect'>IRect</a> -## <a name="Overview"></a> Overview +# <a name='SkIRect'>Struct SkIRect</a> +<a href='#SkIRect'>SkIRect</a> holds four 32-bit integer coordinates describing the upper and +lower bounds of a rectangle. <a href='#SkIRect'>SkIRect</a> may be created from outer bounds or +from position, width, and height. <a href='#SkIRect'>SkIRect</a> 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. -## <a name="Overview_Subtopic"></a> Overview Subtopic +## Overview -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkIRect">SkIRect</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Member">Member</a> | member values | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkIRect'>SkIRect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> -# <a name="SkIRect"></a> Struct SkIRect -<a href="#SkIRect">SkIRect</a> holds four 32 bit integer coordinates describing the upper and -lower bounds of a rectangle. <a href="#SkIRect">SkIRect</a> may be created from outer bounds or -from position, width, and height. <a href="#SkIRect">SkIRect</a> 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. -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Inset_Outset_Offset">Inset Outset Offset</a> | moves sides | -| <a href="#Intersection">Intersection</a> | set to shared bounds | -| <a href="#Join">Join</a> | set to union of bounds | -| <a href="#Property">Property</a> | member values, center, validity | -| <a href="#Set">Set</a> | replaces all values | -| <a href="#Sorting">Sorting</a> | orders sides | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkIRect_EmptyIRect">EmptyIRect</a> | returns immutable bounds of (0, 0, 0, 0) | -| <a href="#SkIRect_Intersects">Intersects</a> | returns true if areas overlap | -| <a href="#SkIRect_IntersectsNoEmptyCheck">IntersectsNoEmptyCheck</a> | returns true if areas overlap skips empty check | -| <a href="#SkIRect_MakeEmpty">MakeEmpty</a> | returns bounds of (0, 0, 0, 0) | -| <a href="#SkIRect_MakeLTRB">MakeLTRB</a> | constructs from int left, top, right, bottom | -| <a href="#SkIRect_MakeSize">MakeSize</a> | constructs from <a href="undocumented#ISize">ISize</a> returning (0, 0, width, height) | -| <a href="#SkIRect_MakeWH">MakeWH</a> | constructs from int input returning (0, 0, width, height) | -| <a href="#SkIRect_MakeXYWH">MakeXYWH</a> | constructs from int input returning (x, y, width, height) | -| <a href="#SkIRect_bottom">bottom</a> | returns larger bounds in y, if sorted | -| <a href="#SkIRect_contains">contains</a> | returns true if <a href="SkIPoint_Reference#IPoint">IPoint</a> (x, y) is equal or inside | -| <a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a> | returns true if contains unsorted <a href="#IRect">IRect</a> | -| <a href="#SkIRect_height">height</a> | returns span in y | -| <a href="#SkIRect_height64">height64</a> | returns span in y as int64_t | -| <a href="#SkIRect_inset">inset</a> | moves the sides symmetrically about the center | -| <a href="#SkIRect_intersect">intersect</a> | sets to shared area; returns true if not empty | -| <a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> | sets to shared area; returns true if not empty skips empty check | -| <a href="#SkIRect_isEmpty">isEmpty</a> | returns true if width or height are zero or negative or they exceed int32_t | -| <a href="#SkIRect_isEmpty64">isEmpty64</a> | returns true if width or height are zero or negative | -| <a href="#SkIRect_join">join</a> | sets to union of bounds | -| <a href="#SkIRect_left">left</a> | returns smaller bounds in x, if sorted | -| <a href="#SkIRect_makeInset">makeInset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkIRect_makeOffset">makeOffset</a> | constructs from translated sides | -| <a href="#SkIRect_makeOutset">makeOutset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkIRect_makeSorted">makeSorted</a> | constructs, ordering sides from smaller to larger | -| <a href="#SkIRect_offset">offset</a> | translates sides without changing width and height | -| <a href="#SkIRect_offsetTo">offsetTo</a> | translates to (x, y) without changing width and height | -| <a href="#SkIRect_outset">outset</a> | moves the sides symmetrically about the center | -| <a href="#SkIRect_right">right</a> | returns larger bounds in x, if sorted | -| <a href="#SkIRect_set">set</a> | sets to (left, top, right, bottom) | -| <a href="#SkIRect_setEmpty">setEmpty</a> | sets to (0, 0, 0, 0) | -| <a href="#SkIRect_setLTRB">setLTRB</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (left, top, right, bottom) | -| <a href="#SkIRect_setXYWH">setXYWH</a> | sets to (x, y, width, height) | -| <a href="#SkIRect_size">size</a> | returns <a href="undocumented#ISize">ISize</a> (width, height) | -| <a href="#SkIRect_sort">sort</a> | orders sides from smaller to larger | -| <a href="#SkIRect_top">top</a> | returns smaller bounds in y, if sorted | -| <a href="#SkIRect_width">width</a> | returns span in x | -| <a href="#SkIRect_width64">width64</a> | returns span in y as int64_t | -| <a href="#SkIRect_x">x</a> | returns bounds left | -| <a href="#SkIRect_y">y</a> | returns bounds top | - -## <a name="Member"></a> Member - -| name | description | -| --- | --- | -| <a href="#SkIRect_fBottom">fBottom</a> | larger y-axis bounds | -| <a href="#SkIRect_fLeft">fLeft</a> | smaller x-axis bounds | -| <a href="#SkIRect_fRight">fRight</a> | larger x-axis bounds | -| <a href="#SkIRect_fTop">fTop</a> | smaller y-axis bounds | - -<a name="SkIRect_fLeft"> <code><strong>int32_t fLeft</strong></code> </a> +## <a name='Related_Function'>Related Function</a> -May contain any value. The smaller of the horizontal values when sorted. -When equal to or greater than <a href="#SkIRect_fRight">fRight</a>, <a href="#IRect">IRect</a> is empty. -<a name="SkIRect_fTop"> <code><strong>int32_t fTop</strong></code> </a> +SkIRect global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Inset_Outset_Offset'>Inset Outset Offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves sides</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Intersection'>Intersection</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Join'>Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values, center, validity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Sorting'>Sorting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides</td> + </tr> +</table> -May contain any value. The smaller of the horizontal values when sorted. -When equal to or greater than <a href="#SkIRect_fBottom">fBottom</a>, <a href="#IRect">IRect</a> is empty. -<a name="SkIRect_fRight"> <code><strong>int32_t fRight</strong></code> </a> +## <a name='Member_Function'>Member Function</a> -May contain any value. The larger of the vertical values when sorted. -When equal to or less than <a href="#SkIRect_fLeft">fLeft</a>, <a href="#IRect">IRect</a> is empty. -<a name="SkIRect_fBottom"> <code><strong>int32_t fBottom</strong></code> </a> +SkIRect member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_EmptyIRect'>EmptyIRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns immutable bounds of (0, 0, 0, 0)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_Intersects'>Intersects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap skips empty check</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeEmpty'>MakeEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of (0, 0, 0, 0)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeLTRB'>MakeLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int left, top, right, bottom</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeSize'>MakeSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#ISize'>ISize</a> returning (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeWH'>MakeWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeXYWH'>MakeXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (x, y, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_bottom'>bottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in y, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_contains'>contains</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkIPoint_Reference#IPoint'>IPoint</a> (x, y) is equal or inside</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if contains unsorted <a href='#IRect'>IRect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height64'>height64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_inset'>inset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersect'>intersect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty skips empty check</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative or they exceed int32_t</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty64'>isEmpty64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join'>join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_left'>left</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in x, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeInset'>makeInset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOffset'>makeOffset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translated sides</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOutset'>makeOutset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeSorted'>makeSorted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#IRect'>IRect</a>, ordering sides from smaller to larger</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates sides without changing width and height</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offsetTo'>offsetTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates to (x, y) without changing width and height</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_outset'>outset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_right'>right</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in x, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (left, top, right, bottom)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setEmpty'>setEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (0, 0, 0, 0)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setLTRB'>setLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setXYWH'>setXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (x, y, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_size'>size</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#ISize'>ISize</a> (width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_sort'>sort</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides from smaller to larger</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_top'>top</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in y, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width64'>width64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds left</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds top</td> + </tr> +</table> + + +## <a name='Member'>Member</a> + + + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fLeft'><code>fLeft</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller x-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fTop'><code>fTop</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller y-axis bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fRight'><code>fRight</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger x-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fBottom'><code>fBottom</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger y-axis bounds</td> + </tr> +</table> + + +SkIRect members may be read and written directly without using a member function. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fBottom'>fBottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger y-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fLeft'>fLeft</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller x-axis bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fRight'>fRight</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger x-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_fTop'>fTop</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller y-axis bounds</td> + </tr> +</table> + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIRect_fLeft'><code>fLeft</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May contain any value. The smaller of the horizontal values when sorted. +When equal to or greater than <a href='#SkIRect_fRight'>fRight</a>, <a href='#IRect'>IRect</a> is empty. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIRect_fTop'><code>fTop</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May contain any value. The smaller of the horizontal values when sorted. +When equal to or greater than <a href='#SkIRect_fBottom'>fBottom</a>, <a href='#IRect'>IRect</a> is empty. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIRect_fRight'><code>fRight</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May contain any value. The larger of the vertical values when sorted. +When equal to or less than <a href='#SkIRect_fLeft'>fLeft</a>, <a href='#IRect'>IRect</a> is empty. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>int32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkIRect_fBottom'><code>fBottom</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> May contain any value. The larger of the vertical values when sorted. -When equal to or less than <a href="#SkIRect_fTop">fTop</a>, <a href="#IRect">IRect</a> is empty. - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkIRect_EmptyIRect">EmptyIRect</a> | returns immutable bounds of (0, 0, 0, 0) | -| <a href="#SkIRect_MakeEmpty">MakeEmpty</a> | returns bounds of (0, 0, 0, 0) | -| <a href="#SkIRect_MakeLTRB">MakeLTRB</a> | constructs from int left, top, right, bottom | -| <a href="#SkIRect_MakeSize">MakeSize</a> | constructs from <a href="undocumented#ISize">ISize</a> returning (0, 0, width, height) | -| <a href="#SkIRect_MakeWH">MakeWH</a> | constructs from int input returning (0, 0, width, height) | -| <a href="#SkIRect_MakeXYWH">MakeXYWH</a> | constructs from int input returning (x, y, width, height) | -| <a href="#SkIRect_makeInset">makeInset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkIRect_makeOffset">makeOffset</a> | constructs from translated sides | -| <a href="#SkIRect_makeOutset">makeOutset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkIRect_makeSorted">makeSorted</a> | constructs, ordering sides from smaller to larger | - -<a name="SkIRect_MakeEmpty"></a> +When equal to or less than <a href='#SkIRect_fTop'>fTop</a>, <a href='#IRect'>IRect</a> is empty. +</td> + </tr> + + +## <a name='Constructor'>Constructor</a> + + +SkIRect can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_EmptyIRect'>EmptyIRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns immutable bounds of (0, 0, 0, 0)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeEmpty'>MakeEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of (0, 0, 0, 0)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeLTRB'>MakeLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int left, top, right, bottom</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeSize'>MakeSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#ISize'>ISize</a> returning (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeWH'>MakeWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_MakeXYWH'>MakeXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (x, y, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeInset'>makeInset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOffset'>makeOffset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translated sides</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeOutset'>makeOutset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_makeSorted'>makeSorted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#IRect'>IRect</a>, ordering sides from smaller to larger</td> + </tr> +</table> + + +<a name='SkIRect_MakeEmpty'></a> ## MakeEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeEmpty'>MakeEmpty</a>() </pre> -Returns constructed <a href="#IRect">IRect</a> set to (0, 0, 0, 0). +Returns constructed <a href='#IRect'>IRect</a> 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. @@ -154,32 +417,33 @@ outset rect isEmpty: false ### See Also -<a href="#SkIRect_EmptyIRect">EmptyIRect</a> <a href="#SkIRect_isEmpty">isEmpty</a> <a href="#SkIRect_setEmpty">setEmpty</a> <a href="SkRect_Reference#SkRect_MakeEmpty">SkRect::MakeEmpty</a> +<a href='#SkIRect_EmptyIRect'>EmptyIRect</a> <a href='#SkIRect_isEmpty'>isEmpty</a> <a href='#SkIRect_setEmpty'>setEmpty</a> <a href='SkRect_Reference#SkRect_MakeEmpty'>SkRect::MakeEmpty</a> --- -<a name="SkIRect_MakeWH"></a> +<a name='SkIRect_MakeWH'></a> ## MakeWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeWH'>MakeWH</a>(int32_t w, int32_t h) </pre> -Returns constructed <a href="#IRect">IRect</a> set to (0, 0, <a href="#SkIRect_MakeWH_w">w</a>, <a href="#SkIRect_MakeWH_h">h</a>). Does not validate input; <a href="#SkIRect_MakeWH_w">w</a> or <a href="#SkIRect_MakeWH_h">h</a> +Returns constructed <a href='#IRect'>IRect</a> set to (0, 0, <a href='#SkIRect_MakeWH_w'>w</a>, <a href='#SkIRect_MakeWH_h'>h</a>). Does not validate input; <a href='#SkIRect_MakeWH_w'>w</a> or <a href='#SkIRect_MakeWH_h'>h</a> may be negative. ### Parameters -<table> <tr> <td><a name="SkIRect_MakeWH_w"> <code><strong>w </strong></code> </a></td> <td> -width of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_MakeWH_h"> <code><strong>h </strong></code> </a></td> <td> -height of constructed <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_MakeWH_w'><code><strong>w</strong></code></a></td> + <td>width of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeWH_h'><code><strong>h</strong></code></a></td> + <td>height of constructed <a href='#IRect'>IRect</a></td> </tr> </table> ### Return Value -bounds (0, 0, <a href="#SkIRect_MakeWH_w">w</a>, <a href="#SkIRect_MakeWH_h">h</a>) +bounds (0, 0, <a href='#SkIRect_MakeWH_w'>w</a>, <a href='#SkIRect_MakeWH_h'>h</a>) ### Example @@ -195,30 +459,30 @@ all equal ### See Also -<a href="#SkIRect_MakeSize">MakeSize</a> <a href="#SkIRect_MakeXYWH">MakeXYWH</a> <a href="SkRect_Reference#SkRect_MakeWH">SkRect::MakeWH</a> <a href="SkRect_Reference#SkRect_MakeIWH">SkRect::MakeIWH</a> +<a href='#SkIRect_MakeSize'>MakeSize</a> <a href='#SkIRect_MakeXYWH'>MakeXYWH</a> <a href='SkRect_Reference#SkRect_MakeWH'>SkRect::MakeWH</a> <a href='SkRect_Reference#SkRect_MakeIWH'>SkRect::MakeIWH</a> --- -<a name="SkIRect_MakeSize"></a> +<a name='SkIRect_MakeSize'></a> ## MakeSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkISize'>SkISize</a>& size) </pre> -Returns constructed <a href="#IRect">IRect</a> set to (0, 0, size.<a href="#SkIRect_width">width</a>, size.<a href="#SkIRect_height">height</a>). -Does not validate input; size.<a href="#SkIRect_width">width</a> or size.<a href="#SkIRect_height">height</a> may be negative. +Returns constructed <a href='#IRect'>IRect</a> set to (0, 0, size.<a href='#SkIRect_width'>width</a>, size.<a href='#SkIRect_height'>height</a>). +Does not validate input; size.<a href='#SkIRect_width'>width</a> or size.<a href='#SkIRect_height'>height</a> may be negative. ### Parameters -<table> <tr> <td><a name="SkIRect_MakeSize_size"> <code><strong>size </strong></code> </a></td> <td> -values for <a href="#IRect">IRect</a> width and height</td> +<table> <tr> <td><a name='SkIRect_MakeSize_size'><code><strong>size</strong></code></a></td> + <td>values for <a href='#IRect'>IRect</a> width and height</td> </tr> </table> ### Return Value -bounds (0, 0, size.<a href="#SkIRect_width">width</a>, size.<a href="#SkIRect_height">height</a>) +bounds (0, 0, size.<a href='#SkIRect_width'>width</a>, size.<a href='#SkIRect_height'>height</a>) ### Example @@ -235,36 +499,39 @@ floor width: 25 height: 35 ### See Also -<a href="#SkIRect_MakeWH">MakeWH</a> <a href="#SkIRect_MakeXYWH">MakeXYWH</a> <a href="SkRect_Reference#SkRect_Make">SkRect::Make</a><sup><a href="SkRect_Reference#SkRect_Make_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_MakeIWH">SkRect::MakeIWH</a> +<a href='#SkIRect_MakeWH'>MakeWH</a> <a href='#SkIRect_MakeXYWH'>MakeXYWH</a> <a href='SkRect_Reference#SkRect_Make'>SkRect::Make</a><sup><a href='SkRect_Reference#SkRect_Make_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_MakeIWH'>SkRect::MakeIWH</a> --- -<a name="SkIRect_MakeLTRB"></a> +<a name='SkIRect_MakeLTRB'></a> ## MakeLTRB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeLTRB'>MakeLTRB</a>(int32_t l, int32_t t, int32_t r, int32_t b) </pre> -Returns constructed <a href="#IRect">IRect</a> set to (<a href="#SkIRect_MakeLTRB_l">l</a>, <a href="#SkIRect_MakeLTRB_t">t</a>, <a href="#SkIRect_MakeLTRB_r">r</a>, <a href="#SkIRect_MakeLTRB_b">b</a>). Does not sort input; <a href="#IRect">IRect</a> may -result in <a href="#SkIRect_fLeft">fLeft</a> greater than <a href="#SkIRect_fRight">fRight</a>, or <a href="#SkIRect_fTop">fTop</a> greater than <a href="#SkIRect_fBottom">fBottom</a>. +Returns constructed <a href='#IRect'>IRect</a> set to (<a href='#SkIRect_MakeLTRB_l'>l</a>, <a href='#SkIRect_MakeLTRB_t'>t</a>, <a href='#SkIRect_MakeLTRB_r'>r</a>, <a href='#SkIRect_MakeLTRB_b'>b</a>). Does not sort input; <a href='#IRect'>IRect</a> may +result in <a href='#SkIRect_fLeft'>fLeft</a> greater than <a href='#SkIRect_fRight'>fRight</a>, or <a href='#SkIRect_fTop'>fTop</a> greater than <a href='#SkIRect_fBottom'>fBottom</a>. ### Parameters -<table> <tr> <td><a name="SkIRect_MakeLTRB_l"> <code><strong>l </strong></code> </a></td> <td> -integer stored in <a href="#SkIRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkIRect_MakeLTRB_t"> <code><strong>t </strong></code> </a></td> <td> -integer stored in <a href="#SkIRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkIRect_MakeLTRB_r"> <code><strong>r </strong></code> </a></td> <td> -integer stored in <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_MakeLTRB_b"> <code><strong>b </strong></code> </a></td> <td> -integer stored in <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_MakeLTRB_l'><code><strong>l</strong></code></a></td> + <td>integer stored in <a href='#SkIRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeLTRB_t'><code><strong>t</strong></code></a></td> + <td>integer stored in <a href='#SkIRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeLTRB_r'><code><strong>r</strong></code></a></td> + <td>integer stored in <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeLTRB_b'><code><strong>b</strong></code></a></td> + <td>integer stored in <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -bounds (<a href="#SkIRect_MakeLTRB_l">l</a>, <a href="#SkIRect_MakeLTRB_t">t</a>, <a href="#SkIRect_MakeLTRB_r">r</a>, <a href="#SkIRect_MakeLTRB_b">b</a>) +bounds (<a href='#SkIRect_MakeLTRB_l'>l</a>, <a href='#SkIRect_MakeLTRB_t'>t</a>, <a href='#SkIRect_MakeLTRB_r'>r</a>, <a href='#SkIRect_MakeLTRB_b'>b</a>) ### Example @@ -281,39 +548,42 @@ rect: 5, 25, 15, 35 isEmpty: false ### See Also -<a href="#SkIRect_MakeXYWH">MakeXYWH</a> <a href="SkRect_Reference#SkRect_MakeLTRB">SkRect::MakeLTRB</a> +<a href='#SkIRect_MakeXYWH'>MakeXYWH</a> <a href='SkRect_Reference#SkRect_MakeLTRB'>SkRect::MakeLTRB</a> --- -<a name="SkIRect_MakeXYWH"></a> +<a name='SkIRect_MakeXYWH'></a> ## MakeXYWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeXYWH'>MakeXYWH</a>(int32_t x, int32_t y, int32_t w, int32_t h) </pre> -Returns constructed <a href="#IRect">IRect</a> set to: -(x, y, x + <a href="#SkIRect_MakeXYWH_w">w</a>, y + <a href="#SkIRect_MakeXYWH_h">h</a>) +Returns constructed <a href='#IRect'>IRect</a> set to: +(x, y, x + <a href='#SkIRect_MakeXYWH_w'>w</a>, y + <a href='#SkIRect_MakeXYWH_h'>h</a>) . Does not validate input; -<a href="#SkIRect_MakeXYWH_w">w</a> or <a href="#SkIRect_MakeXYWH_h">h</a> may be negative. +<a href='#SkIRect_MakeXYWH_w'>w</a> or <a href='#SkIRect_MakeXYWH_h'>h</a> may be negative. ### Parameters -<table> <tr> <td><a name="SkIRect_MakeXYWH_x"> <code><strong>x </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkIRect_MakeXYWH_y"> <code><strong>y </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkIRect_MakeXYWH_w"> <code><strong>w </strong></code> </a></td> <td> -added to x and stored in <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_MakeXYWH_h"> <code><strong>h </strong></code> </a></td> <td> -added to y and stored in <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_MakeXYWH_x'><code><strong>x</strong></code></a></td> + <td>stored in <a href='#SkIRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeXYWH_y'><code><strong>y</strong></code></a></td> + <td>stored in <a href='#SkIRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeXYWH_w'><code><strong>w</strong></code></a></td> + <td>added to x and stored in <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_MakeXYWH_h'><code><strong>h</strong></code></a></td> + <td>added to y and stored in <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -bounds at (x, y) with width <a href="#SkIRect_MakeXYWH_w">w</a> and height <a href="#SkIRect_MakeXYWH_h">h</a> +bounds at (x, y) with width <a href='#SkIRect_MakeXYWH_w'>w</a> and height <a href='#SkIRect_MakeXYWH_h'>h</a> ### Example @@ -330,41 +600,84 @@ rect: -10, 35, 5, 60 isEmpty: false ### See Also -<a href="#SkIRect_MakeLTRB">MakeLTRB</a> <a href="SkRect_Reference#SkRect_MakeXYWH">SkRect::MakeXYWH</a> +<a href='#SkIRect_MakeLTRB'>MakeLTRB</a> <a href='SkRect_Reference#SkRect_MakeXYWH'>SkRect::MakeXYWH</a> --- -## <a name="Property"></a> Property - -| name | description | -| --- | --- | -| <a href="#SkIRect_bottom">bottom</a> | returns larger bounds in y, if sorted | -| <a href="#SkIRect_height">height</a> | returns span in y | -| <a href="#SkIRect_height64">height64</a> | returns span in y as int64_t | -| <a href="#SkIRect_isEmpty">isEmpty</a> | returns true if width or height are zero or negative or they exceed int32_t | -| <a href="#SkIRect_isEmpty64">isEmpty64</a> | returns true if width or height are zero or negative | -| <a href="#SkIRect_left">left</a> | returns smaller bounds in x, if sorted | -| <a href="#SkIRect_right">right</a> | returns larger bounds in x, if sorted | -| <a href="#SkIRect_size">size</a> | returns <a href="undocumented#ISize">ISize</a> (width, height) | -| <a href="#SkIRect_top">top</a> | returns smaller bounds in y, if sorted | -| <a href="#SkIRect_width">width</a> | returns span in x | -| <a href="#SkIRect_width64">width64</a> | returns span in y as int64_t | -| <a href="#SkIRect_x">x</a> | returns bounds left | -| <a href="#SkIRect_y">y</a> | returns bounds top | - -<a name="SkIRect_left"></a> +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_bottom'>bottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in y, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_height64'>height64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative or they exceed int32_t</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_isEmpty64'>isEmpty64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_left'>left</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in x, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_right'>right</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in x, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_size'>size</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#ISize'>ISize</a> (width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_top'>top</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in y, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_width64'>width64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y as int64_t</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds left</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds top</td> + </tr> +</table> + + +<a name='SkIRect_left'></a> ## left -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t left() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_left'>left</a>() const </pre> -Returns left edge of <a href="#IRect">IRect</a>, if sorted. -Call <a href="#SkIRect_sort">sort</a> to reverse <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a> if needed. +Returns left edge of <a href='#IRect'>IRect</a>, if sorted. +Call <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed. ### Return Value -<a href="#SkIRect_fLeft">fLeft</a> +<a href='#SkIRect_fLeft'>fLeft</a> ### Example @@ -381,23 +694,23 @@ sorted.fLeft: 10 sorted.left(): 10 ### See Also -<a href="#SkIRect_fLeft">fLeft</a> <a href="#SkIRect_x">x</a> <a href="SkRect_Reference#SkRect_left">SkRect::left()</a> +<a href='#SkIRect_fLeft'>fLeft</a> <a href='#SkIRect_x'>x</a> <a href='SkRect_Reference#SkRect_left'>SkRect::left()</a> --- -<a name="SkIRect_top"></a> +<a name='SkIRect_top'></a> ## top -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t top() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_top'>top</a>() const </pre> -Returns top edge of <a href="#IRect">IRect</a>, if sorted. Call <a href="#SkIRect_isEmpty">isEmpty</a> to see if <a href="#IRect">IRect</a> may be invalid, -and <a href="#SkIRect_sort">sort</a> to reverse <a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a> if needed. +Returns top edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid, +and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed. ### Return Value -<a href="#SkIRect_fTop">fTop</a> +<a href='#SkIRect_fTop'>fTop</a> ### Example @@ -414,23 +727,23 @@ sorted.fTop: 5 sorted.top(): 5 ### See Also -<a href="#SkIRect_fTop">fTop</a> <a href="#SkIRect_y">y</a> <a href="SkRect_Reference#SkRect_top">SkRect::top()</a> +<a href='#SkIRect_fTop'>fTop</a> <a href='#SkIRect_y'>y</a> <a href='SkRect_Reference#SkRect_top'>SkRect::top()</a> --- -<a name="SkIRect_right"></a> +<a name='SkIRect_right'></a> ## right -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t right() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_right'>right</a>() const </pre> -Returns right edge of <a href="#IRect">IRect</a>, if sorted. -Call <a href="#SkIRect_sort">sort</a> to reverse <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a> if needed. +Returns right edge of <a href='#IRect'>IRect</a>, if sorted. +Call <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed. ### Return Value -<a href="#SkIRect_fRight">fRight</a> +<a href='#SkIRect_fRight'>fRight</a> ### Example @@ -447,23 +760,23 @@ sorted.fRight: 15 sorted.right(): 15 ### See Also -<a href="#SkIRect_fRight">fRight</a> <a href="SkRect_Reference#SkRect_right">SkRect::right()</a> +<a href='#SkIRect_fRight'>fRight</a> <a href='SkRect_Reference#SkRect_right'>SkRect::right()</a> --- -<a name="SkIRect_bottom"></a> +<a name='SkIRect_bottom'></a> ## bottom -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t bottom() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_bottom'>bottom</a>() const </pre> -Returns bottom edge of <a href="#IRect">IRect</a>, if sorted. Call <a href="#SkIRect_isEmpty">isEmpty</a> to see if <a href="#IRect">IRect</a> may be invalid, -and <a href="#SkIRect_sort">sort</a> to reverse <a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a> if needed. +Returns bottom edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid, +and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed. ### Return Value -<a href="#SkIRect_fBottom">fBottom</a> +<a href='#SkIRect_fBottom'>fBottom</a> ### Example @@ -480,23 +793,23 @@ sorted.fBottom: 25 sorted.bottom(): 25 ### See Also -<a href="#SkIRect_fBottom">fBottom</a> <a href="SkRect_Reference#SkRect_bottom">SkRect::bottom()</a> +<a href='#SkIRect_fBottom'>fBottom</a> <a href='SkRect_Reference#SkRect_bottom'>SkRect::bottom()</a> --- -<a name="SkIRect_x"></a> +<a name='SkIRect_x'></a> ## x -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t x() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_x'>x</a>() const </pre> -Returns left edge of <a href="#IRect">IRect</a>, if sorted. Call <a href="#SkIRect_isEmpty">isEmpty</a> to see if <a href="#IRect">IRect</a> may be invalid, -and <a href="#SkIRect_sort">sort</a> to reverse <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a> if needed. +Returns left edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid, +and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if needed. ### Return Value -<a href="#SkIRect_fLeft">fLeft</a> +<a href='#SkIRect_fLeft'>fLeft</a> ### Example @@ -513,23 +826,23 @@ sorted.fLeft: 10 sorted.x(): 10 ### See Also -<a href="#SkIRect_fLeft">fLeft</a> <a href="#SkIRect_left">left</a> <a href="#SkIRect_y">y</a> <a href="SkRect_Reference#SkRect_x">SkRect::x()</a> +<a href='#SkIRect_fLeft'>fLeft</a> <a href='#SkIRect_left'>left</a> <a href='#SkIRect_y'>y</a> <a href='SkRect_Reference#SkRect_x'>SkRect::x()</a> --- -<a name="SkIRect_y"></a> +<a name='SkIRect_y'></a> ## y -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t y() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_y'>y</a>() const </pre> -Returns top edge of <a href="#IRect">IRect</a>, if sorted. Call <a href="#SkIRect_isEmpty">isEmpty</a> to see if <a href="#IRect">IRect</a> may be invalid, -and <a href="#SkIRect_sort">sort</a> to reverse <a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a> if needed. +Returns top edge of <a href='#IRect'>IRect</a>, if sorted. Call <a href='#SkIRect_isEmpty'>isEmpty</a> to see if <a href='#IRect'>IRect</a> may be invalid, +and <a href='#SkIRect_sort'>sort</a> to reverse <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if needed. ### Return Value -<a href="#SkIRect_fTop">fTop</a> +<a href='#SkIRect_fTop'>fTop</a> ### Example @@ -546,23 +859,23 @@ sorted.fTop: 5 sorted.y(): 5 ### See Also -<a href="#SkIRect_fTop">fTop</a> <a href="#SkIRect_top">top</a> <a href="#SkIRect_x">x</a> <a href="SkRect_Reference#SkRect_y">SkRect::y()</a> +<a href='#SkIRect_fTop'>fTop</a> <a href='#SkIRect_top'>top</a> <a href='#SkIRect_x'>x</a> <a href='SkRect_Reference#SkRect_y'>SkRect::y()</a> --- -<a name="SkIRect_width"></a> +<a name='SkIRect_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_width'>width</a>() const </pre> -Returns span on the x-axis. This does not check if <a href="#IRect">IRect</a> is sorted, or if +Returns span on the x-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, or if result fits in 32-bit signed integer; result may be negative. ### Return Value -<a href="#SkIRect_fRight">fRight</a> minus <a href="#SkIRect_fLeft">fLeft</a> +<a href='#SkIRect_fRight'>fRight</a> minus <a href='#SkIRect_fLeft'>fLeft</a> ### Example @@ -579,24 +892,24 @@ large width: -5 ### See Also -<a href="#SkIRect_height">height</a> <a href="#SkIRect_width64">width64</a> <a href="#SkIRect_height64">height64</a> <a href="SkRect_Reference#SkRect_width">SkRect::width()</a> +<a href='#SkIRect_height'>height</a> <a href='#SkIRect_width64'>width64</a> <a href='#SkIRect_height64'>height64</a> <a href='SkRect_Reference#SkRect_width'>SkRect::width()</a> --- -<a name="SkIRect_width64"></a> +<a name='SkIRect_width64'></a> ## width64 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int64_t width64() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int64_t <a href='#SkIRect_width64'>width64</a>() const </pre> -Returns span on the x-axis. This does not check if <a href="#IRect">IRect</a> is sorted, so the -result may be negative. This is safer than calling <a href="#SkIRect_width">width</a> since <a href="#SkIRect_width">width</a> might +Returns span on the x-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, so the +result may be negative. This is safer than calling <a href='#SkIRect_width'>width</a> since <a href='#SkIRect_width'>width</a> might overflow in its calculation. ### Return Value -<a href="#SkIRect_fRight">fRight</a> minus <a href="#SkIRect_fLeft">fLeft</a> cast to int64_t +<a href='#SkIRect_fRight'>fRight</a> minus <a href='#SkIRect_fLeft'>fLeft</a> cast to int64_t ### Example @@ -612,23 +925,23 @@ width: -5 width64: 4294967291 ### See Also -<a href="#SkIRect_width">width</a> <a href="#SkIRect_height">height</a> <a href="#SkIRect_height64">height64</a> <a href="SkRect_Reference#SkRect_width">SkRect::width()</a> +<a href='#SkIRect_width'>width</a> <a href='#SkIRect_height'>height</a> <a href='#SkIRect_height64'>height64</a> <a href='SkRect_Reference#SkRect_width'>SkRect::width()</a> --- -<a name="SkIRect_height"></a> +<a name='SkIRect_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int32_t <a href='#SkIRect_height'>height</a>() const </pre> -Returns span on the y-axis. This does not check if <a href="#IRect">IRect</a> is sorted, or if +Returns span on the y-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, or if result fits in 32-bit signed integer; result may be negative. ### Return Value -<a href="#SkIRect_fBottom">fBottom</a> minus <a href="#SkIRect_fTop">fTop</a> +<a href='#SkIRect_fBottom'>fBottom</a> minus <a href='#SkIRect_fTop'>fTop</a> ### Example @@ -645,24 +958,24 @@ large height: -5 ### See Also -<a href="#SkIRect_width">width</a> <a href="SkRect_Reference#SkRect_height">SkRect::height()</a> +<a href='#SkIRect_width'>width</a> <a href='SkRect_Reference#SkRect_height'>SkRect::height()</a> --- -<a name="SkIRect_height64"></a> +<a name='SkIRect_height64'></a> ## height64 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int64_t height64() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int64_t <a href='#SkIRect_height64'>height64</a>() const </pre> -Returns span on the y-axis. This does not check if <a href="#IRect">IRect</a> is sorted, so the -result may be negative. This is safer than calling <a href="#SkIRect_height">height</a> since <a href="#SkIRect_height">height</a> might +Returns span on the y-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, so the +result may be negative. This is safer than calling <a href='#SkIRect_height'>height</a> since <a href='#SkIRect_height'>height</a> might overflow in its calculation. ### Return Value -<a href="#SkIRect_fBottom">fBottom</a> minus <a href="#SkIRect_fTop">fTop</a> cast to int64_t +<a href='#SkIRect_fBottom'>fBottom</a> minus <a href='#SkIRect_fTop'>fTop</a> cast to int64_t ### Example @@ -678,23 +991,23 @@ height: -5 height64: 4294967291 ### See Also -<a href="#SkIRect_width">width</a> <a href="#SkIRect_height">height</a> <a href="#SkIRect_width64">width64</a> <a href="SkRect_Reference#SkRect_height">SkRect::height()</a> +<a href='#SkIRect_width'>width</a> <a href='#SkIRect_height'>height</a> <a href='#SkIRect_width64'>width64</a> <a href='SkRect_Reference#SkRect_height'>SkRect::height()</a> --- -<a name="SkIRect_size"></a> +<a name='SkIRect_size'></a> ## size -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkISize size() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkISize'>SkISize</a> <a href='#SkIRect_size'>size</a>() const </pre> -Returns spans on the x-axis and y-axis. This does not check if <a href="#IRect">IRect</a> is sorted, +Returns spans on the x-axis and y-axis. This does not check if <a href='#IRect'>IRect</a> is sorted, or if result fits in 32-bit signed integer; result may be negative. ### Return Value -<a href="undocumented#ISize">ISize</a> (width, height) +<a href='undocumented#ISize'>ISize</a> (width, height) ### Example @@ -712,22 +1025,22 @@ outset rect: 20, 30, 80, 90 size: 60, 60 ### See Also -<a href="#SkIRect_height">height</a> <a href="#SkIRect_width">width</a> <a href="#SkIRect_MakeSize">MakeSize</a> +<a href='#SkIRect_height'>height</a> <a href='#SkIRect_width'>width</a> <a href='#SkIRect_MakeSize'>MakeSize</a> --- -<a name="SkIRect_isEmpty"></a> +<a name='SkIRect_isEmpty'></a> ## isEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isEmpty() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_isEmpty'>isEmpty</a>() const </pre> -Returns true if <a href="#SkIRect_width">width</a> or <a href="#SkIRect_height">height</a> . +Returns true if <a href='#SkIRect_width'>width</a> or <a href='#SkIRect_height'>height</a> . ### Return Value -true if <a href="#SkIRect_width">width</a> or <a href="#SkIRect_height">height</a> are zero or negative +true if <a href='#SkIRect_width'>width</a> or <a href='#SkIRect_height'>height</a> are zero or negative ### Example @@ -746,24 +1059,24 @@ sorted: {20, 40, 20, 50} is empty ### See Also -<a href="#SkIRect_EmptyIRect">EmptyIRect</a> <a href="#SkIRect_MakeEmpty">MakeEmpty</a> <a href="#SkIRect_sort">sort</a> <a href="SkRect_Reference#SkRect_isEmpty">SkRect::isEmpty</a> +<a href='#SkIRect_EmptyIRect'>EmptyIRect</a> <a href='#SkIRect_MakeEmpty'>MakeEmpty</a> <a href='#SkIRect_sort'>sort</a> <a href='SkRect_Reference#SkRect_isEmpty'>SkRect::isEmpty</a> --- -<a name="SkIRect_isEmpty64"></a> +<a name='SkIRect_isEmpty64'></a> ## isEmpty64 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isEmpty64() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_isEmpty64'>isEmpty64</a>() const </pre> -Returns true if <a href="#SkIRect_fLeft">fLeft</a> is equal to or greater than <a href="#SkIRect_fRight">fRight</a>, or if <a href="#SkIRect_fTop">fTop</a> is equal -to or greater than <a href="#SkIRect_fBottom">fBottom</a>. Call <a href="#SkIRect_sort">sort</a> to reverse rectangles with negative -<a href="#SkIRect_width64">width64</a> or <a href="#SkIRect_height64">height64</a>. +Returns true if <a href='#SkIRect_fLeft'>fLeft</a> is equal to or greater than <a href='#SkIRect_fRight'>fRight</a>, or if <a href='#SkIRect_fTop'>fTop</a> is equal +to or greater than <a href='#SkIRect_fBottom'>fBottom</a>. Call <a href='#SkIRect_sort'>sort</a> to reverse rectangles with negative +<a href='#SkIRect_width64'>width64</a> or <a href='#SkIRect_height64'>height64</a>. ### Return Value -true if <a href="#SkIRect_width64">width64</a> or <a href="#SkIRect_height64">height64</a> are zero or negative +true if <a href='#SkIRect_width64'>width64</a> or <a href='#SkIRect_height64'>height64</a> are zero or negative ### Example @@ -782,33 +1095,45 @@ sorted: {20, 40, 20, 50} is empty ### See Also -<a href="#SkIRect_EmptyIRect">EmptyIRect</a> <a href="#SkIRect_MakeEmpty">MakeEmpty</a> <a href="#SkIRect_sort">sort</a> <a href="SkRect_Reference#SkRect_isEmpty">SkRect::isEmpty</a> +<a href='#SkIRect_EmptyIRect'>EmptyIRect</a> <a href='#SkIRect_MakeEmpty'>MakeEmpty</a> <a href='#SkIRect_sort'>sort</a> <a href='SkRect_Reference#SkRect_isEmpty'>SkRect::isEmpty</a> --- -## <a name="Operator"></a> Operator +## <a name='Operator'>Operator</a> + + +SkIRect operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_notequal_operator'>operator!=(const SkIRect& a, const SkIRect& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_equal_operator'>operator==(const SkIRect& a, const SkIRect& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkIRect_notequal_operator">operator!=(const SkIRect& a, const SkIRect& b)</a> | returns true if members are unequal | -| <a href="#SkIRect_equal_operator">operator==(const SkIRect& a, const SkIRect& b)</a> | returns true if members are equal | -<a name="SkIRect_equal_operator"></a> +<a name='SkIRect_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkIRect& a, const SkIRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_equal_operator'>operator==(const SkIRect& a, const SkIRect& b)</a> </pre> -Returns true if all members in <a href="#SkIRect_equal_operator_a">a</a>: <a href="#SkIRect_fLeft">fLeft</a>, <a href="#SkIRect_fTop">fTop</a>, <a href="#SkIRect_fRight">fRight</a>, and <a href="#SkIRect_fBottom">fBottom</a>; are -identical to corresponding members in <a href="#SkIRect_equal_operator_b">b</a>. +Returns true if all members in <a href='#SkIRect_equal_operator_a'>a</a>: <a href='#SkIRect_fLeft'>fLeft</a>, <a href='#SkIRect_fTop'>fTop</a>, <a href='#SkIRect_fRight'>fRight</a>, and <a href='#SkIRect_fBottom'>fBottom</a>; are +identical to corresponding members in <a href='#SkIRect_equal_operator_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkIRect_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to compare</td> - </tr> <tr> <td><a name="SkIRect_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to compare</td> +<table> <tr> <td><a name='SkIRect_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to compare</td> + </tr> + <tr> <td><a name='SkIRect_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to compare</td> </tr> </table> @@ -830,26 +1155,27 @@ test == sorted ### See Also -<a href="#SkIRect_notequal_operator">operator!=(const SkIRect& a, const SkIRect& b)</a> +<a href='#SkIRect_notequal_operator'>operator!=(const SkIRect& a, const SkIRect& b)</a> --- -<a name="SkIRect_notequal_operator"></a> +<a name='SkIRect_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkIRect& a, const SkIRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_notequal_operator'>operator!=(const SkIRect& a, const SkIRect& b)</a> </pre> -Returns true if any member in <a href="#SkIRect_notequal_operator_a">a</a>: <a href="#SkIRect_fLeft">fLeft</a>, <a href="#SkIRect_fTop">fTop</a>, <a href="#SkIRect_fRight">fRight</a>, and <a href="#SkIRect_fBottom">fBottom</a>; is not -identical to the corresponding member in <a href="#SkIRect_notequal_operator_b">b</a>. +Returns true if any member in <a href='#SkIRect_notequal_operator_a'>a</a>: <a href='#SkIRect_fLeft'>fLeft</a>, <a href='#SkIRect_fTop'>fTop</a>, <a href='#SkIRect_fRight'>fRight</a>, and <a href='#SkIRect_fBottom'>fBottom</a>; is not +identical to the corresponding member in <a href='#SkIRect_notequal_operator_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkIRect_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to compare</td> - </tr> <tr> <td><a name="SkIRect_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to compare</td> +<table> <tr> <td><a name='SkIRect_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to compare</td> + </tr> + <tr> <td><a name='SkIRect_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to compare</td> </tr> </table> @@ -871,27 +1197,43 @@ test != sorted ### See Also -<a href="#SkIRect_equal_operator">operator==(const SkIRect& a, const SkIRect& b)</a> +<a href='#SkIRect_equal_operator'>operator==(const SkIRect& a, const SkIRect& b)</a> --- -## <a name="Set"></a> Set +## <a name='Set'>Set</a> -| name | description | -| --- | --- | -| <a href="#SkIRect_set">set</a> | sets to (left, top, right, bottom) | -| <a href="#SkIRect_setEmpty">setEmpty</a> | sets to (0, 0, 0, 0) | -| <a href="#SkIRect_setLTRB">setLTRB</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (left, top, right, bottom) | -| <a href="#SkIRect_setXYWH">setXYWH</a> | sets to (x, y, width, height) | -<a name="SkIRect_setEmpty"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (left, top, right, bottom)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setEmpty'>setEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (0, 0, 0, 0)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setLTRB'>setLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_setXYWH'>setXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (x, y, width, height)</td> + </tr> +</table> + + +<a name='SkIRect_setEmpty'></a> ## setEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setEmpty() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_setEmpty'>setEmpty</a>() </pre> -Sets <a href="#IRect">IRect</a> to (0, 0, 0, 0). +Sets <a href='#IRect'>IRect</a> 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 @@ -912,31 +1254,34 @@ rect: {0, 0, 0, 0} is empty ### See Also -<a href="#SkIRect_MakeEmpty">MakeEmpty</a> <a href="SkRect_Reference#SkRect_setEmpty">SkRect::setEmpty</a> +<a href='#SkIRect_MakeEmpty'>MakeEmpty</a> <a href='SkRect_Reference#SkRect_setEmpty'>SkRect::setEmpty</a> --- -<a name="SkIRect_set"></a> +<a name='SkIRect_set'></a> ## set -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(int32_t left, int32_t top, int32_t right, int32_t bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_set'>set</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) </pre> -Sets <a href="#IRect">IRect</a> to (left, top, right, bottom). +Sets <a href='#IRect'>IRect</a> to (left, top, right, bottom). left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom. ### Parameters -<table> <tr> <td><a name="SkIRect_set_left"> <code><strong>left </strong></code> </a></td> <td> -assigned to <a href="#SkIRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkIRect_set_top"> <code><strong>top </strong></code> </a></td> <td> -assigned to <a href="#SkIRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkIRect_set_right"> <code><strong>right </strong></code> </a></td> <td> -assigned to <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_set_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -assigned to <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_set_left'><code><strong>left</strong></code></a></td> + <td>assigned to <a href='#SkIRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkIRect_set_top'><code><strong>top</strong></code></a></td> + <td>assigned to <a href='#SkIRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkIRect_set_right'><code><strong>right</strong></code></a></td> + <td>assigned to <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_set_bottom'><code><strong>bottom</strong></code></a></td> + <td>assigned to <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> @@ -955,31 +1300,34 @@ rect2: {3, 4, 1, 2} ### See Also -<a href="#SkIRect_setLTRB">setLTRB</a> <a href="#SkIRect_setXYWH">setXYWH</a> <a href="SkRect_Reference#SkRect_set">SkRect::set</a><sup><a href="SkRect_Reference#SkRect_set_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_set_3">[3]</a></sup><sup><a href="SkRect_Reference#SkRect_set_4">[4]</a></sup> +<a href='#SkIRect_setLTRB'>setLTRB</a> <a href='#SkIRect_setXYWH'>setXYWH</a> <a href='SkRect_Reference#SkRect_set'>SkRect::set</a><sup><a href='SkRect_Reference#SkRect_set_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_set_3'>[3]</a></sup><sup><a href='SkRect_Reference#SkRect_set_4'>[4]</a></sup> --- -<a name="SkIRect_setLTRB"></a> +<a name='SkIRect_setLTRB'></a> ## setLTRB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_setLTRB'>setLTRB</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) </pre> -Sets <a href="#IRect">IRect</a> to (left, top, right, bottom). +Sets <a href='#IRect'>IRect</a> to (left, top, right, bottom). left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom. ### Parameters -<table> <tr> <td><a name="SkIRect_setLTRB_left"> <code><strong>left </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkIRect_setLTRB_top"> <code><strong>top </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkIRect_setLTRB_right"> <code><strong>right </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_setLTRB_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_setLTRB_left'><code><strong>left</strong></code></a></td> + <td>stored in <a href='#SkIRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkIRect_setLTRB_top'><code><strong>top</strong></code></a></td> + <td>stored in <a href='#SkIRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkIRect_setLTRB_right'><code><strong>right</strong></code></a></td> + <td>stored in <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_setLTRB_bottom'><code><strong>bottom</strong></code></a></td> + <td>stored in <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> @@ -998,18 +1346,18 @@ rect2: {3, 4, 1, 2} ### See Also -<a href="#SkIRect_set">set</a> <a href="#SkIRect_setXYWH">setXYWH</a> <a href="SkRect_Reference#SkRect_setLTRB">SkRect::setLTRB</a> +<a href='#SkIRect_set'>set</a> <a href='#SkIRect_setXYWH'>setXYWH</a> <a href='SkRect_Reference#SkRect_setLTRB'>SkRect::setLTRB</a> --- -<a name="SkIRect_setXYWH"></a> +<a name='SkIRect_setXYWH'></a> ## setXYWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_setXYWH'>setXYWH</a>(int32_t x, int32_t y, int32_t width, int32_t height) </pre> -Sets <a href="#IRect">IRect</a> to: +Sets <a href='#IRect'>IRect</a> to: (x, y, x + width, y + height) . Does not validate input; @@ -1017,14 +1365,17 @@ width or height may be negative. ### Parameters -<table> <tr> <td><a name="SkIRect_setXYWH_x"> <code><strong>x </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkIRect_setXYWH_y"> <code><strong>y </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkIRect_setXYWH_width"> <code><strong>width </strong></code> </a></td> <td> -added to x and stored in <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_setXYWH_height"> <code><strong>height </strong></code> </a></td> <td> -added to y and stored in <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_setXYWH_x'><code><strong>x</strong></code></a></td> + <td>stored in <a href='#SkIRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkIRect_setXYWH_y'><code><strong>y</strong></code></a></td> + <td>stored in <a href='#SkIRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkIRect_setXYWH_width'><code><strong>width</strong></code></a></td> + <td>added to x and stored in <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_setXYWH_height'><code><strong>height</strong></code></a></td> + <td>added to y and stored in <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1043,46 +1394,66 @@ rect: -10, 35, 5, 60 isEmpty: false ### See Also -<a href="#SkIRect_MakeXYWH">MakeXYWH</a> <a href="#SkIRect_setLTRB">setLTRB</a> <a href="#SkIRect_set">set</a> <a href="SkRect_Reference#SkRect_setXYWH">SkRect::setXYWH</a> +<a href='#SkIRect_MakeXYWH'>MakeXYWH</a> <a href='#SkIRect_setLTRB'>setLTRB</a> <a href='#SkIRect_set'>set</a> <a href='SkRect_Reference#SkRect_setXYWH'>SkRect::setXYWH</a> --- -## <a name="Inset_Outset_Offset"></a> Inset Outset Offset +## <a name='Inset_Outset_Offset'>Inset Outset Offset</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_inset'>inset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates sides without changing width and height</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offset'>offset(int32 t dx, int32 t dy)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_offsetTo'>offsetTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates to (x, y) without changing width and height</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_outset'>outset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkIRect_inset">inset</a> | moves the sides symmetrically about the center | -| <a href="#SkIRect_offset">offset</a> | translates sides without changing width and height | -| | <a href="#SkIRect_offset">offset(int32 t dx, int32 t dy)</a> | -| <a href="#SkIRect_offsetTo">offsetTo</a> | translates to (x, y) without changing width and height | -| <a href="#SkIRect_outset">outset</a> | moves the sides symmetrically about the center | -<a name="SkIRect_makeOffset"></a> +<a name='SkIRect_makeOffset'></a> ## makeOffset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect makeOffset(int32_t dx, int32_t dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOffset'>makeOffset</a>(int32_t dx, int32_t dy) const </pre> -Returns <a href="#IRect">IRect</a> offset by (<a href="#SkIRect_makeOffset_dx">dx</a>, <a href="#SkIRect_makeOffset_dy">dy</a>). +Returns <a href='#IRect'>IRect</a> offset by (<a href='#SkIRect_makeOffset_dx'>dx</a>, <a href='#SkIRect_makeOffset_dy'>dy</a>). -If <a href="#SkIRect_makeOffset_dx">dx</a> is negative, <a href="#IRect">IRect</a> returned is moved to the left. -If <a href="#SkIRect_makeOffset_dx">dx</a> is positive, <a href="#IRect">IRect</a> returned is moved to the right. -If <a href="#SkIRect_makeOffset_dy">dy</a> is negative, <a href="#IRect">IRect</a> returned is moved upward. -If <a href="#SkIRect_makeOffset_dy">dy</a> is positive, <a href="#IRect">IRect</a> returned is moved downward. +If <a href='#SkIRect_makeOffset_dx'>dx</a> is negative, <a href='#IRect'>IRect</a> returned is moved to the left. +If <a href='#SkIRect_makeOffset_dx'>dx</a> is positive, <a href='#IRect'>IRect</a> returned is moved to the right. +If <a href='#SkIRect_makeOffset_dy'>dy</a> is negative, <a href='#IRect'>IRect</a> returned is moved upward. +If <a href='#SkIRect_makeOffset_dy'>dy</a> is positive, <a href='#IRect'>IRect</a> returned is moved downward. ### Parameters -<table> <tr> <td><a name="SkIRect_makeOffset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_makeOffset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_makeOffset_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_makeOffset_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -<a href="#IRect">IRect</a> offset in x or y, with original width and height +<a href='#IRect'>IRect</a> offset in x or y, with original width and height ### Example @@ -1099,36 +1470,37 @@ rect: 25, 82, 35, 92 isEmpty: false ### See Also -<a href="#SkIRect_offset">offset</a><sup><a href="#SkIRect_offset_2">[2]</a></sup> <a href="#SkIRect_makeInset">makeInset</a> <a href="#SkIRect_makeOutset">makeOutset</a> <a href="SkRect_Reference#SkRect_makeOffset">SkRect::makeOffset</a> +<a href='#SkIRect_offset'>offset</a><sup><a href='#SkIRect_offset_2'>[2]</a></sup> <a href='#SkIRect_makeInset'>makeInset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_makeOffset'>SkRect::makeOffset</a> --- -<a name="SkIRect_makeInset"></a> +<a name='SkIRect_makeInset'></a> ## makeInset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect makeInset(int32_t dx, int32_t dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeInset'>makeInset</a>(int32_t dx, int32_t dy) const </pre> -Returns <a href="#IRect">IRect</a>, inset by (<a href="#SkIRect_makeInset_dx">dx</a>, <a href="#SkIRect_makeInset_dy">dy</a>). +Returns <a href='#IRect'>IRect</a>, inset by (<a href='#SkIRect_makeInset_dx'>dx</a>, <a href='#SkIRect_makeInset_dy'>dy</a>). -If <a href="#SkIRect_makeInset_dx">dx</a> is negative, <a href="#IRect">IRect</a> returned is wider. -If <a href="#SkIRect_makeInset_dx">dx</a> is positive, <a href="#IRect">IRect</a> returned is narrower. -If <a href="#SkIRect_makeInset_dy">dy</a> is negative, <a href="#IRect">IRect</a> returned is taller. -If <a href="#SkIRect_makeInset_dy">dy</a> is positive, <a href="#IRect">IRect</a> returned is shorter. +If <a href='#SkIRect_makeInset_dx'>dx</a> is negative, <a href='#IRect'>IRect</a> returned is wider. +If <a href='#SkIRect_makeInset_dx'>dx</a> is positive, <a href='#IRect'>IRect</a> returned is narrower. +If <a href='#SkIRect_makeInset_dy'>dy</a> is negative, <a href='#IRect'>IRect</a> returned is taller. +If <a href='#SkIRect_makeInset_dy'>dy</a> is positive, <a href='#IRect'>IRect</a> returned is shorter. ### Parameters -<table> <tr> <td><a name="SkIRect_makeInset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fLeft">fLeft</a> and subtracted from <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_makeInset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fTop">fTop</a> and subtracted from <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_makeInset_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fLeft'>fLeft</a> and subtracted from <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_makeInset_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fTop'>fTop</a> and subtracted from <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -<a href="#IRect">IRect</a> inset symmetrically left and right, top and bottom +<a href='#IRect'>IRect</a> inset symmetrically left and right, top and bottom ### Example @@ -1145,36 +1517,37 @@ rect: 25, 82, 5, 28 isEmpty: true ### See Also -<a href="#SkIRect_inset">inset</a> <a href="#SkIRect_makeOffset">makeOffset</a> <a href="#SkIRect_makeOutset">makeOutset</a> <a href="SkRect_Reference#SkRect_makeInset">SkRect::makeInset</a> +<a href='#SkIRect_inset'>inset</a> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_makeInset'>SkRect::makeInset</a> --- -<a name="SkIRect_makeOutset"></a> +<a name='SkIRect_makeOutset'></a> ## makeOutset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect makeOutset(int32_t dx, int32_t dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeOutset'>makeOutset</a>(int32_t dx, int32_t dy) const </pre> -Returns <a href="#IRect">IRect</a>, outset by (<a href="#SkIRect_makeOutset_dx">dx</a>, <a href="#SkIRect_makeOutset_dy">dy</a>). +Returns <a href='#IRect'>IRect</a>, outset by (<a href='#SkIRect_makeOutset_dx'>dx</a>, <a href='#SkIRect_makeOutset_dy'>dy</a>). -If <a href="#SkIRect_makeOutset_dx">dx</a> is negative, <a href="#IRect">IRect</a> returned is narrower. -If <a href="#SkIRect_makeOutset_dx">dx</a> is positive, <a href="#IRect">IRect</a> returned is wider. -If <a href="#SkIRect_makeOutset_dy">dy</a> is negative, <a href="#IRect">IRect</a> returned is shorter. -If <a href="#SkIRect_makeOutset_dy">dy</a> is positive, <a href="#IRect">IRect</a> returned is taller. +If <a href='#SkIRect_makeOutset_dx'>dx</a> is negative, <a href='#IRect'>IRect</a> returned is narrower. +If <a href='#SkIRect_makeOutset_dx'>dx</a> is positive, <a href='#IRect'>IRect</a> returned is wider. +If <a href='#SkIRect_makeOutset_dy'>dy</a> is negative, <a href='#IRect'>IRect</a> returned is shorter. +If <a href='#SkIRect_makeOutset_dy'>dy</a> is positive, <a href='#IRect'>IRect</a> returned is taller. ### Parameters -<table> <tr> <td><a name="SkIRect_makeOutset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset subtracted to <a href="#SkIRect_fLeft">fLeft</a> and added from <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_makeOutset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset subtracted to <a href="#SkIRect_fTop">fTop</a> and added from <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_makeOutset_dx'><code><strong>dx</strong></code></a></td> + <td>offset subtracted to <a href='#SkIRect_fLeft'>fLeft</a> and added from <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_makeOutset_dy'><code><strong>dy</strong></code></a></td> + <td>offset subtracted to <a href='#SkIRect_fTop'>fTop</a> and added from <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -<a href="#IRect">IRect</a> outset symmetrically left and right, top and bottom +<a href='#IRect'>IRect</a> outset symmetrically left and right, top and bottom ### Example @@ -1191,30 +1564,31 @@ rect: -5, 18, 35, 92 isEmpty: false ### See Also -<a href="#SkIRect_outset">outset</a> <a href="#SkIRect_makeOffset">makeOffset</a> <a href="#SkIRect_makeInset">makeInset</a> <a href="SkRect_Reference#SkRect_makeOutset">SkRect::makeOutset</a> +<a href='#SkIRect_outset'>outset</a> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_makeInset'>makeInset</a> <a href='SkRect_Reference#SkRect_makeOutset'>SkRect::makeOutset</a> --- -<a name="SkIRect_offset"></a> +<a name='SkIRect_offset'></a> ## offset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(int32_t dx, int32_t dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_offset'>offset</a>(int32_t dx, int32_t dy) </pre> -Offsets <a href="#IRect">IRect</a> by adding <a href="#SkIRect_offset_dx">dx</a> to <a href="#SkIRect_fLeft">fLeft</a>, <a href="#SkIRect_fRight">fRight</a>; and by adding <a href="#SkIRect_offset_dy">dy</a> to <a href="#SkIRect_fTop">fTop</a>, <a href="#SkIRect_fBottom">fBottom</a>. +Offsets <a href='#IRect'>IRect</a> by adding <a href='#SkIRect_offset_dx'>dx</a> to <a href='#SkIRect_fLeft'>fLeft</a>, <a href='#SkIRect_fRight'>fRight</a>; and by adding <a href='#SkIRect_offset_dy'>dy</a> to <a href='#SkIRect_fTop'>fTop</a>, <a href='#SkIRect_fBottom'>fBottom</a>. -If <a href="#SkIRect_offset_dx">dx</a> is negative, moves <a href="#IRect">IRect</a> returned to the left. -If <a href="#SkIRect_offset_dx">dx</a> is positive, moves <a href="#IRect">IRect</a> returned to the right. -If <a href="#SkIRect_offset_dy">dy</a> is negative, moves <a href="#IRect">IRect</a> returned upward. -If <a href="#SkIRect_offset_dy">dy</a> is positive, moves <a href="#IRect">IRect</a> returned downward. +If <a href='#SkIRect_offset_dx'>dx</a> is negative, moves <a href='#IRect'>IRect</a> returned to the left. +If <a href='#SkIRect_offset_dx'>dx</a> is positive, moves <a href='#IRect'>IRect</a> returned to the right. +If <a href='#SkIRect_offset_dy'>dy</a> is negative, moves <a href='#IRect'>IRect</a> returned upward. +If <a href='#SkIRect_offset_dy'>dy</a> is positive, moves <a href='#IRect'>IRect</a> returned downward. ### Parameters -<table> <tr> <td><a name="SkIRect_offset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_offset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_offset_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_offset_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1232,28 +1606,28 @@ rect: 15, 27, 55, 86 ### See Also -<a href="#SkIRect_offsetTo">offsetTo</a> <a href="#SkIRect_makeOffset">makeOffset</a> <a href="SkRect_Reference#SkRect_offset">SkRect::offset</a><sup><a href="SkRect_Reference#SkRect_offset_2">[2]</a></sup> +<a href='#SkIRect_offsetTo'>offsetTo</a> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='SkRect_Reference#SkRect_offset'>SkRect::offset</a><sup><a href='SkRect_Reference#SkRect_offset_2'>[2]</a></sup> --- -<a name="SkIRect_offset_2"></a> +<a name='SkIRect_offset_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(const SkIPoint& delta) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_offset'>offset</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& delta) </pre> -Offsets <a href="#IRect">IRect</a> by adding <a href="#SkIRect_offset_2_delta">delta</a>.fX to <a href="#SkIRect_fLeft">fLeft</a>, <a href="#SkIRect_fRight">fRight</a>; and by adding <a href="#SkIRect_offset_2_delta">delta</a>.fY to -<a href="#SkIRect_fTop">fTop</a>, <a href="#SkIRect_fBottom">fBottom</a>. +Offsets <a href='#IRect'>IRect</a> by adding <a href='#SkIRect_offset_2_delta'>delta</a>.fX to <a href='#SkIRect_fLeft'>fLeft</a>, <a href='#SkIRect_fRight'>fRight</a>; and by adding <a href='#SkIRect_offset_2_delta'>delta</a>.fY to +<a href='#SkIRect_fTop'>fTop</a>, <a href='#SkIRect_fBottom'>fBottom</a>. -If <a href="#SkIRect_offset_2_delta">delta</a>.fX is negative, moves <a href="#IRect">IRect</a> returned to the left. -If <a href="#SkIRect_offset_2_delta">delta</a>.fX is positive, moves <a href="#IRect">IRect</a> returned to the right. -If <a href="#SkIRect_offset_2_delta">delta</a>.fY is negative, moves <a href="#IRect">IRect</a> returned upward. -If <a href="#SkIRect_offset_2_delta">delta</a>.fY is positive, moves <a href="#IRect">IRect</a> returned downward. +If <a href='#SkIRect_offset_2_delta'>delta</a>.fX is negative, moves <a href='#IRect'>IRect</a> returned to the left. +If <a href='#SkIRect_offset_2_delta'>delta</a>.fX is positive, moves <a href='#IRect'>IRect</a> returned to the right. +If <a href='#SkIRect_offset_2_delta'>delta</a>.fY is negative, moves <a href='#IRect'>IRect</a> returned upward. +If <a href='#SkIRect_offset_2_delta'>delta</a>.fY is positive, moves <a href='#IRect'>IRect</a> returned downward. ### Parameters -<table> <tr> <td><a name="SkIRect_offset_2_delta"> <code><strong>delta </strong></code> </a></td> <td> -offset added to <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_offset_2_delta'><code><strong>delta</strong></code></a></td> + <td>offset added to <a href='#IRect'>IRect</a></td> </tr> </table> @@ -1271,26 +1645,27 @@ rect: 15, 27, 55, 86 ### See Also -<a href="#SkIRect_offsetTo">offsetTo</a> <a href="#SkIRect_makeOffset">makeOffset</a> <a href="SkRect_Reference#SkRect_offset">SkRect::offset</a><sup><a href="SkRect_Reference#SkRect_offset_2">[2]</a></sup> +<a href='#SkIRect_offsetTo'>offsetTo</a> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='SkRect_Reference#SkRect_offset'>SkRect::offset</a><sup><a href='SkRect_Reference#SkRect_offset_2'>[2]</a></sup> --- -<a name="SkIRect_offsetTo"></a> +<a name='SkIRect_offsetTo'></a> ## offsetTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offsetTo(int32_t newX, int32_t newY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_offsetTo'>offsetTo</a>(int32_t newX, int32_t newY) </pre> -Offsets <a href="#IRect">IRect</a> so that <a href="#SkIRect_fLeft">fLeft</a> equals <a href="#SkIRect_offsetTo_newX">newX</a>, and <a href="#SkIRect_fTop">fTop</a> equals <a href="#SkIRect_offsetTo_newY">newY</a>. width and height +Offsets <a href='#IRect'>IRect</a> so that <a href='#SkIRect_fLeft'>fLeft</a> equals <a href='#SkIRect_offsetTo_newX'>newX</a>, and <a href='#SkIRect_fTop'>fTop</a> equals <a href='#SkIRect_offsetTo_newY'>newY</a>. width and height are unchanged. ### Parameters -<table> <tr> <td><a name="SkIRect_offsetTo_newX"> <code><strong>newX </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fLeft">fLeft</a>, preserving <a href="#SkIRect_width">width</a></td> - </tr> <tr> <td><a name="SkIRect_offsetTo_newY"> <code><strong>newY </strong></code> </a></td> <td> -stored in <a href="#SkIRect_fTop">fTop</a>, preserving <a href="#SkIRect_height">height</a></td> +<table> <tr> <td><a name='SkIRect_offsetTo_newX'><code><strong>newX</strong></code></a></td> + <td>stored in <a href='#SkIRect_fLeft'>fLeft</a>, preserving <a href='#SkIRect_width'>width</a></td> + </tr> + <tr> <td><a name='SkIRect_offsetTo_newY'><code><strong>newY</strong></code></a></td> + <td>stored in <a href='#SkIRect_fTop'>fTop</a>, preserving <a href='#SkIRect_height'>height</a></td> </tr> </table> @@ -1308,30 +1683,31 @@ rect: 15, 27, 55, 86 ### See Also -<a href="#SkIRect_offset">offset</a><sup><a href="#SkIRect_offset_2">[2]</a></sup> <a href="#SkIRect_makeOffset">makeOffset</a> <a href="#SkIRect_setXYWH">setXYWH</a> <a href="SkRect_Reference#SkRect_offsetTo">SkRect::offsetTo</a> +<a href='#SkIRect_offset'>offset</a><sup><a href='#SkIRect_offset_2'>[2]</a></sup> <a href='#SkIRect_makeOffset'>makeOffset</a> <a href='#SkIRect_setXYWH'>setXYWH</a> <a href='SkRect_Reference#SkRect_offsetTo'>SkRect::offsetTo</a> --- -<a name="SkIRect_inset"></a> +<a name='SkIRect_inset'></a> ## inset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void inset(int32_t dx, int32_t dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_inset'>inset</a>(int32_t dx, int32_t dy) </pre> -Insets <a href="#IRect">IRect</a> by (<a href="#SkIRect_inset_dx">dx</a>,<a href="#SkIRect_inset_dy">dy</a>). +Insets <a href='#IRect'>IRect</a> by (<a href='#SkIRect_inset_dx'>dx</a>,<a href='#SkIRect_inset_dy'>dy</a>). -If <a href="#SkIRect_inset_dx">dx</a> is positive, makes <a href="#IRect">IRect</a> narrower. -If <a href="#SkIRect_inset_dx">dx</a> is negative, makes <a href="#IRect">IRect</a> wider. -If <a href="#SkIRect_inset_dy">dy</a> is positive, makes <a href="#IRect">IRect</a> shorter. -If <a href="#SkIRect_inset_dy">dy</a> is negative, makes <a href="#IRect">IRect</a> taller. +If <a href='#SkIRect_inset_dx'>dx</a> is positive, makes <a href='#IRect'>IRect</a> narrower. +If <a href='#SkIRect_inset_dx'>dx</a> is negative, makes <a href='#IRect'>IRect</a> wider. +If <a href='#SkIRect_inset_dy'>dy</a> is positive, makes <a href='#IRect'>IRect</a> shorter. +If <a href='#SkIRect_inset_dy'>dy</a> is negative, makes <a href='#IRect'>IRect</a> taller. ### Parameters -<table> <tr> <td><a name="SkIRect_inset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fLeft">fLeft</a> and subtracted from <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_inset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#SkIRect_fTop">fTop</a> and subtracted from <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_inset_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fLeft'>fLeft</a> and subtracted from <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_inset_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#SkIRect_fTop'>fTop</a> and subtracted from <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1349,30 +1725,31 @@ rect: 15, 27, 45, 60 ### See Also -<a href="#SkIRect_outset">outset</a> <a href="#SkIRect_makeInset">makeInset</a> <a href="SkRect_Reference#SkRect_inset">SkRect::inset</a> +<a href='#SkIRect_outset'>outset</a> <a href='#SkIRect_makeInset'>makeInset</a> <a href='SkRect_Reference#SkRect_inset'>SkRect::inset</a> --- -<a name="SkIRect_outset"></a> +<a name='SkIRect_outset'></a> ## outset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void outset(int32_t dx, int32_t dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_outset'>outset</a>(int32_t dx, int32_t dy) </pre> -Outsets <a href="#IRect">IRect</a> by (<a href="#SkIRect_outset_dx">dx</a>, <a href="#SkIRect_outset_dy">dy</a>). +Outsets <a href='#IRect'>IRect</a> by (<a href='#SkIRect_outset_dx'>dx</a>, <a href='#SkIRect_outset_dy'>dy</a>). -If <a href="#SkIRect_outset_dx">dx</a> is positive, makes <a href="#IRect">IRect</a> wider. -If <a href="#SkIRect_outset_dx">dx</a> is negative, makes <a href="#IRect">IRect</a> narrower. -If <a href="#SkIRect_outset_dy">dy</a> is positive, makes <a href="#IRect">IRect</a> taller. -If <a href="#SkIRect_outset_dy">dy</a> is negative, makes <a href="#IRect">IRect</a> shorter. +If <a href='#SkIRect_outset_dx'>dx</a> is positive, makes <a href='#IRect'>IRect</a> wider. +If <a href='#SkIRect_outset_dx'>dx</a> is negative, makes <a href='#IRect'>IRect</a> narrower. +If <a href='#SkIRect_outset_dy'>dy</a> is positive, makes <a href='#IRect'>IRect</a> taller. +If <a href='#SkIRect_outset_dy'>dy</a> is negative, makes <a href='#IRect'>IRect</a> shorter. ### Parameters -<table> <tr> <td><a name="SkIRect_outset_dx"> <code><strong>dx </strong></code> </a></td> <td> -subtracted to <a href="#SkIRect_fLeft">fLeft</a> and added from <a href="#SkIRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkIRect_outset_dy"> <code><strong>dy </strong></code> </a></td> <td> -subtracted to <a href="#SkIRect_fTop">fTop</a> and added from <a href="#SkIRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkIRect_outset_dx'><code><strong>dx</strong></code></a></td> + <td>subtracted to <a href='#SkIRect_fLeft'>fLeft</a> and added from <a href='#SkIRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkIRect_outset_dy'><code><strong>dy</strong></code></a></td> + <td>subtracted to <a href='#SkIRect_fTop'>fTop</a> and added from <a href='#SkIRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1390,64 +1767,96 @@ rect: 5, 1, 55, 86 ### See Also -<a href="#SkIRect_inset">inset</a> <a href="#SkIRect_makeOutset">makeOutset</a> <a href="SkRect_Reference#SkRect_outset">SkRect::outset</a> +<a href='#SkIRect_inset'>inset</a> <a href='#SkIRect_makeOutset'>makeOutset</a> <a href='SkRect_Reference#SkRect_outset'>SkRect::outset</a> --- -## <a name="Intersection"></a> Intersection +## <a name='Intersection'>Intersection</a> -<a href="#IRect">IRects</a> intersect when they enclose a common area. To intersect, each of the pair -must describe area; <a href="#SkIRect_fLeft">fLeft</a> is less than <a href="#SkIRect_fRight">fRight</a>, and <a href="#SkIRect_fTop">fTop</a> is less than <a href="#SkIRect_fBottom">fBottom</a>; -empty() returns false. The intersection of <a href="#IRect">IRect</a> pair can be described by: +<a href='#IRect'>IRects</a> intersect when they enclose a common area. To intersect, each of the pair +must describe area; <a href='#SkIRect_fLeft'>fLeft</a> is less than <a href='#SkIRect_fRight'>fRight</a>, and <a href='#SkIRect_fTop'>fTop</a> is less than <a href='#SkIRect_fBottom'>fBottom</a>; +empty() returns false. The intersection of <a href='#IRect'>IRect</a> pair can be described by: (max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)) . -The intersection is only meaningful if the resulting <a href="#IRect">IRect</a> is not empty and -describes an area: <a href="#SkIRect_fLeft">fLeft</a> is less than <a href="#SkIRect_fRight">fRight</a>, and <a href="#SkIRect_fTop">fTop</a> is less than <a href="#SkIRect_fBottom">fBottom</a>. - -| name | description | -| --- | --- | -| <a href="#SkIRect_Intersects">Intersects</a> | returns true if areas overlap | -| <a href="#SkIRect_IntersectsNoEmptyCheck">IntersectsNoEmptyCheck</a> | returns true if areas overlap skips empty check | -| <a href="#SkIRect_contains">contains</a> | returns true if <a href="SkIPoint_Reference#IPoint">IPoint</a> (x, y) is equal or inside | -| | <a href="#SkIRect_contains">contains(int32 t x, int32 t y)</a> const | -| <a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a> | returns true if contains unsorted <a href="#IRect">IRect</a> | -| | <a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck(int32 t left, int32 t top, int32 t right, int32 t bottom)</a> const | -| <a href="#SkIRect_intersect">intersect</a> | sets to shared area; returns true if not empty | -| | <a href="#SkIRect_intersect">intersect(const SkIRect& r)</a> | -| <a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> | sets to shared area; returns true if not empty skips empty check | - -<a name="SkIRect_contains"></a> +The intersection is only meaningful if the resulting <a href='#IRect'>IRect</a> is not empty and +describes an area: <a href='#SkIRect_fLeft'>fLeft</a> is less than <a href='#SkIRect_fRight'>fRight</a>, and <a href='#SkIRect_fTop'>fTop</a> is less than <a href='#SkIRect_fBottom'>fBottom</a>. + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_Intersects'>Intersects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap skips empty check</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_contains'>contains</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkIPoint_Reference#IPoint'>IPoint</a> (x, y) is equal or inside</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_contains'>contains(int32 t x, int32 t y)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if contains unsorted <a href='#IRect'>IRect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck(int32 t left, int32 t top, int32 t right, int32 t bottom)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersect'>intersect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersect'>intersect(const SkIRect& r)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty skips empty check</td> + </tr> +</table> + + +<a name='SkIRect_contains'></a> ## contains -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(int32_t x, int32_t y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_contains'>contains</a>(int32_t x, int32_t y) const </pre> Returns true if: -<a href="#SkIRect_fLeft">fLeft</a> <= x < <a href="#SkIRect_fRight">fRight</a> && <a href="#SkIRect_fTop">fTop</a> <= y < <a href="#SkIRect_fBottom">fBottom</a>. +<a href='#SkIRect_fLeft'>fLeft</a> <= x < <a href='#SkIRect_fRight'>fRight</a> && <a href='#SkIRect_fTop'>fTop</a> <= y < <a href='#SkIRect_fBottom'>fBottom</a>. -Returns false if <a href="#IRect">IRect</a> is empty. +Returns false if <a href='#IRect'>IRect</a> is empty. -Considers input to describe constructed <a href="#IRect">IRect</a>: +Considers input to describe constructed <a href='#IRect'>IRect</a>: (x, y, x + 1, y + 1) and -returns true if constructed area is completely enclosed by <a href="#IRect">IRect</a> area. +returns true if constructed area is completely enclosed by <a href='#IRect'>IRect</a> area. ### Parameters -<table> <tr> <td><a name="SkIRect_contains_x"> <code><strong>x </strong></code> </a></td> <td> -test <a href="SkIPoint_Reference#IPoint">IPoint</a> x-coordinate</td> - </tr> <tr> <td><a name="SkIRect_contains_y"> <code><strong>y </strong></code> </a></td> <td> -test <a href="SkIPoint_Reference#IPoint">IPoint</a> y-coordinate</td> +<table> <tr> <td><a name='SkIRect_contains_x'><code><strong>x</strong></code></a></td> + <td>test <a href='SkIPoint_Reference#IPoint'>IPoint</a> x-coordinate</td> + </tr> + <tr> <td><a name='SkIRect_contains_y'><code><strong>y</strong></code></a></td> + <td>test <a href='SkIPoint_Reference#IPoint'>IPoint</a> y-coordinate</td> </tr> </table> ### Return Value -true if (x, y) is inside <a href="#IRect">IRect</a> +true if (x, y) is inside <a href='#IRect'>IRect</a> ### Example @@ -1465,38 +1874,41 @@ rect: (30, 50, 40, 60) does not contain (30, 60) ### See Also -<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup> +<a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a><sup><a href='#SkIRect_containsNoEmptyCheck_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup> --- -<a name="SkIRect_contains_2"></a> +<a name='SkIRect_contains_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_contains'>contains</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) const </pre> -Constructs <a href="#IRect">IRect</a> to intersect from (left, top, right, bottom). Does not sort +Constructs <a href='#IRect'>IRect</a> to intersect from (left, top, right, bottom). Does not sort construction. -Returns true if <a href="#IRect">IRect</a> contains construction. -Returns false if <a href="#IRect">IRect</a> is empty or construction is empty. +Returns true if <a href='#IRect'>IRect</a> contains construction. +Returns false if <a href='#IRect'>IRect</a> is empty or construction is empty. ### Parameters -<table> <tr> <td><a name="SkIRect_contains_2_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_contains_2_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_contains_2_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_contains_2_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_contains_2_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_contains_2_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_contains_2_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_contains_2_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#IRect'>IRect</a></td> </tr> </table> ### Return Value -true if all sides of <a href="#IRect">IRect</a> are outside construction +true if all sides of <a href='#IRect'>IRect</a> are outside construction ### Example @@ -1514,31 +1926,31 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup> +<a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a><sup><a href='#SkIRect_containsNoEmptyCheck_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup> --- -<a name="SkIRect_contains_3"></a> +<a name='SkIRect_contains_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(const SkIRect& r) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_contains'>contains</a>(const <a href='#SkIRect'>SkIRect</a>& r) const </pre> -Returns true if <a href="#IRect">IRect</a> contains <a href="#SkIRect_contains_3_r">r</a>. -Returns false if <a href="#IRect">IRect</a> is empty or <a href="#SkIRect_contains_3_r">r</a> is empty. +Returns true if <a href='#IRect'>IRect</a> contains <a href='#SkIRect_contains_3_r'>r</a>. +Returns false if <a href='#IRect'>IRect</a> is empty or <a href='#SkIRect_contains_3_r'>r</a> is empty. -<a href="#IRect">IRect</a> contains <a href="#SkIRect_contains_3_r">r</a> when <a href="#IRect">IRect</a> area completely includes <a href="#SkIRect_contains_3_r">r</a> area. +<a href='#IRect'>IRect</a> contains <a href='#SkIRect_contains_3_r'>r</a> when <a href='#IRect'>IRect</a> area completely includes <a href='#SkIRect_contains_3_r'>r</a> area. ### Parameters -<table> <tr> <td><a name="SkIRect_contains_3_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> contained</td> +<table> <tr> <td><a name='SkIRect_contains_3_r'><code><strong>r</strong></code></a></td> + <td><a href='#IRect'>IRect</a> contained</td> </tr> </table> ### Return Value -true if all sides of <a href="#IRect">IRect</a> are outside <a href="#SkIRect_contains_3_r">r</a> +true if all sides of <a href='#IRect'>IRect</a> are outside <a href='#SkIRect_contains_3_r'>r</a> ### Example @@ -1556,31 +1968,31 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup> +<a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a><sup><a href='#SkIRect_containsNoEmptyCheck_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup> --- -<a name="SkIRect_contains_4"></a> +<a name='SkIRect_contains_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(const SkRect& r) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_contains'>contains</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& r) const </pre> -Returns true if <a href="#IRect">IRect</a> contains <a href="#SkIRect_contains_4_r">r</a>. -Returns false if <a href="#IRect">IRect</a> is empty or <a href="#SkIRect_contains_4_r">r</a> is empty. +Returns true if <a href='#IRect'>IRect</a> contains <a href='#SkIRect_contains_4_r'>r</a>. +Returns false if <a href='#IRect'>IRect</a> is empty or <a href='#SkIRect_contains_4_r'>r</a> is empty. -<a href="#IRect">IRect</a> contains <a href="#SkIRect_contains_4_r">r</a> when <a href="#IRect">IRect</a> area completely includes <a href="#SkIRect_contains_4_r">r</a> area. +<a href='#IRect'>IRect</a> contains <a href='#SkIRect_contains_4_r'>r</a> when <a href='#IRect'>IRect</a> area completely includes <a href='#SkIRect_contains_4_r'>r</a> area. ### Parameters -<table> <tr> <td><a name="SkIRect_contains_4_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> contained</td> +<table> <tr> <td><a name='SkIRect_contains_4_r'><code><strong>r</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> contained</td> </tr> </table> ### Return Value -true if all sides of <a href="#IRect">IRect</a> are outside <a href="#SkIRect_contains_4_r">r</a> +true if all sides of <a href='#IRect'>IRect</a> are outside <a href='#SkIRect_contains_4_r'>r</a> ### Example @@ -1598,41 +2010,44 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a><sup><a href="#SkIRect_containsNoEmptyCheck_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup> +<a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a><sup><a href='#SkIRect_containsNoEmptyCheck_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup> --- -<a name="SkIRect_containsNoEmptyCheck"></a> +<a name='SkIRect_containsNoEmptyCheck'></a> ## containsNoEmptyCheck -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool containsNoEmptyCheck(int32_t left, int32_t top, int32_t right, int32_t bottom) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) const </pre> -Constructs <a href="#IRect">IRect</a> from (left, top, right, bottom). Does not sort +Constructs <a href='#IRect'>IRect</a> from (left, top, right, bottom). Does not sort construction. -Returns true if <a href="#IRect">IRect</a> contains construction. -Asserts if <a href="#IRect">IRect</a> is empty or construction is empty, and if SK_DEBUG is defined. +Returns true if <a href='#IRect'>IRect</a> contains construction. +Asserts if <a href='#IRect'>IRect</a> is empty or construction is empty, and if SK_DEBUG is defined. -Return is undefined if <a href="#IRect">IRect</a> is empty or construction is empty. +Return is undefined if <a href='#IRect'>IRect</a> is empty or construction is empty. ### Parameters -<table> <tr> <td><a name="SkIRect_containsNoEmptyCheck_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_containsNoEmptyCheck_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_containsNoEmptyCheck_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_containsNoEmptyCheck_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_containsNoEmptyCheck_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_containsNoEmptyCheck_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_containsNoEmptyCheck_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_containsNoEmptyCheck_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#IRect'>IRect</a></td> </tr> </table> ### Return Value -true if all sides of <a href="#IRect">IRect</a> are outside construction +true if all sides of <a href='#IRect'>IRect</a> are outside construction ### Example @@ -1650,31 +2065,31 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="#SkIRect_contains">contains</a><sup><a href="#SkIRect_contains_2">[2]</a></sup><sup><a href="#SkIRect_contains_3">[3]</a></sup><sup><a href="#SkIRect_contains_4">[4]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup> +<a href='#SkIRect_contains'>contains</a><sup><a href='#SkIRect_contains_2'>[2]</a></sup><sup><a href='#SkIRect_contains_3'>[3]</a></sup><sup><a href='#SkIRect_contains_4'>[4]</a></sup> <a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup> --- -<a name="SkIRect_containsNoEmptyCheck_2"></a> +<a name='SkIRect_containsNoEmptyCheck_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool containsNoEmptyCheck(const SkIRect& r) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_containsNoEmptyCheck'>containsNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& r) const </pre> -Returns true if <a href="#IRect">IRect</a> contains construction. -Asserts if <a href="#IRect">IRect</a> is empty or construction is empty, and if SK_DEBUG is defined. +Returns true if <a href='#IRect'>IRect</a> contains construction. +Asserts if <a href='#IRect'>IRect</a> is empty or construction is empty, and if SK_DEBUG is defined. -Return is undefined if <a href="#IRect">IRect</a> is empty or construction is empty. +Return is undefined if <a href='#IRect'>IRect</a> is empty or construction is empty. ### Parameters -<table> <tr> <td><a name="SkIRect_containsNoEmptyCheck_2_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> contained</td> +<table> <tr> <td><a name='SkIRect_containsNoEmptyCheck_2_r'><code><strong>r</strong></code></a></td> + <td><a href='#IRect'>IRect</a> contained</td> </tr> </table> ### Return Value -true if all sides of <a href="#IRect">IRect</a> are outside <a href="#SkIRect_containsNoEmptyCheck_2_r">r</a> +true if all sides of <a href='#IRect'>IRect</a> are outside <a href='#SkIRect_containsNoEmptyCheck_2_r'>r</a> ### Example @@ -1692,36 +2107,36 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="#SkIRect_contains">contains</a><sup><a href="#SkIRect_contains_2">[2]</a></sup><sup><a href="#SkIRect_contains_3">[3]</a></sup><sup><a href="#SkIRect_contains_4">[4]</a></sup> <a href="SkRect_Reference#SkRect_contains">SkRect::contains</a><sup><a href="SkRect_Reference#SkRect_contains_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_contains_3">[3]</a></sup> +<a href='#SkIRect_contains'>contains</a><sup><a href='#SkIRect_contains_2'>[2]</a></sup><sup><a href='#SkIRect_contains_3'>[3]</a></sup><sup><a href='#SkIRect_contains_4'>[4]</a></sup> <a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup> --- -<a name="SkIRect_intersect"></a> +<a name='SkIRect_intersect'></a> ## intersect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool intersect(const SkIRect& r) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_intersect'>intersect</a>(const <a href='#SkIRect'>SkIRect</a>& r) </pre> -Returns true if <a href="#IRect">IRect</a> intersects <a href="#SkIRect_intersect_r">r</a>, and sets <a href="#IRect">IRect</a> to intersection. -Returns false if <a href="#IRect">IRect</a> does not intersect <a href="#SkIRect_intersect_r">r</a>, and leaves <a href="#IRect">IRect</a> unchanged. +Returns true if <a href='#IRect'>IRect</a> intersects <a href='#SkIRect_intersect_r'>r</a>, and sets <a href='#IRect'>IRect</a> to intersection. +Returns false if <a href='#IRect'>IRect</a> does not intersect <a href='#SkIRect_intersect_r'>r</a>, and leaves <a href='#IRect'>IRect</a> unchanged. -Returns false if either <a href="#SkIRect_intersect_r">r</a> or <a href="#IRect">IRect</a> is empty, leaving <a href="#IRect">IRect</a> unchanged. +Returns false if either <a href='#SkIRect_intersect_r'>r</a> or <a href='#IRect'>IRect</a> is empty, leaving <a href='#IRect'>IRect</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkIRect_intersect_r"> <code><strong>r </strong></code> </a></td> <td> -limit of result</td> +<table> <tr> <td><a name='SkIRect_intersect_r'><code><strong>r</strong></code></a></td> + <td>limit of result</td> </tr> </table> ### Return Value -true if <a href="#SkIRect_intersect_r">r</a> and <a href="#IRect">IRect</a> have area in common +true if <a href='#SkIRect_intersect_r'>r</a> and <a href='#IRect'>IRect</a> have area in common ### Example -<div><fiddle-embed name="2be1302480e54a767e25cbeed5d41b41"><div>Two <a href="undocumented#SkDebugf">SkDebugf</a> calls are required. If the calls are combined, their arguments +<div><fiddle-embed name="ea233f5d5d1ae0e76fc6f2eb371c927a"><div>Two <a href='undocumented#SkDebugf'>SkDebugf</a> calls are required. If the calls are combined, their arguments may not be evaluated in left to right order: the printed intersection may be before or after the call to intersect. </div> @@ -1736,33 +2151,34 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkIRect_Intersects">Intersects</a> <a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> <a href="#SkIRect_join">join</a><sup><a href="#SkIRect_join_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_intersect">SkRect::intersect</a><sup><a href="SkRect_Reference#SkRect_intersect_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_intersect_3">[3]</a></sup> +<a href='#SkIRect_Intersects'>Intersects</a> <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a> <a href='#SkIRect_join'>join</a><sup><a href='#SkIRect_join_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_intersect'>SkRect::intersect</a><sup><a href='SkRect_Reference#SkRect_intersect_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_intersect_3'>[3]</a></sup> --- -<a name="SkIRect_intersect_2"></a> +<a name='SkIRect_intersect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkIRect_intersect'>intersect</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b) </pre> -Returns true if <a href="#SkIRect_intersect_2_a">a</a> intersects <a href="#SkIRect_intersect_2_b">b</a>, and sets <a href="#IRect">IRect</a> to intersection. -Returns false if <a href="#SkIRect_intersect_2_a">a</a> does not intersect <a href="#SkIRect_intersect_2_b">b</a>, and leaves <a href="#IRect">IRect</a> unchanged. +Returns true if <a href='#SkIRect_intersect_2_a'>a</a> intersects <a href='#SkIRect_intersect_2_b'>b</a>, and sets <a href='#IRect'>IRect</a> to intersection. +Returns false if <a href='#SkIRect_intersect_2_a'>a</a> does not intersect <a href='#SkIRect_intersect_2_b'>b</a>, and leaves <a href='#IRect'>IRect</a> unchanged. -Returns false if either <a href="#SkIRect_intersect_2_a">a</a> or <a href="#SkIRect_intersect_2_b">b</a> is empty, leaving <a href="#IRect">IRect</a> unchanged. +Returns false if either <a href='#SkIRect_intersect_2_a'>a</a> or <a href='#SkIRect_intersect_2_b'>b</a> is empty, leaving <a href='#IRect'>IRect</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkIRect_intersect_2_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> - </tr> <tr> <td><a name="SkIRect_intersect_2_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> +<table> <tr> <td><a name='SkIRect_intersect_2_a'><code><strong>a</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> + </tr> + <tr> <td><a name='SkIRect_intersect_2_b'><code><strong>b</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkIRect_intersect_2_a">a</a> and <a href="#SkIRect_intersect_2_b">b</a> have area in common +true if <a href='#SkIRect_intersect_2_a'>a</a> and <a href='#SkIRect_intersect_2_b'>b</a> have area in common ### Example @@ -1778,34 +2194,35 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkIRect_Intersects">Intersects</a> <a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> <a href="#SkIRect_join">join</a><sup><a href="#SkIRect_join_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_intersect">SkRect::intersect</a><sup><a href="SkRect_Reference#SkRect_intersect_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_intersect_3">[3]</a></sup> +<a href='#SkIRect_Intersects'>Intersects</a> <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a> <a href='#SkIRect_join'>join</a><sup><a href='#SkIRect_join_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_intersect'>SkRect::intersect</a><sup><a href='SkRect_Reference#SkRect_intersect_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_intersect_3'>[3]</a></sup> --- -<a name="SkIRect_intersectNoEmptyCheck"></a> +<a name='SkIRect_intersectNoEmptyCheck'></a> ## intersectNoEmptyCheck -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b) </pre> -Returns true if <a href="#SkIRect_intersectNoEmptyCheck_a">a</a> intersects <a href="#SkIRect_intersectNoEmptyCheck_b">b</a>, and sets <a href="#IRect">IRect</a> to intersection. -Returns false if <a href="#SkIRect_intersectNoEmptyCheck_a">a</a> does not intersect <a href="#SkIRect_intersectNoEmptyCheck_b">b</a>, and leaves <a href="#IRect">IRect</a> unchanged. +Returns true if <a href='#SkIRect_intersectNoEmptyCheck_a'>a</a> intersects <a href='#SkIRect_intersectNoEmptyCheck_b'>b</a>, and sets <a href='#IRect'>IRect</a> to intersection. +Returns false if <a href='#SkIRect_intersectNoEmptyCheck_a'>a</a> does not intersect <a href='#SkIRect_intersectNoEmptyCheck_b'>b</a>, and leaves <a href='#IRect'>IRect</a> unchanged. -Asserts if either <a href="#SkIRect_intersectNoEmptyCheck_a">a</a> or <a href="#SkIRect_intersectNoEmptyCheck_b">b</a> is empty, and if SK_DEBUG is defined. +Asserts if either <a href='#SkIRect_intersectNoEmptyCheck_a'>a</a> or <a href='#SkIRect_intersectNoEmptyCheck_b'>b</a> is empty, and if SK_DEBUG is defined. ### Parameters -<table> <tr> <td><a name="SkIRect_intersectNoEmptyCheck_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> - </tr> <tr> <td><a name="SkIRect_intersectNoEmptyCheck_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> +<table> <tr> <td><a name='SkIRect_intersectNoEmptyCheck_a'><code><strong>a</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> + </tr> + <tr> <td><a name='SkIRect_intersectNoEmptyCheck_b'><code><strong>b</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkIRect_intersectNoEmptyCheck_a">a</a> and <a href="#SkIRect_intersectNoEmptyCheck_b">b</a> have area in common +true if <a href='#SkIRect_intersectNoEmptyCheck_a'>a</a> and <a href='#SkIRect_intersectNoEmptyCheck_b'>b</a> have area in common ### Example @@ -1821,44 +2238,47 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkIRect_Intersects">Intersects</a> <a href="#SkIRect_intersect">intersect</a><sup><a href="#SkIRect_intersect_2">[2]</a></sup><sup><a href="#SkIRect_intersect_3">[3]</a></sup> <a href="#SkIRect_join">join</a><sup><a href="#SkIRect_join_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_intersect">SkRect::intersect</a><sup><a href="SkRect_Reference#SkRect_intersect_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_intersect_3">[3]</a></sup> +<a href='#SkIRect_Intersects'>Intersects</a> <a href='#SkIRect_intersect'>intersect</a><sup><a href='#SkIRect_intersect_2'>[2]</a></sup><sup><a href='#SkIRect_intersect_3'>[3]</a></sup> <a href='#SkIRect_join'>join</a><sup><a href='#SkIRect_join_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_intersect'>SkRect::intersect</a><sup><a href='SkRect_Reference#SkRect_intersect_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_intersect_3'>[3]</a></sup> --- -<a name="SkIRect_intersect_3"></a> +<a name='SkIRect_intersect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkIRect_intersect'>intersect</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) </pre> -Constructs <a href="#IRect">IRect</a> to intersect from (left, top, right, bottom). Does not sort +Constructs <a href='#IRect'>IRect</a> to intersect from (left, top, right, bottom). Does not sort construction. -Returns true if <a href="#IRect">IRect</a> intersects construction, and sets <a href="#IRect">IRect</a> to intersection. -Returns false if <a href="#IRect">IRect</a> does not intersect construction, and leaves <a href="#IRect">IRect</a> unchanged. +Returns true if <a href='#IRect'>IRect</a> intersects construction, and sets <a href='#IRect'>IRect</a> to intersection. +Returns false if <a href='#IRect'>IRect</a> does not intersect construction, and leaves <a href='#IRect'>IRect</a> unchanged. -Returns false if either construction or <a href="#IRect">IRect</a> is empty, leaving <a href="#IRect">IRect</a> unchanged. +Returns false if either construction or <a href='#IRect'>IRect</a> is empty, leaving <a href='#IRect'>IRect</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkIRect_intersect_3_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_intersect_3_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_intersect_3_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_intersect_3_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_intersect_3_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_intersect_3_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_intersect_3_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_intersect_3_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#IRect'>IRect</a></td> </tr> </table> ### Return Value -true if construction and <a href="#IRect">IRect</a> have area in common +true if construction and <a href='#IRect'>IRect</a> have area in common ### Example -<div><fiddle-embed name="4e6f580a3906c08a5faee524f7e72334"><div>Two <a href="undocumented#SkDebugf">SkDebugf</a> calls are required. If the calls are combined, their arguments +<div><fiddle-embed name="200422990eded2f754ab9893118f2645"><div>Two <a href='undocumented#SkDebugf'>SkDebugf</a> calls are required. If the calls are combined, their arguments may not be evaluated in left to right order: the printed intersection may be before or after the call to intersect. </div> @@ -1873,32 +2293,33 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> <a href="#SkIRect_Intersects">Intersects</a> <a href="#SkIRect_join">join</a><sup><a href="#SkIRect_join_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_intersect">SkRect::intersect</a><sup><a href="SkRect_Reference#SkRect_intersect_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_intersect_3">[3]</a></sup> +<a href='#SkIRect_intersectNoEmptyCheck'>intersectNoEmptyCheck</a> <a href='#SkIRect_Intersects'>Intersects</a> <a href='#SkIRect_join'>join</a><sup><a href='#SkIRect_join_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_intersect'>SkRect::intersect</a><sup><a href='SkRect_Reference#SkRect_intersect_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_intersect_3'>[3]</a></sup> --- -<a name="SkIRect_Intersects"></a> +<a name='SkIRect_Intersects'></a> ## Intersects -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool Intersects(const SkIRect& a, const SkIRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkIRect_Intersects'>Intersects</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b) </pre> -Returns true if <a href="#SkIRect_Intersects_a">a</a> intersects <a href="#SkIRect_Intersects_b">b</a>. -Returns false if either <a href="#SkIRect_Intersects_a">a</a> or <a href="#SkIRect_Intersects_b">b</a> is empty, or do not intersect. +Returns true if <a href='#SkIRect_Intersects_a'>a</a> intersects <a href='#SkIRect_Intersects_b'>b</a>. +Returns false if either <a href='#SkIRect_Intersects_a'>a</a> or <a href='#SkIRect_Intersects_b'>b</a> is empty, or do not intersect. ### Parameters -<table> <tr> <td><a name="SkIRect_Intersects_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> - </tr> <tr> <td><a name="SkIRect_Intersects_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> +<table> <tr> <td><a name='SkIRect_Intersects_a'><code><strong>a</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> + </tr> + <tr> <td><a name='SkIRect_Intersects_b'><code><strong>b</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkIRect_Intersects_a">a</a> and <a href="#SkIRect_Intersects_b">b</a> have area in common +true if <a href='#SkIRect_Intersects_a'>a</a> and <a href='#SkIRect_Intersects_b'>b</a> have area in common ### Example @@ -1914,32 +2335,33 @@ intersection ### See Also -<a href="#SkIRect_IntersectsNoEmptyCheck">IntersectsNoEmptyCheck</a> <a href="#SkIRect_intersect">intersect</a><sup><a href="#SkIRect_intersect_2">[2]</a></sup><sup><a href="#SkIRect_intersect_3">[3]</a></sup> <a href="SkRect_Reference#SkRect_intersect">SkRect::intersect</a><sup><a href="SkRect_Reference#SkRect_intersect_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_intersect_3">[3]</a></sup> +<a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a> <a href='#SkIRect_intersect'>intersect</a><sup><a href='#SkIRect_intersect_2'>[2]</a></sup><sup><a href='#SkIRect_intersect_3'>[3]</a></sup> <a href='SkRect_Reference#SkRect_intersect'>SkRect::intersect</a><sup><a href='SkRect_Reference#SkRect_intersect_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_intersect_3'>[3]</a></sup> --- -<a name="SkIRect_IntersectsNoEmptyCheck"></a> +<a name='SkIRect_IntersectsNoEmptyCheck'></a> ## IntersectsNoEmptyCheck -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool IntersectsNoEmptyCheck(const SkIRect& a, const SkIRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkIRect_IntersectsNoEmptyCheck'>IntersectsNoEmptyCheck</a>(const <a href='#SkIRect'>SkIRect</a>& a, const <a href='#SkIRect'>SkIRect</a>& b) </pre> -Returns true if <a href="#SkIRect_IntersectsNoEmptyCheck_a">a</a> intersects <a href="#SkIRect_IntersectsNoEmptyCheck_b">b</a>. -Asserts if either <a href="#SkIRect_IntersectsNoEmptyCheck_a">a</a> or <a href="#SkIRect_IntersectsNoEmptyCheck_b">b</a> is empty, and if SK_DEBUG is defined. +Returns true if <a href='#SkIRect_IntersectsNoEmptyCheck_a'>a</a> intersects <a href='#SkIRect_IntersectsNoEmptyCheck_b'>b</a>. +Asserts if either <a href='#SkIRect_IntersectsNoEmptyCheck_a'>a</a> or <a href='#SkIRect_IntersectsNoEmptyCheck_b'>b</a> is empty, and if SK_DEBUG is defined. ### Parameters -<table> <tr> <td><a name="SkIRect_IntersectsNoEmptyCheck_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> - </tr> <tr> <td><a name="SkIRect_IntersectsNoEmptyCheck_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#IRect">IRect</a> to intersect</td> +<table> <tr> <td><a name='SkIRect_IntersectsNoEmptyCheck_a'><code><strong>a</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> + </tr> + <tr> <td><a name='SkIRect_IntersectsNoEmptyCheck_b'><code><strong>b</strong></code></a></td> + <td><a href='#IRect'>IRect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkIRect_IntersectsNoEmptyCheck_a">a</a> and <a href="#SkIRect_IntersectsNoEmptyCheck_b">b</a> have area in common +true if <a href='#SkIRect_IntersectsNoEmptyCheck_a'>a</a> and <a href='#SkIRect_IntersectsNoEmptyCheck_b'>b</a> have area in common ### Example @@ -1955,43 +2377,59 @@ intersection ### See Also -<a href="#SkIRect_Intersects">Intersects</a> <a href="#SkIRect_intersect">intersect</a><sup><a href="#SkIRect_intersect_2">[2]</a></sup><sup><a href="#SkIRect_intersect_3">[3]</a></sup> <a href="SkRect_Reference#SkRect_intersect">SkRect::intersect</a><sup><a href="SkRect_Reference#SkRect_intersect_2">[2]</a></sup><sup><a href="SkRect_Reference#SkRect_intersect_3">[3]</a></sup> +<a href='#SkIRect_Intersects'>Intersects</a> <a href='#SkIRect_intersect'>intersect</a><sup><a href='#SkIRect_intersect_2'>[2]</a></sup><sup><a href='#SkIRect_intersect_3'>[3]</a></sup> <a href='SkRect_Reference#SkRect_intersect'>SkRect::intersect</a><sup><a href='SkRect_Reference#SkRect_intersect_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_intersect_3'>[3]</a></sup> --- -## <a name="Join"></a> Join +## <a name='Join'>Join</a> + -| name | description | -| --- | --- | -| <a href="#SkIRect_join">join</a> | sets to union of bounds | -| | <a href="#SkIRect_join">join(int32 t left, int32 t top, int32 t right, int32 t bottom)</a> | -| | <a href="#SkIRect_join_2">join(const SkIRect& r)</a> | +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join'>join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join'>join(int32 t left, int32 t top, int32 t right, int32 t bottom)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_join_2'>join(const SkIRect& r)</a></td> + </tr> +</table> -<a name="SkIRect_join"></a> + +<a name='SkIRect_join'></a> ## join -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void join(int32_t left, int32_t top, int32_t right, int32_t bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_join'>join</a>(int32_t left, int32_t top, int32_t right, int32_t bottom) </pre> -Constructs <a href="#IRect">IRect</a> to intersect from (left, top, right, bottom). Does not sort +Constructs <a href='#IRect'>IRect</a> to intersect from (left, top, right, bottom). Does not sort construction. -Sets <a href="#IRect">IRect</a> to the union of itself and the construction. +Sets <a href='#IRect'>IRect</a> to the union of itself and the construction. -Has no effect if construction is empty. Otherwise, if <a href="#IRect">IRect</a> is empty, sets -<a href="#IRect">IRect</a> to construction. +Has no effect if construction is empty. Otherwise, if <a href='#IRect'>IRect</a> is empty, sets +<a href='#IRect'>IRect</a> to construction. ### Parameters -<table> <tr> <td><a name="SkIRect_join_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_join_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_join_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_join_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_join_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_join_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_join_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#IRect'>IRect</a></td> + </tr> + <tr> <td><a name='SkIRect_join_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#IRect'>IRect</a></td> </tr> </table> @@ -2009,24 +2447,24 @@ join: 10, 20, 55, 65 ### See Also -<a href="#SkIRect_set">set</a> <a href="SkRect_Reference#SkRect_join">SkRect::join</a><sup><a href="SkRect_Reference#SkRect_join_2">[2]</a></sup> +<a href='#SkIRect_set'>set</a> <a href='SkRect_Reference#SkRect_join'>SkRect::join</a><sup><a href='SkRect_Reference#SkRect_join_2'>[2]</a></sup> --- -<a name="SkIRect_join_2"></a> +<a name='SkIRect_join_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void join(const SkIRect& r) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_join'>join</a>(const <a href='#SkIRect'>SkIRect</a>& r) </pre> -Sets <a href="#IRect">IRect</a> to the union of itself and <a href="#SkIRect_join_2_r">r</a>. +Sets <a href='#IRect'>IRect</a> to the union of itself and <a href='#SkIRect_join_2_r'>r</a>. -Has no effect if <a href="#SkIRect_join_2_r">r</a> is empty. Otherwise, if <a href="#IRect">IRect</a> is empty, sets <a href="#IRect">IRect</a> to <a href="#SkIRect_join_2_r">r</a>. +Has no effect if <a href='#SkIRect_join_2_r'>r</a> is empty. Otherwise, if <a href='#IRect'>IRect</a> is empty, sets <a href='#IRect'>IRect</a> to <a href='#SkIRect_join_2_r'>r</a>. ### Parameters -<table> <tr> <td><a name="SkIRect_join_2_r"> <code><strong>r </strong></code> </a></td> <td> -expansion <a href="#IRect">IRect</a></td> +<table> <tr> <td><a name='SkIRect_join_2_r'><code><strong>r</strong></code></a></td> + <td>expansion <a href='#IRect'>IRect</a></td> </tr> </table> @@ -2044,26 +2482,33 @@ join: 10, 20, 55, 65 ### See Also -<a href="#SkIRect_set">set</a> <a href="SkRect_Reference#SkRect_join">SkRect::join</a><sup><a href="SkRect_Reference#SkRect_join_2">[2]</a></sup> +<a href='#SkIRect_set'>set</a> <a href='SkRect_Reference#SkRect_join'>SkRect::join</a><sup><a href='SkRect_Reference#SkRect_join_2'>[2]</a></sup> --- -## <a name="Sorting"></a> Sorting +## <a name='Sorting'>Sorting</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkIRect_sort'>sort</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides from smaller to larger</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkIRect_sort">sort</a> | orders sides from smaller to larger | -<a name="SkIRect_sort"></a> +<a name='SkIRect_sort'></a> ## sort -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void sort() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkIRect_sort'>sort</a>() </pre> -Swaps <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a> if <a href="#SkIRect_fLeft">fLeft</a> is greater than <a href="#SkIRect_fRight">fRight</a>; and swaps -<a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a> if <a href="#SkIRect_fTop">fTop</a> is greater than <a href="#SkIRect_fBottom">fBottom</a>. Result may be empty, -and <a href="#SkIRect_width">width</a> and <a href="#SkIRect_height">height</a> will be zero or positive. +Swaps <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> if <a href='#SkIRect_fLeft'>fLeft</a> is greater than <a href='#SkIRect_fRight'>fRight</a>; and swaps +<a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> if <a href='#SkIRect_fTop'>fTop</a> is greater than <a href='#SkIRect_fBottom'>fBottom</a>. Result may be empty, +and <a href='#SkIRect_width'>width</a> and <a href='#SkIRect_height'>height</a> will be zero or positive. ### Example @@ -2080,24 +2525,24 @@ sorted: 20, 10, 30, 50 ### See Also -<a href="#SkIRect_makeSorted">makeSorted</a> <a href="SkRect_Reference#SkRect_sort">SkRect::sort</a> +<a href='#SkIRect_makeSorted'>makeSorted</a> <a href='SkRect_Reference#SkRect_sort'>SkRect::sort</a> --- -<a name="SkIRect_makeSorted"></a> +<a name='SkIRect_makeSorted'></a> ## makeSorted -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect makeSorted() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkIRect'>SkIRect</a> <a href='#SkIRect_makeSorted'>makeSorted</a>() const </pre> -Returns <a href="#IRect">IRect</a> with <a href="#SkIRect_fLeft">fLeft</a> and <a href="#SkIRect_fRight">fRight</a> swapped if <a href="#SkIRect_fLeft">fLeft</a> is greater than <a href="#SkIRect_fRight">fRight</a>; and -with <a href="#SkIRect_fTop">fTop</a> and <a href="#SkIRect_fBottom">fBottom</a> swapped if <a href="#SkIRect_fTop">fTop</a> is greater than <a href="#SkIRect_fBottom">fBottom</a>. Result may be empty; -and <a href="#SkIRect_width">width</a> and <a href="#SkIRect_height">height</a> will be zero or positive. +Returns <a href='#IRect'>IRect</a> with <a href='#SkIRect_fLeft'>fLeft</a> and <a href='#SkIRect_fRight'>fRight</a> swapped if <a href='#SkIRect_fLeft'>fLeft</a> is greater than <a href='#SkIRect_fRight'>fRight</a>; and +with <a href='#SkIRect_fTop'>fTop</a> and <a href='#SkIRect_fBottom'>fBottom</a> swapped if <a href='#SkIRect_fTop'>fTop</a> is greater than <a href='#SkIRect_fBottom'>fBottom</a>. Result may be empty; +and <a href='#SkIRect_width'>width</a> and <a href='#SkIRect_height'>height</a> will be zero or positive. ### Return Value -sorted <a href="#IRect">IRect</a> +sorted <a href='#IRect'>IRect</a> ### Example @@ -2114,22 +2559,22 @@ sorted: 20, 10, 30, 50 ### See Also -<a href="#SkIRect_sort">sort</a> <a href="SkRect_Reference#SkRect_makeSorted">SkRect::makeSorted</a> +<a href='#SkIRect_sort'>sort</a> <a href='SkRect_Reference#SkRect_makeSorted'>SkRect::makeSorted</a> --- -<a name="SkIRect_EmptyIRect"></a> +<a name='SkIRect_EmptyIRect'></a> ## EmptyIRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static const SkIRect& SK_WARN_UNUSED_RESULT EmptyIRect() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static const <a href='#SkIRect'>SkIRect</a>& SK_WARN_UNUSED_RESULT <a href='#SkIRect_EmptyIRect'>EmptyIRect</a>() </pre> -Returns a reference to immutable empty <a href="#IRect">IRect</a>, set to (0, 0, 0, 0). +Returns a reference to immutable empty <a href='#IRect'>IRect</a>, set to (0, 0, 0, 0). ### Return Value -global <a href="#IRect">IRect</a> set to all zeroes +global <a href='#IRect'>IRect</a> set to all zeroes ### Example @@ -2145,16 +2590,18 @@ rect: 0, 0, 0, 0 ### See Also -<a href="#SkIRect_MakeEmpty">MakeEmpty</a> +<a href='#SkIRect_MakeEmpty'>MakeEmpty</a> --- -<a name="SkIRect_MakeLargest"></a> +<a name='SkIRect_MakeLargest'></a> ## MakeLargest -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkIRect SK_WARN_UNUSED_RESULT MakeLargest() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkIRect'>SkIRect</a> SK_WARN_UNUSED_RESULT <a href='#SkIRect_MakeLargest'>MakeLargest</a>() </pre> +Deprecated. + --- diff --git a/site/user/api/SkImageInfo_Reference.md b/site/user/api/SkImageInfo_Reference.md index 439f6d7155..eacaa9418a 100644 --- a/site/user/api/SkImageInfo_Reference.md +++ b/site/user/api/SkImageInfo_Reference.md @@ -1,194 +1,344 @@ SkImageInfo Reference === -# <a name="Image_Info"></a> Image Info -<a href="#Image_Info">Image Info</a> specifies the dimensions and encoding of the pixels in a <a href="SkBitmap_Reference#Bitmap">Bitmap</a>. +# <a name='Image_Info'>Image Info</a> +<a href='#Image_Info'>Image Info</a> specifies the dimensions and encoding of the pixels in a <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>. The dimensions are integral width and height. The encoding is how pixel -bits describe <a href="SkColor_Reference#Alpha">Color Alpha</a>, transparency; <a href="SkColor_Reference#Color">Color</a> components red, blue, -and green; and <a href="undocumented#Color_Space">Color Space</a>, the range and linearity of colors. - -<a href="#Image_Info">Image Info</a> describes an uncompressed raster pixels. In contrast, <a href="SkImage_Reference#Image">Image</a> -additionally describes compressed pixels like PNG, and <a href="SkSurface_Reference#Surface">Surface</a> describes -destinations on the GPU. <a href="SkImage_Reference#Image">Image</a> and <a href="SkSurface_Reference#Surface">Surface</a> may be specified by <a href="#Image_Info">Image Info</a>, -but <a href="SkImage_Reference#Image">Image</a> and <a href="SkSurface_Reference#Surface">Surface</a> may not contain <a href="#Image_Info">Image Info</a>. +bits describe <a href='SkColor_Reference#Alpha'>Color Alpha</a>, transparency; <a href='SkColor_Reference#Color'>Color</a> components red, blue, +and green; and <a href='undocumented#Color_Space'>Color Space</a>, the range and linearity of colors. + +<a href='#Image_Info'>Image Info</a> describes an uncompressed raster pixels. In contrast, <a href='SkImage_Reference#Image'>Image</a> +additionally describes compressed pixels like PNG, and <a href='SkSurface_Reference#Surface'>Surface</a> describes +destinations on the GPU. <a href='SkImage_Reference#Image'>Image</a> and <a href='SkSurface_Reference#Surface'>Surface</a> may be specified by <a href='#Image_Info'>Image Info</a>, +but <a href='SkImage_Reference#Image'>Image</a> and <a href='SkSurface_Reference#Surface'>Surface</a> may not contain <a href='#Image_Info'>Image Info</a>. + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkImageInfo'>SkImageInfo</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> -## <a name="Overview"></a> Overview -## <a name="Overview_Subtopic"></a> Overview Subtopic +## <a name='Constant'>Constant</a> -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkImageInfo">SkImageInfo</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -## <a name="Constant"></a> Constant +SkImageInfo related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlphaType'>SkAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel transparency</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorType'>SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkYUVColorSpace'>SkYUVColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>color range of YUV pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 4 bits for alpha, red, green, blue; in 16-bit word</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with <a href='SkColor_Reference#Alpha'>Alpha</a> in 8-bit byte</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 8 bits for blue, green, red, alpha; in 32-bit word</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with <a href='SkColor_Reference#Gray'>Color Gray</a> level in 8-bit byte</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>describes full range</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kLastEnum_SkAlphaType'>kLastEnum_SkAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kLastEnum_SkColorType'>kLastEnum_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kLastEnum_SkYUVColorSpace'>kLastEnum_SkYUVColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>last valid value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kN32_SkColorType'>kN32_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>native <a href='SkColor_Reference#ARGB'>Color ARGB</a> 32-bit encoding</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel is opaque</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel components are <a href='undocumented#Premultiply'>Premultiplied</a> by <a href='SkColor_Reference#Alpha'>Alpha</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>10 bits for red, green, blue; 2 bits for alpha; in 32-bit word</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 8 bits for red, green, blue, alpha; in 32-bit word</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with half floats for red, green, blue, alpha; in 64-bit word</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 10 bits each for red, green, blue; in 32-bit word</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel with 8 bits each for red, green, blue; in 32-bit word</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>describes SDTV range</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>describes HDTV range</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uninitialized</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uninitialized</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixel components are independent of <a href='SkColor_Reference#Alpha'>Alpha</a></td> + </tr> +</table> -| name | description | -| --- | --- | -## <a name="Alpha_Type"></a> Alpha Type +## <a name='Alpha_Type'>Alpha Type</a> -## <a name="SkAlphaType"></a> Enum SkAlphaType +## <a name='SkAlphaType'>Enum SkAlphaType</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkAlphaType">SkAlphaType</a> { - <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, - <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, - <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, - <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>, - kLastEnum_SkAlphaType = <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>, + enum <a href='#SkAlphaType'>SkAlphaType</a> { + <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, + <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, + <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, + <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>, + <a href='#kLastEnum_SkAlphaType'>kLastEnum_SkAlphaType</a> = <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>, }; </pre> Describes how to interpret the alpha component of a pixel. A pixel may -be opaque, or <a href="SkColor_Reference#Alpha">Color Alpha</a>, describing multiple levels of transparency. +be opaque, or <a href='SkColor_Reference#Alpha'>Color Alpha</a>, describing multiple levels of transparency. -In simple blending, <a href="SkColor_Reference#Alpha">Color Alpha</a> weights the draw color and the destination +In simple blending, <a href='SkColor_Reference#Alpha'>Color Alpha</a> weights the draw color and the destination color to create a new color. If alpha describes a weight from zero to one: -new color = draw color * alpha + destination color * (1 - alpha) +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> + new color = draw color * alpha + destination color * (1 - alpha) +</pre> + In practice alpha is encoded in two or more bits, where 1.0 equals all bits set. -<a href="SkColor_Reference#RGB">Color RGB</a> may have <a href="SkColor_Reference#Alpha">Color Alpha</a> included in each component value; the stored -value is the original <a href="SkColor_Reference#RGB">Color RGB</a> multiplied by <a href="SkColor_Reference#Alpha">Color Alpha</a>. <a href="undocumented#Premultiply">Premultiplied</a> color +<a href='SkColor_Reference#RGB'>Color RGB</a> may have <a href='SkColor_Reference#Alpha'>Color Alpha</a> included in each component value; the stored +value is the original <a href='SkColor_Reference#RGB'>Color RGB</a> multiplied by <a href='SkColor_Reference#Alpha'>Color Alpha</a>. <a href='undocumented#Premultiply'>Premultiplied</a> color components improve performance. ### Constants -<table> - <tr> - <td><a name="kUnknown_SkAlphaType"> <code><strong>kUnknown_SkAlphaType </strong></code> </a></td><td>0</td><td><a href="#Alpha_Type">Alpha Type</a> is uninitialized. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Details</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kUnknown_SkAlphaType'><code>kUnknown_SkAlphaType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#Alpha_Type'>Alpha Type</a> is uninitialized. </td> </tr> <tr> - <td><a name="kOpaque_SkAlphaType"> <code><strong>kOpaque_SkAlphaType </strong></code> </a></td><td>1</td><td>Pixels are opaque. The <a href="#Color_Type">Color Type</a> must have no explicit alpha + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kOpaque_SkAlphaType'><code>kOpaque_SkAlphaType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Opaque'>Alpha Type Opaque</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Pixels are opaque. The <a href='#Color_Type'>Color Type</a> must have no explicit alpha component, or all alpha components must be set to their maximum value. </td> </tr> - <tr> - <td><a name="kPremul_SkAlphaType"> <code><strong>kPremul_SkAlphaType </strong></code> </a></td><td>2</td><td>Pixels have alpha premultiplied into color components. -<a href="SkSurface_Reference#Surface">Surface</a> pixels must be premultiplied. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kPremul_SkAlphaType'><code>kPremul_SkAlphaType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Premul'>Alpha Type Premul</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Pixels have <a href='SkColor_Reference#Alpha'>Alpha</a> <a href='undocumented#Premultiply'>Premultiplied</a> into color components. +<a href='SkSurface_Reference#Surface'>Surface</a> pixels must be <a href='undocumented#Premultiply'>Premultiplied</a>. </td> </tr> <tr> - <td><a name="kUnpremul_SkAlphaType"> <code><strong>kUnpremul_SkAlphaType </strong></code> </a></td><td>3</td><td><a href="undocumented#Pixel">Pixel</a> color component values are independent of alpha value. -Images generated from encoded data like PNG do not premultiply pixel color -components. <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> is supported for <a href="SkImage_Reference#Image">Image</a> pixels, but not for -<a href="SkSurface_Reference#Surface">Surface</a> pixels. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kUnpremul_SkAlphaType'><code>kUnpremul_SkAlphaType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Unpremul'>Alpha Type Unpremul</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='undocumented#Pixel'>Pixel</a> color component values are independent of alpha value. +Images generated from encoded data like PNG do not <a href='undocumented#Premultiply'>Premultiply</a> pixel color +components. <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> is supported for <a href='SkImage_Reference#Image'>Image</a> pixels, but not for +<a href='SkSurface_Reference#Surface'>Surface</a> pixels. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kLastEnum_SkAlphaType'><code>kLastEnum_SkAlphaType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Used by tests to iterate through all valid values. </td> </tr> </table> ### See Also -<a href="#SkColorType">SkColorType</a> <a href="undocumented#SkColorSpace">SkColorSpace</a> - - +<a href='#SkColorType'>SkColorType</a> <a href='undocumented#SkColorSpace'>SkColorSpace</a> -## <a name="Alpha_Type_Opaque"></a> Alpha Type Opaque +## <a name='Alpha_Type_Opaque'>Alpha Type Opaque</a> -Use <a href="#Alpha_Type_Opaque">Opaque</a> as a hint to optimize drawing when alpha component +Use <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> as a hint to optimize drawing when <a href='SkColor_Reference#Alpha'>Alpha</a> component of all pixel is set to its maximum value of 1.0; all alpha component bits are set. -If <a href="#Image_Info">Image Info</a> is set to <a href="#Alpha_Type_Opaque">Opaque</a> but all alpha values are not 1.0, results are -undefined. +If <a href='#Image_Info'>Image Info</a> is set to <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> but all alpha values are not 1.0, +results are undefined. ### Example -<div><fiddle-embed name="79146a1a41d58d22582fdc567c6ffe4e"><div><a href="SkColor_Reference#SkPreMultiplyARGB">SkPreMultiplyARGB</a> parameter a is set to 255, its maximum value, and is interpreted -as <a href="SkColor_Reference#Alpha">Color Alpha</a> of 1.0. <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> may be set to improve performance. -If <a href="SkColor_Reference#SkPreMultiplyARGB">SkPreMultiplyARGB</a> parameter a is set to a value smaller than 255, -<a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> must be used instead to avoid undefined results. +<div><fiddle-embed name="79146a1a41d58d22582fdc567c6ffe4e"><div><a href='SkColor_Reference#SkPreMultiplyARGB'>SkPreMultiplyARGB</a> parameter a is set to 255, its maximum value, and is interpreted +as <a href='SkColor_Reference#Alpha'>Color Alpha</a> of 1.0. <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> may be set to improve performance. +If <a href='SkColor_Reference#SkPreMultiplyARGB'>SkPreMultiplyARGB</a> parameter a is set to a value smaller than 255, +<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a> must be used instead to avoid undefined results. The four displayed values are the original component values, though not necessarily in the same order. </div></fiddle-embed></div> -## <a name="Alpha_Type_Premul"></a> Alpha Type Premul +## <a name='Alpha_Type_Premul'>Alpha Type Premul</a> -Use <a href="#Alpha_Type_Premul">Premul</a> 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 <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a> 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. -stored color = original color * alpha / max alphaThe color component must be equal to or smaller than the alpha component, +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> +stored color = original color * alpha / max alpha +</pre> + +The color component must be equal to or smaller than the alpha component, or the results are undefined. ### Example -<div><fiddle-embed name="ad696b39c915803d566e96896ec3a36c"><div><a href="SkColor_Reference#SkPreMultiplyARGB">SkPreMultiplyARGB</a> parameter a is set to 150, less than its maximum value, and is -interpreted as <a href="SkColor_Reference#Alpha">Color Alpha</a> of about 0.6. <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> must be set, since -<a href="SkColor_Reference#SkPreMultiplyARGB">SkPreMultiplyARGB</a> parameter a is set to a value smaller than 255, +<div><fiddle-embed name="ad696b39c915803d566e96896ec3a36c"><div><a href='SkColor_Reference#SkPreMultiplyARGB'>SkPreMultiplyARGB</a> parameter a is set to 150, less than its maximum value, and is +interpreted as <a href='SkColor_Reference#Alpha'>Color Alpha</a> of about 0.6. <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a> must be set, since +<a href='SkColor_Reference#SkPreMultiplyARGB'>SkPreMultiplyARGB</a> 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. </div></fiddle-embed></div> -## <a name="Alpha_Type_Unpremul"></a> Alpha Type Unpremul +## <a name='Alpha_Type_Unpremul'>Alpha Type Unpremul</a> -Use <a href="#Alpha_Type_Unpremul">Unpremul</a> if stored color components are not divided by the alpha component. -Some drawing destinations may not support <a href="#Alpha_Type_Unpremul">Unpremul</a>. +Use <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> if stored color components are not divided by the +alpha component. Some drawing destinations may not support +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>. ### Example -<div><fiddle-embed name="b8216a9e5ff5bc61a0e46eba7d36307b"><div><a href="SkColor_Reference#SkColorSetARGB">SkColorSetARGB</a> parameter a is set to 150, less than its maximum value, and is -interpreted as <a href="SkColor_Reference#Alpha">Color Alpha</a> of about 0.6. color is not premultiplied; +<div><fiddle-embed name="b8216a9e5ff5bc61a0e46eba7d36307b"><div><a href='SkColor_Reference#SkColorSetARGB'>SkColorSetARGB</a> parameter a is set to 150, less than its maximum value, and is +interpreted as <a href='SkColor_Reference#Alpha'>Color Alpha</a> of about 0.6. color is not <a href='undocumented#Premultiply'>Premultiplied</a>; 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. </div></fiddle-embed></div> -<a name="SkAlphaTypeIsOpaque"></a> +<a name='SkAlphaTypeIsOpaque'></a> ## SkAlphaTypeIsOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static inline bool SkAlphaTypeIsOpaque(SkAlphaType at) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static inline bool <a href='#SkAlphaTypeIsOpaque'>SkAlphaTypeIsOpaque</a>(<a href='#SkAlphaType'>SkAlphaType</a> at) </pre> -Returns true if <a href="#Alpha_Type">Alpha Type</a> equals <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> is a -hint that the <a href="#Color_Type">Color Type</a> is opaque, or that all <a href="SkColor_Reference#Alpha">Color Alpha</a> values are set to -their 1.0 equivalent. If <a href="#Alpha_Type">Alpha Type</a> is <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, and <a href="#Color_Type">Color Type</a> is not -opaque, then the result of drawing any pixel with a <a href="SkColor_Reference#Alpha">Color Alpha</a> value less than +Returns true if <a href='#Alpha_Type'>Alpha Type</a> equals <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> is a +hint that the <a href='#Color_Type'>Color Type</a> is opaque, or that all <a href='SkColor_Reference#Alpha'>Color Alpha</a> values are set to +their 1.0 equivalent. If <a href='#Alpha_Type'>Alpha Type</a> is <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, and <a href='#Color_Type'>Color Type</a> is not +opaque, then the result of drawing any pixel with a <a href='SkColor_Reference#Alpha'>Color Alpha</a> value less than 1.0 is undefined. ### Parameters -<table> <tr> <td><a name="SkAlphaTypeIsOpaque_at"> <code><strong>at </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> +<table> <tr> <td><a name='SkAlphaTypeIsOpaque_at'><code><strong>at</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> </tr> </table> ### Return Value -true if <a href="#SkAlphaTypeIsOpaque_at">at</a> equals <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> +true if <a href='#SkAlphaTypeIsOpaque_at'>at</a> equals <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> --- -## <a name="Color_Type"></a> Color Type - -## <a name="Color_Type_Native"></a> Color Type Native +## <a name='Color_Type'>Color Type</a> -## <a name="SkColorType"></a> Enum SkColorType +## <a name='SkColorType'>Enum SkColorType</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkColorType">SkColorType</a> { - <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, - <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, - <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, - <a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, - <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, - <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, - <a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, - <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, - <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, - <a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, - <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>, - - kLastEnum_SkColorType = <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>, + enum <a href='#SkColorType'>SkColorType</a> { + <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, + <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, + <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, + <a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, + <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, + <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, + <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, + <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, + <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, + <a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, + <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>, + + <a href='#kLastEnum_SkColorType'>kLastEnum_SkColorType</a> = <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>, #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) - <a href="#kN32_SkColorType">kN32_SkColorType</a> = <a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, + <a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) - <a href="#kN32_SkColorType">kN32_SkColorType</a> = <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, + <a href='#kN32_SkColorType'>kN32_SkColorType</a> = <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, #else #error #endif @@ -196,286 +346,406 @@ true if <a href="#SkAlphaTypeIsOpaque_at">at</a> equals <a href="#kOpaque_SkAlph </pre> Describes how pixel bits encode color. A pixel may be an alpha mask, a -gray level, <a href="SkColor_Reference#RGB">Color RGB</a>, or <a href="SkColor_Reference#ARGB">Color ARGB</a>. +gray level, <a href='SkColor_Reference#RGB'>Color RGB</a>, or <a href='SkColor_Reference#ARGB'>Color ARGB</a>. -<a href="#kN32_SkColorType">kN32_SkColorType</a> selects the native 32-bit <a href="SkColor_Reference#ARGB">Color ARGB</a> format. On Little_Endian -processors, pixels containing 8-bit <a href="SkColor_Reference#ARGB">Color ARGB</a> components pack into 32-bit -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>. On Big_Endian processors, pixels pack into 32-bit -<a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>. +<a href='#kN32_SkColorType'>kN32_SkColorType</a> selects the native 32-bit <a href='SkColor_Reference#ARGB'>Color ARGB</a> format. On Little_Endian +processors, pixels containing 8-bit <a href='SkColor_Reference#ARGB'>Color ARGB</a> components pack into 32-bit +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>. On Big_Endian processors, pixels pack into 32-bit +<a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>. ### Constants -<table> - <tr> - <td><a name="kUnknown_SkColorType"> <code><strong>kUnknown_SkColorType </strong></code> </a></td><td>0</td><td><a href="#Color_Type">Color Type</a> is uninitialized; encoding format and size is unknown. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Details</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kUnknown_SkColorType'><code>kUnknown_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#Color_Type'>Color Type</a> is set to <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a> by default. If set, +encoding format and size is unknown. </td> </tr> <tr> - <td><a name="kAlpha_8_SkColorType"> <code><strong>kAlpha_8_SkColorType </strong></code> </a></td><td>1</td><td>Encodes <a href="SkColor_Reference#Alpha">Color Alpha</a> as <a href="#Color_Type_Alpha_8">Alpha 8</a> pixel in an 8-bit byte. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kAlpha_8_SkColorType'><code>kAlpha_8_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_Alpha_8'>Color Type Alpha 8</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Stores 8-bit byte pixel encoding that represents transparency. Value of zero +is completely transparent; a value of 255 is completely opaque. </td> </tr> - <tr> - <td><a name="kRGB_565_SkColorType"> <code><strong>kRGB_565_SkColorType </strong></code> </a></td><td>2</td><td>Encodes <a href="SkColor_Reference#RGB">Color RGB</a> as <a href="#Color_Type_BGR_565">BGR 565</a> pixel in a 16-bit word. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRGB_565_SkColorType'><code>kRGB_565_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_565'>Color Type RGB 565</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Stores 16-bit word pixel encoding that contains five bits of blue, +six bits of green, and five bits of red. </td> </tr> <tr> - <td><a name="kARGB_4444_SkColorType"> <code><strong>kARGB_4444_SkColorType </strong></code> </a></td><td>3</td><td>Encodes <a href="SkColor_Reference#ARGB">Color ARGB</a> as <a href="#Color_Type_ABGR_4444">ABGR 4444</a> pixel in a 16-bit word. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kARGB_4444_SkColorType'><code>kARGB_4444_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_ARGB_4444'>Color Type ARGB 4444</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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. </td> </tr> - <tr> - <td><a name="kRGBA_8888_SkColorType"> <code><strong>kRGBA_8888_SkColorType </strong></code> </a></td><td>4</td><td>Encodes <a href="SkColor_Reference#ARGB">Color ARGB</a> as <a href="#Color_Type_RGBA_8888">RGBA 8888</a> pixel in a 32-bit word. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRGBA_8888_SkColorType'><code>kRGBA_8888_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_8888'>Color Type RGBA 8888</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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. </td> </tr> <tr> - <td><a name="kRGB_888x_SkColorType"> <code><strong>kRGB_888x_SkColorType </strong></code> </a></td><td>5</td><td>Encodes <a href="SkColor_Reference#RGB">Color RGB</a> as <a href="#Color_Type_RGB_888x">RGB 888x</a> pixel in a 32-bit word. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRGB_888x_SkColorType'><code>kRGB_888x_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_888'>Color Type RGB 888</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Stores 32-bit word pixel encoding that contains eight bits of red, +eight bits of green, eight bits of blue, and eight unused bits. </td> </tr> - <tr> - <td><a name="kBGRA_8888_SkColorType"> <code><strong>kBGRA_8888_SkColorType </strong></code> </a></td><td>6</td><td>Encodes <a href="SkColor_Reference#ARGB">Color ARGB</a> as <a href="#Color_Type_BGRA_8888">BGRA 8888</a> pixel in a 32-bit word. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kBGRA_8888_SkColorType'><code>kBGRA_8888_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>6</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_BGRA_8888'>Color Type BGRA 8888</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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. </td> </tr> <tr> - <td><a name="kRGBA_1010102_SkColorType"> <code><strong>kRGBA_1010102_SkColorType </strong></code> </a></td><td>7</td><td>Encodes <a href="SkColor_Reference#ARGB">Color ARGB</a> as <a href="#Color_Type_RGBA_1010102">RGBA 1010102</a> pixel in a 32-bit word. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRGBA_1010102_SkColorType'><code>kRGBA_1010102_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>7</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_1010102'>Color Type RGBA 1010102</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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. </td> </tr> - <tr> - <td><a name="kRGB_101010x_SkColorType"> <code><strong>kRGB_101010x_SkColorType </strong></code> </a></td><td>8</td><td>Encodes <a href="SkColor_Reference#RGB">Color RGB</a> as <a href="#Color_Type_RGB_101010x">RGB 101010x</a> pixel in a 32-bit word. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRGB_101010x_SkColorType'><code>kRGB_101010x_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_101010'>Color Type RGB 101010</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Stores 32-bit word pixel encoding that contains ten bits of red, +ten bits of green, ten bits of blue, and two unused bits. </td> </tr> <tr> - <td><a name="kGray_8_SkColorType"> <code><strong>kGray_8_SkColorType </strong></code> </a></td><td>9</td><td>Encodes <a href="SkColor_Reference#Gray">Color Gray</a> as <a href="#Color_Type_Gray_8">Gray 8</a> in an 8-bit byte. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kGray_8_SkColorType'><code>kGray_8_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>9</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_Gray_8'>Color Type Gray 8</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Stores 8-bit byte pixel encoding that equivalent to equal values for red, +blue, and green, representing colors from black to white. </td> </tr> - <tr> - <td><a name="kRGBA_F16_SkColorType"> <code><strong>kRGBA_F16_SkColorType </strong></code> </a></td><td>10</td><td>Encodes <a href="SkColor_Reference#ARGB">Color ARGB</a> as <a href="#Color_Type_RGBA_F16">RGBA F16</a> in a 64-bit word. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRGBA_F16_SkColorType'><code>kRGBA_F16_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>10</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_F16'>Color Type RGBA F16</a> </td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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. </td> </tr> -</table> - -### Constants - -<table> <tr> - <td><a name="kN32_SkColorType"> <code><strong>kN32_SkColorType </strong></code> </a></td><td>4</td><td>Encodes <a href="SkColor_Reference#ARGB">Color ARGB</a> as either <a href="#Color_Type_RGBA_8888">RGBA 8888</a> or <a href="#Color_Type_BGRA_8888">BGRA 8888</a>, whichever -is native to the platform. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kLastEnum_SkColorType'><code>kLastEnum_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>10</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Used by tests to iterate through all valid values. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kN32_SkColorType'><code>kN32_SkColorType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4 or 6</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> as either <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> or +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, whichever is native to the platform. </td> </tr> </table> ### See Also -<a href="#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorSpace">SkColorSpace</a> - - +<a href='#SkAlphaType'>SkAlphaType</a> <a href='undocumented#SkColorSpace'>SkColorSpace</a> -## <a name="Color_Type_Alpha_8"></a> Color Type Alpha 8 +## <a name='Color_Type_Alpha_8'>Color Type Alpha 8</a> -<a href="#Color_Type_Alpha_8">Alpha 8</a> is an 8-bit byte pixel encoding that represents transparency. A value of zero is -completely transparent; a value of 255 is completely opaque. <a href="SkBitmap_Reference#Bitmap">Bitmap</a> with <a href="#Color_Type_Alpha_8">Alpha 8</a> -pixels does not visibly draw, because its pixels have no color information. -The paired <a href="#SkAlphaType">SkAlphaType</a> is ignored. +<a href='SkColor_Reference#Alpha'>Alpha</a> pixels encode transparency without color information. Value of zero is +completely transparent; a value of 255 is completely opaque. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> +pixels do not visibly draw, because its pixels have no color information. +When <a href='#SkColorType'>SkColorType</a> is set to <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, the paired <a href='#SkAlphaType'>SkAlphaType</a> is +ignored. ### Example -<div><fiddle-embed name="21ae21e4ce53d2018e042dd457997300"><div><a href="#Color_Type_Alpha_8">Alpha 8</a> pixels can modify another draw. orangePaint fills the bounds of bitmap, +<div><fiddle-embed name="21ae21e4ce53d2018e042dd457997300"><div><a href='SkColor_Reference#Alpha'>Alpha</a> pixels can modify another draw. orangePaint fills the bounds of bitmap, with its transparency set to alpha8 pixel value. </div></fiddle-embed></div> -## <a name="Color_Type_BGR_565"></a> Color Type BGR 565 +### See Also + +incomplete + +## <a name='Color_Type_RGB_565'>Color Type RGB 565</a> -<a href="#Color_Type_BGR_565">BGR 565</a> is a 16-bit word pixel encoding that contains five bits of blue, -six bits of green, and five bits of red. <a href="#Color_Type_BGR_565">BGR 565</a> is fully opaque as if its -<a href="SkColor_Reference#Alpha">Color Alpha</a> was set to one, and should always be paired with <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. +<a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> encodes <a href='SkColor_Reference#RGB'>Color RGB</a> to fit in a 16-bit word. <a href='SkColor_Reference#RGB_Red'>Red</a> and <a href='SkColor_Reference#RGB_Blue'>Blue</a> +components use five bits describing 32 levels. <a href='SkColor_Reference#RGB_Green'>Green</a> components, more sensitive +to the eye, use six bits describing 64 levels. <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> has no +bits for <a href='SkColor_Reference#Alpha'>Alpha</a>. +Pixels are fully opaque as if its <a href='SkColor_Reference#Alpha'>Color Alpha</a> was set to one, and should +always be paired with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. -![Color_Type_BGR_565](https://fiddle.skia.org/i/b674a54eb4188d5ce66c04cebdb61089_raster.png "") +![Color_Type_RGB_565](https://fiddle.skia.org/i/f5981f4d2337dc5b6ee2d1d0c2a05078_raster.png "") ### Example -<div><fiddle-embed name="54e4c690d64d73ba028c5b250c0d09f0"></fiddle-embed></div> +<div><fiddle-embed name="7e7c46bb4572e21e13529ff364eb0a9c"></fiddle-embed></div> -## <a name="Color_Type_ABGR_4444"></a> Color Type ABGR 4444 +### See Also -<a href="#Color_Type_ABGR_4444">ABGR 4444</a> 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. +incomplete + +## <a name='Color_Type_ARGB_4444'>Color Type ARGB 4444</a> -![Color_Type_ABGR_4444](https://fiddle.skia.org/i/0441bdba65a19aa72b75b7fa62d22121_raster.png "") +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a> encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> to fit in 16-bit word. Each +component: alpha, blue, green, and red; use four bits, describing 16 levels. +Note that <a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a> is misnamed; the acronym does not +describe the actual component order. -If paired with <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>: blue, green, and red components are -premultiplied by the alpha value. If blue, green, or red is greater than alpha, +![Color_Type_ARGB_4444](https://fiddle.skia.org/i/0441bdba65a19aa72b75b7fa62d22121_raster.png "") + +If paired with <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>: blue, green, and red components are +<a href='undocumented#Premultiply'>Premultiplied</a> by the alpha value. If blue, green, or red is greater than alpha, the drawn result is undefined. -If paired with <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>: alpha, blue, green, and red components -may have any value. There may be a performance penalty with unpremultipled +If paired with <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>: alpha, blue, green, and red components +may have any value. There may be a performance penalty with Unpremultipled pixels. -If paired with <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>: all alpha component values are at the maximum; +If paired with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>: 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. ### Example -<div><fiddle-embed name="f89e8200d225ccb839e50a1481db48e9"></fiddle-embed></div> +<div><fiddle-embed name="33a360c3404ac21db801943336843d8e"></fiddle-embed></div> -## <a name="Color_Type_RGBA_8888"></a> Color Type RGBA 8888 +### See Also -<a href="#Color_Type_RGBA_8888">RGBA 8888</a> 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. +incomplete + +## <a name='Color_Type_RGBA_8888'>Color Type RGBA 8888</a> + +<a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> into a 32-bit word. Each component: +red, green, blue, alpha; use eight bits, describing 256 levels. ![Color_Type_RGBA_8888](https://fiddle.skia.org/i/4ccd35f27fe73dce8cce8c75e18df23c_raster.png "") -If paired with <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>: red, green, and blue components are -premultiplied by the alpha value. If red, green, or blue is greater than alpha, +If paired with <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>: red, green, and blue components are +<a href='undocumented#Premultiply'>Premultiplied</a> by the alpha value. If red, green, or blue is greater than alpha, the drawn result is undefined. -If paired with <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>: alpha, red, green, and blue components -may have any value. There may be a performance penalty with unpremultipled +If paired with <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>: alpha, red, green, and blue components +may have any value. There may be a performance penalty with Unpremultipled pixels. -If paired with <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>: all alpha component values are at the maximum; +If paired with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>: 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, <a href="#Color_Type_RGBA_8888">RGBA 8888</a> is the native <a href="#Color_Type">Color Type</a>, and will have -the best performance. Use <a href="#kN32_SkColorType">kN32_SkColorType</a> to choose the best <a href="#Color_Type">Color Type</a> for -the platform at compile time. +On Big_Endian platforms, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> is the native <a href='#Color_Type'>Color Type</a>, and +will have the best performance. Use <a href='#kN32_SkColorType'>kN32_SkColorType</a> to choose the best +<a href='#Color_Type'>Color Type</a> for the platform at compile time. ### Example -<div><fiddle-embed name="f3b9effa700b1b95ce10caf422b020cd"></fiddle-embed></div> +<div><fiddle-embed name="947922a19d59893fe7f9d9ee1954379b"></fiddle-embed></div> -## <a name="Color_Type_RGB_888x"></a> Color Type RGB 888x +### See Also + +incomplete + +## <a name='Color_Type_RGB_888'>Color Type RGB 888</a> -<a href="#Color_Type_RGB_888x">RGB 888x</a> 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. <a href="#Color_Type_RGB_888x">RGB 888x</a> is fully -opaque as if its <a href="SkColor_Reference#Alpha">Color Alpha</a> was set to one, and should always be paired with -<a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. +<a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a> encodes <a href='SkColor_Reference#RGB'>Color RGB</a> into a 32-bit word. Each component: +red, green, blue; use eight bits, describing 256 levels. Eight bits are +unused. Pixels described by <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a> are fully opaque as if +their <a href='SkColor_Reference#Alpha'>Color Alpha</a> was set to one, and should always be paired with +<a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. -![Color_Type_RGB_888x](https://fiddle.skia.org/i/fecfe58c25cfc1b1e411e5eb50f7d8d1_raster.png "") +![Color_Type_RGB_888](https://fiddle.skia.org/i/fecfe58c25cfc1b1e411e5eb50f7d8d1_raster.png "") ### Example -<div><fiddle-embed name="1e236c4c9ce0597c22186589fee9dc1e"></fiddle-embed></div> +<div><fiddle-embed name="4260d6cc15db2c60c07f6fdc8d9ae425"></fiddle-embed></div> -## <a name="Color_Type_BGRA_8888"></a> Color Type BGRA 8888 +## <a name='Color_Type_BGRA_8888'>Color Type BGRA 8888</a> -<a href="#Color_Type_BGRA_8888">BGRA 8888</a> 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. +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a> encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> into a 32-bit word. Each component: +blue, green, red, and alpha; use eight bits, describing 256 levels. ![Color_Type_BGRA_8888](https://fiddle.skia.org/i/babd0e12db21a88c74d4e88aa40268ab_raster.png "") -If paired with <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>: blue, green, and red components are -premultiplied by the alpha value. If blue, green, or red is greater than alpha, +If paired with <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>: blue, green, and red components are +<a href='undocumented#Premultiply'>Premultiplied</a> by the alpha value. If blue, green, or red is greater than alpha, the drawn result is undefined. -If paired with <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>: blue, green, red, and alpha components -may have any value. There may be a performance penalty with unpremultipled +If paired with <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>: blue, green, red, and alpha components +may have any value. There may be a performance penalty with <a href='undocumented#Unpremultiply'>Unpremultiplied</a> pixels. -If paired with <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>: all alpha component values are at the maximum; +If paired with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>: 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, <a href="#Color_Type_BGRA_8888">BGRA 8888</a> is the native <a href="#Color_Type">Color Type</a>, and will have -the best performance. Use <a href="#kN32_SkColorType">kN32_SkColorType</a> to choose the best <a href="#Color_Type">Color Type</a> for -the platform at compile time. +On Little_Endian platforms, <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a> is the native <a href='#Color_Type'>Color Type</a>, +and will have the best performance. Use <a href='#kN32_SkColorType'>kN32_SkColorType</a> to choose the best +<a href='#Color_Type'>Color Type</a> for the platform at compile time. ### Example -<div><fiddle-embed name="fcadba68a4fe7253b1726487e12b1eeb"></fiddle-embed></div> +<div><fiddle-embed name="945ce5344fce5470f8604b2e06e9f9ae"></fiddle-embed></div> + +### See Also -## <a name="Color_Type_RGBA_1010102"></a> Color Type RGBA 1010102 +<a href='#Color_Type_RGBA_8888'>RGBA 8888</a> -<a href="#Color_Type_RGBA_1010102">RGBA 1010102</a> 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 +## <a name='Color_Type_RGBA_1010102'>Color Type RGBA 1010102</a> + +<a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a> encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> into a 32-bit word. Each +<a href='SkColor_Reference#Color'>Color</a> 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, <a href='SkColor_Reference#Color'>Color</a> in <a href='SkPaint_Reference#Paint'>Paint</a> does not provide enough precision to +draw all colors possible to a <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>. + ![Color_Type_RGBA_1010102](https://fiddle.skia.org/i/6c470410001ad8f1ee9f58204c66f1bb_raster.png "") -If paired with <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>: red, green, and blue components are -premultiplied by the alpha value. If red, green, or blue is greater than the +If paired with <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>: red, green, and blue components are +<a href='undocumented#Premultiply'>Premultiplied</a> 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 <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>: alpha, red, green, and blue components -may have any value. There may be a performance penalty with unpremultipled +If paired with <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>: alpha, red, green, and blue components +may have any value. There may be a performance penalty with <a href='undocumented#Unpremultiply'>Unpremultiplied</a> pixels. -If paired with <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>: all alpha component values are at the maximum; +If paired with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>: 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. +less than three, the drawn result is undefined. ### Example -<div><fiddle-embed name="1bf1a6f087b4f2f93962960902061a7a"></fiddle-embed></div> +<div><fiddle-embed name="1282dc1127ce1b0061544619ae4de0f0"></fiddle-embed></div> + +### See Also + +incomplete -## <a name="Color_Type_RGB_101010x"></a> Color Type RGB 101010x +## <a name='Color_Type_RGB_101010'>Color Type RGB 101010</a> -<a href="#Color_Type_RGB_101010x">RGB 101010x</a> 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. <a href="#Color_Type_RGB_101010x">RGB 101010x</a> is fully -opaque as if its <a href="SkColor_Reference#Alpha">Color Alpha</a> was set to one, and should always be paired with -<a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. +<a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a> encodes <a href='SkColor_Reference#RGB'>Color RGB</a> into a 32-bit word. Each +<a href='SkColor_Reference#Color'>Color</a> component: red, green, and blue; use ten bits, describing 1024 levels. +Two bits are unused. Pixels described by <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a> are fully +opaque as if its <a href='SkColor_Reference#Alpha'>Color Alpha</a> was set to one, and should always be paired +with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. -![Color_Type_RGB_101010x](https://fiddle.skia.org/i/c22477b11dabaa3e3a0b5bb33a7733cd_raster.png "") +At present, <a href='SkColor_Reference#Color'>Color</a> in <a href='SkPaint_Reference#Paint'>Paint</a> does not provide enough precision to +draw all colors possible to a <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>. + +![Color_Type_RGB_101010](https://fiddle.skia.org/i/c22477b11dabaa3e3a0b5bb33a7733cd_raster.png "") ### Example -<div><fiddle-embed name="d975ec17354b1297841e4a31d3f6a5d5"></fiddle-embed></div> +<div><fiddle-embed name="92f81aa0459230459600a01e79ccff29"></fiddle-embed></div> + +### See Also + +incomplete -## <a name="Color_Type_Gray_8"></a> Color Type Gray 8 +## <a name='Color_Type_Gray_8'>Color Type Gray 8</a> -<a href="#Color_Type_Gray_8">Gray 8</a> is an 8-bit byte pixel encoding that represents equal values for red, -blue, and green, reprsenting colors from black to white. <a href="#Color_Type_Gray_8">Gray 8</a> is fully -opaque as if its <a href="SkColor_Reference#Alpha">Color Alpha</a> was set to one, and should always be paired with -<a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a> encodes <a href='SkColor_Reference#Gray'>Color Gray</a> level in eight bits that is equivalent +to equal values for red, blue, and green, representing colors from black to +white. Pixels described by <a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a> are fully +opaque as if its <a href='SkColor_Reference#Alpha'>Color Alpha</a> was set to one, and should always be paired with +<a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. ### Example <div><fiddle-embed name="93da0eb0b6722a4f33dc7dae094abf0b"></fiddle-embed></div> -## <a name="Color_Type_RGBA_F16"></a> Color Type RGBA F16 +### See Also + +incomplete -<a href="#Color_Type_RGBA_F16">RGBA F16</a> 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. +## <a name='Color_Type_RGBA_F16'>Color Type RGBA F16</a> -Each component encodes a floating point value using <a href="https://www.khronos.org/opengl/wiki/Small_Float_Formats">Half floats</a> . +<a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> 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. + +At present, <a href='SkColor_Reference#Color'>Color</a> in <a href='SkPaint_Reference#Paint'>Paint</a> does not provide enough precision or range to +draw all colors possible to a <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>. + +Each component encodes a floating point value using <a href='https://www.khronos.org/opengl/wiki/Small_Float_Formats'>Half floats</a></a> . 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 <a href="undocumented#Transfer_Mode">Transfer Mode</a>. +and larger values may be useful when used in combination with <a href='undocumented#Transfer_Mode'>Transfer Mode</a>. ![Color_Type_RGBA_F16](https://fiddle.skia.org/i/9344796c059ff5e4f057595e781905b3_raster.png "") -If paired with <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>: blue, green, and red components are -premultiplied by the alpha value. If blue, green, or red is greater than alpha, +If paired with <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>: blue, green, and red components are +<a href='undocumented#Premultiply'>Premultiplied</a> by the alpha value. If blue, green, or red is greater than alpha, the drawn result is undefined. -If paired with <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>: blue, green, red, and alpha components -may have any value. There may be a performance penalty with unpremultipled +If paired with <a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>: blue, green, red, and alpha components +may have any value. There may be a performance penalty with <a href='undocumented#Unpremultiply'>Unpremultiplied</a> pixels. -If paired with <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>: all alpha component values are at the maximum; +If paired with <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>: 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. ### Example -<div><fiddle-embed name="1795410dffea303b08ba98ee78dc1556"></fiddle-embed></div> +<div><fiddle-embed name="788ac33198103a14a5076dc3e03f2f4b"></fiddle-embed></div> + +### See Also + +incomplete -<a name="SkColorTypeBytesPerPixel"></a> +<a name='SkColorTypeBytesPerPixel'></a> ## SkColorTypeBytesPerPixel -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int SkColorTypeBytesPerPixel(SkColorType ct) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkColorTypeBytesPerPixel'>SkColorTypeBytesPerPixel</a>(<a href='#SkColorType'>SkColorType</a> ct) </pre> Returns the number of bytes required to store a pixel, including unused padding. -Returns zero if <a href="#SkColorTypeBytesPerPixel_ct">ct</a> is <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a> or invalid. +Returns zero if <a href='#SkColorTypeBytesPerPixel_ct'>ct</a> is <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a> or invalid. ### Parameters -<table> <tr> <td><a name="SkColorTypeBytesPerPixel_ct"> <code><strong>ct </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> +<table> <tr> <td><a name='SkColorTypeBytesPerPixel_ct'><code><strong>ct</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> </tr> </table> @@ -485,122 +755,124 @@ bytes per pixel ### Example -<div><fiddle-embed name="09ef49d07cb7005ba3e34d5ea53896f5"><a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </fiddle-embed></div> +<div><fiddle-embed name="09ef49d07cb7005ba3e34d5ea53896f5"><a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </fiddle-embed></div> ### See Also -<a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> +<a href='#SkImageInfo_bytesPerPixel'>SkImageInfo::bytesPerPixel</a> --- -<a name="SkColorTypeIsAlwaysOpaque"></a> +<a name='SkColorTypeIsAlwaysOpaque'></a> ## SkColorTypeIsAlwaysOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SkColorTypeIsAlwaysOpaque(SkColorType ct) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a>(<a href='#SkColorType'>SkColorType</a> ct) </pre> -Returns true if <a href="#Color_Type">Color Type</a> always decodes <a href="SkColor_Reference#Alpha">Color Alpha</a> to 1.0, making the pixel -fully opaque. If true, <a href="#Color_Type">Color Type</a> does not reserve bits to encode <a href="SkColor_Reference#Alpha">Color Alpha</a>. +Returns true if <a href='#Color_Type'>Color Type</a> always decodes <a href='SkColor_Reference#Alpha'>Color Alpha</a> to 1.0, making the pixel +fully opaque. If true, <a href='#Color_Type'>Color Type</a> does not reserve bits to encode <a href='SkColor_Reference#Alpha'>Color Alpha</a>. ### Parameters -<table> <tr> <td><a name="SkColorTypeIsAlwaysOpaque_ct"> <code><strong>ct </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> +<table> <tr> <td><a name='SkColorTypeIsAlwaysOpaque_ct'><code><strong>ct</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> </tr> </table> ### Return Value -true if <a href="SkColor_Reference#Alpha">Color Alpha</a> is always set to 1.0 +true if <a href='SkColor_Reference#Alpha'>Color Alpha</a> is always set to 1.0 ### Example -<div><fiddle-embed name="9b3eb5aaa0dfea9feee54e7650fa5446"><a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </fiddle-embed></div> +<div><fiddle-embed name="9b3eb5aaa0dfea9feee54e7650fa5446"><a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </fiddle-embed></div> ### See Also -<a href="#SkColorTypeValidateAlphaType">SkColorTypeValidateAlphaType</a> +<a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a> --- -<a name="SkColorTypeValidateAlphaType"></a> +<a name='SkColorTypeValidateAlphaType'></a> ## SkColorTypeValidateAlphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, - SkAlphaType* canonical = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a>(<a href='#SkColorType'>SkColorType</a> <a href='#SkImageInfo_colorType'>colorType</a>, <a href='#SkAlphaType'>SkAlphaType</a> <a href='#SkImageInfo_alphaType'>alphaType</a>, + <a href='#SkAlphaType'>SkAlphaType</a>* canonical = nullptr) </pre> -Returns true if <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> can be set to a valid <a href="#Alpha_Type">Alpha Type</a> for <a href="#SkColorTypeValidateAlphaType_colorType">colorType</a>. If -there is more than one valid <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> <a href="#Alpha_Type">Alpha Type</a>, set to <a href="#SkColorTypeValidateAlphaType_alphaType">alphaType</a>, if valid. -If true is returned and <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> is not nullptr, store valid <a href="#Alpha_Type">Alpha Type</a>. +Returns true if <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> can be set to a valid <a href='#Alpha_Type'>Alpha Type</a> for <a href='#SkImageInfo_colorType'>colorType</a>. If +there is more than one valid <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> <a href='#Alpha_Type'>Alpha Type</a>, set to <a href='#SkImageInfo_alphaType'>alphaType</a>, if valid. +If true is returned and <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> is not nullptr, store valid <a href='#Alpha_Type'>Alpha Type</a>. -Returns false only if <a href="#SkColorTypeValidateAlphaType_alphaType">alphaType</a> is <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, color type is not -<a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, and <a href="#Color_Type">Color Type</a> is not always opaque. If false is returned, -<a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> is ignored. +Returns false only if <a href='#SkImageInfo_alphaType'>alphaType</a> is <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, color type is not +<a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, and <a href='#Color_Type'>Color Type</a> is not always opaque. If false is returned, +<a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> is ignored. -For <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>: set <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> to <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> and return true. -For <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>: set <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> to <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> or -<a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> and return true if <a href="#SkColorTypeValidateAlphaType_alphaType">alphaType</a> is not <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. -For <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, and -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>: set <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> to <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> and return true. -For <a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, -<a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, and <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>: set <a href="#SkColorTypeValidateAlphaType_canonical">canonical</a> to <a href="#SkColorTypeValidateAlphaType_alphaType">alphaType</a> -and return true if <a href="#SkColorTypeValidateAlphaType_alphaType">alphaType</a> is not <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. +For <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>: set <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> to <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a> and return true. +For <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>: set <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> to <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a> or +<a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> and return true if <a href='#SkImageInfo_alphaType'>alphaType</a> is not <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. +For <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, and +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>: set <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> to <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> and return true. +For <a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, +<a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, and <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>: set <a href='#SkColorTypeValidateAlphaType_canonical'>canonical</a> to <a href='#SkImageInfo_alphaType'>alphaType</a> +and return true if <a href='#SkImageInfo_alphaType'>alphaType</a> is not <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. ### Parameters -<table> <tr> <td><a name="SkColorTypeValidateAlphaType_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkColorTypeValidateAlphaType_alphaType"> <code><strong>alphaType </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkColorTypeValidateAlphaType_canonical"> <code><strong>canonical </strong></code> </a></td> <td> -storage for <a href="#Alpha_Type">Alpha Type</a></td> +<table> <tr> <td><a name='SkColorTypeValidateAlphaType_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkColorTypeValidateAlphaType_alphaType'><code><strong>alphaType</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkColorTypeValidateAlphaType_canonical'><code><strong>canonical</strong></code></a></td> + <td>storage for <a href='#Alpha_Type'>Alpha Type</a></td> </tr> </table> ### Return Value -true if valid <a href="#Alpha_Type">Alpha Type</a> can be associated with <a href="#SkColorTypeValidateAlphaType_colorType">colorType</a> +true if valid <a href='#Alpha_Type'>Alpha Type</a> can be associated with <a href='#SkImageInfo_colorType'>colorType</a> ### Example -<div><fiddle-embed name="befac1c29ed21507d367e4d824383a04"><a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </fiddle-embed></div> +<div><fiddle-embed name="befac1c29ed21507d367e4d824383a04"><a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </fiddle-embed></div> ### See Also -<a href="#SkColorTypeIsAlwaysOpaque">SkColorTypeIsAlwaysOpaque</a> +<a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a> --- -## <a name="YUV_ColorSpace"></a> YUV ColorSpace +## <a name='YUV_ColorSpace'>YUV ColorSpace</a> -## <a name="SkYUVColorSpace"></a> Enum SkYUVColorSpace +## <a name='SkYUVColorSpace'>Enum SkYUVColorSpace</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkYUVColorSpace">SkYUVColorSpace</a> { - <a href="#kJPEG_SkYUVColorSpace">kJPEG_SkYUVColorSpace</a>, - <a href="#kRec601_SkYUVColorSpace">kRec601_SkYUVColorSpace</a>, - <a href="#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a>, - kLastEnum_SkYUVColorSpace = <a href="#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a>, + enum <a href='#SkYUVColorSpace'>SkYUVColorSpace</a> { + <a href='#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a>, + <a href='#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a>, + <a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>, + <a href='#kLastEnum_SkYUVColorSpace'>kLastEnum_SkYUVColorSpace</a> = <a href='#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a>, }; </pre> @@ -611,180 +883,449 @@ 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 <a href="https://en.wikipedia.org/wiki/YCbCr">YCbCr color space</a> . +encoding and conversion to RGB are described in <a href='https://en.wikipedia.org/wiki/YCbCr'>YCbCr color space</a></a> . ### Constants -<table> - <tr> - <td><a name="kJPEG_SkYUVColorSpace"> <code><strong>kJPEG_SkYUVColorSpace </strong></code> </a></td><td>0</td><td>Describes standard JPEG color space; -<a href="https://en.wikipedia.org/wiki/Rec._601">CCIR 601</table> - -</a> with full range of 0 to 255 for components. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kJPEG_SkYUVColorSpace'><code>kJPEG_SkYUVColorSpace</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Describes standard JPEG color space; +<a href='https://en.wikipedia.org/wiki/Rec._601'>CCIR 601</a></a> with full range of 0 to 255 for components. </td> </tr> <tr> - <td><a name="kRec601_SkYUVColorSpace"> <code><strong>kRec601_SkYUVColorSpace </strong></code> </a></td><td>1</td><td>Describes standard used by SDTV; -<a href="https://en.wikipedia.org/wiki/Rec._601">CCIR 601</table> - -</a> with studio range of 16 to 235 range for components. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRec601_SkYUVColorSpace'><code>kRec601_SkYUVColorSpace</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Describes standard used by standard definition television; +<a href='https://en.wikipedia.org/wiki/Rec._601'>CCIR 601</a></a> with studio range of 16 to 235 range for components. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kRec709_SkYUVColorSpace'><code>kRec709_SkYUVColorSpace</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Describes standard used by high definition television; +<a href='https://en.wikipedia.org/wiki/Rec._709'>Rec. 709</a></a> with studio range of 16 to 235 range for components. </td> </tr> <tr> - <td><a name="kRec709_SkYUVColorSpace"> <code><strong>kRec709_SkYUVColorSpace </strong></code> </a></td><td>2</td><td>Describes standard used by HDTV; -<a href="http://en.wikipedia.org/wiki/Rec._709">Rec. 709</table> - -</a> with studio range of 16 to 235 range for components. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kLastEnum_SkYUVColorSpace'><code>kLastEnum_SkYUVColorSpace</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Used by tests to iterate through all valid values. </td> </tr> </table> ### See Also -<a href="SkImage_Reference#SkImage_MakeFromYUVTexturesCopy">SkImage::MakeFromYUVTexturesCopy</a> <a href="SkImage_Reference#SkImage_MakeFromNV12TexturesCopy">SkImage::MakeFromNV12TexturesCopy</a> - - - -# <a name="SkImageInfo"></a> Struct SkImageInfo -Describes pixel dimensions and encoding. <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, <a href="SkImage_Reference#Image">Image</a>, PixMap, and <a href="SkSurface_Reference#Surface">Surface</a> -can be created from <a href="#Image_Info">Image Info</a>. <a href="#Image_Info">Image Info</a> can be retrieved from <a href="SkBitmap_Reference#Bitmap">Bitmap</a> and -<a href="SkPixmap_Reference#Pixmap">Pixmap</a>, but not from <a href="SkImage_Reference#Image">Image</a> and <a href="SkSurface_Reference#Surface">Surface</a>. For example, <a href="SkImage_Reference#Image">Image</a> and <a href="SkSurface_Reference#Surface">Surface</a> -implementations may defer pixel depth, so may not completely specify <a href="#Image_Info">Image Info</a>. - -<a href="#Image_Info">Image Info</a> contains dimensions, the pixel integral width and height. It encodes -how pixel bits describe <a href="SkColor_Reference#Alpha">Color Alpha</a>, transparency; <a href="SkColor_Reference#Color">Color</a> components red, blue, -and green; and <a href="undocumented#Color_Space">Color Space</a>, the range and linearity of colors. - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkImageInfo_ByteSizeOverflowed">ByteSizeOverflowed</a> | checks result of <a href="#SkImageInfo_computeByteSize">computeByteSize</a> and <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> | -| <a href="#SkImageInfo_Make">Make</a> | creates <a href="#Image_Info">Image Info</a> from dimensions, <a href="#Color_Type">Color Type</a>, <a href="#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_MakeA8">MakeA8</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> | -| <a href="#SkImageInfo_MakeN32">MakeN32</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#Color_Type_Native">Native Color Type</a> | -| <a href="#SkImageInfo_MakeN32Premul">MakeN32Premul</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#Color_Type_Native">Native Color Type</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> | -| <a href="#SkImageInfo_MakeS32">MakeS32</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#Color_Type_Native">Native Color Type</a>, sRGB <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_MakeUnknown">MakeUnknown</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> | -| <a href="#SkImageInfo_alphaType">alphaType</a> | Returns <a href="#Alpha_Type">Alpha Type</a> | -| <a href="#SkImageInfo_bounds">bounds</a> | returns <a href="#SkImageInfo_width">width</a> and <a href="#SkImageInfo_height">height</a> as Rectangle | -| <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> | returns number of bytes in pixel based on <a href="#Color_Type">Color Type</a> | -| <a href="#SkImageInfo_colorSpace">colorSpace</a> | returns <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_colorType">colorType</a> | returns <a href="#Color_Type">Color Type</a> | -| <a href="#SkImageInfo_computeByteSize">computeByteSize</a> | memory required by pixel buffer with given row bytes | -| <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> | least memory required by pixel buffer | -| <a href="#SkImageInfo_computeOffset">computeOffset</a> | returns byte offset within pixel array | -| <a href="#SkImageInfo_dimensions">dimensions</a> | returns <a href="#SkImageInfo_width">width</a> and <a href="#SkImageInfo_height">height</a> | -| <a href="#SkImageInfo_gammaCloseToSRGB">gammaCloseToSRGB</a> | Returns if <a href="undocumented#Color_Space">Color Space</a> gamma is approximately the same as sRGB | -| <a href="#SkImageInfo_height">height</a> | returns pixel row count | -| <a href="#SkImageInfo_isEmpty">isEmpty</a> | returns if dimensions contain pixels | -| <a href="#SkImageInfo_isOpaque">isOpaque</a> | returns if <a href="#Alpha_Type">Alpha Type</a> is <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> | -| <a href="#SkImageInfo_makeAlphaType">makeAlphaType</a> | creates <a href="#Image_Info">Image Info</a> with changed <a href="#Alpha_Type">Alpha Type</a> | -| <a href="#SkImageInfo_makeColorSpace">makeColorSpace</a> | creates <a href="#Image_Info">Image Info</a> with changed <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_makeColorType">makeColorType</a> | creates <a href="#Image_Info">Image Info</a> with changed <a href="#Color_Type">Color Type</a> | -| <a href="#SkImageInfo_makeWH">makeWH</a> | creates <a href="#Image_Info">Image Info</a> with changed dimensions | -| <a href="#SkImageInfo_minRowBytes">minRowBytes</a> | returns <a href="#SkImageInfo_width">width</a> times <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> in 32 bits | -| <a href="#SkImageInfo_minRowBytes64">minRowBytes64</a> | returns <a href="#SkImageInfo_width">width</a> times <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> in 64 bits | -| <a href="#SkImageInfo_refColorSpace">refColorSpace</a> | returns <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_reset">reset</a> | sets zero dimensions, <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> | -| <a href="#SkImageInfo_shiftPerPixel">shiftPerPixel</a> | returns bit shift from pixels to bytes | -| <a href="#SkImageInfo_validRowBytes">validRowBytes</a> | checks if row bytes is large enough to contain pixel row | -| <a href="#SkImageInfo_validate">validate</a> | asserts if <a href="#Image_Info">Image Info</a> is invalid (debug only) | -| <a href="#SkImageInfo_width">width</a> | returns pixel column count | - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Property">Property</a> | metrics and attributes | -| <a href="#Utility">Utility</a> | rarely called management functions | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkImageInfo_Make">Make</a> | creates <a href="#Image_Info">Image Info</a> from dimensions, <a href="#Color_Type">Color Type</a>, <a href="#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_MakeA8">MakeA8</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> | -| <a href="#SkImageInfo_MakeN32">MakeN32</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#Color_Type_Native">Native Color Type</a> | -| <a href="#SkImageInfo_MakeN32Premul">MakeN32Premul</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#Color_Type_Native">Native Color Type</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a> | -| | <a href="#SkImageInfo_MakeN32Premul">MakeN32Premul(int width, int height, sk sp<SkColorSpace> cs = nullptr)</a> | -| | <a href="#SkImageInfo_MakeN32Premul_2">MakeN32Premul(const SkISize& size)</a> | -| <a href="#SkImageInfo_MakeS32">MakeS32</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#Color_Type_Native">Native Color Type</a>, sRGB <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_MakeUnknown">MakeUnknown</a> | creates <a href="#Image_Info">Image Info</a> with <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> | -| | <a href="#SkImageInfo_MakeUnknown">MakeUnknown(int width, int height)</a> | -| | <a href="#SkImageInfo_MakeUnknown_2">MakeUnknown()</a> | -| <a href="#SkImageInfo_empty_constructor">SkImageInfo()</a> | creates with zero dimensions, <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> | -| <a href="#SkImageInfo_makeAlphaType">makeAlphaType</a> | creates <a href="#Image_Info">Image Info</a> with changed <a href="#Alpha_Type">Alpha Type</a> | -| <a href="#SkImageInfo_makeColorSpace">makeColorSpace</a> | creates <a href="#Image_Info">Image Info</a> with changed <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_makeColorType">makeColorType</a> | creates <a href="#Image_Info">Image Info</a> with changed <a href="#Color_Type">Color Type</a> | -| <a href="#SkImageInfo_makeWH">makeWH</a> | creates <a href="#Image_Info">Image Info</a> with changed dimensions | -| <a href="#SkImageInfo_reset">reset</a> | sets zero dimensions, <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a> | - -<a name="SkImageInfo_empty_constructor"></a> +<a href='SkImage_Reference#SkImage_MakeFromYUVTexturesCopy'>SkImage::MakeFromYUVTexturesCopy</a> <a href='SkImage_Reference#SkImage_MakeFromNV12TexturesCopy'>SkImage::MakeFromNV12TexturesCopy</a> + +# <a name='SkImageInfo'>Struct SkImageInfo</a> + +## <a name='Constant'>Constant</a> + + +SkImageInfo related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> +Describes pixel dimensions and encoding. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, <a href='SkImage_Reference#Image'>Image</a>, PixMap, and <a href='SkSurface_Reference#Surface'>Surface</a> +can be created from <a href='#Image_Info'>Image Info</a>. <a href='#Image_Info'>Image Info</a> can be retrieved from <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> and +<a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, but not from <a href='SkImage_Reference#Image'>Image</a> and <a href='SkSurface_Reference#Surface'>Surface</a>. For example, <a href='SkImage_Reference#Image'>Image</a> and <a href='SkSurface_Reference#Surface'>Surface</a> +implementations may defer pixel depth, so may not completely specify <a href='#Image_Info'>Image Info</a>. + +<a href='#Image_Info'>Image Info</a> contains dimensions, the pixel integral width and height. It encodes +how pixel bits describe <a href='SkColor_Reference#Alpha'>Color Alpha</a>, transparency; <a href='SkColor_Reference#Color'>Color</a> components red, blue, +and green; and <a href='undocumented#Color_Space'>Color Space</a>, the range and linearity of colors. + +## <a name='Member_Function'>Member Function</a> + + +SkImageInfo member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks result of <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> and <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> from dimensions, <a href='#Color_Type'>Color Type</a>, <a href='#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeA8'>MakeA8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32'>MakeN32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeS32'>MakeS32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, sRGB <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlphaTypeIsOpaque'>SkAlphaTypeIsOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> equals <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeBytesPerPixel'>SkColorTypeBytesPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a> byte size</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Color_Type'>Color Type</a> includes <a href='SkColor_Reference#Alpha'>Color Alpha</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is valid</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a> as Rectangle</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of bytes in pixel based on <a href='#Color_Type'>Color Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeByteSize'>computeByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns memory required by pixel buffer with given row bytes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns least memory required by pixel buffer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeOffset'>computeOffset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns byte offset within pixel array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_dimensions'>dimensions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_gammaCloseToSRGB'>gammaCloseToSRGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Color_Space'>Color Space</a> gamma is approximately the same as sRGB</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if dimensions contain pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorType'>makeColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeWH'>makeWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed dimensions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes'>minRowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 32 bits</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 64 bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_refColorSpace'>refColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets zero dimensions, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validRowBytes'>validRowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks if row bytes is large enough to contain pixel row</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validate'>validate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Image_Info'>Image Info</a> is invalid (debug only)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkImageInfo global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type'>Alpha Type</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel transparency</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Opaque'>Alpha Type Opaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>hints all pixels are opaque</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Premul'>Alpha Type Premul</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stores components scaled by <a href='SkColor_Reference#Alpha'>Alpha</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Type_Unpremul'>Alpha Type Unpremul</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stores components without <a href='SkColor_Reference#Alpha'>Alpha</a> scaling</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type'>Color Type</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encoding for pixel color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_ARGB_4444'>Color Type ARGB 4444</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> in 16 bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_Alpha_8'>Color Type Alpha 8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes transparency only</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_BGRA_8888'>Color Type BGRA 8888</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> Little_Endian in 32 bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_Gray_8'>Color Type Gray 8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes level of <a href='SkColor_Reference#Gray'>Color Gray</a> in 8 bits</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_1010102'>Color Type RGBA 1010102</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> ten bits per color component</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_8888'>Color Type RGBA 8888</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> Big_Endian in 32 bits</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGBA_F16'>Color Type RGBA F16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#ARGB'>Color ARGB</a> as half floats</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_101010'>Color Type RGB 101010</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#RGB'>Color RGB</a> ten bits per color component</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_565'>Color Type RGB 565</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#RGB'>Color RGB</a> in 16 bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Type_RGB_888'>Color Type RGB 888</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>encodes <a href='SkColor_Reference#RGB'>Color RGB</a> in 32 bits</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>metrics and attributes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#YUV_ColorSpace'>YUV ColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>color range of YUV pixels</td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkImageInfo can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> from dimensions, <a href='#Color_Type'>Color Type</a>, <a href='#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeA8'>MakeA8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32'>MakeN32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul(int width, int height, sk sp<SkColorSpace> cs = nullptr)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeN32Premul_2'>MakeN32Premul(const SkISize& size)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeS32'>MakeS32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kN32_SkColorType'>Native_Color_Type</a>, sRGB <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown'>MakeUnknown(int width, int height)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_MakeUnknown_2'>MakeUnknown()</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_empty_constructor'>SkImageInfo()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates with zero dimensions, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeColorType'>makeColorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed <a href='#Color_Type'>Color Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_makeWH'>makeWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image_Info'>Image Info</a> with changed dimensions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets zero dimensions, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a></td> + </tr> +</table> + + +<a name='SkImageInfo_empty_constructor'></a> ## SkImageInfo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageInfo() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkImageInfo'>SkImageInfo</a>() </pre> -Creates an empty <a href="#Image_Info">Image Info</a> with <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, -a width and height of zero, and no <a href="undocumented#Color_Space">Color Space</a>. +Creates an empty <a href='#Image_Info'>Image Info</a> with <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, +a width and height of zero, and no <a href='undocumented#Color_Space'>Color Space</a>. ### Return Value -empty <a href="#Image_Info">Image Info</a> +empty <a href='#Image_Info'>Image Info</a> ### Example -<div><fiddle-embed name="f206f698e7a8db3d84334c26b1a702dc"><div>An empty <a href="#Image_Info">Image Info</a> may be passed to <a href="SkCanvas_Reference#SkCanvas_accessTopLayerPixels">SkCanvas::accessTopLayerPixels</a> as storage -for the <a href="SkCanvas_Reference#Canvas">Canvas</a> actual <a href="#Image_Info">Image Info</a>. +<div><fiddle-embed name="f206f698e7a8db3d84334c26b1a702dc"><div>An empty <a href='#Image_Info'>Image Info</a> may be passed to <a href='SkCanvas_Reference#SkCanvas_accessTopLayerPixels'>SkCanvas::accessTopLayerPixels</a> as storage +for the <a href='SkCanvas_Reference#Canvas'>Canvas</a> actual <a href='#Image_Info'>Image Info</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_MakeA8">MakeA8</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a> --- -<a name="SkImageInfo_Make"></a> +<a name='SkImageInfo_Make'></a> ## Make -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at, - sk_sp<SkColorSpace> cs = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_Make'>Make</a>(int width, int height, <a href='#SkColorType'>SkColorType</a> ct, <a href='#SkAlphaType'>SkAlphaType</a> at, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs = nullptr) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#Color_Type">Color Type</a> <a href="#SkImageInfo_Make_ct">ct</a>, -<a href="#Alpha_Type">Alpha Type</a> <a href="#SkImageInfo_Make_at">at</a>, and optionally <a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_Make_cs">cs</a>. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#Color_Type'>Color Type</a> <a href='#SkImageInfo_Make_ct'>ct</a>, +<a href='#Alpha_Type'>Alpha Type</a> <a href='#SkImageInfo_Make_at'>at</a>, and optionally <a href='undocumented#Color_Space'>Color Space</a> <a href='#SkImageInfo_Make_cs'>cs</a>. -If <a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_Make_cs">cs</a> is nullptr and <a href="#Image_Info">Image Info</a> is part of drawing source: <a href="undocumented#Color_Space">Color Space</a> -defaults to sRGB, mapping into <a href="SkSurface_Reference#Surface">Surface</a> <a href="undocumented#Color_Space">Color Space</a>. +If <a href='undocumented#Color_Space'>Color Space</a> <a href='#SkImageInfo_Make_cs'>cs</a> is nullptr and <a href='#Image_Info'>Image Info</a> is part of drawing source: <a href='undocumented#Color_Space'>Color Space</a> +defaults to sRGB, mapping into <a href='SkSurface_Reference#Surface'>Surface</a> <a href='undocumented#Color_Space'>Color Space</a>. Parameters are not validated to see if their values are legal, or that the combination is supported. ### Parameters -<table> <tr> <td><a name="SkImageInfo_Make_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_Make_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_Make_ct"> <code><strong>ct </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkImageInfo_Make_at"> <code><strong>at </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkImageInfo_Make_cs"> <code><strong>cs </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImageInfo_Make_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_Make_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_Make_ct'><code><strong>ct</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkImageInfo_Make_at'><code><strong>at</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkImageInfo_Make_cs'><code><strong>cs</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -792,44 +1333,47 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeN32Premul">MakeN32Premul</a><sup><a href="#SkImageInfo_MakeN32Premul_2">[2]</a></sup> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_MakeA8">MakeA8</a> +<a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a><sup><a href='#SkImageInfo_MakeN32Premul_2'>[2]</a></sup> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a> --- -<a name="SkImageInfo_MakeN32"></a> +<a name='SkImageInfo_MakeN32'></a> ## MakeN32 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeN32(int width, int height, SkAlphaType at, sk_sp<SkColorSpace> cs = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeN32'>MakeN32</a>(int width, int height, <a href='#SkAlphaType'>SkAlphaType</a> at, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs = nullptr) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#kN32_SkColorType">kN32_SkColorType</a>, -<a href="#Alpha_Type">Alpha Type</a> <a href="#SkImageInfo_MakeN32_at">at</a>, and optionally <a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_MakeN32_cs">cs</a>. <a href="#kN32_SkColorType">kN32_SkColorType</a> will equal either -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a> or <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, whichever is optimal. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#kN32_SkColorType'>kN32_SkColorType</a>, +<a href='#Alpha_Type'>Alpha Type</a> <a href='#SkImageInfo_MakeN32_at'>at</a>, and optionally <a href='undocumented#Color_Space'>Color Space</a> <a href='#SkImageInfo_MakeN32_cs'>cs</a>. <a href='#kN32_SkColorType'>kN32_SkColorType</a> will equal either +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a> or <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, whichever is optimal. -If <a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_MakeN32_cs">cs</a> is nullptr and <a href="#Image_Info">Image Info</a> is part of drawing source: <a href="undocumented#Color_Space">Color Space</a> -defaults to sRGB, mapping into <a href="SkSurface_Reference#Surface">Surface</a> <a href="undocumented#Color_Space">Color Space</a>. +If <a href='undocumented#Color_Space'>Color Space</a> <a href='#SkImageInfo_MakeN32_cs'>cs</a> is nullptr and <a href='#Image_Info'>Image Info</a> is part of drawing source: <a href='undocumented#Color_Space'>Color Space</a> +defaults to sRGB, mapping into <a href='SkSurface_Reference#Surface'>Surface</a> <a href='undocumented#Color_Space'>Color Space</a>. Parameters are not validated to see if their values are legal, or that the combination is supported. ### Parameters -<table> <tr> <td><a name="SkImageInfo_MakeN32_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeN32_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeN32_at"> <code><strong>at </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkImageInfo_MakeN32_cs"> <code><strong>cs </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImageInfo_MakeN32_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeN32_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeN32_at'><code><strong>at</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkImageInfo_MakeN32_cs'><code><strong>cs</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -837,84 +1381,88 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_MakeN32Premul">MakeN32Premul</a><sup><a href="#SkImageInfo_MakeN32Premul_2">[2]</a></sup> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_MakeA8">MakeA8</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a><sup><a href='#SkImageInfo_MakeN32Premul_2'>[2]</a></sup> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a> --- -<a name="SkImageInfo_MakeS32"></a> +<a name='SkImageInfo_MakeS32'></a> ## MakeS32 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeS32(int width, int height, SkAlphaType at) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a>(int width, int height, <a href='#SkAlphaType'>SkAlphaType</a> at) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#kN32_SkColorType">kN32_SkColorType</a>, -<a href="#Alpha_Type">Alpha Type</a> <a href="#SkImageInfo_MakeS32_at">at</a>, with sRGB <a href="undocumented#Color_Space">Color Space</a>. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#kN32_SkColorType'>kN32_SkColorType</a>, +<a href='#Alpha_Type'>Alpha Type</a> <a href='#SkImageInfo_MakeS32_at'>at</a>, with sRGB <a href='undocumented#Color_Space'>Color Space</a>. Parameters are not validated to see if their values are legal, or that the combination is supported. ### Parameters -<table> <tr> <td><a name="SkImageInfo_MakeS32_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeS32_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeS32_at"> <code><strong>at </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> +<table> <tr> <td><a name='SkImageInfo_MakeS32_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeS32_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeS32_at'><code><strong>at</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example -<div><fiddle-embed name="bb85fc8a82fe772e1d611f3ab8770a1d"><div>Top gradient is drawn to offscreen without <a href="undocumented#Color_Space">Color Space</a>. It is darker than middle -gradient, drawn to offscreen with sRGB <a href="undocumented#Color_Space">Color Space</a>. Bottom gradient shares bits -with middle, but does not specify the <a href="undocumented#Color_Space">Color Space</a> in noColorSpaceBitmap. A source -without <a href="undocumented#Color_Space">Color Space</a> is treated as sRGB; the bottom gradient is identical to the +<div><fiddle-embed name="de418ccb42471d1589508ef3955f8c53"><div>Top gradient is drawn to offScreen without <a href='undocumented#Color_Space'>Color Space</a>. It is darker than middle +gradient, drawn to offScreen with sRGB <a href='undocumented#Color_Space'>Color Space</a>. Bottom gradient shares bits +with middle, but does not specify the <a href='undocumented#Color_Space'>Color Space</a> in noColorSpaceBitmap. A source +without <a href='undocumented#Color_Space'>Color Space</a> is treated as sRGB; the bottom gradient is identical to the middle gradient. </div></fiddle-embed></div> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeN32Premul">MakeN32Premul</a><sup><a href="#SkImageInfo_MakeN32Premul_2">[2]</a></sup> <a href="#SkImageInfo_MakeA8">MakeA8</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a><sup><a href='#SkImageInfo_MakeN32Premul_2'>[2]</a></sup> <a href='#SkImageInfo_MakeA8'>MakeA8</a> --- -<a name="SkImageInfo_MakeN32Premul"></a> +<a name='SkImageInfo_MakeN32Premul'></a> ## MakeN32Premul -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a>(int width, int height, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs = nullptr) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#kN32_SkColorType">kN32_SkColorType</a>, -<a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, with optional <a href="undocumented#Color_Space">Color Space</a>. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#kN32_SkColorType'>kN32_SkColorType</a>, +<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, with optional <a href='undocumented#Color_Space'>Color Space</a>. -If <a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_MakeN32Premul_cs">cs</a> is nullptr and <a href="#Image_Info">Image Info</a> is part of drawing source: <a href="undocumented#Color_Space">Color Space</a> -defaults to sRGB, mapping into <a href="SkSurface_Reference#Surface">Surface</a> <a href="undocumented#Color_Space">Color Space</a>. +If <a href='undocumented#Color_Space'>Color Space</a> <a href='#SkImageInfo_MakeN32Premul_cs'>cs</a> is nullptr and <a href='#Image_Info'>Image Info</a> is part of drawing source: <a href='undocumented#Color_Space'>Color Space</a> +defaults to sRGB, mapping into <a href='SkSurface_Reference#Surface'>Surface</a> <a href='undocumented#Color_Space'>Color Space</a>. Parameters are not validated to see if their values are legal, or that the combination is supported. ### Parameters -<table> <tr> <td><a name="SkImageInfo_MakeN32Premul_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeN32Premul_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeN32Premul_cs"> <code><strong>cs </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImageInfo_MakeN32Premul_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeN32Premul_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeN32Premul_cs'><code><strong>cs</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -922,35 +1470,35 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_MakeA8">MakeA8</a> <a href="#SkImageInfo_Make">Make</a> +<a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a> <a href='#SkImageInfo_Make'>Make</a> --- -<a name="SkImageInfo_MakeN32Premul_2"></a> +<a name='SkImageInfo_MakeN32Premul_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeN32Premul(const SkISize& size) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeN32Premul'>MakeN32Premul</a>(const <a href='undocumented#SkISize'>SkISize</a>& size) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#kN32_SkColorType">kN32_SkColorType</a>, -<a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, with <a href="undocumented#Color_Space">Color Space</a> set to nullptr. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#kN32_SkColorType'>kN32_SkColorType</a>, +<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, with <a href='undocumented#Color_Space'>Color Space</a> set to nullptr. -If <a href="#Image_Info">Image Info</a> is part of drawing source: <a href="undocumented#Color_Space">Color Space</a> defaults to sRGB, mapping -into <a href="SkSurface_Reference#Surface">Surface</a> <a href="undocumented#Color_Space">Color Space</a>. +If <a href='#Image_Info'>Image Info</a> is part of drawing source: <a href='undocumented#Color_Space'>Color Space</a> defaults to sRGB, mapping +into <a href='SkSurface_Reference#Surface'>Surface</a> <a href='undocumented#Color_Space'>Color Space</a>. Parameters are not validated to see if their values are legal, or that the combination is supported. ### Parameters -<table> <tr> <td><a name="SkImageInfo_MakeN32Premul_2_size"> <code><strong>size </strong></code> </a></td> <td> -width and height, each must be zero or greater</td> +<table> <tr> <td><a name='SkImageInfo_MakeN32Premul_2_size'><code><strong>size</strong></code></a></td> + <td>width and height, each must be zero or greater</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -958,32 +1506,33 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_MakeA8">MakeA8</a> <a href="#SkImageInfo_Make">Make</a> +<a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a> <a href='#SkImageInfo_Make'>Make</a> --- -<a name="SkImageInfo_MakeA8"></a> +<a name='SkImageInfo_MakeA8'></a> ## MakeA8 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeA8(int width, int height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a>(int width, int height) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, -<a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, with <a href="undocumented#Color_Space">Color Space</a> set to nullptr. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, +<a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, with <a href='undocumented#Color_Space'>Color Space</a> set to nullptr. ### Parameters -<table> <tr> <td><a name="SkImageInfo_MakeA8_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeA8_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> +<table> <tr> <td><a name='SkImageInfo_MakeA8_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeA8_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -991,35 +1540,36 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_Make">Make</a> +<a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_Make'>Make</a> --- -<a name="SkImageInfo_MakeUnknown"></a> +<a name='SkImageInfo_MakeUnknown'></a> ## MakeUnknown -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeUnknown(int width, int height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a>(int width, int height) </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height, <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, -<a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, with <a href="undocumented#Color_Space">Color Space</a> set to nullptr. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height, <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, +<a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, with <a href='undocumented#Color_Space'>Color Space</a> set to nullptr. -Returned <a href="#Image_Info">Image Info</a> as part of source does not draw, and as part of destination +Returned <a href='#Image_Info'>Image Info</a> as part of source does not draw, and as part of destination can not be drawn to. ### Parameters -<table> <tr> <td><a name="SkImageInfo_MakeUnknown_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_MakeUnknown_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> +<table> <tr> <td><a name='SkImageInfo_MakeUnknown_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_MakeUnknown_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -1027,25 +1577,25 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_empty_constructor">SkImageInfo()</a> <a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_Make">Make</a> +<a href='#SkImageInfo_empty_constructor'>SkImageInfo()</a> <a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_Make'>Make</a> --- -<a name="SkImageInfo_MakeUnknown_2"></a> +<a name='SkImageInfo_MakeUnknown_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkImageInfo MakeUnknown() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_MakeUnknown'>MakeUnknown</a>() </pre> -Creates <a href="#Image_Info">Image Info</a> from integral dimensions width and height set to zero, -<a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, with <a href="undocumented#Color_Space">Color Space</a> set to nullptr. +Creates <a href='#Image_Info'>Image Info</a> from integral dimensions width and height set to zero, +<a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, with <a href='undocumented#Color_Space'>Color Space</a> set to nullptr. -Returned <a href="#Image_Info">Image Info</a> as part of source does not draw, and as part of destination +Returned <a href='#Image_Info'>Image Info</a> as part of source does not draw, and as part of destination can not be drawn to. ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -1053,35 +1603,100 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_empty_constructor">SkImageInfo()</a> <a href="#SkImageInfo_MakeN32">MakeN32</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_Make">Make</a> +<a href='#SkImageInfo_empty_constructor'>SkImageInfo()</a> <a href='#SkImageInfo_MakeN32'>MakeN32</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_Make'>Make</a> --- -## <a name="Property"></a> Property - -| name | description | -| --- | --- | -| <a href="#SkImageInfo_alphaType">alphaType</a> | Returns <a href="#Alpha_Type">Alpha Type</a> | -| <a href="#SkImageInfo_bounds">bounds</a> | returns <a href="#SkImageInfo_width">width</a> and <a href="#SkImageInfo_height">height</a> as Rectangle | -| <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> | returns number of bytes in pixel based on <a href="#Color_Type">Color Type</a> | -| <a href="#SkImageInfo_colorSpace">colorSpace</a> | returns <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_colorType">colorType</a> | returns <a href="#Color_Type">Color Type</a> | -| <a href="#SkImageInfo_dimensions">dimensions</a> | returns <a href="#SkImageInfo_width">width</a> and <a href="#SkImageInfo_height">height</a> | -| <a href="#SkImageInfo_gammaCloseToSRGB">gammaCloseToSRGB</a> | Returns if <a href="undocumented#Color_Space">Color Space</a> gamma is approximately the same as sRGB | -| <a href="#SkImageInfo_height">height</a> | returns pixel row count | -| <a href="#SkImageInfo_isEmpty">isEmpty</a> | returns if dimensions contain pixels | -| <a href="#SkImageInfo_isOpaque">isOpaque</a> | returns if <a href="#Alpha_Type">Alpha Type</a> is <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> | -| <a href="#SkImageInfo_minRowBytes">minRowBytes</a> | returns <a href="#SkImageInfo_width">width</a> times <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> in 32 bits | -| <a href="#SkImageInfo_minRowBytes64">minRowBytes64</a> | returns <a href="#SkImageInfo_width">width</a> times <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> in 64 bits | -| <a href="#SkImageInfo_refColorSpace">refColorSpace</a> | returns <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImageInfo_shiftPerPixel">shiftPerPixel</a> | returns bit shift from pixels to bytes | -| <a href="#SkImageInfo_width">width</a> | returns pixel column count | - -<a name="SkImageInfo_width"></a> +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkAlphaTypeIsOpaque'>SkAlphaTypeIsOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> equals <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeBytesPerPixel'>SkColorTypeBytesPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a> byte size</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeIsAlwaysOpaque'>SkColorTypeIsAlwaysOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Color_Type'>Color Type</a> includes <a href='SkColor_Reference#Alpha'>Color Alpha</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is valid</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a> as Rectangle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of bytes in pixel based on <a href='#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Color_Type'>Color Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_dimensions'>dimensions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_gammaCloseToSRGB'>gammaCloseToSRGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Color_Space'>Color Space</a> gamma is approximately the same as sRGB</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if dimensions contain pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Alpha_Type'>Alpha Type</a> is <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes'>minRowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 32 bits</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> in 64 bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_refColorSpace'>refColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> +</table> + + +<a name='SkImageInfo_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkImageInfo_width'>width</a>() const </pre> Returns pixel count in each row. @@ -1096,15 +1711,15 @@ pixel width ### See Also -<a href="#SkImageInfo_height">height</a> <a href="SkBitmap_Reference#SkBitmap_width">SkBitmap::width</a> <a href="undocumented#SkPixelRef_width">SkPixelRef::width</a> <a href="SkImage_Reference#SkImage_width">SkImage::width</a> <a href="SkSurface_Reference#SkSurface_width">SkSurface::width</a> +<a href='#SkImageInfo_height'>height</a> <a href='SkBitmap_Reference#SkBitmap_width'>SkBitmap::width</a> <a href='undocumented#SkPixelRef_width'>SkPixelRef::width</a> <a href='SkImage_Reference#SkImage_width'>SkImage::width</a> <a href='SkSurface_Reference#SkSurface_width'>SkSurface::width</a> --- -<a name="SkImageInfo_height"></a> +<a name='SkImageInfo_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkImageInfo_height'>height</a>() const </pre> Returns pixel row count. @@ -1119,25 +1734,25 @@ pixel height ### See Also -<a href="#SkImageInfo_width">width</a> <a href="SkBitmap_Reference#SkBitmap_height">SkBitmap::height</a> <a href="undocumented#SkPixelRef_height">SkPixelRef::height</a> <a href="SkImage_Reference#SkImage_height">SkImage::height</a> <a href="SkSurface_Reference#SkSurface_height">SkSurface::height</a> +<a href='#SkImageInfo_width'>width</a> <a href='SkBitmap_Reference#SkBitmap_height'>SkBitmap::height</a> <a href='undocumented#SkPixelRef_height'>SkPixelRef::height</a> <a href='SkImage_Reference#SkImage_height'>SkImage::height</a> <a href='SkSurface_Reference#SkSurface_height'>SkSurface::height</a> --- -<a name="SkImageInfo_colorType"></a> +<a name='SkImageInfo_colorType'></a> ## colorType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorType colorType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkColorType'>SkColorType</a> <a href='#SkImageInfo_colorType'>colorType</a>() const </pre> -Returns <a href="#Color_Type">Color Type</a>, one of: <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>. +Returns <a href='#Color_Type'>Color Type</a>, one of: <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>. ### Return Value -<a href="#Color_Type">Color Type</a> +<a href='#Color_Type'>Color Type</a> ### Example @@ -1153,23 +1768,23 @@ color type: kAlpha_8_SkColorType ### See Also -<a href="#SkImageInfo_alphaType">alphaType</a> <a href="SkPixmap_Reference#SkPixmap_colorType">SkPixmap::colorType</a> <a href="SkBitmap_Reference#SkBitmap_colorType">SkBitmap::colorType</a> +<a href='#SkImageInfo_alphaType'>alphaType</a> <a href='SkPixmap_Reference#SkPixmap_colorType'>SkPixmap::colorType</a> <a href='SkBitmap_Reference#SkBitmap_colorType'>SkBitmap::colorType</a> --- -<a name="SkImageInfo_alphaType"></a> +<a name='SkImageInfo_alphaType'></a> ## alphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkAlphaType alphaType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkAlphaType'>SkAlphaType</a> <a href='#SkImageInfo_alphaType'>alphaType</a>() const </pre> -Returns <a href="#Alpha_Type">Alpha Type</a>, one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>. +Returns <a href='#Alpha_Type'>Alpha Type</a>, one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>. ### Return Value -<a href="#Alpha_Type">Alpha Type</a> +<a href='#Alpha_Type'>Alpha Type</a> ### Example @@ -1185,28 +1800,28 @@ alpha type: kPremul_SkAlphaType ### See Also -<a href="#SkImageInfo_colorType">colorType</a> <a href="SkPixmap_Reference#SkPixmap_alphaType">SkPixmap::alphaType</a> <a href="SkBitmap_Reference#SkBitmap_alphaType">SkBitmap::alphaType</a> +<a href='#SkImageInfo_colorType'>colorType</a> <a href='SkPixmap_Reference#SkPixmap_alphaType'>SkPixmap::alphaType</a> <a href='SkBitmap_Reference#SkBitmap_alphaType'>SkBitmap::alphaType</a> --- -<a name="SkImageInfo_colorSpace"></a> +<a name='SkImageInfo_colorSpace'></a> ## colorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorSpace* colorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkColorSpace'>SkColorSpace</a>* <a href='#SkImageInfo_colorSpace'>colorSpace</a>() const </pre> -Returns <a href="undocumented#Color_Space">Color Space</a>, the range of colors. The reference count of -<a href="undocumented#Color_Space">Color Space</a> is unchanged. The returned <a href="undocumented#Color_Space">Color Space</a> is immutable. +Returns <a href='undocumented#Color_Space'>Color Space</a>, the range of colors. The reference count of +<a href='undocumented#Color_Space'>Color Space</a> is unchanged. The returned <a href='undocumented#Color_Space'>Color Space</a> is immutable. ### Return Value -<a href="undocumented#Color_Space">Color Space</a>, or nullptr +<a href='undocumented#Color_Space'>Color Space</a>, or nullptr ### Example -<div><fiddle-embed name="2952a6c863bd504484c9f66cc727f968"><div><a href="undocumented#SkColorSpace_MakeSRGBLinear">SkColorSpace::MakeSRGBLinear</a> creates <a href="undocumented#Color_Space">Color Space</a> with linear gamma -and an sRGB gamut. This <a href="undocumented#Color_Space">Color Space</a> gamma is not close to sRGB gamma. +<div><fiddle-embed name="5602b816d7cf75e3851274ef36a4c10f"><div><a href='undocumented#SkColorSpace_MakeSRGBLinear'>SkColorSpace::MakeSRGBLinear</a> creates <a href='undocumented#Color_Space'>Color Space</a> with linear gamma +and an sRGB gamut. This <a href='undocumented#Color_Space'>Color Space</a> gamma is not close to sRGB gamma. </div> #### Example Output @@ -1219,45 +1834,45 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false ### See Also -<a href="undocumented#Color_Space">Color Space</a> <a href="SkPixmap_Reference#SkPixmap_colorSpace">SkPixmap::colorSpace</a> <a href="SkBitmap_Reference#SkBitmap_colorSpace">SkBitmap::colorSpace</a> +<a href='undocumented#Color_Space'>Color Space</a> <a href='SkPixmap_Reference#SkPixmap_colorSpace'>SkPixmap::colorSpace</a> <a href='SkBitmap_Reference#SkBitmap_colorSpace'>SkBitmap::colorSpace</a> --- -<a name="SkImageInfo_refColorSpace"></a> +<a name='SkImageInfo_refColorSpace'></a> ## refColorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkColorSpace> refColorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImageInfo_refColorSpace'>refColorSpace</a>() const </pre> -Returns smart pointer to <a href="undocumented#Color_Space">Color Space</a>, the range of colors. The smart pointer -tracks the number of objects sharing this <a href="undocumented#Color_Space">Color Space</a> reference so the memory +Returns smart pointer to <a href='undocumented#Color_Space'>Color Space</a>, the range of colors. The smart pointer +tracks the number of objects sharing this <a href='undocumented#Color_Space'>Color Space</a> reference so the memory is released when the owners destruct. -The returned <a href="undocumented#Color_Space">Color Space</a> is immutable. +The returned <a href='undocumented#Color_Space'>Color Space</a> is immutable. ### Return Value -<a href="undocumented#Color_Space">Color Space</a> wrapped in a smart pointer +<a href='undocumented#Color_Space'>Color Space</a> wrapped in a smart pointer ### Example -<div><fiddle-embed name="f36afcc295602f5c8c4c2c2025c25884"></fiddle-embed></div> +<div><fiddle-embed name="33f65524736736fd91802b4198ba6fa8"></fiddle-embed></div> ### See Also -<a href="undocumented#Color_Space">Color Space</a> <a href="SkBitmap_Reference#SkBitmap_refColorSpace">SkBitmap::refColorSpace</a> +<a href='undocumented#Color_Space'>Color Space</a> <a href='SkBitmap_Reference#SkBitmap_refColorSpace'>SkBitmap::refColorSpace</a> --- -<a name="SkImageInfo_isEmpty"></a> +<a name='SkImageInfo_isEmpty'></a> ## isEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isEmpty() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImageInfo_isEmpty'>isEmpty</a>() const </pre> -Returns if <a href="#Image_Info">Image Info</a> describes an empty area of pixels by checking if either +Returns if <a href='#Image_Info'>Image Info</a> describes an empty area of pixels by checking if either width or height is zero or smaller. ### Return Value @@ -1281,27 +1896,27 @@ width: 2 height: 2 empty: false ### See Also -<a href="#SkImageInfo_dimensions">dimensions</a> <a href="#SkImageInfo_bounds">bounds</a> <a href="SkBitmap_Reference#SkBitmap_empty">SkBitmap::empty</a> <a href="SkPixmap_Reference#SkPixmap_bounds">SkPixmap::bounds</a> +<a href='#SkImageInfo_dimensions'>dimensions</a> <a href='#SkImageInfo_bounds'>bounds</a> <a href='SkBitmap_Reference#SkBitmap_empty'>SkBitmap::empty</a> <a href='SkPixmap_Reference#SkPixmap_bounds'>SkPixmap::bounds</a> --- -<a name="SkImageInfo_isOpaque"></a> +<a name='SkImageInfo_isOpaque'></a> ## isOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isOpaque() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImageInfo_isOpaque'>isOpaque</a>() const </pre> -Returns true if <a href="#Alpha_Type">Alpha Type</a> is set to hint that all pixels are opaque; their -<a href="SkColor_Reference#Alpha">Color Alpha</a> value is implicitly or explicitly 1.0. If true, and all pixels are +Returns true if <a href='#Alpha_Type'>Alpha Type</a> is set to hint that all pixels are opaque; their +<a href='SkColor_Reference#Alpha'>Color Alpha</a> value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly. -Does not check if <a href="#Color_Type">Color Type</a> allows <a href="SkColor_Reference#Alpha">Alpha</a>, or if any pixel value has +Does not check if <a href='#Color_Type'>Color Type</a> allows <a href='SkColor_Reference#Alpha'>Alpha</a>, or if any pixel value has transparency. ### Return Value -true if <a href="#Alpha_Type">Alpha Type</a> is <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> +true if <a href='#Alpha_Type'>Alpha Type</a> is <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> ### Example @@ -1320,22 +1935,22 @@ isOpaque: true ### See Also -<a href="SkColor_Reference#Alpha">Color Alpha</a> <a href="#SkColorTypeValidateAlphaType">SkColorTypeValidateAlphaType</a> <a href="SkBitmap_Reference#SkBitmap_isOpaque">SkBitmap::isOpaque</a> <a href="SkImage_Reference#SkImage_isOpaque">SkImage::isOpaque</a> <a href="SkPixmap_Reference#SkPixmap_isOpaque">SkPixmap::isOpaque</a> +<a href='SkColor_Reference#Alpha'>Color Alpha</a> <a href='#SkColorTypeValidateAlphaType'>SkColorTypeValidateAlphaType</a> <a href='SkBitmap_Reference#SkBitmap_isOpaque'>SkBitmap::isOpaque</a> <a href='SkImage_Reference#SkImage_isOpaque'>SkImage::isOpaque</a> <a href='SkPixmap_Reference#SkPixmap_isOpaque'>SkPixmap::isOpaque</a> --- -<a name="SkImageInfo_dimensions"></a> +<a name='SkImageInfo_dimensions'></a> ## dimensions -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkISize dimensions() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkISize'>SkISize</a> <a href='#SkImageInfo_dimensions'>dimensions</a>() const </pre> -Returns <a href="undocumented#ISize">ISize</a> { <a href="#SkImageInfo_width">width</a>, <a href="#SkImageInfo_height">height</a> }. +Returns <a href='undocumented#ISize'>ISize</a> { <a href='#SkImageInfo_width'>width</a>, <a href='#SkImageInfo_height'>height</a> }. ### Return Value -integral size of <a href="#SkImageInfo_width">width</a> and <a href="#SkImageInfo_height">height</a> +integral size of <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a> ### Example @@ -1351,22 +1966,22 @@ dimensionsAsBounds == bounds ### See Also -<a href="#SkImageInfo_width">width</a> <a href="#SkImageInfo_height">height</a> <a href="#SkImageInfo_bounds">bounds</a> <a href="SkBitmap_Reference#SkBitmap_dimensions">SkBitmap::dimensions</a> +<a href='#SkImageInfo_width'>width</a> <a href='#SkImageInfo_height'>height</a> <a href='#SkImageInfo_bounds'>bounds</a> <a href='SkBitmap_Reference#SkBitmap_dimensions'>SkBitmap::dimensions</a> --- -<a name="SkImageInfo_bounds"></a> +<a name='SkImageInfo_bounds'></a> ## bounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect bounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkImageInfo_bounds'>bounds</a>() const </pre> -Returns <a href="SkIRect_Reference#IRect">IRect</a> { 0, 0, <a href="#SkImageInfo_width">width</a>, <a href="#SkImageInfo_height">height</a> }. +Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkImageInfo_width'>width</a>, <a href='#SkImageInfo_height'>height</a> }. ### Return Value -integral rectangle from origin to <a href="#SkImageInfo_width">width</a> and <a href="#SkImageInfo_height">height</a> +integral rectangle from origin to <a href='#SkImageInfo_width'>width</a> and <a href='#SkImageInfo_height'>height</a> ### Example @@ -1374,24 +1989,24 @@ integral rectangle from origin to <a href="#SkImageInfo_width">width</a> and <a ### See Also -<a href="#SkImageInfo_width">width</a> <a href="#SkImageInfo_height">height</a> <a href="#SkImageInfo_dimensions">dimensions</a> +<a href='#SkImageInfo_width'>width</a> <a href='#SkImageInfo_height'>height</a> <a href='#SkImageInfo_dimensions'>dimensions</a> --- -<a name="SkImageInfo_gammaCloseToSRGB"></a> +<a name='SkImageInfo_gammaCloseToSRGB'></a> ## gammaCloseToSRGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool gammaCloseToSRGB() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImageInfo_gammaCloseToSRGB'>gammaCloseToSRGB</a>() const </pre> -Returns true if associated <a href="undocumented#Color_Space">Color Space</a> is not nullptr, and <a href="undocumented#Color_Space">Color Space</a> gamma +Returns true if associated <a href='undocumented#Color_Space'>Color Space</a> is not nullptr, and <a href='undocumented#Color_Space'>Color Space</a> gamma is approximately the same as sRGB. -This includes the <a href="">sRGB transfer function $ https://en.wikipedia.org/wiki/SRGB#The_sRGB_transfer_function_(%22gamma%22)</a> as well as a gamma curve described by a 2.2 exponent. +This includes the <a href='https://en.wikipedia.org/wiki/SRGB#The_sRGB_transfer_function_(%22gamma%22)'>sRGB transfer function</a></a> as well as a gamma curve described by a 2.2 exponent. ### Return Value -true if <a href="undocumented#Color_Space">Color Space</a> gamma is approximately the same as sRGB +true if <a href='undocumented#Color_Space'>Color Space</a> gamma is approximately the same as sRGB ### Example @@ -1399,132 +2014,133 @@ true if <a href="undocumented#Color_Space">Color Space</a> gamma is approximatel ### See Also -<a href="undocumented#SkColorSpace_gammaCloseToSRGB">SkColorSpace::gammaCloseToSRGB</a> +<a href='undocumented#SkColorSpace_gammaCloseToSRGB'>SkColorSpace::gammaCloseToSRGB</a> --- -<a name="SkImageInfo_makeWH"></a> +<a name='SkImageInfo_makeWH'></a> ## makeWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageInfo makeWH(int newWidth, int newHeight) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeWH'>makeWH</a>(int newWidth, int newHeight) const </pre> -Creates <a href="#Image_Info">Image Info</a> with the same <a href="#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a>, and <a href="#Alpha_Type">Alpha Type</a>, +Creates <a href='#Image_Info'>Image Info</a> with the same <a href='#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, and <a href='#Alpha_Type'>Alpha Type</a>, with dimensions set to width and height. ### Parameters -<table> <tr> <td><a name="SkImageInfo_makeWH_newWidth"> <code><strong>newWidth </strong></code> </a></td> <td> -pixel column count; must be zero or greater</td> - </tr> <tr> <td><a name="SkImageInfo_makeWH_newHeight"> <code><strong>newHeight </strong></code> </a></td> <td> -pixel row count; must be zero or greater</td> +<table> <tr> <td><a name='SkImageInfo_makeWH_newWidth'><code><strong>newWidth</strong></code></a></td> + <td>pixel column count; must be zero or greater</td> + </tr> + <tr> <td><a name='SkImageInfo_makeWH_newHeight'><code><strong>newHeight</strong></code></a></td> + <td>pixel row count; must be zero or greater</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example -<div><fiddle-embed name="26827898b6b199d6c4b5e4d2c6e6bac8"></fiddle-embed></div> +<div><fiddle-embed name="cd203a3f9c5fb68272f21f302dd54fbc"></fiddle-embed></div> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_makeAlphaType">makeAlphaType</a> <a href="#SkImageInfo_makeColorSpace">makeColorSpace</a> <a href="#SkImageInfo_makeColorType">makeColorType</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a> <a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a> <a href='#SkImageInfo_makeColorType'>makeColorType</a> --- -<a name="SkImageInfo_makeAlphaType"></a> +<a name='SkImageInfo_makeAlphaType'></a> ## makeAlphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a>(<a href='#SkAlphaType'>SkAlphaType</a> newAlphaType) const </pre> -Creates <a href="#Image_Info">Image Info</a> with same <a href="#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a>, width, and height, -with <a href="#Alpha_Type">Alpha Type</a> set to <a href="#SkImageInfo_makeAlphaType_newAlphaType">newAlphaType</a>. +Creates <a href='#Image_Info'>Image Info</a> with same <a href='#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, width, and height, +with <a href='#Alpha_Type'>Alpha Type</a> set to <a href='#SkImageInfo_makeAlphaType_newAlphaType'>newAlphaType</a>. -Created <a href="#Image_Info">Image Info</a> contains <a href="#SkImageInfo_makeAlphaType_newAlphaType">newAlphaType</a> even if it is incompatible with -<a href="#Color_Type">Color Type</a>, in which case <a href="#Alpha_Type">Alpha Type</a> in <a href="#Image_Info">Image Info</a> is ignored. +Created <a href='#Image_Info'>Image Info</a> contains <a href='#SkImageInfo_makeAlphaType_newAlphaType'>newAlphaType</a> even if it is incompatible with +<a href='#Color_Type'>Color Type</a>, in which case <a href='#Alpha_Type'>Alpha Type</a> in <a href='#Image_Info'>Image Info</a> is ignored. ### Parameters -<table> <tr> <td><a name="SkImageInfo_makeAlphaType_newAlphaType"> <code><strong>newAlphaType </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> +<table> <tr> <td><a name='SkImageInfo_makeAlphaType_newAlphaType'><code><strong>newAlphaType</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example -<div><fiddle-embed name="5166f1a04d53443ed8aed519d0faa3db"></fiddle-embed></div> +<div><fiddle-embed name="e72db006f1bea26feceaef8727ff9818"></fiddle-embed></div> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_MakeA8">MakeA8</a> <a href="#SkImageInfo_makeColorType">makeColorType</a> <a href="#SkImageInfo_makeColorSpace">makeColorSpace</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_MakeA8'>MakeA8</a> <a href='#SkImageInfo_makeColorType'>makeColorType</a> <a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a> --- -<a name="SkImageInfo_makeColorType"></a> +<a name='SkImageInfo_makeColorType'></a> ## makeColorType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageInfo makeColorType(SkColorType newColorType) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeColorType'>makeColorType</a>(<a href='#SkColorType'>SkColorType</a> newColorType) const </pre> -Creates <a href="#Image_Info">Image Info</a> with same <a href="#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, width, and height, -with <a href="#Color_Type">Color Type</a> set to <a href="#SkImageInfo_makeColorType_newColorType">newColorType</a>. +Creates <a href='#Image_Info'>Image Info</a> with same <a href='#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, width, and height, +with <a href='#Color_Type'>Color Type</a> set to <a href='#SkImageInfo_makeColorType_newColorType'>newColorType</a>. ### Parameters -<table> <tr> <td><a name="SkImageInfo_makeColorType_newColorType"> <code><strong>newColorType </strong></code> </a></td> <td> -one of: <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> +<table> <tr> <td><a name='SkImageInfo_makeColorType_newColorType'><code><strong>newColorType</strong></code></a></td> + <td>one of: <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example -<div><fiddle-embed name="0d67609fbf0988bfaf9ca5e2460af3d3"></fiddle-embed></div> +<div><fiddle-embed name="3ac267b08b12dc83c95f91d8dd5d70ee"></fiddle-embed></div> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_makeAlphaType">makeAlphaType</a> <a href="#SkImageInfo_makeColorSpace">makeColorSpace</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a> <a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a> --- -<a name="SkImageInfo_makeColorSpace"></a> +<a name='SkImageInfo_makeColorSpace'></a> ## makeColorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkImageInfo'>SkImageInfo</a> <a href='#SkImageInfo_makeColorSpace'>makeColorSpace</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> cs) const </pre> -Creates <a href="#Image_Info">Image Info</a> with same <a href="#Alpha_Type">Alpha Type</a>, <a href="#Color_Type">Color Type</a>, width, and height, -with <a href="undocumented#Color_Space">Color Space</a> set to <a href="#SkImageInfo_makeColorSpace_cs">cs</a>. +Creates <a href='#Image_Info'>Image Info</a> with same <a href='#Alpha_Type'>Alpha Type</a>, <a href='#Color_Type'>Color Type</a>, width, and height, +with <a href='undocumented#Color_Space'>Color Space</a> set to <a href='#SkImageInfo_makeColorSpace_cs'>cs</a>. ### Parameters -<table> <tr> <td><a name="SkImageInfo_makeColorSpace_cs"> <code><strong>cs </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImageInfo_makeColorSpace_cs'><code><strong>cs</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image_Info">Image Info</a> +created <a href='#Image_Info'>Image Info</a> ### Example @@ -1532,19 +2148,19 @@ created <a href="#Image_Info">Image Info</a> ### See Also -<a href="#SkImageInfo_Make">Make</a> <a href="#SkImageInfo_MakeS32">MakeS32</a> <a href="#SkImageInfo_makeAlphaType">makeAlphaType</a> <a href="#SkImageInfo_makeColorType">makeColorType</a> +<a href='#SkImageInfo_Make'>Make</a> <a href='#SkImageInfo_MakeS32'>MakeS32</a> <a href='#SkImageInfo_makeAlphaType'>makeAlphaType</a> <a href='#SkImageInfo_makeColorType'>makeColorType</a> --- -<a name="SkImageInfo_bytesPerPixel"></a> +<a name='SkImageInfo_bytesPerPixel'></a> ## bytesPerPixel -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int bytesPerPixel() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>() const </pre> -Returns number of bytes per pixel required by <a href="#Color_Type">Color Type</a>. -Returns zero if <a href="#SkImageInfo_colorType">colorType</a>( is <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns number of bytes per pixel required by <a href='#Color_Type'>Color Type</a>. +Returns zero if <a href='#SkImageInfo_colorType'>colorType</a>( is <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -1552,10 +2168,10 @@ bytes in pixel ### Example -<div><fiddle-embed name="9b6de4a07b2316228e9340e5a3b82134"><a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> +<div><fiddle-embed name="9b6de4a07b2316228e9340e5a3b82134"><a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> #### Example Output @@ -1577,19 +2193,19 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8 ### See Also -<a href="#SkImageInfo_width">width</a> <a href="#SkImageInfo_shiftPerPixel">shiftPerPixel</a> <a href="SkBitmap_Reference#SkBitmap_bytesPerPixel">SkBitmap::bytesPerPixel</a> +<a href='#SkImageInfo_width'>width</a> <a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a> <a href='SkBitmap_Reference#SkBitmap_bytesPerPixel'>SkBitmap::bytesPerPixel</a> --- -<a name="SkImageInfo_shiftPerPixel"></a> +<a name='SkImageInfo_shiftPerPixel'></a> ## shiftPerPixel -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int shiftPerPixel() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkImageInfo_shiftPerPixel'>shiftPerPixel</a>() const </pre> Returns bit shift converting row bytes to row pixels. -Returns zero for <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns zero for <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -1597,10 +2213,10 @@ one of: 0, 1, 2, 3; left shift to convert pixels to bytes ### Example -<div><fiddle-embed name="e47b911f94fc629f756a829e523a2a89"><a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> +<div><fiddle-embed name="e47b911f94fc629f756a829e523a2a89"><a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> #### Example Output @@ -1622,28 +2238,28 @@ color: kRGBA_F16_SkColorType shiftPerPixel: 3 ### See Also -<a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> <a href="#SkImageInfo_minRowBytes">minRowBytes</a> <a href="SkBitmap_Reference#SkBitmap_shiftPerPixel">SkBitmap::shiftPerPixel</a> <a href="SkPixmap_Reference#SkPixmap_shiftPerPixel">SkPixmap::shiftPerPixel</a> +<a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> <a href='#SkImageInfo_minRowBytes'>minRowBytes</a> <a href='SkBitmap_Reference#SkBitmap_shiftPerPixel'>SkBitmap::shiftPerPixel</a> <a href='SkPixmap_Reference#SkPixmap_shiftPerPixel'>SkPixmap::shiftPerPixel</a> --- -<a name="SkImageInfo_minRowBytes64"></a> +<a name='SkImageInfo_minRowBytes64'></a> ## minRowBytes64 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint64_t minRowBytes64() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint64_t <a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a>() const </pre> -Returns minimum bytes per row, computed from pixel <a href="#SkImageInfo_width">width</a> and <a href="#Color_Type">Color Type</a>, which -specifies <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a>. <a href="SkBitmap_Reference#Bitmap">Bitmap</a> maximum value for row bytes must be representable -as a positive value in a 32-bit signed integer. +Returns minimum bytes per row, computed from pixel <a href='#SkImageInfo_width'>width</a> and <a href='#Color_Type'>Color Type</a>, which +specifies <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> maximum value for row bytes must fit +in 31 bits. ### Return Value -<a href="#SkImageInfo_width">width</a> times <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> as unsigned 64-bit integer +<a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> as unsigned 64-bit integer ### Example -<div><fiddle-embed name="3004125e67431bd7a5c0ff3863aad8a0"> +<div><fiddle-embed name="4b5d3904476726a39f1c3e276d6b6ba7"> #### Example Output @@ -1662,28 +2278,28 @@ RGBA_F16 width -2147483648 (0x80000000) too large ### See Also -<a href="#SkImageInfo_minRowBytes">minRowBytes</a> <a href="#SkImageInfo_computeByteSize">computeByteSize</a> <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> <a href="#SkImageInfo_validRowBytes">validRowBytes</a> +<a href='#SkImageInfo_minRowBytes'>minRowBytes</a> <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> <a href='#SkImageInfo_validRowBytes'>validRowBytes</a> --- -<a name="SkImageInfo_minRowBytes"></a> +<a name='SkImageInfo_minRowBytes'></a> ## minRowBytes -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t minRowBytes() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>() const </pre> -Returns minimum bytes per row, computed from pixel <a href="#SkImageInfo_width">width</a> and <a href="#Color_Type">Color Type</a>, which -specifies <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a>. <a href="SkBitmap_Reference#Bitmap">Bitmap</a> maximum value for row bytes must be representable -as a positive value in a 32-bit signed integer. +Returns minimum bytes per row, computed from pixel <a href='#SkImageInfo_width'>width</a> and <a href='#Color_Type'>Color Type</a>, which +specifies <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a>. <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> maximum value for row bytes must fit +in 31 bits. ### Return Value -<a href="#SkImageInfo_width">width</a> times <a href="#SkImageInfo_bytesPerPixel">bytesPerPixel</a> as signed 32-bit integer +<a href='#SkImageInfo_width'>width</a> times <a href='#SkImageInfo_bytesPerPixel'>bytesPerPixel</a> as signed 32-bit integer ### Example -<div><fiddle-embed name="4cb6975732a7ffab2c9ebac31af1432e"> +<div><fiddle-embed name="897230ecfb36095486beca324fd369f9"> #### Example Output @@ -1702,30 +2318,32 @@ RGBA_F16 width -2147483648 (0x80000000) too large ### See Also -<a href="#SkImageInfo_minRowBytes64">minRowBytes64</a> <a href="#SkImageInfo_computeByteSize">computeByteSize</a> <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> <a href="#SkImageInfo_validRowBytes">validRowBytes</a> +<a href='#SkImageInfo_minRowBytes64'>minRowBytes64</a> <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> <a href='#SkImageInfo_validRowBytes'>validRowBytes</a> --- -<a name="SkImageInfo_computeOffset"></a> +<a name='SkImageInfo_computeOffset'></a> ## computeOffset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t computeOffset(int x, int y, size_t rowBytes) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkImageInfo_computeOffset'>computeOffset</a>(int x, int y, size_t rowBytes) const </pre> Returns byte offset of pixel from pixel base address. -Asserts in debug build if <a href="#SkImageInfo_computeOffset_x">x</a> or <a href="#SkImageInfo_computeOffset_y">y</a> is outside of bounds. Does not assert if -<a href="#SkImageInfo_computeOffset_rowBytes">rowBytes</a> is smaller than <a href="#SkImageInfo_minRowBytes">minRowBytes</a>, even though result may be incorrect. +Asserts in debug build if <a href='#SkImageInfo_computeOffset_x'>x</a> or <a href='#SkImageInfo_computeOffset_y'>y</a> is outside of bounds. Does not assert if +<a href='#SkImageInfo_computeOffset_rowBytes'>rowBytes</a> is smaller than <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>, even though result may be incorrect. ### Parameters -<table> <tr> <td><a name="SkImageInfo_computeOffset_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkImageInfo_width">width</a></td> - </tr> <tr> <td><a name="SkImageInfo_computeOffset_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkImageInfo_height">height</a></td> - </tr> <tr> <td><a name="SkImageInfo_computeOffset_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger</td> +<table> <tr> <td><a name='SkImageInfo_computeOffset_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkImageInfo_width'>width</a></td> + </tr> + <tr> <td><a name='SkImageInfo_computeOffset_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkImageInfo_height'>height</a></td> + </tr> + <tr> <td><a name='SkImageInfo_computeOffset_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger</td> </tr> </table> @@ -1739,37 +2357,48 @@ offset within pixel array ### See Also -<a href="#SkImageInfo_height">height</a> <a href="#SkImageInfo_width">width</a> <a href="#SkImageInfo_minRowBytes">minRowBytes</a> <a href="#SkImageInfo_computeByteSize">computeByteSize</a> +<a href='#SkImageInfo_height'>height</a> <a href='#SkImageInfo_width'>width</a> <a href='#SkImageInfo_minRowBytes'>minRowBytes</a> <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> --- -## <a name="Operator"></a> Operator +## <a name='Operator'>Operator</a> + + +SkImageInfo operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_notequal1_operator'>operator!=(const SkImageInfo& other) const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Image_Info'>Image Info</a> for inequality</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_equal1_operator'>operator==(const SkImageInfo& other) const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Image_Info'>Image Info</a> for equality</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkImageInfo_notequal1_operator">operator!=(const SkImageInfo& other) const</a> | compares <a href="#Image_Info">Image Info</a> for inequality | -| <a href="#SkImageInfo_equal1_operator">operator==(const SkImageInfo& other) const</a> | compares <a href="#Image_Info">Image Info</a> for equality | -<a name="SkImageInfo_equal1_operator"></a> +<a name='SkImageInfo_equal1_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> bool operator==(const SkImageInfo& other) _const </pre> -Compares <a href="#Image_Info">Image Info</a> with <a href="#SkImageInfo_equal1_operator_other">other</a>, and returns true if width, height, <a href="#Color_Type">Color Type</a>, -<a href="#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> are equivalent. +Compares <a href='#Image_Info'>Image Info</a> with <a href='#SkImageInfo_equal1_operator_other'>other</a>, and returns true if width, height, <a href='#Color_Type'>Color Type</a>, +<a href='#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a> are equivalent. ### Parameters -<table> <tr> <td><a name="SkImageInfo_equal1_operator_other"> <code><strong>other </strong></code> </a></td> <td> -<a href="#Image_Info">Image Info</a> to compare</td> +<table> <tr> <td><a name='SkImageInfo_equal1_operator_other'><code><strong>other</strong></code></a></td> + <td><a href='#Image_Info'>Image Info</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Image_Info">Image Info</a> equals <a href="#SkImageInfo_equal1_operator_other">other</a> +true if <a href='#Image_Info'>Image Info</a> equals <a href='#SkImageInfo_equal1_operator_other'>other</a> ### Example @@ -1788,30 +2417,30 @@ info1 == info2 ### See Also -<a href="#SkImageInfo_notequal1_operator">operator!=(const SkImageInfo& other) const</a> <a href="undocumented#SkColorSpace_Equals">SkColorSpace::Equals</a> +<a href='#SkImageInfo_notequal1_operator'>operator!=(const SkImageInfo& other) const</a> <a href='undocumented#SkColorSpace_Equals'>SkColorSpace::Equals</a> --- -<a name="SkImageInfo_notequal1_operator"></a> +<a name='SkImageInfo_notequal1_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> bool operator!=(const SkImageInfo& other) _const </pre> -Compares <a href="#Image_Info">Image Info</a> with <a href="#SkImageInfo_notequal1_operator_other">other</a>, and returns true if width, height, <a href="#Color_Type">Color Type</a>, -<a href="#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> are equivalent. +Compares <a href='#Image_Info'>Image Info</a> with <a href='#SkImageInfo_notequal1_operator_other'>other</a>, and returns true if width, height, <a href='#Color_Type'>Color Type</a>, +<a href='#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a> are equivalent. ### Parameters -<table> <tr> <td><a name="SkImageInfo_notequal1_operator_other"> <code><strong>other </strong></code> </a></td> <td> -<a href="#Image_Info">Image Info</a> to compare</td> +<table> <tr> <td><a name='SkImageInfo_notequal1_operator_other'><code><strong>other</strong></code></a></td> + <td><a href='#Image_Info'>Image Info</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Image_Info">Image Info</a> is not equal to <a href="#SkImageInfo_notequal1_operator_other">other</a> +true if <a href='#Image_Info'>Image Info</a> is not equal to <a href='#SkImageInfo_notequal1_operator_other'>other</a> ### Example @@ -1830,27 +2459,27 @@ info1 == info2 ### See Also -<a href="#SkImageInfo_equal1_operator">operator==(const SkImageInfo& other) const</a> <a href="undocumented#SkColorSpace_Equals">SkColorSpace::Equals</a> +<a href='#SkImageInfo_equal1_operator'>operator==(const SkImageInfo& other) const</a> <a href='undocumented#SkColorSpace_Equals'>SkColorSpace::Equals</a> --- -<a name="SkImageInfo_computeByteSize"></a> +<a name='SkImageInfo_computeByteSize'></a> ## computeByteSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t computeByteSize(size_t rowBytes) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkImageInfo_computeByteSize'>computeByteSize</a>(size_t rowBytes) const </pre> -Returns storage required by pixel array, given <a href="#Image_Info">Image Info</a> dimensions, <a href="#Color_Type">Color Type</a>, -and <a href="#SkImageInfo_computeByteSize_rowBytes">rowBytes</a>. <a href="#SkImageInfo_computeByteSize_rowBytes">rowBytes</a> is assumed to be at least as large as <a href="#SkImageInfo_minRowBytes">minRowBytes</a>. +Returns storage required by pixel array, given <a href='#Image_Info'>Image Info</a> dimensions, <a href='#Color_Type'>Color Type</a>, +and <a href='#SkImageInfo_computeByteSize_rowBytes'>rowBytes</a>. <a href='#SkImageInfo_computeByteSize_rowBytes'>rowBytes</a> is assumed to be at least as large as <a href='#SkImageInfo_minRowBytes'>minRowBytes</a>. Returns zero if height is zero. -Returns <a href="undocumented#SK_MaxSizeT">SK MaxSizeT</a> if answer exceeds the range of size_t. +Returns <a href='undocumented#SK_MaxSizeT'>SK MaxSizeT</a> if answer exceeds the range of size_t. ### Parameters -<table> <tr> <td><a name="SkImageInfo_computeByteSize_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger</td> +<table> <tr> <td><a name='SkImageInfo_computeByteSize_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger</td> </tr> </table> @@ -1864,22 +2493,22 @@ memory required by pixel buffer ### See Also -<a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> <a href="#SkImageInfo_validRowBytes">validRowBytes</a> +<a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> <a href='#SkImageInfo_validRowBytes'>validRowBytes</a> --- -<a name="SkImageInfo_computeMinByteSize"></a> +<a name='SkImageInfo_computeMinByteSize'></a> ## computeMinByteSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t computeMinByteSize() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a>() const </pre> -Returns storage required by pixel array, given <a href="#Image_Info">Image Info</a> dimensions, and -<a href="#Color_Type">Color Type</a>. Uses <a href="#SkImageInfo_minRowBytes">minRowBytes</a> to compute bytes for pixel row. +Returns storage required by pixel array, given <a href='#Image_Info'>Image Info</a> dimensions, and +<a href='#Color_Type'>Color Type</a>. Uses <a href='#SkImageInfo_minRowBytes'>minRowBytes</a> to compute bytes for pixel row. Returns zero if height is zero. -Returns <a href="undocumented#SK_MaxSizeT">SK MaxSizeT</a> if answer exceeds the range of size_t. +Returns <a href='undocumented#SK_MaxSizeT'>SK MaxSizeT</a> if answer exceeds the range of size_t. ### Return Value @@ -1891,30 +2520,30 @@ least memory required by pixel buffer ### See Also -<a href="#SkImageInfo_computeByteSize">computeByteSize</a> <a href="#SkImageInfo_validRowBytes">validRowBytes</a> +<a href='#SkImageInfo_computeByteSize'>computeByteSize</a> <a href='#SkImageInfo_validRowBytes'>validRowBytes</a> --- -<a name="SkImageInfo_ByteSizeOverflowed"></a> +<a name='SkImageInfo_ByteSizeOverflowed'></a> ## ByteSizeOverflowed -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool ByteSizeOverflowed(size_t byteSize) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a>(size_t byteSize) </pre> -Returns true if <a href="#SkImageInfo_ByteSizeOverflowed_byteSize">byteSize</a> equals <a href="undocumented#SK_MaxSizeT">SK MaxSizeT</a>. <a href="#SkImageInfo_computeByteSize">computeByteSize</a> and -<a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> return <a href="undocumented#SK_MaxSizeT">SK MaxSizeT</a> if size_t can not hold buffer size. +Returns true if <a href='#SkImageInfo_ByteSizeOverflowed_byteSize'>byteSize</a> equals <a href='undocumented#SK_MaxSizeT'>SK MaxSizeT</a>. <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> and +<a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> return <a href='undocumented#SK_MaxSizeT'>SK MaxSizeT</a> if size_t can not hold buffer size. ### Parameters -<table> <tr> <td><a name="SkImageInfo_ByteSizeOverflowed_byteSize"> <code><strong>byteSize </strong></code> </a></td> <td> -result of <a href="#SkImageInfo_computeByteSize">computeByteSize</a> or <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a></td> +<table> <tr> <td><a name='SkImageInfo_ByteSizeOverflowed_byteSize'><code><strong>byteSize</strong></code></a></td> + <td>result of <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> or <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td> </tr> </table> ### Return Value -true if <a href="#SkImageInfo_computeByteSize">computeByteSize</a> or <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> result exceeds size_t +true if <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> or <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> result exceeds size_t ### Example @@ -1934,29 +2563,29 @@ rowBytes:1000000000000 size:18446744073709551615 overflowed:true ### See Also -<a href="#SkImageInfo_computeByteSize">computeByteSize</a> <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> <a href="#SkImageInfo_validRowBytes">validRowBytes</a> +<a href='#SkImageInfo_computeByteSize'>computeByteSize</a> <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> <a href='#SkImageInfo_validRowBytes'>validRowBytes</a> --- -<a name="SkImageInfo_validRowBytes"></a> +<a name='SkImageInfo_validRowBytes'></a> ## validRowBytes -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool validRowBytes(size_t rowBytes) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImageInfo_validRowBytes'>validRowBytes</a>(size_t rowBytes) const </pre> -Returns true if <a href="#SkImageInfo_validRowBytes_rowBytes">rowBytes</a> is smaller than width times pixel size. +Returns true if <a href='#SkImageInfo_validRowBytes_rowBytes'>rowBytes</a> is smaller than width times pixel size. ### Parameters -<table> <tr> <td><a name="SkImageInfo_validRowBytes_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger</td> +<table> <tr> <td><a name='SkImageInfo_validRowBytes_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger</td> </tr> </table> ### Return Value -true if <a href="#SkImageInfo_validRowBytes_rowBytes">rowBytes</a> is large enough to contain pixel row +true if <a href='#SkImageInfo_validRowBytes_rowBytes'>rowBytes</a> is large enough to contain pixel row ### Example @@ -1974,19 +2603,19 @@ validRowBytes(68): true ### See Also -<a href="#SkImageInfo_ByteSizeOverflowed">ByteSizeOverflowed</a> <a href="#SkImageInfo_computeByteSize">computeByteSize</a> <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> +<a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a> <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a> --- -<a name="SkImageInfo_reset"></a> +<a name='SkImageInfo_reset'></a> ## reset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkImageInfo_reset'>reset</a>() </pre> -Creates an empty <a href="#Image_Info">Image Info</a> with <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, -a width and height of zero, and no <a href="undocumented#Color_Space">Color Space</a>. +Creates an empty <a href='#Image_Info'>Image Info</a> with <a href='#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, +a width and height of zero, and no <a href='undocumented#Color_Space'>Color Space</a>. ### Example @@ -2004,26 +2633,48 @@ SkImageInfo() == reset copy ### See Also -<a href="#SkImageInfo_empty_constructor">SkImageInfo()</a> +<a href='#SkImageInfo_empty_constructor'>SkImageInfo()</a> --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_ByteSizeOverflowed'>ByteSizeOverflowed</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks result of <a href='#SkImageInfo_computeByteSize'>computeByteSize</a> and <a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeByteSize'>computeByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns memory required by pixel buffer with given row bytes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeMinByteSize'>computeMinByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns least memory required by pixel buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_computeOffset'>computeOffset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns byte offset within pixel array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validRowBytes'>validRowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>checks if row bytes is large enough to contain pixel row</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImageInfo_validate'>validate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Image_Info'>Image Info</a> is invalid (debug only)</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkImageInfo_ByteSizeOverflowed">ByteSizeOverflowed</a> | checks result of <a href="#SkImageInfo_computeByteSize">computeByteSize</a> and <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> | -| <a href="#SkImageInfo_computeByteSize">computeByteSize</a> | memory required by pixel buffer with given row bytes | -| <a href="#SkImageInfo_computeMinByteSize">computeMinByteSize</a> | least memory required by pixel buffer | -| <a href="#SkImageInfo_computeOffset">computeOffset</a> | returns byte offset within pixel array | -| <a href="#SkImageInfo_validRowBytes">validRowBytes</a> | checks if row bytes is large enough to contain pixel row | -| <a href="#SkImageInfo_validate">validate</a> | asserts if <a href="#Image_Info">Image Info</a> is invalid (debug only) | -<a name="SkImageInfo_validate"></a> +<a name='SkImageInfo_validate'></a> ## validate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void validate() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkImageInfo_validate'>validate</a>() const </pre> Asserts if internal values are illegal or inconsistent. Only available if @@ -2031,7 +2682,7 @@ SK_DEBUG is defined at compile time. ### See Also -<a href="#SkImageInfo_validRowBytes">validRowBytes</a> <a href="SkBitmap_Reference#SkBitmap_validate">SkBitmap::validate</a> +<a href='#SkImageInfo_validRowBytes'>validRowBytes</a> <a href='SkBitmap_Reference#SkBitmap_validate'>SkBitmap::validate</a> --- diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index ffb003c0d3..6403e07b60 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -1,284 +1,610 @@ SkImage Reference === -# <a name="Image"></a> Image +# <a name='Image'>Image</a> -## <a name="Overview"></a> Overview +# <a name='SkImage'>Class SkImage</a> -## <a name="Overview_Subtopic"></a> Overview Subtopic +## <a name='Constant'>Constant</a> -| name | description | -| --- | --- | -| Constant | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkImage">SkImage</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -| Typedef | types defined by other types | -# <a name="SkImage"></a> Class SkImage -<a href="#Image">Image</a> describes a two dimensional array of pixels to draw. The pixels may be -decoded in a <a href="undocumented#Raster_Bitmap">Raster Bitmap</a>, encoded in a <a href="undocumented#Picture">Picture</a> or compressed data stream, -or located in GPU memory as a <a href="undocumented#GPU_Texture">GPU Texture</a>. +SkImage related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_BitDepth'>BitDepth</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>options for <a href='#SkImage_MakeFromPicture'>MakeFromPicture</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_CachingHint'>CachingHint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>options for <a href='#SkImage_readPixels'>readPixels</a> and <a href='#SkImage_scalePixels'>scalePixels</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allows internally caching decoded and copied pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>disallows internally caching decoded and copied pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_BitDepth_kF16'>BitDepth::kF16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses 16-bit float per <a href='SkColor_Reference#Color'>Color</a> component</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_kRO_LegacyBitmapMode'>kRO LegacyBitmapMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returned bitmap is read-only and immutable</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_BitDepth_kU8'>BitDepth::kU8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses 8-bit unsigned int per <a href='SkColor_Reference#Color'>Color</a> component</td> + </tr> +</table> + -<a href="#Image">Image</a> cannot be modified after it is created. <a href="#Image">Image</a> may allocate additional -storage as needed; for instance, an encoded <a href="#Image">Image</a> may decode when drawn. +## <a name='Typedef'>Typedef</a> -<a href="#Image">Image</a> width and height are greater than zero. Creating an <a href="#Image">Image</a> with zero width -or height returns <a href="#Image">Image</a> equal to nullptr. -<a href="#Image">Image</a> may be created from <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, <a href="SkPixmap_Reference#Pixmap">Pixmap</a>, <a href="SkSurface_Reference#Surface">Surface</a>, <a href="undocumented#Picture">Picture</a>, encoded streams, -<a href="undocumented#GPU_Texture">GPU Texture</a>, <a href="SkImageInfo_Reference#YUV_ColorSpace">YUV ColorSpace</a> data, or hardware buffer. Encoded streams supported +SkImage <code>typedef</code> define a data type. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_BackendTextureReleaseProc'>BackendTextureReleaseProc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>parameter type for <a href='#SkImage_MakeBackendTextureFromSkImage'>MakeBackendTextureFromSkImage</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_RasterReleaseProc'>RasterReleaseProc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>parameter type for <a href='#SkImage_MakeFromRaster'>MakeFromRaster</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_ReleaseContext'>ReleaseContext</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>parameter type for <a href='#SkImage_MakeFromRaster'>MakeFromRaster</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_TextureReleaseProc'>TextureReleaseProc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>parameter type for <a href='#SkImage_MakeFromTexture'>MakeFromTexture</a></td> + </tr> +</table> +<a href='#Image'>Image</a> describes a two dimensional array of pixels to draw. The pixels may be +decoded in a <a href='undocumented#Raster_Bitmap'>Raster Bitmap</a>, encoded in a <a href='undocumented#Picture'>Picture</a> or compressed data stream, +or located in GPU memory as a <a href='undocumented#GPU_Texture'>GPU Texture</a>. + +<a href='#Image'>Image</a> cannot be modified after it is created. <a href='#Image'>Image</a> may allocate additional +storage as needed; for instance, an encoded <a href='#Image'>Image</a> may decode when drawn. + +<a href='#Image'>Image</a> width and height are greater than zero. Creating an <a href='#Image'>Image</a> with zero width +or height returns <a href='#Image'>Image</a> equal to nullptr. + +<a href='#Image'>Image</a> may be created from <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, <a href='SkSurface_Reference#Surface'>Surface</a>, <a href='undocumented#Picture'>Picture</a>, encoded streams, +<a href='undocumented#GPU_Texture'>GPU Texture</a>, <a href='SkImageInfo_Reference#YUV_ColorSpace'>YUV ColorSpace</a> data, or hardware buffer. Encoded streams supported include BMP, GIF, HEIF, ICO, JPEG, PNG, WBMP, WebP. Supported encoding details vary with platform. -## <a name="Raster_Image"></a> Raster Image +## <a name='Raster_Image'>Raster Image</a> -<a href="#Raster_Image">Raster Image</a> pixels are decoded in a <a href="undocumented#Raster_Bitmap">Raster Bitmap</a>. These pixels may be read +<a href='#Raster_Image'>Raster Image</a> pixels are decoded in a <a href='undocumented#Raster_Bitmap'>Raster Bitmap</a>. These pixels may be read directly and in most cases written to, although edited pixels may not be drawn -if <a href="#Image">Image</a> has been copied internally. +if <a href='#Image'>Image</a> has been copied internally. -## <a name="Texture_Image"></a> Texture Image +## <a name='Texture_Image'>Texture Image</a> -<a href="#Texture_Image">Texture Image</a> are located on GPU and pixels are not accessible. <a href="#Texture_Image">Texture Image</a> -are allocated optimally for best performance. <a href="#Raster_Image">Raster Image</a> may -be drawn to <a href="undocumented#GPU_Surface">GPU Surface</a>, but pixels are uploaded from CPU to GPU downgrading +<a href='#Texture_Image'>Texture Image</a> are located on GPU and pixels are not accessible. <a href='#Texture_Image'>Texture Image</a> +are allocated optimally for best performance. <a href='#Raster_Image'>Raster Image</a> may +be drawn to <a href='undocumented#GPU_Surface'>GPU Surface</a>, but pixels are uploaded from CPU to GPU downgrading performance. -## <a name="Lazy_Image"></a> Lazy Image +## <a name='Lazy_Image'>Lazy Image</a> -<a href="#Lazy_Image">Lazy Image</a> defer allocating buffer for <a href="#Image">Image</a> pixels and decoding stream until -<a href="#Image">Image</a> is drawn. <a href="#Lazy_Image">Lazy Image</a> caches result if possible to speed up repeated +<a href='#Lazy_Image'>Lazy Image</a> defer allocating buffer for <a href='#Image'>Image</a> pixels and decoding stream until +<a href='#Image'>Image</a> is drawn. <a href='#Lazy_Image'>Lazy Image</a> caches result if possible to speed up repeated drawing. -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Lazy_Image">Lazy Image</a> | deferred pixel buffer | -| <a href="#Pixels">Pixels</a> | read and write pixel values | -| <a href="#Property">Property</a> | values and attributes | -| <a href="#Raster_Image">Raster Image</a> | pixels decoded in <a href="undocumented#Raster_Bitmap">Raster Bitmap</a> | -| <a href="#Texture_Image">Texture Image</a> | pixels located on GPU | -| <a href="#Utility">Utility</a> | rarely called management functions | - -## <a name="Class_or_Struct"></a> Class or Struct - -| name | description | -| --- | --- | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkImage_MakeBackendTextureFromSkImage">MakeBackendTextureFromSkImage</a> | creates <a href="undocumented#GPU_Texture">GPU Texture</a> from <a href="#Image">Image</a> | -| <a href="#SkImage_MakeCrossContextFromEncoded">MakeCrossContextFromEncoded</a> | creates <a href="#Image">Image</a> from encoded data, and uploads to GPU | -| <a href="#SkImage_MakeCrossContextFromPixmap">MakeCrossContextFromPixmap</a> | creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a>, and uploads to GPU | -| <a href="#SkImage_MakeFromAHardwareBuffer">MakeFromAHardwareBuffer</a> | creates <a href="#Image">Image</a> from Android hardware buffer | -| <a href="#SkImage_MakeFromAdoptedTexture">MakeFromAdoptedTexture</a> | creates <a href="#Image">Image</a> from <a href="undocumented#GPU_Texture">GPU Texture</a>, managed internally | -| <a href="#SkImage_MakeFromBitmap">MakeFromBitmap</a> | creates <a href="#Image">Image</a> from <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, sharing or copying pixels | -| <a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> | creates <a href="#Image">Image</a> from encoded data | -| <a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> | creates <a href="#Image">Image</a> from a stream of data | -| <a href="#SkImage_MakeFromNV12TexturesCopy">MakeFromNV12TexturesCopy</a> | creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#YUV_ColorSpace">YUV ColorSpace</a> data in three planes | -| <a href="#SkImage_MakeFromPicture">MakeFromPicture</a> | creates <a href="#Image">Image</a> from <a href="undocumented#Picture">Picture</a> | -| <a href="#SkImage_MakeFromRaster">MakeFromRaster</a> | creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a>, with release | -| <a href="#SkImage_MakeFromTexture">MakeFromTexture</a> | creates <a href="#Image">Image</a> from <a href="undocumented#GPU_Texture">GPU Texture</a> | -| | <a href="#SkImage_MakeFromTexture">MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk sp<SkColorSpace> colorSpace)</a> | -| | <a href="#SkImage_MakeFromTexture_2">MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk sp<SkColorSpace> colorSpace, TextureReleaseProc textureReleaseProc, ReleaseContext releaseContext)</a> | -| <a href="#SkImage_MakeFromYUVTexturesCopy">MakeFromYUVTexturesCopy</a> | creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#YUV_ColorSpace">YUV ColorSpace</a> data in three planes | -| <a href="#SkImage_MakeRasterCopy">MakeRasterCopy</a> | creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a> and copied pixels | -| <a href="#SkImage_MakeRasterData">MakeRasterData</a> | creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> and shared pixels | -| <a href="#SkImage_asLegacyBitmap">asLegacyBitmap</a> | returns as <a href="undocumented#Raster_Bitmap">Raster Bitmap</a> | -| <a href="#SkImage_makeColorSpace">makeColorSpace</a> | creates <a href="#Image">Image</a> matching <a href="undocumented#Color_Space">Color Space</a> if possible | -| <a href="#SkImage_makeNonTextureImage">makeNonTextureImage</a> | creates <a href="#Image">Image</a> without dependency on <a href="undocumented#GPU_Texture">GPU Texture</a> | -| <a href="#SkImage_makeRasterImage">makeRasterImage</a> | creates <a href="#Image">Image</a> compatible with <a href="undocumented#Raster_Surface">Raster Surface</a> if possible | -| <a href="#SkImage_makeShader">makeShader</a> | creates <a href="undocumented#Shader">Shader</a>, <a href="SkPaint_Reference#Paint">Paint</a> element that can tile <a href="#Image">Image</a> | -| | <a href="#SkImage_makeShader">makeShader(SkShader::TileMode tileMode1, SkShader::TileMode tileMode2, const SkMatrix* localMatrix = nullptr)</a> const | -| | <a href="#SkImage_makeShader_2">makeShader(const SkMatrix* localMatrix = nullptr)</a> const | -| <a href="#SkImage_makeSubset">makeSubset</a> | creates <a href="#Image">Image</a> containing part of original | -| <a href="#SkImage_makeTextureImage">makeTextureImage</a> | creates <a href="#Image">Image</a> matching <a href="undocumented#Color_Space">Color Space</a> if possible | -| <a href="#SkImage_makeWithFilter">makeWithFilter</a> | creates filtered, clipped <a href="#Image">Image</a> | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkImage_MakeBackendTextureFromSkImage">MakeBackendTextureFromSkImage</a> | creates <a href="undocumented#GPU_Texture">GPU Texture</a> from <a href="#Image">Image</a> | -| <a href="#SkImage_MakeCrossContextFromEncoded">MakeCrossContextFromEncoded</a> | creates <a href="#Image">Image</a> from encoded data, and uploads to GPU | -| <a href="#SkImage_MakeCrossContextFromPixmap">MakeCrossContextFromPixmap</a> | creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a>, and uploads to GPU | -| <a href="#SkImage_MakeFromAHardwareBuffer">MakeFromAHardwareBuffer</a> | creates <a href="#Image">Image</a> from Android hardware buffer | -| <a href="#SkImage_MakeFromAdoptedTexture">MakeFromAdoptedTexture</a> | creates <a href="#Image">Image</a> from <a href="undocumented#GPU_Texture">GPU Texture</a>, managed internally | -| <a href="#SkImage_MakeFromBitmap">MakeFromBitmap</a> | creates <a href="#Image">Image</a> from <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, sharing or copying pixels | -| <a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> | creates <a href="#Image">Image</a> from encoded data | -| <a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> | creates <a href="#Image">Image</a> from a stream of data | -| <a href="#SkImage_MakeFromNV12TexturesCopy">MakeFromNV12TexturesCopy</a> | creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#YUV_ColorSpace">YUV ColorSpace</a> data in three planes | -| <a href="#SkImage_MakeFromPicture">MakeFromPicture</a> | creates <a href="#Image">Image</a> from <a href="undocumented#Picture">Picture</a> | -| <a href="#SkImage_MakeFromRaster">MakeFromRaster</a> | creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a>, with release | -| <a href="#SkImage_MakeFromTexture">MakeFromTexture</a> | creates <a href="#Image">Image</a> from <a href="undocumented#GPU_Texture">GPU Texture</a> | -| <a href="#SkImage_MakeFromYUVTexturesCopy">MakeFromYUVTexturesCopy</a> | creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#YUV_ColorSpace">YUV ColorSpace</a> data in three planes | -| <a href="#SkImage_MakeRasterCopy">MakeRasterCopy</a> | creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a> and copied pixels | -| <a href="#SkImage_MakeRasterData">MakeRasterData</a> | creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#Image_Info">Image Info</a> and shared pixels | -| <a href="#SkImage_alphaType">alphaType</a> | returns <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> | -| <a href="#SkImage_asLegacyBitmap">asLegacyBitmap</a> | returns as <a href="undocumented#Raster_Bitmap">Raster Bitmap</a> | -| <a href="#SkImage_bounds">bounds</a> | returns <a href="#SkImage_width">width</a> and <a href="#SkImage_height">height</a> as Rectangle | -| <a href="#SkImage_colorSpace">colorSpace</a> | returns <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImage_colorType">colorType</a> | returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkImage_dimensions">dimensions</a> | returns <a href="#SkImage_width">width</a> and <a href="#SkImage_height">height</a> | -| <a href="#SkImage_encodeToData">encodeToData</a> | returns encoded <a href="#Image">Image</a> as <a href="undocumented#SkData">SkData</a> | -| <a href="#SkImage_getBackendTexture">getBackendTexture</a> | returns GPU reference to <a href="#Image">Image</a> as texture | -| <a href="#SkImage_height">height</a> | returns pixel row count | -| <a href="#SkImage_isAlphaOnly">isAlphaOnly</a> | returns if pixels represent a transparency mask | -| <a href="#SkImage_isLazyGenerated">isLazyGenerated</a> | returns if <a href="#Image">Image</a> is created as needed | -| <a href="#SkImage_isOpaque">isOpaque</a> | returns if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> | -| <a href="#SkImage_isTextureBacked">isTextureBacked</a> | returns if <a href="#Image">Image</a> was created from <a href="undocumented#GPU_Texture">GPU Texture</a> | -| <a href="#SkImage_isValid">isValid</a> | returns if <a href="#Image">Image</a> can draw to <a href="undocumented#Raster_Surface">Raster Surface</a> or <a href="undocumented#GPU_Context">GPU Context</a> | -| <a href="#SkImage_makeColorSpace">makeColorSpace</a> | creates <a href="#Image">Image</a> matching <a href="undocumented#Color_Space">Color Space</a> if possible | -| <a href="#SkImage_makeNonTextureImage">makeNonTextureImage</a> | creates <a href="#Image">Image</a> without dependency on <a href="undocumented#GPU_Texture">GPU Texture</a> | -| <a href="#SkImage_makeRasterImage">makeRasterImage</a> | creates <a href="#Image">Image</a> compatible with <a href="undocumented#Raster_Surface">Raster Surface</a> if possible | -| <a href="#SkImage_makeShader">makeShader</a> | creates <a href="undocumented#Shader">Shader</a>, <a href="SkPaint_Reference#Paint">Paint</a> element that can tile <a href="#Image">Image</a> | -| <a href="#SkImage_makeSubset">makeSubset</a> | creates <a href="#Image">Image</a> containing part of original | -| <a href="#SkImage_makeTextureImage">makeTextureImage</a> | creates <a href="#Image">Image</a> matching <a href="undocumented#Color_Space">Color Space</a> if possible | -| <a href="#SkImage_makeWithFilter">makeWithFilter</a> | creates filtered, clipped <a href="#Image">Image</a> | -| <a href="#SkImage_peekPixels">peekPixels</a> | returns <a href="SkPixmap_Reference#Pixmap">Pixmap</a> if possible | -| <a href="#SkImage_readPixels">readPixels</a> | copies and converts pixels | -| <a href="#SkImage_refColorSpace">refColorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImage_refEncodedData">refEncodedData</a> | returns <a href="#Image">Image</a> encoded in <a href="undocumented#SkData">SkData</a> if present | -| <a href="#SkImage_scalePixels">scalePixels</a> | scales and converts one <a href="#Image">Image</a> to another | -| <a href="#SkImage_toString">toString</a> | converts <a href="#Image">Image</a> to machine readable form | -| <a href="#SkImage_uniqueID">uniqueID</a> | identifier for <a href="#Image">Image</a> | -| <a href="#SkImage_width">width</a> | returns pixel column count | - -<a name="SkImage_MakeRasterCopy"></a> +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkImage'>SkImage</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Typedef'>Typedef Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>types defined by other types</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkImage global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Lazy_Image'>Lazy Image</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>deferred pixel buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Pixels'>Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>read and write pixel values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>values and attributes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Raster_Image'>Raster Image</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixels decoded in <a href='undocumented#Raster_Bitmap'>Raster Bitmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Texture_Image'>Texture Image</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pixels located on GPU</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkImage can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeBackendTextureFromSkImage'>MakeBackendTextureFromSkImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#GPU_Texture'>GPU Texture</a> from <a href='#Image'>Image</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeCrossContextFromEncoded'>MakeCrossContextFromEncoded</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from encoded data, and uploads to GPU</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeCrossContextFromPixmap'>MakeCrossContextFromPixmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, and uploads to GPU</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromAHardwareBuffer'>MakeFromAHardwareBuffer</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from Android hardware buffer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromAdoptedTexture'>MakeFromAdoptedTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='undocumented#GPU_Texture'>GPU Texture</a>, managed internally</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromBitmap'>MakeFromBitmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, sharing or copying pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from encoded data</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from a stream of data</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromNV12TexturesCopy'>MakeFromNV12TexturesCopy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#YUV_ColorSpace'>YUV ColorSpace</a> data in three planes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromPicture'>MakeFromPicture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='undocumented#Picture'>Picture</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromRaster'>MakeFromRaster</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, with release</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromTexture'>MakeFromTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='undocumented#GPU_Texture'>GPU Texture</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromTexture'>MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk sp<SkColorSpace> colorSpace)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromTexture_2'>MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk sp<SkColorSpace> colorSpace, TextureReleaseProc textureReleaseProc, ReleaseContext releaseContext)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromYUVTexturesCopy'>MakeFromYUVTexturesCopy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#YUV_ColorSpace'>YUV ColorSpace</a> data in three planes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeRasterCopy'>MakeRasterCopy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> and copied pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeRasterData'>MakeRasterData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> and shared pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_asLegacyBitmap'>asLegacyBitmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns as <a href='undocumented#Raster_Bitmap'>Raster Bitmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeColorSpace'>makeColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> matching <a href='undocumented#Color_Space'>Color Space</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeNonTextureImage'>makeNonTextureImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> without dependency on <a href='undocumented#GPU_Texture'>GPU Texture</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeRasterImage'>makeRasterImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> compatible with <a href='undocumented#Raster_Surface'>Raster Surface</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeShader'>makeShader</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Shader'>Shader</a>, <a href='SkPaint_Reference#Paint'>Paint</a> element that can tile <a href='#Image'>Image</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeShader'>makeShader(SkShader::TileMode tileMode1, SkShader::TileMode tileMode2, const SkMatrix* localMatrix = nullptr)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeShader_2'>makeShader(const SkMatrix* localMatrix = nullptr)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeSubset'>makeSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> containing part of original</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeTextureImage'>makeTextureImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> matching <a href='undocumented#Color_Space'>Color Space</a> if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeWithFilter'>makeWithFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates filtered, clipped <a href='#Image'>Image</a></td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkImage member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeBackendTextureFromSkImage'>MakeBackendTextureFromSkImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#GPU_Texture'>GPU Texture</a> from <a href='#Image'>Image</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeCrossContextFromEncoded'>MakeCrossContextFromEncoded</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from encoded data, and uploads to GPU</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeCrossContextFromPixmap'>MakeCrossContextFromPixmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, and uploads to GPU</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromAHardwareBuffer'>MakeFromAHardwareBuffer</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from Android hardware buffer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromAdoptedTexture'>MakeFromAdoptedTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='undocumented#GPU_Texture'>GPU Texture</a>, managed internally</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromBitmap'>MakeFromBitmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, sharing or copying pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from encoded data</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from a stream of data</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromNV12TexturesCopy'>MakeFromNV12TexturesCopy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#YUV_ColorSpace'>YUV ColorSpace</a> data in three planes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromPicture'>MakeFromPicture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='undocumented#Picture'>Picture</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromRaster'>MakeFromRaster</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, with release</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromTexture'>MakeFromTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='undocumented#GPU_Texture'>GPU Texture</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeFromYUVTexturesCopy'>MakeFromYUVTexturesCopy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#YUV_ColorSpace'>YUV ColorSpace</a> data in three planes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeRasterCopy'>MakeRasterCopy</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> and copied pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_MakeRasterData'>MakeRasterData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> and shared pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_asLegacyBitmap'>asLegacyBitmap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns as <a href='undocumented#Raster_Bitmap'>Raster Bitmap</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImage_width'>width</a> and <a href='#SkImage_height'>height</a> as Rectangle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_dimensions'>dimensions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImage_width'>width</a> and <a href='#SkImage_height'>height</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_encodeToData'>encodeToData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns encoded <a href='#Image'>Image</a> as <a href='undocumented#SkData'>SkData</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_getBackendTexture'>getBackendTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns GPU reference to <a href='#Image'>Image</a> as texture</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isAlphaOnly'>isAlphaOnly</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if pixels represent a transparency mask</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isLazyGenerated'>isLazyGenerated</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Image'>Image</a> is created as needed</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isTextureBacked'>isTextureBacked</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Image'>Image</a> was created from <a href='undocumented#GPU_Texture'>GPU Texture</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isValid'>isValid</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Image'>Image</a> can draw to <a href='undocumented#Raster_Surface'>Raster Surface</a> or <a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeColorSpace'>makeColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> matching <a href='undocumented#Color_Space'>Color Space</a> if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeNonTextureImage'>makeNonTextureImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> without dependency on <a href='undocumented#GPU_Texture'>GPU Texture</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeRasterImage'>makeRasterImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> compatible with <a href='undocumented#Raster_Surface'>Raster Surface</a> if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeShader'>makeShader</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Shader'>Shader</a>, <a href='SkPaint_Reference#Paint'>Paint</a> element that can tile <a href='#Image'>Image</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeSubset'>makeSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> containing part of original</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeTextureImage'>makeTextureImage</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Image'>Image</a> matching <a href='undocumented#Color_Space'>Color Space</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_makeWithFilter'>makeWithFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates filtered, clipped <a href='#Image'>Image</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_refColorSpace'>refColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_refEncodedData'>refEncodedData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Image'>Image</a> encoded in <a href='undocumented#SkData'>SkData</a> if present</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_scalePixels'>scalePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and converts one <a href='#Image'>Image</a> to another</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Image'>Image</a> to machine readable form</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_uniqueID'>uniqueID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns identifier for <a href='#Image'>Image</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> +</table> + + +<a name='SkImage_MakeRasterCopy'></a> ## MakeRasterCopy -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeRasterCopy(const SkPixmap& pixmap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeRasterCopy'>MakeRasterCopy</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& pixmap) </pre> -Creates <a href="#Image">Image</a> from <a href="SkPixmap_Reference#Pixmap">Pixmap</a> and copy of pixels. Since pixels are copied, <a href="SkPixmap_Reference#Pixmap">Pixmap</a> -pixels may be modified or deleted without affecting <a href="#Image">Image</a>. +Creates <a href='#Image'>Image</a> from <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> and copy of pixels. Since pixels are copied, <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> +pixels may be modified or deleted without affecting <a href='#Image'>Image</a>. -<a href="#Image">Image</a> is returned if <a href="SkPixmap_Reference#Pixmap">Pixmap</a> is valid. Valid <a href="SkPixmap_Reference#Pixmap">Pixmap</a> parameters include: +<a href='#Image'>Image</a> is returned if <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> is valid. Valid <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> parameters include: dimensions are greater than zero; each dimension fits in 29 bits; -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> are valid, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> are valid, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; row bytes are large enough to hold one row of pixels; pixel address is not nullptr. ### Parameters -<table> <tr> <td><a name="SkImage_MakeRasterCopy_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixel address, and row bytes</td> +<table> <tr> <td><a name='SkImage_MakeRasterCopy_pixmap'><code><strong>pixmap</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixel address, and row bytes</td> </tr> </table> ### Return Value -copy of <a href="SkPixmap_Reference#Pixmap">Pixmap</a> pixels, or nullptr +copy of <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> pixels, or nullptr ### Example -<div><fiddle-embed name="513afec5795a9504ebf6af5373d16b6b"><div>Draw a five by five bitmap, and draw a copy in an <a href="#Image">Image</a>. Editing the <a href="#SkImage_MakeRasterCopy_pixmap">pixmap</a> -alters the bitmap draw, but does not alter the <a href="#Image">Image</a> draw since the <a href="#Image">Image</a> +<div><fiddle-embed name="513afec5795a9504ebf6af5373d16b6b"><div>Draw a five by five bitmap, and draw a copy in an <a href='#Image'>Image</a>. Editing the <a href='#SkImage_MakeRasterCopy_pixmap'>pixmap</a> +alters the bitmap draw, but does not alter the <a href='#Image'>Image</a> draw since the <a href='#Image'>Image</a> contains a copy of the pixels. </div></fiddle-embed></div> ### See Also -<a href="#SkImage_MakeRasterData">MakeRasterData</a> <a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> +<a href='#SkImage_MakeRasterData'>MakeRasterData</a> <a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a> --- -<a name="SkImage_MakeRasterData"></a> +<a name='SkImage_MakeRasterData'></a> ## MakeRasterData -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeRasterData(const SkImageInfo& info, sk_sp<SkData> pixels, size_t rowBytes) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeRasterData'>MakeRasterData</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> pixels, size_t rowBytes) </pre> -Creates <a href="#Image">Image</a> from <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, sharing <a href="#SkImage_MakeRasterData_pixels">pixels</a>. +Creates <a href='#Image'>Image</a> from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, sharing <a href='#SkImage_MakeRasterData_pixels'>pixels</a>. -<a href="#Image">Image</a> is returned if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> is valid. Valid <a href="SkImageInfo_Reference#Image_Info">Image Info</a> parameters include: +<a href='#Image'>Image</a> is returned if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> is valid. Valid <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> parameters include: dimensions are greater than zero; each dimension fits in 29 bits; -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> are valid, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; -<a href="#SkImage_MakeRasterData_rowBytes">rowBytes</a> are large enough to hold one row of <a href="#SkImage_MakeRasterData_pixels">pixels</a>; -<a href="#SkImage_MakeRasterData_pixels">pixels</a> is not nullptr, and contains enough data for <a href="#Image">Image</a>. +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> are valid, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; +<a href='#SkImage_MakeRasterData_rowBytes'>rowBytes</a> are large enough to hold one row of <a href='#SkImage_MakeRasterData_pixels'>pixels</a>; +<a href='#SkImage_MakeRasterData_pixels'>pixels</a> is not nullptr, and contains enough data for <a href='#Image'>Image</a>. ### Parameters -<table> <tr> <td><a name="SkImage_MakeRasterData_info"> <code><strong>info </strong></code> </a></td> <td> -contains width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkImage_MakeRasterData_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -address or pixel storage</td> - </tr> <tr> <td><a name="SkImage_MakeRasterData_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of pixel row or larger</td> +<table> <tr> <td><a name='SkImage_MakeRasterData_info'><code><strong>info</strong></code></a></td> + <td>contains width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkImage_MakeRasterData_pixels'><code><strong>pixels</strong></code></a></td> + <td>address or pixel storage</td> + </tr> + <tr> <td><a name='SkImage_MakeRasterData_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of pixel row or larger</td> </tr> </table> ### Return Value -<a href="#Image">Image</a> sharing <a href="#SkImage_MakeRasterData_pixels">pixels</a>, or nullptr +<a href='#Image'>Image</a> sharing <a href='#SkImage_MakeRasterData_pixels'>pixels</a>, or nullptr ### Example -<div><fiddle-embed name="367bdf6ee6ef2482eea95d4a9887c9b0"></fiddle-embed></div> +<div><fiddle-embed name="22e7ce79ab2fe94252d23319f2258127"></fiddle-embed></div> ### See Also -<a href="#SkImage_MakeRasterCopy">MakeRasterCopy</a> <a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> +<a href='#SkImage_MakeRasterCopy'>MakeRasterCopy</a> <a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a> --- -Caller data passed to <a href="#SkImage_RasterReleaseProc">RasterReleaseProc</a>; may be nullptr. +# <a name='SkImage_ReleaseContext'>Typedef SkImage::ReleaseContext</a> +Caller data passed to <a href='#SkImage_RasterReleaseProc'>RasterReleaseProc</a>; may be nullptr. ### See Also -<a href="#SkImage_MakeFromRaster">MakeFromRaster</a> <a href="#SkImage_RasterReleaseProc">RasterReleaseProc</a> +<a href='#SkImage_MakeFromRaster'>MakeFromRaster</a> <a href='#SkImage_RasterReleaseProc'>RasterReleaseProc</a> -Function called when <a href="#Image">Image</a> no longer shares pixels. <a href="#SkImage_ReleaseContext">ReleaseContext</a> is -provided by caller when <a href="#Image">Image</a> is created, and may be nullptr. +# <a name='SkImage_RasterReleaseProc'>Typedef SkImage::RasterReleaseProc</a> +Function called when <a href='#Image'>Image</a> no longer shares pixels. <a href='#SkImage_ReleaseContext'>ReleaseContext</a> is +provided by caller when <a href='#Image'>Image</a> is created, and may be nullptr. ### See Also -<a href="#SkImage_ReleaseContext">ReleaseContext</a> <a href="#SkImage_MakeFromRaster">MakeFromRaster</a> +<a href='#SkImage_ReleaseContext'>ReleaseContext</a> <a href='#SkImage_MakeFromRaster'>MakeFromRaster</a> -<a name="SkImage_MakeFromRaster"></a> +<a name='SkImage_MakeFromRaster'></a> ## MakeFromRaster -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromRaster(const SkPixmap& pixmap, RasterReleaseProc rasterReleaseProc, - ReleaseContext releaseContext) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromRaster'>MakeFromRaster</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& pixmap, <a href='#SkImage_RasterReleaseProc'>RasterReleaseProc</a> rasterReleaseProc, + <a href='#SkImage_ReleaseContext'>ReleaseContext</a> releaseContext) </pre> -Creates <a href="#Image">Image</a> from <a href="#SkImage_MakeFromRaster_pixmap">pixmap</a>, sharing <a href="SkPixmap_Reference#Pixmap">Pixmap</a> pixels. <a href="#Pixels">Pixels</a> must remain valid and -unchanged until <a href="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> is called. <a href="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> is passed -<a href="#SkImage_MakeFromRaster_releaseContext">releaseContext</a> when <a href="#Image">Image</a> is deleted or no longer refers to <a href="#SkImage_MakeFromRaster_pixmap">pixmap</a> pixels. +Creates <a href='#Image'>Image</a> from <a href='#SkImage_MakeFromRaster_pixmap'>pixmap</a>, sharing <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> pixels. <a href='#Pixels'>Pixels</a> must remain valid and +unchanged until <a href='#SkImage_MakeFromRaster_rasterReleaseProc'>rasterReleaseProc</a> is called. <a href='#SkImage_MakeFromRaster_rasterReleaseProc'>rasterReleaseProc</a> is passed +<a href='#SkImage_MakeFromRaster_releaseContext'>releaseContext</a> when <a href='#Image'>Image</a> is deleted or no longer refers to <a href='#SkImage_MakeFromRaster_pixmap'>pixmap</a> pixels. -Pass nullptr for <a href="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> to share <a href="SkPixmap_Reference#Pixmap">Pixmap</a> without requiring a callback -when <a href="#Image">Image</a> is released. Pass nullptr for <a href="#SkImage_MakeFromRaster_releaseContext">releaseContext</a> if <a href="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a> +Pass nullptr for <a href='#SkImage_MakeFromRaster_rasterReleaseProc'>rasterReleaseProc</a> to share <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> without requiring a callback +when <a href='#Image'>Image</a> is released. Pass nullptr for <a href='#SkImage_MakeFromRaster_releaseContext'>releaseContext</a> if <a href='#SkImage_MakeFromRaster_rasterReleaseProc'>rasterReleaseProc</a> does not require state. -<a href="#Image">Image</a> is returned if <a href="#SkImage_MakeFromRaster_pixmap">pixmap</a> is valid. Valid <a href="SkPixmap_Reference#Pixmap">Pixmap</a> parameters include: +<a href='#Image'>Image</a> is returned if <a href='#SkImage_MakeFromRaster_pixmap'>pixmap</a> is valid. Valid <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> parameters include: dimensions are greater than zero; each dimension fits in 29 bits; -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> are valid, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> are valid, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; row bytes are large enough to hold one row of pixels; pixel address is not nullptr. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromRaster_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixel address, and row bytes</td> - </tr> <tr> <td><a name="SkImage_MakeFromRaster_rasterReleaseProc"> <code><strong>rasterReleaseProc </strong></code> </a></td> <td> -function called when pixels can be released; or nullptr</td> - </tr> <tr> <td><a name="SkImage_MakeFromRaster_releaseContext"> <code><strong>releaseContext </strong></code> </a></td> <td> -state passed to <a href="#SkImage_MakeFromRaster_rasterReleaseProc">rasterReleaseProc</a>; or nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromRaster_pixmap'><code><strong>pixmap</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixel address, and row bytes</td> + </tr> + <tr> <td><a name='SkImage_MakeFromRaster_rasterReleaseProc'><code><strong>rasterReleaseProc</strong></code></a></td> + <td>function called when pixels can be released; or nullptr</td> + </tr> + <tr> <td><a name='SkImage_MakeFromRaster_releaseContext'><code><strong>releaseContext</strong></code></a></td> + <td>state passed to <a href='#SkImage_MakeFromRaster_rasterReleaseProc'>rasterReleaseProc</a>; or nullptr</td> </tr> </table> ### Return Value -<a href="#Image">Image</a> sharing <a href="#SkImage_MakeFromRaster_pixmap">pixmap</a> +<a href='#Image'>Image</a> sharing <a href='#SkImage_MakeFromRaster_pixmap'>pixmap</a> ### Example @@ -295,122 +621,124 @@ after reset: 1 ### See Also -<a href="#SkImage_MakeRasterCopy">MakeRasterCopy</a> <a href="#SkImage_MakeRasterData">MakeRasterData</a> <a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> <a href="#SkImage_RasterReleaseProc">RasterReleaseProc</a> <a href="#SkImage_ReleaseContext">ReleaseContext</a> +<a href='#SkImage_MakeRasterCopy'>MakeRasterCopy</a> <a href='#SkImage_MakeRasterData'>MakeRasterData</a> <a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a> <a href='#SkImage_RasterReleaseProc'>RasterReleaseProc</a> <a href='#SkImage_ReleaseContext'>ReleaseContext</a> --- -<a name="SkImage_MakeFromBitmap"></a> +<a name='SkImage_MakeFromBitmap'></a> ## MakeFromBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromBitmap(const SkBitmap& bitmap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromBitmap'>MakeFromBitmap</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& bitmap) </pre> -Creates <a href="#Image">Image</a> from <a href="#SkImage_MakeFromBitmap_bitmap">bitmap</a>, sharing or copying <a href="#SkImage_MakeFromBitmap_bitmap">bitmap</a> pixels. If the <a href="#SkImage_MakeFromBitmap_bitmap">bitmap</a> +Creates <a href='#Image'>Image</a> from <a href='#SkImage_MakeFromBitmap_bitmap'>bitmap</a>, sharing or copying <a href='#SkImage_MakeFromBitmap_bitmap'>bitmap</a> pixels. If the <a href='#SkImage_MakeFromBitmap_bitmap'>bitmap</a> is marked immutable, and its pixel memory is shareable, it may be shared instead of copied. -<a href="#Image">Image</a> is returned if <a href="#SkImage_MakeFromBitmap_bitmap">bitmap</a> is valid. Valid <a href="SkBitmap_Reference#Bitmap">Bitmap</a> parameters include: +<a href='#Image'>Image</a> is returned if <a href='#SkImage_MakeFromBitmap_bitmap'>bitmap</a> is valid. Valid <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> parameters include: dimensions are greater than zero; each dimension fits in 29 bits; -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> are valid, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> are valid, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; row bytes are large enough to hold one row of pixels; pixel address is not nullptr. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromBitmap_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>, row bytes, and pixels</td> +<table> <tr> <td><a name='SkImage_MakeFromBitmap_bitmap'><code><strong>bitmap</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, row bytes, and pixels</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example -<div><fiddle-embed name="cf2cf53321e4e6a77c2841bfbc0ef707"><div>The first <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is shared; writing to the pixel memory changes the first -<a href="#Image">Image</a>. -The second <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is marked immutable, and is copied; writing to the pixel -memory does not alter the second <a href="#Image">Image</a>. +<div><fiddle-embed name="cf2cf53321e4e6a77c2841bfbc0ef707"><div>The first <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is shared; writing to the pixel memory changes the first +<a href='#Image'>Image</a>. +The second <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is marked immutable, and is copied; writing to the pixel +memory does not alter the second <a href='#Image'>Image</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkImage_MakeFromRaster">MakeFromRaster</a> <a href="#SkImage_MakeRasterCopy">MakeRasterCopy</a> <a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> <a href="#SkImage_MakeRasterData">MakeRasterData</a> +<a href='#SkImage_MakeFromRaster'>MakeFromRaster</a> <a href='#SkImage_MakeRasterCopy'>MakeRasterCopy</a> <a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a> <a href='#SkImage_MakeRasterData'>MakeRasterData</a> --- -<a name="SkImage_MakeFromGenerator"></a> +<a name='SkImage_MakeFromGenerator'></a> ## MakeFromGenerator -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromGenerator(std::unique_ptr<SkImageGenerator> imageGenerator, - const SkIRect* subset = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a>(std::unique_ptr<<a href='undocumented#SkImageGenerator'>SkImageGenerator</a>> imageGenerator, + const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>* subset = nullptr) </pre> -Creates <a href="#Image">Image</a> from data returned by <a href="#SkImage_MakeFromGenerator_imageGenerator">imageGenerator</a>. Generated data is owned by <a href="#Image">Image</a> and may not +Creates <a href='#Image'>Image</a> from data returned by <a href='#SkImage_MakeFromGenerator_imageGenerator'>imageGenerator</a>. Generated data is owned by <a href='#Image'>Image</a> and may not be shared or accessed. -<a href="#SkImage_MakeFromGenerator_subset">subset</a> allows selecting a portion of the full image. Pass nullptr to select the entire image; -otherwise, <a href="#SkImage_MakeFromGenerator_subset">subset</a> must be contained by image bounds. +<a href='#SkImage_MakeFromGenerator_subset'>subset</a> allows selecting a portion of the full image. Pass nullptr to select the entire image; +otherwise, <a href='#SkImage_MakeFromGenerator_subset'>subset</a> must be contained by image bounds. -<a href="#Image">Image</a> is returned if generator data is valid. Valid data parameters vary by type of data +<a href='#Image'>Image</a> is returned if generator data is valid. Valid data parameters vary by type of data and platform. -<a href="#SkImage_MakeFromGenerator_imageGenerator">imageGenerator</a> may wrap <a href="undocumented#Picture">Picture</a> data, codec data, or custom data. +<a href='#SkImage_MakeFromGenerator_imageGenerator'>imageGenerator</a> may wrap <a href='undocumented#Picture'>Picture</a> data, codec data, or custom data. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromGenerator_imageGenerator"> <code><strong>imageGenerator </strong></code> </a></td> <td> -stock or custom routines to retrieve <a href="#Image">Image</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromGenerator_subset"> <code><strong>subset </strong></code> </a></td> <td> -bounds of returned <a href="#Image">Image</a>; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromGenerator_imageGenerator'><code><strong>imageGenerator</strong></code></a></td> + <td>stock or custom routines to retrieve <a href='#Image'>Image</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromGenerator_subset'><code><strong>subset</strong></code></a></td> + <td>bounds of returned <a href='#Image'>Image</a>; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example -<div><fiddle-embed name="c2fec0746f88ca34d7dce59dd9bdef9e"><div>The generator returning <a href="undocumented#Picture">Picture</a> cannot be shared; std::move transfers ownership to generated <a href="#Image">Image</a>. +<div><fiddle-embed name="c2fec0746f88ca34d7dce59dd9bdef9e"><div>The generator returning <a href='undocumented#Picture'>Picture</a> cannot be shared; std::move transfers ownership to generated <a href='#Image'>Image</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> +<a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a> --- -<a name="SkImage_MakeFromEncoded"></a> +<a name='SkImage_MakeFromEncoded'></a> ## MakeFromEncoded -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromEncoded(sk_sp<SkData> encoded, const SkIRect* subset = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> encoded, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>* subset = nullptr) </pre> -Creates <a href="#Image">Image</a> from <a href="#SkImage_MakeFromEncoded_encoded">encoded</a> data. -<a href="#SkImage_MakeFromEncoded_subset">subset</a> allows selecting a portion of the full image. Pass nullptr to select the entire image; -otherwise, <a href="#SkImage_MakeFromEncoded_subset">subset</a> must be contained by image bounds. +Creates <a href='#Image'>Image</a> from <a href='#SkImage_MakeFromEncoded_encoded'>encoded</a> data. +<a href='#SkImage_MakeFromEncoded_subset'>subset</a> allows selecting a portion of the full image. Pass nullptr to select the entire image; +otherwise, <a href='#SkImage_MakeFromEncoded_subset'>subset</a> must be contained by image bounds. -<a href="#Image">Image</a> is returned if format of the <a href="#SkImage_MakeFromEncoded_encoded">encoded</a> data is recognized and supported. +<a href='#Image'>Image</a> is returned if format of the <a href='#SkImage_MakeFromEncoded_encoded'>encoded</a> data is recognized and supported. Recognized formats vary by platform. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromEncoded_encoded"> <code><strong>encoded </strong></code> </a></td> <td> -data of <a href="#Image">Image</a> to decode</td> - </tr> <tr> <td><a name="SkImage_MakeFromEncoded_subset"> <code><strong>subset </strong></code> </a></td> <td> -bounds of returned <a href="#Image">Image</a>; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromEncoded_encoded'><code><strong>encoded</strong></code></a></td> + <td>data of <a href='#Image'>Image</a> to decode</td> + </tr> + <tr> <td><a name='SkImage_MakeFromEncoded_subset'><code><strong>subset</strong></code></a></td> + <td>bounds of returned <a href='#Image'>Image</a>; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -418,49 +746,61 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromGenerator">MakeFromGenerator</a> +<a href='#SkImage_MakeFromGenerator'>MakeFromGenerator</a> --- -<a name="SkImage_MakeFromTexture"></a> +# <a name='SkImage_TextureReleaseProc'>Typedef SkImage::TextureReleaseProc</a> +User function called when supplied texture may be deleted. + +### See Also + +<a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> + +<a name='SkImage_MakeFromTexture'></a> ## MakeFromTexture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, - GrSurfaceOrigin origin, SkColorType colorType, - SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromTexture'>MakeFromTexture</a>(<a href='undocumented#GrContext'>GrContext</a>* context, const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> <a href='#SkImage_colorType'>colorType</a>, + <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkImage_alphaType'>alphaType</a>, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a>) </pre> -Creates <a href="#Image">Image</a> from <a href="undocumented#GPU_Texture">GPU Texture</a> associated with <a href="#SkImage_MakeFromTexture_context">context</a>. Caller is responsible for -managing the lifetime of <a href="undocumented#GPU_Texture">GPU Texture</a>. +Creates <a href='#Image'>Image</a> from <a href='undocumented#GPU_Texture'>GPU Texture</a> associated with <a href='#SkImage_MakeFromTexture_context'>context</a>. Caller is responsible for +managing the lifetime of <a href='undocumented#GPU_Texture'>GPU Texture</a>. -<a href="#Image">Image</a> is returned if format of <a href="#SkImage_MakeFromTexture_backendTexture">backendTexture</a> is recognized and supported. +<a href='#Image'>Image</a> is returned if format of <a href='#SkImage_MakeFromTexture_backendTexture'>backendTexture</a> is recognized and supported. Recognized formats vary by GPU back-end. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromTexture_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_backendTexture"> <code><strong>backendTexture </strong></code> </a></td> <td> -texture residing on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_origin"> <code><strong>origin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_alphaType"> <code><strong>alphaType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromTexture_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_backendTexture'><code><strong>backendTexture</strong></code></a></td> + <td>texture residing on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_origin'><code><strong>origin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_alphaType'><code><strong>alphaType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -469,55 +809,62 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromAdoptedTexture">MakeFromAdoptedTexture</a> <a href="SkSurface_Reference#SkSurface_MakeFromBackendTexture">SkSurface::MakeFromBackendTexture</a> +<a href='#SkImage_MakeFromAdoptedTexture'>MakeFromAdoptedTexture</a> <a href='SkSurface_Reference#SkSurface_MakeFromBackendTexture'>SkSurface::MakeFromBackendTexture</a> --- -<a name="SkImage_MakeFromTexture_2"></a> +<a name='SkImage_MakeFromTexture_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromTexture(GrContext* context, const GrBackendTexture& backendTexture, - GrSurfaceOrigin origin, SkColorType colorType, - SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace, - TextureReleaseProc textureReleaseProc, - ReleaseContext releaseContext) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromTexture'>MakeFromTexture</a>(<a href='undocumented#GrContext'>GrContext</a>* context, const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> <a href='#SkImage_colorType'>colorType</a>, + <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkImage_alphaType'>alphaType</a>, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a>, + <a href='#SkImage_TextureReleaseProc'>TextureReleaseProc</a> textureReleaseProc, + <a href='#SkImage_ReleaseContext'>ReleaseContext</a> releaseContext) </pre> -Creates <a href="#Image">Image</a> from <a href="undocumented#GPU_Texture">GPU Texture</a> associated with <a href="#SkImage_MakeFromTexture_2_context">context</a>. <a href="undocumented#GPU_Texture">GPU Texture</a> must stay -valid and unchanged until <a href="#SkImage_MakeFromTexture_2_textureReleaseProc">textureReleaseProc</a> is called. <a href="#SkImage_MakeFromTexture_2_textureReleaseProc">textureReleaseProc</a> is -passed <a href="#SkImage_MakeFromTexture_2_releaseContext">releaseContext</a> when <a href="#Image">Image</a> is deleted or no longer refers to texture. +Creates <a href='#Image'>Image</a> from <a href='undocumented#GPU_Texture'>GPU Texture</a> associated with <a href='#SkImage_MakeFromTexture_2_context'>context</a>. <a href='undocumented#GPU_Texture'>GPU Texture</a> must stay +valid and unchanged until <a href='#SkImage_MakeFromTexture_2_textureReleaseProc'>textureReleaseProc</a> is called. <a href='#SkImage_MakeFromTexture_2_textureReleaseProc'>textureReleaseProc</a> is +passed <a href='#SkImage_MakeFromTexture_2_releaseContext'>releaseContext</a> when <a href='#Image'>Image</a> is deleted or no longer refers to texture. -<a href="#Image">Image</a> is returned if format of <a href="#SkImage_MakeFromTexture_2_backendTexture">backendTexture</a> is recognized and supported. +<a href='#Image'>Image</a> is returned if format of <a href='#SkImage_MakeFromTexture_2_backendTexture'>backendTexture</a> is recognized and supported. Recognized formats vary by GPU back-end. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromTexture_2_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_backendTexture"> <code><strong>backendTexture </strong></code> </a></td> <td> -texture residing on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_origin"> <code><strong>origin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_alphaType"> <code><strong>alphaType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_textureReleaseProc"> <code><strong>textureReleaseProc </strong></code> </a></td> <td> -function called when texture can be released</td> - </tr> <tr> <td><a name="SkImage_MakeFromTexture_2_releaseContext"> <code><strong>releaseContext </strong></code> </a></td> <td> -state passed to <a href="#SkImage_MakeFromTexture_2_textureReleaseProc">textureReleaseProc</a></td> +<table> <tr> <td><a name='SkImage_MakeFromTexture_2_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_backendTexture'><code><strong>backendTexture</strong></code></a></td> + <td>texture residing on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_origin'><code><strong>origin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_alphaType'><code><strong>alphaType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_textureReleaseProc'><code><strong>textureReleaseProc</strong></code></a></td> + <td>function called when texture can be released</td> + </tr> + <tr> <td><a name='SkImage_MakeFromTexture_2_releaseContext'><code><strong>releaseContext</strong></code></a></td> + <td>state passed to <a href='#SkImage_MakeFromTexture_2_textureReleaseProc'>textureReleaseProc</a></td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -525,55 +872,59 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromAdoptedTexture">MakeFromAdoptedTexture</a> <a href="SkSurface_Reference#SkSurface_MakeFromBackendTexture">SkSurface::MakeFromBackendTexture</a> +<a href='#SkImage_MakeFromAdoptedTexture'>MakeFromAdoptedTexture</a> <a href='SkSurface_Reference#SkSurface_MakeFromBackendTexture'>SkSurface::MakeFromBackendTexture</a> --- -<a name="SkImage_MakeCrossContextFromEncoded"></a> +<a name='SkImage_MakeCrossContextFromEncoded'></a> ## MakeCrossContextFromEncoded -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeCrossContextFromEncoded(GrContext* context, sk_sp<SkData> data, - bool buildMips, SkColorSpace* dstColorSpace, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeCrossContextFromEncoded'>MakeCrossContextFromEncoded</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> data, + bool buildMips, <a href='undocumented#SkColorSpace'>SkColorSpace</a>* dstColorSpace, bool limitToMaxTextureSize = false) </pre> -Creates <a href="#Image">Image</a> from encoded <a href="#SkImage_MakeCrossContextFromEncoded_data">data</a>. <a href="#Image">Image</a> is uploaded to GPU back-end using <a href="#SkImage_MakeCrossContextFromEncoded_context">context</a>. +Creates <a href='#Image'>Image</a> from encoded <a href='#SkImage_MakeCrossContextFromEncoded_data'>data</a>. <a href='#Image'>Image</a> is uploaded to GPU back-end using <a href='#SkImage_MakeCrossContextFromEncoded_context'>context</a>. -Created <a href="#Image">Image</a> is available to other GPU contexts, and is available across thread +Created <a href='#Image'>Image</a> is available to other GPU contexts, and is available across thread boundaries. All contexts must be in the same GPU_Share_Group, or otherwise share resources. -When <a href="#Image">Image</a> is no longer referenced, <a href="#SkImage_MakeCrossContextFromEncoded_context">context</a> releases texture memory +When <a href='#Image'>Image</a> is no longer referenced, <a href='#SkImage_MakeCrossContextFromEncoded_context'>context</a> releases texture memory asynchronously. -<a href="undocumented#Texture">Texture</a> decoded from <a href="#SkImage_MakeCrossContextFromEncoded_data">data</a> is uploaded to match <a href="SkSurface_Reference#Surface">Surface</a> created with -<a href="#SkImage_MakeCrossContextFromEncoded_dstColorSpace">dstColorSpace</a>. <a href="undocumented#Color_Space">Color Space</a> of <a href="#Image">Image</a> is determined by encoded <a href="#SkImage_MakeCrossContextFromEncoded_data">data</a>. +<a href='undocumented#Texture'>Texture</a> decoded from <a href='#SkImage_MakeCrossContextFromEncoded_data'>data</a> is uploaded to match <a href='SkSurface_Reference#Surface'>Surface</a> created with +<a href='#SkImage_MakeCrossContextFromEncoded_dstColorSpace'>dstColorSpace</a>. <a href='undocumented#Color_Space'>Color Space</a> of <a href='#Image'>Image</a> is determined by encoded <a href='#SkImage_MakeCrossContextFromEncoded_data'>data</a>. -<a href="#Image">Image</a> is returned if format of <a href="#SkImage_MakeCrossContextFromEncoded_data">data</a> is recognized and supported, and if <a href="#SkImage_MakeCrossContextFromEncoded_context">context</a> +<a href='#Image'>Image</a> is returned if format of <a href='#SkImage_MakeCrossContextFromEncoded_data'>data</a> is recognized and supported, and if <a href='#SkImage_MakeCrossContextFromEncoded_context'>context</a> supports moving resources. Recognized formats vary by platform and GPU back-end. -<a href="#Image">Image</a> is returned using <a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> if <a href="#SkImage_MakeCrossContextFromEncoded_context">context</a> is nullptr or does not support +<a href='#Image'>Image</a> is returned using <a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a> if <a href='#SkImage_MakeCrossContextFromEncoded_context'>context</a> is nullptr or does not support moving resources between contexts. ### Parameters -<table> <tr> <td><a name="SkImage_MakeCrossContextFromEncoded_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromEncoded_data"> <code><strong>data </strong></code> </a></td> <td> -<a href="#Image">Image</a> to decode</td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromEncoded_buildMips"> <code><strong>buildMips </strong></code> </a></td> <td> -create <a href="#Image">Image</a> as Mip_Map if true</td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromEncoded_dstColorSpace"> <code><strong>dstColorSpace </strong></code> </a></td> <td> -range of colors of matching <a href="SkSurface_Reference#Surface">Surface</a> on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromEncoded_limitToMaxTextureSize"> <code><strong>limitToMaxTextureSize </strong></code> </a></td> <td> -downscale image to GPU maximum texture size, if necessary</td> +<table> <tr> <td><a name='SkImage_MakeCrossContextFromEncoded_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromEncoded_data'><code><strong>data</strong></code></a></td> + <td><a href='#Image'>Image</a> to decode</td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromEncoded_buildMips'><code><strong>buildMips</strong></code></a></td> + <td>create <a href='#Image'>Image</a> as Mip_Map if true</td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromEncoded_dstColorSpace'><code><strong>dstColorSpace</strong></code></a></td> + <td>range of colors of matching <a href='SkSurface_Reference#Surface'>Surface</a> on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromEncoded_limitToMaxTextureSize'><code><strong>limitToMaxTextureSize</strong></code></a></td> + <td>downscale image to GPU maximum texture size, if necessary</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -581,55 +932,59 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeCrossContextFromPixmap">MakeCrossContextFromPixmap</a> +<a href='#SkImage_MakeCrossContextFromPixmap'>MakeCrossContextFromPixmap</a> --- -<a name="SkImage_MakeCrossContextFromPixmap"></a> +<a name='SkImage_MakeCrossContextFromPixmap'></a> ## MakeCrossContextFromPixmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeCrossContextFromPixmap(GrContext* context, const SkPixmap& pixmap, - bool buildMips, SkColorSpace* dstColorSpace, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeCrossContextFromPixmap'>MakeCrossContextFromPixmap</a>(<a href='undocumented#GrContext'>GrContext</a>* context, const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& pixmap, + bool buildMips, <a href='undocumented#SkColorSpace'>SkColorSpace</a>* dstColorSpace, bool limitToMaxTextureSize = false) </pre> -Creates <a href="#Image">Image</a> from <a href="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a>. <a href="#Image">Image</a> is uploaded to GPU back-end using <a href="#SkImage_MakeCrossContextFromPixmap_context">context</a>. +Creates <a href='#Image'>Image</a> from <a href='#SkImage_MakeCrossContextFromPixmap_pixmap'>pixmap</a>. <a href='#Image'>Image</a> is uploaded to GPU back-end using <a href='#SkImage_MakeCrossContextFromPixmap_context'>context</a>. -Created <a href="#Image">Image</a> is available to other GPU contexts, and is available across thread +Created <a href='#Image'>Image</a> is available to other GPU contexts, and is available across thread boundaries. All contexts must be in the same GPU_Share_Group, or otherwise share resources. -When <a href="#Image">Image</a> is no longer referenced, <a href="#SkImage_MakeCrossContextFromPixmap_context">context</a> releases texture memory +When <a href='#Image'>Image</a> is no longer referenced, <a href='#SkImage_MakeCrossContextFromPixmap_context'>context</a> releases texture memory asynchronously. -<a href="undocumented#Texture">Texture</a> created from <a href="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a> is uploaded to match <a href="SkSurface_Reference#Surface">Surface</a> created with -<a href="#SkImage_MakeCrossContextFromPixmap_dstColorSpace">dstColorSpace</a>. <a href="undocumented#Color_Space">Color Space</a> of <a href="#Image">Image</a> is determined by <a href="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a>.<a href="#SkImage_colorSpace">colorSpace</a>. +<a href='undocumented#Texture'>Texture</a> created from <a href='#SkImage_MakeCrossContextFromPixmap_pixmap'>pixmap</a> is uploaded to match <a href='SkSurface_Reference#Surface'>Surface</a> created with +<a href='#SkImage_MakeCrossContextFromPixmap_dstColorSpace'>dstColorSpace</a>. <a href='undocumented#Color_Space'>Color Space</a> of <a href='#Image'>Image</a> is determined by <a href='#SkImage_MakeCrossContextFromPixmap_pixmap'>pixmap</a>.<a href='#SkImage_colorSpace'>colorSpace</a>. -<a href="#Image">Image</a> is returned referring to GPU back-end if <a href="#SkImage_MakeCrossContextFromPixmap_context">context</a> is not nullptr, -format of data is recognized and supported, and if <a href="#SkImage_MakeCrossContextFromPixmap_context">context</a> supports moving -resources between contexts. Otherwise, <a href="#SkImage_MakeCrossContextFromPixmap_pixmap">pixmap</a> pixel data is copied and <a href="#Image">Image</a> +<a href='#Image'>Image</a> is returned referring to GPU back-end if <a href='#SkImage_MakeCrossContextFromPixmap_context'>context</a> is not nullptr, +format of data is recognized and supported, and if <a href='#SkImage_MakeCrossContextFromPixmap_context'>context</a> supports moving +resources between contexts. Otherwise, <a href='#SkImage_MakeCrossContextFromPixmap_pixmap'>pixmap</a> pixel data is copied and <a href='#Image'>Image</a> as returned in raster format if possible; nullptr may be returned. Recognized GPU formats vary by platform and GPU back-end. ### Parameters -<table> <tr> <td><a name="SkImage_MakeCrossContextFromPixmap_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromPixmap_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixel address, and row bytes</td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromPixmap_buildMips"> <code><strong>buildMips </strong></code> </a></td> <td> -create <a href="#Image">Image</a> as Mip_Map if true</td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromPixmap_dstColorSpace"> <code><strong>dstColorSpace </strong></code> </a></td> <td> -range of colors of matching <a href="SkSurface_Reference#Surface">Surface</a> on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeCrossContextFromPixmap_limitToMaxTextureSize"> <code><strong>limitToMaxTextureSize </strong></code> </a></td> <td> -downscale image to GPU maximum texture size, if necessary</td> +<table> <tr> <td><a name='SkImage_MakeCrossContextFromPixmap_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromPixmap_pixmap'><code><strong>pixmap</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixel address, and row bytes</td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromPixmap_buildMips'><code><strong>buildMips</strong></code></a></td> + <td>create <a href='#Image'>Image</a> as Mip_Map if true</td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromPixmap_dstColorSpace'><code><strong>dstColorSpace</strong></code></a></td> + <td>range of colors of matching <a href='SkSurface_Reference#Surface'>Surface</a> on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeCrossContextFromPixmap_limitToMaxTextureSize'><code><strong>limitToMaxTextureSize</strong></code></a></td> + <td>downscale image to GPU maximum texture size, if necessary</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -637,208 +992,233 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeCrossContextFromEncoded">MakeCrossContextFromEncoded</a> +<a href='#SkImage_MakeCrossContextFromEncoded'>MakeCrossContextFromEncoded</a> --- -<a name="SkImage_MakeFromAdoptedTexture"></a> +<a name='SkImage_MakeFromAdoptedTexture'></a> ## MakeFromAdoptedTexture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromAdoptedTexture(GrContext* context, - const GrBackendTexture& backendTexture, - GrSurfaceOrigin surfaceOrigin, SkColorType colorType, - SkAlphaType alphaType = kPremul_SkAlphaType, - sk_sp<SkColorSpace> colorSpace = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromAdoptedTexture'>MakeFromAdoptedTexture</a>(<a href='undocumented#GrContext'>GrContext</a>* context, + const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> surfaceOrigin, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> <a href='#SkImage_colorType'>colorType</a>, + <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkImage_alphaType'>alphaType</a> = <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a> = nullptr) </pre> -Creates <a href="#Image">Image</a> from <a href="#SkImage_MakeFromAdoptedTexture_backendTexture">backendTexture</a> associated with <a href="#SkImage_MakeFromAdoptedTexture_context">context</a>. <a href="#SkImage_MakeFromAdoptedTexture_backendTexture">backendTexture</a> and -returned <a href="#Image">Image</a> are managed internally, and are released when no longer needed. +Creates <a href='#Image'>Image</a> from <a href='#SkImage_MakeFromAdoptedTexture_backendTexture'>backendTexture</a> associated with <a href='#SkImage_MakeFromAdoptedTexture_context'>context</a>. <a href='#SkImage_MakeFromAdoptedTexture_backendTexture'>backendTexture</a> and +returned <a href='#Image'>Image</a> are managed internally, and are released when no longer needed. -<a href="#Image">Image</a> is returned if format of <a href="#SkImage_MakeFromAdoptedTexture_backendTexture">backendTexture</a> is recognized and supported. +<a href='#Image'>Image</a> is returned if format of <a href='#SkImage_MakeFromAdoptedTexture_backendTexture'>backendTexture</a> is recognized and supported. Recognized formats vary by GPU back-end. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromAdoptedTexture_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromAdoptedTexture_backendTexture"> <code><strong>backendTexture </strong></code> </a></td> <td> -texture residing on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeFromAdoptedTexture_surfaceOrigin"> <code><strong>surfaceOrigin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromAdoptedTexture_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromAdoptedTexture_alphaType"> <code><strong>alphaType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromAdoptedTexture_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromAdoptedTexture_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromAdoptedTexture_backendTexture'><code><strong>backendTexture</strong></code></a></td> + <td>texture residing on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeFromAdoptedTexture_surfaceOrigin'><code><strong>surfaceOrigin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromAdoptedTexture_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromAdoptedTexture_alphaType'><code><strong>alphaType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromAdoptedTexture_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example -<div><fiddle-embed name="b07964ec9c5c8a6febba805f1cf4d071" gpu="true"></fiddle-embed></div> +<div><fiddle-embed name="b034517e39394b7543f06ec885e36d7d" gpu="true"></fiddle-embed></div> ### See Also -<a href="#SkImage_MakeFromTexture">MakeFromTexture</a><sup><a href="#SkImage_MakeFromTexture_2">[2]</a></sup> <a href="#SkImage_MakeFromYUVTexturesCopy">MakeFromYUVTexturesCopy</a> +<a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> <a href='#SkImage_MakeFromYUVTexturesCopy'>MakeFromYUVTexturesCopy</a> --- -<a name="SkImage_MakeFromYUVTexturesCopy"></a> +<a name='SkImage_MakeFromYUVTexturesCopy'></a> ## MakeFromYUVTexturesCopy -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromYUVTexturesCopy(GrContext* context, SkYUVColorSpace yuvColorSpace, - const GrBackendTexture yuvTextures[3], - GrSurfaceOrigin surfaceOrigin, - sk_sp<SkColorSpace> colorSpace = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromYUVTexturesCopy'>MakeFromYUVTexturesCopy</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='SkImageInfo_Reference#SkYUVColorSpace'>SkYUVColorSpace</a> yuvColorSpace, + const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a> yuvTextures[3], + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> surfaceOrigin, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a> = nullptr) </pre> -Creates <a href="#Image">Image</a> from copy of <a href="#SkImage_MakeFromYUVTexturesCopy_yuvTextures">yuvTextures</a>, an array of textures on GPU. -<a href="#SkImage_MakeFromYUVTexturesCopy_yuvTextures">yuvTextures</a> contain pixels for YUV planes of <a href="#Image">Image</a>. Returned <a href="#Image">Image</a> has the dimensions -<a href="#SkImage_MakeFromYUVTexturesCopy_yuvTextures">yuvTextures</a>[0]. <a href="#SkImage_MakeFromYUVTexturesCopy_yuvColorSpace">yuvColorSpace</a> describes how YUV colors convert to RGB colors. +Creates <a href='#Image'>Image</a> from copy of <a href='#SkImage_MakeFromYUVTexturesCopy_yuvTextures'>yuvTextures</a>, an array of textures on GPU. +<a href='#SkImage_MakeFromYUVTexturesCopy_yuvTextures'>yuvTextures</a> contain pixels for YUV planes of <a href='#Image'>Image</a>. Returned <a href='#Image'>Image</a> has the dimensions +<a href='#SkImage_MakeFromYUVTexturesCopy_yuvTextures'>yuvTextures</a>[0]. <a href='#SkImage_MakeFromYUVTexturesCopy_yuvColorSpace'>yuvColorSpace</a> describes how YUV colors convert to RGB colors. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_yuvColorSpace"> <code><strong>yuvColorSpace </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kJPEG_SkYUVColorSpace">kJPEG_SkYUVColorSpace</a>, <a href="SkImageInfo_Reference#kRec601_SkYUVColorSpace">kRec601_SkYUVColorSpace</a>, -<a href="SkImageInfo_Reference#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_yuvTextures"> <code><strong>yuvTextures </strong></code> </a></td> <td> -array of YUV textures on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_surfaceOrigin"> <code><strong>surfaceOrigin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromYUVTexturesCopy_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromYUVTexturesCopy_yuvColorSpace'><code><strong>yuvColorSpace</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a>, <a href='SkImageInfo_Reference#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a>, +<a href='SkImageInfo_Reference#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromYUVTexturesCopy_yuvTextures'><code><strong>yuvTextures</strong></code></a></td> + <td>array of YUV textures on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeFromYUVTexturesCopy_surfaceOrigin'><code><strong>surfaceOrigin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromYUVTexturesCopy_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromNV12TexturesCopy">MakeFromNV12TexturesCopy</a> +<a href='#SkImage_MakeFromNV12TexturesCopy'>MakeFromNV12TexturesCopy</a> --- -<a name="SkImage_MakeFromNV12TexturesCopy"></a> +<a name='SkImage_MakeFromNV12TexturesCopy'></a> ## MakeFromNV12TexturesCopy -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromNV12TexturesCopy(GrContext* context, SkYUVColorSpace yuvColorSpace, - const GrBackendTexture nv12Textures[2], - GrSurfaceOrigin surfaceOrigin, - sk_sp<SkColorSpace> colorSpace = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromNV12TexturesCopy'>MakeFromNV12TexturesCopy</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='SkImageInfo_Reference#SkYUVColorSpace'>SkYUVColorSpace</a> yuvColorSpace, + const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a> nv12Textures[2], + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> surfaceOrigin, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a> = nullptr) </pre> -Creates <a href="#Image">Image</a> from copy of <a href="#SkImage_MakeFromNV12TexturesCopy_nv12Textures">nv12Textures</a>, an array of textures on GPU. -<a href="#SkImage_MakeFromNV12TexturesCopy_nv12Textures">nv12Textures</a>[0] contains pixels for YUV_Component_Y plane. -<a href="#SkImage_MakeFromNV12TexturesCopy_nv12Textures">nv12Textures</a>[1] contains pixels for YUV_Component_U plane, +Creates <a href='#Image'>Image</a> from copy of <a href='#SkImage_MakeFromNV12TexturesCopy_nv12Textures'>nv12Textures</a>, an array of textures on GPU. +<a href='#SkImage_MakeFromNV12TexturesCopy_nv12Textures'>nv12Textures</a>[0] contains pixels for YUV_Component_Y plane. +<a href='#SkImage_MakeFromNV12TexturesCopy_nv12Textures'>nv12Textures</a>[1] contains pixels for YUV_Component_U plane, followed by pixels for YUV_Component_V plane. -Returned <a href="#Image">Image</a> has the dimensions <a href="#SkImage_MakeFromNV12TexturesCopy_nv12Textures">nv12Textures</a>[2]. -<a href="#SkImage_MakeFromNV12TexturesCopy_yuvColorSpace">yuvColorSpace</a> describes how YUV colors convert to RGB colors. +Returned <a href='#Image'>Image</a> has the dimensions <a href='#SkImage_MakeFromNV12TexturesCopy_nv12Textures'>nv12Textures</a>[2]. +<a href='#SkImage_MakeFromNV12TexturesCopy_yuvColorSpace'>yuvColorSpace</a> describes how YUV colors convert to RGB colors. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_yuvColorSpace"> <code><strong>yuvColorSpace </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kJPEG_SkYUVColorSpace">kJPEG_SkYUVColorSpace</a>, <a href="SkImageInfo_Reference#kRec601_SkYUVColorSpace">kRec601_SkYUVColorSpace</a>, -<a href="SkImageInfo_Reference#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_nv12Textures"> <code><strong>nv12Textures </strong></code> </a></td> <td> -array of YUV textures on GPU</td> - </tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_surfaceOrigin"> <code><strong>surfaceOrigin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromNV12TexturesCopy_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromNV12TexturesCopy_yuvColorSpace'><code><strong>yuvColorSpace</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kJPEG_SkYUVColorSpace'>kJPEG_SkYUVColorSpace</a>, <a href='SkImageInfo_Reference#kRec601_SkYUVColorSpace'>kRec601_SkYUVColorSpace</a>, +<a href='SkImageInfo_Reference#kRec709_SkYUVColorSpace'>kRec709_SkYUVColorSpace</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromNV12TexturesCopy_nv12Textures'><code><strong>nv12Textures</strong></code></a></td> + <td>array of YUV textures on GPU</td> + </tr> + <tr> <td><a name='SkImage_MakeFromNV12TexturesCopy_surfaceOrigin'><code><strong>surfaceOrigin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkImage_MakeFromNV12TexturesCopy_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromYUVTexturesCopy">MakeFromYUVTexturesCopy</a> +<a href='#SkImage_MakeFromYUVTexturesCopy'>MakeFromYUVTexturesCopy</a> --- -## <a name="SkImage_BitDepth"></a> Enum SkImage::BitDepth +## <a name='SkImage_BitDepth'>Enum SkImage::BitDepth</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum class <a href="#SkImage_BitDepth">BitDepth</a> { - <a href="#SkImage_BitDepth_kU8">kU8</a>, - <a href="#SkImage_BitDepth_kF16">kF16</a>, + enum class <a href='#SkImage_BitDepth'>BitDepth</a> { + <a href='#SkImage_BitDepth_kU8'>kU8</a>, + <a href='#SkImage_BitDepth_kF16'>kF16</a>, }; </pre> ### Constants -<table> - <tr> - <td><a name="SkImage_BitDepth_kU8"> <code><strong>SkImage::BitDepth::kU8 </strong></code> </a></td><td>0</td><td>Use 8 bits per <a href="SkColor_Reference#ARGB">Color ARGB</a> component using unsigned integer format. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkImage_BitDepth_kU8'><code>SkImage::BitDepth::kU8</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Use 8 bits per <a href='SkColor_Reference#ARGB'>Color ARGB</a> component using unsigned integer format. </td> </tr> <tr> - <td><a name="SkImage_BitDepth_kF16"> <code><strong>SkImage::BitDepth::kF16 </strong></code> </a></td><td>1</td><td>Use 16 bits per <a href="SkColor_Reference#ARGB">Color ARGB</a> component using half-precision floating point format. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkImage_BitDepth_kF16'><code>SkImage::BitDepth::kF16</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Use 16 bits per <a href='SkColor_Reference#ARGB'>Color ARGB</a> component using half-precision floating point format. </td> </tr> </table> ### See Also -<a href="#SkImage_MakeFromPicture">MakeFromPicture</a> - - +<a href='#SkImage_MakeFromPicture'>MakeFromPicture</a> -<a name="SkImage_MakeFromPicture"></a> +<a name='SkImage_MakeFromPicture'></a> ## MakeFromPicture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromPicture(sk_sp<SkPicture> picture, const SkISize& dimensions, - const SkMatrix* matrix, const SkPaint* paint, - BitDepth bitDepth, sk_sp<SkColorSpace> colorSpace) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromPicture'>MakeFromPicture</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkPicture'>SkPicture</a>> picture, const <a href='undocumented#SkISize'>SkISize</a>& dimensions, + const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* matrix, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint, + <a href='#SkImage_BitDepth'>BitDepth</a> bitDepth, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a>) </pre> -Creates <a href="#Image">Image</a> from <a href="#SkImage_MakeFromPicture_picture">picture</a>. Returned <a href="#Image">Image</a> width and height are set by dimensions. -<a href="#Image">Image</a> draws <a href="#SkImage_MakeFromPicture_picture">picture</a> with <a href="#SkImage_MakeFromPicture_matrix">matrix</a> and <a href="#SkImage_MakeFromPicture_paint">paint</a>, set to <a href="#SkImage_MakeFromPicture_bitDepth">bitDepth</a> and <a href="#SkImage_colorSpace">colorSpace</a>. +Creates <a href='#Image'>Image</a> from <a href='#SkImage_MakeFromPicture_picture'>picture</a>. Returned <a href='#Image'>Image</a> width and height are set by dimensions. +<a href='#Image'>Image</a> draws <a href='#SkImage_MakeFromPicture_picture'>picture</a> with <a href='#SkImage_MakeFromPicture_matrix'>matrix</a> and <a href='#SkImage_MakeFromPicture_paint'>paint</a>, set to <a href='#SkImage_MakeFromPicture_bitDepth'>bitDepth</a> and <a href='#SkImage_colorSpace'>colorSpace</a>. -If <a href="#SkImage_MakeFromPicture_matrix">matrix</a> is nullptr, draws with identity <a href="SkMatrix_Reference#Matrix">Matrix</a>. If <a href="#SkImage_MakeFromPicture_paint">paint</a> is nullptr, draws -with default <a href="SkPaint_Reference#Paint">Paint</a>. <a href="#SkImage_colorSpace">colorSpace</a> may be nullptr. +If <a href='#SkImage_MakeFromPicture_matrix'>matrix</a> is nullptr, draws with identity <a href='SkMatrix_Reference#Matrix'>Matrix</a>. If <a href='#SkImage_MakeFromPicture_paint'>paint</a> is nullptr, draws +with default <a href='SkPaint_Reference#Paint'>Paint</a>. <a href='#SkImage_colorSpace'>colorSpace</a> may be nullptr. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromPicture_picture"> <code><strong>picture </strong></code> </a></td> <td> -stream of drawing commands</td> - </tr> <tr> <td><a name="SkImage_MakeFromPicture_dimensions"> <code><strong>dimensions </strong></code> </a></td> <td> -width and height</td> - </tr> <tr> <td><a name="SkImage_MakeFromPicture_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="SkMatrix_Reference#Matrix">Matrix</a> to rotate, scale, translate, and so on; may be nullptr</td> - </tr> <tr> <td><a name="SkImage_MakeFromPicture_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> to apply transparency, filtering, and so on; may be nullptr</td> - </tr> <tr> <td><a name="SkImage_MakeFromPicture_bitDepth"> <code><strong>bitDepth </strong></code> </a></td> <td> -8 bit integer or 16 bit float: per component</td> - </tr> <tr> <td><a name="SkImage_MakeFromPicture_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromPicture_picture'><code><strong>picture</strong></code></a></td> + <td>stream of drawing commands</td> + </tr> + <tr> <td><a name='SkImage_MakeFromPicture_dimensions'><code><strong>dimensions</strong></code></a></td> + <td>width and height</td> + </tr> + <tr> <td><a name='SkImage_MakeFromPicture_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='SkMatrix_Reference#Matrix'>Matrix</a> to rotate, scale, translate, and so on; may be nullptr</td> + </tr> + <tr> <td><a name='SkImage_MakeFromPicture_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> to apply transparency, filtering, and so on; may be nullptr</td> + </tr> + <tr> <td><a name='SkImage_MakeFromPicture_bitDepth'><code><strong>bitDepth</strong></code></a></td> + <td>8-bit integer or 16-bit float: per component</td> + </tr> + <tr> <td><a name='SkImage_MakeFromPicture_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -846,78 +1226,129 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawPicture">SkCanvas::drawPicture</a><sup><a href="SkCanvas_Reference#SkCanvas_drawPicture_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_drawPicture_3">[3]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_drawPicture_4">[4]</a></sup> +<a href='SkCanvas_Reference#SkCanvas_drawPicture'>SkCanvas::drawPicture</a><sup><a href='SkCanvas_Reference#SkCanvas_drawPicture_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_drawPicture_3'>[3]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_drawPicture_4'>[4]</a></sup> --- -<a name="SkImage_MakeFromAHardwareBuffer"></a> +<a name='SkImage_MakeFromAHardwareBuffer'></a> ## MakeFromAHardwareBuffer -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkImage> MakeFromAHardwareBuffer(AHardwareBuffer* hardwareBuffer, - SkAlphaType alphaType = kPremul_SkAlphaType, - sk_sp<SkColorSpace> colorSpace = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_MakeFromAHardwareBuffer'>MakeFromAHardwareBuffer</a>(AHardwareBuffer* hardwareBuffer, + <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkImage_alphaType'>alphaType</a> = <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_colorSpace'>colorSpace</a> = nullptr) </pre> -Creates <a href="#Image">Image</a> from Android hardware buffer. -Returned <a href="#Image">Image</a> takes a reference on the buffer. +Creates <a href='#Image'>Image</a> from Android hardware buffer. +Returned <a href='#Image'>Image</a> takes a reference on the buffer. Only available on Android, when __ANDROID_API__ is defined to be 26 or greater. ### Parameters -<table> <tr> <td><a name="SkImage_MakeFromAHardwareBuffer_hardwareBuffer"> <code><strong>hardwareBuffer </strong></code> </a></td> <td> -AHardwareBuffer Android hardware buffer</td> - </tr> <tr> <td><a name="SkImage_MakeFromAHardwareBuffer_alphaType"> <code><strong>alphaType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a> </td> - </tr> <tr> <td><a name="SkImage_MakeFromAHardwareBuffer_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> +<table> <tr> <td><a name='SkImage_MakeFromAHardwareBuffer_hardwareBuffer'><code><strong>hardwareBuffer</strong></code></a></td> + <td>AHardwareBuffer Android hardware buffer</td> + </tr> + <tr> <td><a name='SkImage_MakeFromAHardwareBuffer_alphaType'><code><strong>alphaType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a> </td> + </tr> + <tr> <td><a name='SkImage_MakeFromAHardwareBuffer_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromRaster">MakeFromRaster</a> +<a href='#SkImage_MakeFromRaster'>MakeFromRaster</a> --- -## <a name="Property"></a> Property - -| name | description | -| --- | --- | -| <a href="#SkImage_alphaType">alphaType</a> | returns <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> | -| <a href="#SkImage_bounds">bounds</a> | returns <a href="#SkImage_width">width</a> and <a href="#SkImage_height">height</a> as Rectangle | -| <a href="#SkImage_colorSpace">colorSpace</a> | returns <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImage_colorType">colorType</a> | returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkImage_dimensions">dimensions</a> | returns <a href="#SkImage_width">width</a> and <a href="#SkImage_height">height</a> | -| <a href="#SkImage_getBackendTexture">getBackendTexture</a> | returns GPU reference to <a href="#Image">Image</a> as texture | -| <a href="#SkImage_height">height</a> | returns pixel row count | -| <a href="#SkImage_isAlphaOnly">isAlphaOnly</a> | returns if pixels represent a transparency mask | -| <a href="#SkImage_isLazyGenerated">isLazyGenerated</a> | returns if <a href="#Image">Image</a> is created as needed | -| <a href="#SkImage_isOpaque">isOpaque</a> | returns if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> | -| <a href="#SkImage_isTextureBacked">isTextureBacked</a> | returns if <a href="#Image">Image</a> was created from <a href="undocumented#GPU_Texture">GPU Texture</a> | -| <a href="#SkImage_isValid">isValid</a> | returns if <a href="#Image">Image</a> can draw to <a href="undocumented#Raster_Surface">Raster Surface</a> or <a href="undocumented#GPU_Context">GPU Context</a> | -| <a href="#SkImage_refColorSpace">refColorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkImage_uniqueID">uniqueID</a> | identifier for <a href="#Image">Image</a> | -| <a href="#SkImage_width">width</a> | returns pixel column count | - -<a name="SkImage_width"></a> +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImage_width'>width</a> and <a href='#SkImage_height'>height</a> as Rectangle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_dimensions'>dimensions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkImage_width'>width</a> and <a href='#SkImage_height'>height</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_getBackendTexture'>getBackendTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns GPU reference to <a href='#Image'>Image</a> as texture</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isAlphaOnly'>isAlphaOnly</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if pixels represent a transparency mask</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isLazyGenerated'>isLazyGenerated</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Image'>Image</a> is created as needed</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isTextureBacked'>isTextureBacked</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Image'>Image</a> was created from <a href='undocumented#GPU_Texture'>GPU Texture</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_isValid'>isValid</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Image'>Image</a> can draw to <a href='undocumented#Raster_Surface'>Raster Surface</a> or <a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_refColorSpace'>refColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_uniqueID'>uniqueID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns identifier for <a href='#Image'>Image</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> +</table> + + +<a name='SkImage_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkImage_width'>width</a>() const </pre> Returns pixel count in each row. ### Return Value -pixel width in <a href="#Image">Image</a> +pixel width in <a href='#Image'>Image</a> ### Example @@ -925,22 +1356,22 @@ pixel width in <a href="#Image">Image</a> ### See Also -<a href="#SkImage_dimensions">dimensions</a> <a href="#SkImage_height">height</a> +<a href='#SkImage_dimensions'>dimensions</a> <a href='#SkImage_height'>height</a> --- -<a name="SkImage_height"></a> +<a name='SkImage_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkImage_height'>height</a>() const </pre> Returns pixel row count. ### Return Value -pixel height in <a href="#Image">Image</a> +pixel height in <a href='#Image'>Image</a> ### Example @@ -948,22 +1379,22 @@ pixel height in <a href="#Image">Image</a> ### See Also -<a href="#SkImage_dimensions">dimensions</a> <a href="#SkImage_width">width</a> +<a href='#SkImage_dimensions'>dimensions</a> <a href='#SkImage_width'>width</a> --- -<a name="SkImage_dimensions"></a> +<a name='SkImage_dimensions'></a> ## dimensions -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkISize dimensions() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkISize'>SkISize</a> <a href='#SkImage_dimensions'>dimensions</a>() const </pre> -Returns <a href="undocumented#ISize">ISize</a> { <a href="#SkImage_width">width</a>, <a href="#SkImage_height">height</a> }. +Returns <a href='undocumented#ISize'>ISize</a> { <a href='#SkImage_width'>width</a>, <a href='#SkImage_height'>height</a> }. ### Return Value -integral size of <a href="#SkImage_width">width</a> and <a href="#SkImage_height">height</a> +integral size of <a href='#SkImage_width'>width</a> and <a href='#SkImage_height'>height</a> ### Example @@ -979,22 +1410,22 @@ dimensionsAsBounds == bounds ### See Also -<a href="#SkImage_height">height</a> <a href="#SkImage_width">width</a> <a href="#SkImage_bounds">bounds</a> +<a href='#SkImage_height'>height</a> <a href='#SkImage_width'>width</a> <a href='#SkImage_bounds'>bounds</a> --- -<a name="SkImage_bounds"></a> +<a name='SkImage_bounds'></a> ## bounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect bounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkImage_bounds'>bounds</a>() const </pre> -Returns <a href="SkIRect_Reference#IRect">IRect</a> { 0, 0, <a href="#SkImage_width">width</a>, <a href="#SkImage_height">height</a> }. +Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkImage_width'>width</a>, <a href='#SkImage_height'>height</a> }. ### Return Value -integral rectangle from origin to <a href="#SkImage_width">width</a> and <a href="#SkImage_height">height</a> +integral rectangle from origin to <a href='#SkImage_width'>width</a> and <a href='#SkImage_height'>height</a> ### Example @@ -1002,19 +1433,19 @@ integral rectangle from origin to <a href="#SkImage_width">width</a> and <a href ### See Also -<a href="#SkImage_dimensions">dimensions</a> +<a href='#SkImage_dimensions'>dimensions</a> --- -<a name="SkImage_uniqueID"></a> +<a name='SkImage_uniqueID'></a> ## uniqueID -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t uniqueID() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkImage_uniqueID'>uniqueID</a>() const </pre> -Returns value unique to image. <a href="#Image">Image</a> contents cannot change after <a href="#Image">Image</a> is -created. Any operation to create a new <a href="#Image">Image</a> will receive generate a new +Returns value unique to image. <a href='#Image'>Image</a> contents cannot change after <a href='#Image'>Image</a> is +created. Any operation to create a new <a href='#Image'>Image</a> will receive generate a new unique number. ### Return Value @@ -1027,24 +1458,26 @@ unique identifier ### See Also -<a href="#SkImage_isLazyGenerated">isLazyGenerated</a> +<a href='#SkImage_isLazyGenerated'>isLazyGenerated</a> --- -<a name="SkImage_alphaType"></a> +<a name='SkImage_alphaType'></a> ## alphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkAlphaType alphaType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkImage_alphaType'>alphaType</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>.<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> returned was a parameter to an <a href="#Image">Image</a> constructor, +Returns <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>. + +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> returned was a parameter to an <a href='#Image'>Image</a> constructor, or was parsed from encoded data. ### Return Value -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> in <a href="#Image">Image</a> +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> in <a href='#Image'>Image</a> ### Example @@ -1052,22 +1485,22 @@ or was parsed from encoded data. ### See Also -<a href="SkImageInfo_Reference#SkImageInfo_alphaType">SkImageInfo::alphaType</a> +<a href='SkImageInfo_Reference#SkImageInfo_alphaType'>SkImageInfo::alphaType</a> --- -<a name="SkImage_colorType"></a> +<a name='SkImage_colorType'></a> ## colorType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorType colorType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> <a href='#SkImage_colorType'>colorType</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a> if known; otherwise, returns <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> if known; otherwise, returns <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> of <a href="#Image">Image</a> +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> of <a href='#Image'>Image</a> ### Example @@ -1075,28 +1508,28 @@ Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a> if known; othe ### See Also -<a href="SkImageInfo_Reference#SkImageInfo_colorType">SkImageInfo::colorType</a> +<a href='SkImageInfo_Reference#SkImageInfo_colorType'>SkImageInfo::colorType</a> --- -<a name="SkImage_colorSpace"></a> +<a name='SkImage_colorSpace'></a> ## colorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorSpace* colorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkColorSpace'>SkColorSpace</a>* <a href='#SkImage_colorSpace'>colorSpace</a>() const </pre> -Returns <a href="undocumented#Color_Space">Color Space</a>, the range of colors, associated with <a href="#Image">Image</a>. The -reference count of <a href="undocumented#Color_Space">Color Space</a> is unchanged. The returned <a href="undocumented#Color_Space">Color Space</a> is +Returns <a href='undocumented#Color_Space'>Color Space</a>, the range of colors, associated with <a href='#Image'>Image</a>. The +reference count of <a href='undocumented#Color_Space'>Color Space</a> is unchanged. The returned <a href='undocumented#Color_Space'>Color Space</a> is immutable. -<a href="undocumented#Color_Space">Color Space</a> returned was passed to an <a href="#Image">Image</a> constructor, -or was parsed from encoded data. <a href="undocumented#Color_Space">Color Space</a> returned may be ignored when <a href="#Image">Image</a> -is drawn, depending on the capabilities of the <a href="SkSurface_Reference#Surface">Surface</a> receiving the drawing. +<a href='undocumented#Color_Space'>Color Space</a> returned was passed to an <a href='#Image'>Image</a> constructor, +or was parsed from encoded data. <a href='undocumented#Color_Space'>Color Space</a> returned may be ignored when <a href='#Image'>Image</a> +is drawn, depending on the capabilities of the <a href='SkSurface_Reference#Surface'>Surface</a> receiving the drawing. ### Return Value -<a href="undocumented#Color_Space">Color Space</a> in <a href="#Image">Image</a>, or nullptr +<a href='undocumented#Color_Space'>Color Space</a> in <a href='#Image'>Image</a>, or nullptr ### Example @@ -1104,30 +1537,30 @@ is drawn, depending on the capabilities of the <a href="SkSurface_Reference#Surf ### See Also -<a href="#SkImage_refColorSpace">refColorSpace</a> <a href="#SkImage_makeColorSpace">makeColorSpace</a> +<a href='#SkImage_refColorSpace'>refColorSpace</a> <a href='#SkImage_makeColorSpace'>makeColorSpace</a> --- -<a name="SkImage_refColorSpace"></a> +<a name='SkImage_refColorSpace'></a> ## refColorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkColorSpace> refColorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkImage_refColorSpace'>refColorSpace</a>() const </pre> -Returns a smart pointer to <a href="undocumented#Color_Space">Color Space</a>, the range of colors, associated with -<a href="#Image">Image</a>. The smart pointer tracks the number of objects sharing this -<a href="undocumented#SkColorSpace">SkColorSpace</a> reference so the memory is released when the owners destruct. +Returns a smart pointer to <a href='undocumented#Color_Space'>Color Space</a>, the range of colors, associated with +<a href='#Image'>Image</a>. The smart pointer tracks the number of objects sharing this +<a href='undocumented#SkColorSpace'>SkColorSpace</a> reference so the memory is released when the owners destruct. -The returned <a href="undocumented#SkColorSpace">SkColorSpace</a> is immutable. +The returned <a href='undocumented#SkColorSpace'>SkColorSpace</a> is immutable. -<a href="undocumented#Color_Space">Color Space</a> returned was passed to an <a href="#Image">Image</a> constructor, -or was parsed from encoded data. <a href="undocumented#Color_Space">Color Space</a> returned may be ignored when <a href="#Image">Image</a> -is drawn, depending on the capabilities of the <a href="SkSurface_Reference#Surface">Surface</a> receiving the drawing. +<a href='undocumented#Color_Space'>Color Space</a> returned was passed to an <a href='#Image'>Image</a> constructor, +or was parsed from encoded data. <a href='undocumented#Color_Space'>Color Space</a> returned may be ignored when <a href='#Image'>Image</a> +is drawn, depending on the capabilities of the <a href='SkSurface_Reference#Surface'>Surface</a> receiving the drawing. ### Return Value -<a href="undocumented#Color_Space">Color Space</a> in <a href="#Image">Image</a>, or nullptr, wrapped in a smart pointer +<a href='undocumented#Color_Space'>Color Space</a> in <a href='#Image'>Image</a>, or nullptr, wrapped in a smart pointer ### Example @@ -1135,19 +1568,19 @@ is drawn, depending on the capabilities of the <a href="SkSurface_Reference#Surf ### See Also -<a href="#SkImage_colorSpace">colorSpace</a> <a href="#SkImage_makeColorSpace">makeColorSpace</a> +<a href='#SkImage_colorSpace'>colorSpace</a> <a href='#SkImage_makeColorSpace'>makeColorSpace</a> --- -<a name="SkImage_isAlphaOnly"></a> +<a name='SkImage_isAlphaOnly'></a> ## isAlphaOnly -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isAlphaOnly() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_isAlphaOnly'>isAlphaOnly</a>() const </pre> -Returns true if <a href="#Image">Image</a> pixels represent transparency only. If true, each pixel -is packed in 8 bits as defined by <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>. +Returns true if <a href='#Image'>Image</a> pixels represent transparency only. If true, each pixel +is packed in 8 bits as defined by <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>. ### Return Value @@ -1167,22 +1600,22 @@ alphaOnly = true ### See Also -<a href="#SkImage_alphaType">alphaType</a> <a href="#SkImage_isOpaque">isOpaque</a> +<a href='#SkImage_alphaType'>alphaType</a> <a href='#SkImage_isOpaque'>isOpaque</a> --- -<a name="SkImage_isOpaque"></a> +<a name='SkImage_isOpaque'></a> ## isOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isOpaque() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_isOpaque'>isOpaque</a>() const </pre> -Returns true if pixels ignore their <a href="SkColor_Reference#Alpha">Alpha</a> value and are treated as fully opaque. +Returns true if pixels ignore their <a href='SkColor_Reference#Alpha'>Alpha</a> value and are treated as fully opaque. ### Return Value -true if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a> +true if <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a> ### Example @@ -1199,38 +1632,40 @@ isOpaque = true ### See Also -<a href="#SkImage_alphaType">alphaType</a> <a href="#SkImage_isAlphaOnly">isAlphaOnly</a> +<a href='#SkImage_alphaType'>alphaType</a> <a href='#SkImage_isAlphaOnly'>isAlphaOnly</a> --- -<a name="SkImage_makeShader"></a> +<a name='SkImage_makeShader'></a> ## makeShader -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkShader> makeShader(SkShader::TileMode tileMode1, SkShader::TileMode tileMode2, - const SkMatrix* localMatrix = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkShader'>SkShader</a>> <a href='#SkImage_makeShader'>makeShader</a>(<a href='undocumented#SkShader_TileMode'>SkShader::TileMode</a> tileMode1, <a href='undocumented#SkShader_TileMode'>SkShader::TileMode</a> tileMode2, + const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* localMatrix = nullptr) const </pre> -Creates <a href="undocumented#Shader">Shader</a> from <a href="#Image">Image</a>. <a href="undocumented#Shader">Shader</a> dimensions are taken from <a href="#Image">Image</a>. <a href="undocumented#Shader">Shader</a> uses -<a href="undocumented#SkShader_TileMode">SkShader::TileMode</a> rules to fill drawn area outside <a href="#Image">Image</a>. <a href="#SkImage_makeShader_localMatrix">localMatrix</a> permits -transforming <a href="#Image">Image</a> before <a href="SkCanvas_Reference#Matrix">Canvas Matrix</a> is applied. +Creates <a href='undocumented#Shader'>Shader</a> from <a href='#Image'>Image</a>. <a href='undocumented#Shader'>Shader</a> dimensions are taken from <a href='#Image'>Image</a>. <a href='undocumented#Shader'>Shader</a> uses +<a href='undocumented#SkShader_TileMode'>SkShader::TileMode</a> rules to fill drawn area outside <a href='#Image'>Image</a>. <a href='#SkImage_makeShader_localMatrix'>localMatrix</a> permits +transforming <a href='#Image'>Image</a> before <a href='SkCanvas_Reference#Matrix'>Canvas Matrix</a> is applied. ### Parameters -<table> <tr> <td><a name="SkImage_makeShader_tileMode1"> <code><strong>tileMode1 </strong></code> </a></td> <td> -tiling in x, one of: <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a>, <a href="undocumented#SkShader_kRepeat_TileMode">SkShader::kRepeat TileMode</a>, -<a href="undocumented#SkShader_kMirror_TileMode">SkShader::kMirror TileMode</a></td> - </tr> <tr> <td><a name="SkImage_makeShader_tileMode2"> <code><strong>tileMode2 </strong></code> </a></td> <td> -tiling in y, one of: <a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a>, <a href="undocumented#SkShader_kRepeat_TileMode">SkShader::kRepeat TileMode</a>, -<a href="undocumented#SkShader_kMirror_TileMode">SkShader::kMirror TileMode</a></td> - </tr> <tr> <td><a name="SkImage_makeShader_localMatrix"> <code><strong>localMatrix </strong></code> </a></td> <td> -<a href="#Image">Image</a> transformation, or nullptr</td> +<table> <tr> <td><a name='SkImage_makeShader_tileMode1'><code><strong>tileMode1</strong></code></a></td> + <td>tiling in x, one of: <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a>, <a href='undocumented#SkShader_kRepeat_TileMode'>SkShader::kRepeat TileMode</a>, +<a href='undocumented#SkShader_kMirror_TileMode'>SkShader::kMirror TileMode</a></td> + </tr> + <tr> <td><a name='SkImage_makeShader_tileMode2'><code><strong>tileMode2</strong></code></a></td> + <td>tiling in y, one of: <a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a>, <a href='undocumented#SkShader_kRepeat_TileMode'>SkShader::kRepeat TileMode</a>, +<a href='undocumented#SkShader_kMirror_TileMode'>SkShader::kMirror TileMode</a></td> + </tr> + <tr> <td><a name='SkImage_makeShader_localMatrix'><code><strong>localMatrix</strong></code></a></td> + <td><a href='#Image'>Image</a> transformation, or nullptr</td> </tr> </table> ### Return Value -<a href="undocumented#Shader">Shader</a> containing <a href="#Image">Image</a> +<a href='undocumented#Shader'>Shader</a> containing <a href='#Image'>Image</a> ### Example @@ -1238,30 +1673,30 @@ tiling in y, one of: <a href="undocumented#SkShader_kClamp_TileMode">SkShader::k ### See Also -<a href="#SkImage_scalePixels">scalePixels</a> +<a href='#SkImage_scalePixels'>scalePixels</a> --- -<a name="SkImage_makeShader_2"></a> +<a name='SkImage_makeShader_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkShader> makeShader(const SkMatrix* localMatrix = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkShader'>SkShader</a>> <a href='#SkImage_makeShader'>makeShader</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* localMatrix = nullptr) const </pre> -Creates <a href="undocumented#Shader">Shader</a> from <a href="#Image">Image</a>. <a href="undocumented#Shader">Shader</a> dimensions are taken from <a href="#Image">Image</a>. <a href="undocumented#Shader">Shader</a> uses -<a href="undocumented#SkShader_kClamp_TileMode">SkShader::kClamp TileMode</a> to fill drawn area outside <a href="#Image">Image</a>. <a href="#SkImage_makeShader_2_localMatrix">localMatrix</a> permits -transforming <a href="#Image">Image</a> before <a href="SkCanvas_Reference#Matrix">Canvas Matrix</a> is applied. +Creates <a href='undocumented#Shader'>Shader</a> from <a href='#Image'>Image</a>. <a href='undocumented#Shader'>Shader</a> dimensions are taken from <a href='#Image'>Image</a>. <a href='undocumented#Shader'>Shader</a> uses +<a href='undocumented#SkShader_kClamp_TileMode'>SkShader::kClamp TileMode</a> to fill drawn area outside <a href='#Image'>Image</a>. <a href='#SkImage_makeShader_2_localMatrix'>localMatrix</a> permits +transforming <a href='#Image'>Image</a> before <a href='SkCanvas_Reference#Matrix'>Canvas Matrix</a> is applied. ### Parameters -<table> <tr> <td><a name="SkImage_makeShader_2_localMatrix"> <code><strong>localMatrix </strong></code> </a></td> <td> -<a href="#Image">Image</a> transformation, or nullptr</td> +<table> <tr> <td><a name='SkImage_makeShader_2_localMatrix'><code><strong>localMatrix</strong></code></a></td> + <td><a href='#Image'>Image</a> transformation, or nullptr</td> </tr> </table> ### Return Value -<a href="undocumented#Shader">Shader</a> containing <a href="#Image">Image</a> +<a href='undocumented#Shader'>Shader</a> containing <a href='#Image'>Image</a> ### Example @@ -1269,41 +1704,60 @@ transforming <a href="#Image">Image</a> before <a href="SkCanvas_Reference#Matri ### See Also -<a href="#SkImage_scalePixels">scalePixels</a> +<a href='#SkImage_scalePixels'>scalePixels</a> --- -## <a name="Pixels"></a> Pixels +## <a name='Pixels'>Pixels</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_readPixels'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, CachingHint cachingHint = kAllow CachingHint)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_readPixels_2'>readPixels(const SkPixmap& dst, int srcX, int srcY, CachingHint cachingHint = kAllow CachingHint)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_scalePixels'>scalePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and converts one <a href='#Image'>Image</a> to another</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkImage_peekPixels">peekPixels</a> | returns <a href="SkPixmap_Reference#Pixmap">Pixmap</a> if possible | -| <a href="#SkImage_readPixels">readPixels</a> | copies and converts pixels | -| | <a href="#SkImage_readPixels">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, CachingHint cachingHint = kAllow CachingHint)</a> const | -| | <a href="#SkImage_readPixels_2">readPixels(const SkPixmap& dst, int srcX, int srcY, CachingHint cachingHint = kAllow CachingHint)</a> const | -| <a href="#SkImage_scalePixels">scalePixels</a> | scales and converts one <a href="#Image">Image</a> to another | -<a name="SkImage_peekPixels"></a> +<a name='SkImage_peekPixels'></a> ## peekPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool peekPixels(SkPixmap* pixmap) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_peekPixels'>peekPixels</a>(<a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>* pixmap) const </pre> -Copies <a href="#Image">Image</a> pixel address, row bytes, and <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to <a href="#SkImage_peekPixels_pixmap">pixmap</a>, if address +Copies <a href='#Image'>Image</a> pixel address, row bytes, and <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to <a href='#SkImage_peekPixels_pixmap'>pixmap</a>, if address is available, and returns true. If pixel address is not available, return -false and leave <a href="#SkImage_peekPixels_pixmap">pixmap</a> unchanged. +false and leave <a href='#SkImage_peekPixels_pixmap'>pixmap</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkImage_peekPixels_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -storage for pixel state if pixels are readable; otherwise, ignored</td> +<table> <tr> <td><a name='SkImage_peekPixels_pixmap'><code><strong>pixmap</strong></code></a></td> + <td>storage for pixel state if pixels are readable; otherwise, ignored</td> </tr> </table> ### Return Value -true if <a href="#Image">Image</a> has direct access to pixels +true if <a href='#Image'>Image</a> has direct access to pixels ### Example @@ -1329,32 +1783,34 @@ true if <a href="#Image">Image</a> has direct access to pixels ### See Also -<a href="#SkImage_readPixels">readPixels</a><sup><a href="#SkImage_readPixels_2">[2]</a></sup> +<a href='#SkImage_readPixels'>readPixels</a><sup><a href='#SkImage_readPixels_2'>[2]</a></sup> --- -<a name="SkImage_getTexture"></a> +<a name='SkImage_getTexture'></a> ## getTexture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrTexture* getTexture() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +GrTexture* <a href='#SkImage_getTexture'>getTexture</a>() const </pre> +Deprecated. + --- -<a name="SkImage_isTextureBacked"></a> +<a name='SkImage_isTextureBacked'></a> ## isTextureBacked -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isTextureBacked() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_isTextureBacked'>isTextureBacked</a>() const </pre> -Returns true the contents of <a href="#Image">Image</a> was created on or uploaded to GPU memory, -and is available as a <a href="undocumented#GPU_Texture">GPU Texture</a>. +Returns true the contents of <a href='#Image'>Image</a> was created on or uploaded to GPU memory, +and is available as a <a href='undocumented#GPU_Texture'>GPU Texture</a>. ### Return Value -true if <a href="#Image">Image</a> is a <a href="undocumented#GPU_Texture">GPU Texture</a> +true if <a href='#Image'>Image</a> is a <a href='undocumented#GPU_Texture'>GPU Texture</a> ### Example @@ -1362,35 +1818,35 @@ true if <a href="#Image">Image</a> is a <a href="undocumented#GPU_Texture">GPU T ### See Also -<a href="#SkImage_MakeFromTexture">MakeFromTexture</a><sup><a href="#SkImage_MakeFromTexture_2">[2]</a></sup> <a href="#SkImage_isValid">isValid</a> +<a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> <a href='#SkImage_isValid'>isValid</a> --- -<a name="SkImage_isValid"></a> +<a name='SkImage_isValid'></a> ## isValid -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isValid(GrContext* context) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_isValid'>isValid</a>(<a href='undocumented#GrContext'>GrContext</a>* context) const </pre> -Returns true if <a href="#Image">Image</a> can be drawn on either <a href="undocumented#Raster_Surface">Raster Surface</a> or <a href="undocumented#GPU_Surface">GPU Surface</a>. -If <a href="#SkImage_isValid_context">context</a> is nullptr, tests if <a href="#Image">Image</a> draws on <a href="undocumented#Raster_Surface">Raster Surface</a>; -otherwise, tests if <a href="#Image">Image</a> draws on <a href="undocumented#GPU_Surface">GPU Surface</a> associated with <a href="#SkImage_isValid_context">context</a>. +Returns true if <a href='#Image'>Image</a> can be drawn on either <a href='undocumented#Raster_Surface'>Raster Surface</a> or <a href='undocumented#GPU_Surface'>GPU Surface</a>. +If <a href='#SkImage_isValid_context'>context</a> is nullptr, tests if <a href='#Image'>Image</a> draws on <a href='undocumented#Raster_Surface'>Raster Surface</a>; +otherwise, tests if <a href='#Image'>Image</a> draws on <a href='undocumented#GPU_Surface'>GPU Surface</a> associated with <a href='#SkImage_isValid_context'>context</a>. -<a href="#Image">Image</a> backed by <a href="undocumented#GPU_Texture">GPU Texture</a> may become invalid if associated <a href="undocumented#GrContext">GrContext</a> is -invalid. <a href="#Lazy_Image">Lazy Image</a> may be invalid and may not draw to <a href="undocumented#Raster_Surface">Raster Surface</a> or -<a href="undocumented#GPU_Surface">GPU Surface</a> or both. +<a href='#Image'>Image</a> backed by <a href='undocumented#GPU_Texture'>GPU Texture</a> may become invalid if associated <a href='undocumented#GrContext'>GrContext</a> is +invalid. <a href='#Lazy_Image'>Lazy Image</a> may be invalid and may not draw to <a href='undocumented#Raster_Surface'>Raster Surface</a> or +<a href='undocumented#GPU_Surface'>GPU Surface</a> or both. ### Parameters -<table> <tr> <td><a name="SkImage_isValid_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> +<table> <tr> <td><a name='SkImage_isValid_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> </tr> </table> ### Return Value -true if <a href="#Image">Image</a> can be drawn +true if <a href='#Image'>Image</a> can be drawn ### Example @@ -1398,41 +1854,44 @@ true if <a href="#Image">Image</a> can be drawn ### See Also -<a href="#SkImage_isTextureBacked">isTextureBacked</a> <a href="#SkImage_isLazyGenerated">isLazyGenerated</a> +<a href='#SkImage_isTextureBacked'>isTextureBacked</a> <a href='#SkImage_isLazyGenerated'>isLazyGenerated</a> --- -<a name="SkImage_getTextureHandle"></a> +<a name='SkImage_getTextureHandle'></a> ## getTextureHandle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrBackendObject getTextureHandle(bool flushPendingGrContextIO, GrSurfaceOrigin* origin = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#GrBackendObject'>GrBackendObject</a> <a href='#SkImage_getTextureHandle'>getTextureHandle</a>(bool flushPendingGrContextIO, <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a>* origin = nullptr) const </pre> +Deprecated. + --- -<a name="SkImage_getBackendTexture"></a> +<a name='SkImage_getBackendTexture'></a> ## getBackendTexture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrBackendTexture getBackendTexture(bool flushPendingGrContextIO, GrSurfaceOrigin* origin = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#GrBackendTexture'>GrBackendTexture</a> <a href='#SkImage_getBackendTexture'>getBackendTexture</a>(bool flushPendingGrContextIO, <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a>* origin = nullptr) const </pre> -Retrieves the backend texture. If <a href="#Image">Image</a> has no backend texture, an invalid -object is returned. Call <a href="undocumented#GrBackendTexture_isValid">GrBackendTexture::isValid</a> to determine if the result +Retrieves the back-end texture. If <a href='#Image'>Image</a> has no back-end texture, an invalid +object is returned. Call <a href='undocumented#GrBackendTexture_isValid'>GrBackendTexture::isValid</a> to determine if the result is valid. -If <a href="#SkImage_getBackendTexture_flushPendingGrContextIO">flushPendingGrContextIO</a> is true, completes deferred I/O operations. +If <a href='#SkImage_getBackendTexture_flushPendingGrContextIO'>flushPendingGrContextIO</a> is true, completes deferred I/O operations. -If <a href="#SkImage_getBackendTexture_origin">origin</a> in not nullptr, copies location of content drawn into <a href="#Image">Image</a>. +If <a href='#SkImage_getBackendTexture_origin'>origin</a> in not nullptr, copies location of content drawn into <a href='#Image'>Image</a>. ### Parameters -<table> <tr> <td><a name="SkImage_getBackendTexture_flushPendingGrContextIO"> <code><strong>flushPendingGrContextIO </strong></code> </a></td> <td> -flag to flush outstanding requests</td> - </tr> <tr> <td><a name="SkImage_getBackendTexture_origin"> <code><strong>origin </strong></code> </a></td> <td> -storage for one of: <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a>, -<a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>; or nullptr</td> +<table> <tr> <td><a name='SkImage_getBackendTexture_flushPendingGrContextIO'><code><strong>flushPendingGrContextIO</strong></code></a></td> + <td>flag to flush outstanding requests</td> + </tr> + <tr> <td><a name='SkImage_getBackendTexture_origin'><code><strong>origin</strong></code></a></td> + <td>storage for one of: <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a>, +<a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>; or nullptr</td> </tr> </table> @@ -1446,105 +1905,118 @@ back-end API texture handle; invalid on failure ### See Also -<a href="#SkImage_MakeFromTexture">MakeFromTexture</a><sup><a href="#SkImage_MakeFromTexture_2">[2]</a></sup> <a href="#SkImage_isTextureBacked">isTextureBacked</a> +<a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> <a href='#SkImage_isTextureBacked'>isTextureBacked</a> --- -## <a name="SkImage_CachingHint"></a> Enum SkImage::CachingHint +## <a name='SkImage_CachingHint'>Enum SkImage::CachingHint</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkImage_CachingHint">CachingHint</a> { - <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, - <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, + enum <a href='#SkImage_CachingHint'>CachingHint</a> { + <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, + <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a>, }; </pre> -<a href="#SkImage_CachingHint">CachingHint</a> selects whether Skia may internally cache <a href="SkBitmap_Reference#Bitmap">Bitmaps</a> generated by -decoding <a href="#Image">Image</a>, or by copying <a href="#Image">Image</a> from GPU to CPU. The default behavior -allows caching <a href="SkBitmap_Reference#Bitmap">Bitmaps</a>. +<a href='#SkImage_CachingHint'>CachingHint</a> selects whether Skia may internally cache <a href='SkBitmap_Reference#Bitmap'>Bitmaps</a> generated by +decoding <a href='#Image'>Image</a>, or by copying <a href='#Image'>Image</a> from GPU to CPU. The default behavior +allows caching <a href='SkBitmap_Reference#Bitmap'>Bitmaps</a>. -Choose <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a> if <a href="#Image">Image</a> pixels are to be used only once, or -if <a href="#Image">Image</a> pixels reside in a cache outside of Skia, or to reduce memory pressure. +Choose <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a> if <a href='#Image'>Image</a> pixels are to be used only once, or +if <a href='#Image'>Image</a> pixels reside in a cache outside of Skia, or to reduce memory pressure. -Choosing <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a> does not ensure that pixels will be cached. -<a href="#Image">Image</a> pixels may not be cached if memory requirements are too large or +Choosing <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a> does not ensure that pixels will be cached. +<a href='#Image'>Image</a> pixels may not be cached if memory requirements are too large or pixels are not accessible. ### Constants -<table> - <tr> - <td><a name="SkImage_kAllow_CachingHint"> <code><strong>SkImage::kAllow_CachingHint </strong></code> </a></td><td>0</td><td>Allows Skia to internally cache decoded and copied pixels. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkImage_kAllow_CachingHint'><code>SkImage::kAllow_CachingHint</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +allows internally caching decoded and copied pixels</td> </tr> <tr> - <td><a name="SkImage_kDisallow_CachingHint"> <code><strong>SkImage::kDisallow_CachingHint </strong></code> </a></td><td>1</td><td>Disallows Skia from internally caching decoded and copied pixels. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkImage_kDisallow_CachingHint'><code>SkImage::kDisallow_CachingHint</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +disallows internally caching decoded and copied pixels</td> </tr> </table> ### See Also -<a href="#SkImage_readPixels">readPixels</a><sup><a href="#SkImage_readPixels_2">[2]</a></sup> <a href="#SkImage_scalePixels">scalePixels</a> - +<a href='#SkImage_readPixels'>readPixels</a><sup><a href='#SkImage_readPixels_2'>[2]</a></sup> <a href='#SkImage_scalePixels'>scalePixels</a> - -<a name="SkImage_readPixels"></a> +<a name='SkImage_readPixels'></a> ## readPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, - CachingHint cachingHint = kAllow_CachingHint) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, + <a href='#SkImage_CachingHint'>CachingHint</a> cachingHint = <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>) const </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Image">Image</a> to <a href="#SkImage_readPixels_dstPixels">dstPixels</a>. Copy starts at offset (<a href="#SkImage_readPixels_srcX">srcX</a>, <a href="#SkImage_readPixels_srcY">srcY</a>), -and does not exceed <a href="#Image">Image</a> (<a href="#SkImage_width">width</a>, <a href="#SkImage_height">height</a>). +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Image'>Image</a> to <a href='#SkImage_readPixels_dstPixels'>dstPixels</a>. Copy starts at offset (<a href='#SkImage_readPixels_srcX'>srcX</a>, <a href='#SkImage_readPixels_srcY'>srcY</a>), +and does not exceed <a href='#Image'>Image</a> (<a href='#SkImage_width'>width</a>, <a href='#SkImage_height'>height</a>). -<a href="#SkImage_readPixels_dstInfo">dstInfo</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of -destination. <a href="#SkImage_readPixels_dstRowBytes">dstRowBytes</a> specifics the gap from one destination row to the next. +<a href='#SkImage_readPixels_dstInfo'>dstInfo</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a> of +destination. <a href='#SkImage_readPixels_dstRowBytes'>dstRowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkImage_readPixels_dstInfo">dstInfo</a>.addr() equals nullptr</td> </tr> <tr> - <td><a href="#SkImage_readPixels_dstRowBytes">dstRowBytes</a> is less than <a href="#SkImage_readPixels_dstInfo">dstInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkImage_readPixels_dstInfo'>dstInfo</a>.addr() equals nullptr</td> + </tr> <tr> + <td><a href='#SkImage_readPixels_dstRowBytes'>dstRowBytes</a> is less than <a href='#SkImage_readPixels_dstInfo'>dstInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkImage_readPixels_dstInfo">dstInfo</a>.<a href="#SkImage_colorType">colorType</a> must match. -If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkImage_readPixels_dstInfo">dstInfo</a>.<a href="#SkImage_colorSpace">colorSpace</a> must match. -If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkImage_readPixels_dstInfo">dstInfo</a>.<a href="#SkImage_alphaType">alphaType</a> must -match. If <a href="#Image">Image</a> <a href="undocumented#Color_Space">Color Space</a> is nullptr, <a href="#SkImage_readPixels_dstInfo">dstInfo</a>.<a href="#SkImage_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkImage_readPixels_dstInfo'>dstInfo</a>.<a href='#SkImage_colorType'>colorType</a> must match. +If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkImage_readPixels_dstInfo'>dstInfo</a>.<a href='#SkImage_colorSpace'>colorSpace</a> must match. +If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkImage_readPixels_dstInfo'>dstInfo</a>.<a href='#SkImage_alphaType'>alphaType</a> must +match. If <a href='#Image'>Image</a> <a href='undocumented#Color_Space'>Color Space</a> is nullptr, <a href='#SkImage_readPixels_dstInfo'>dstInfo</a>.<a href='#SkImage_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkImage_readPixels_srcX">srcX</a> and <a href="#SkImage_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkImage_width">width</a> or <a href="#SkImage_height">height</a> is zero or negative. -Returns false ifabs(srcX) >= <a href="#Image">Image</a> <a href="#SkImage_width">width</a>, -or ifabs(srcY) >= <a href="#Image">Image</a> <a href="#SkImage_height">height</a>. +<a href='#SkImage_readPixels_srcX'>srcX</a> and <a href='#SkImage_readPixels_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkImage_width'>width</a> or <a href='#SkImage_height'>height</a> is zero or negative. +Returns false ifabs(srcX) >= <a href='#Image'>Image</a> <a href='#SkImage_width'>width</a>, +or ifabs(srcY) >= <a href='#Image'>Image</a> <a href='#SkImage_height'>height</a>. -If <a href="#SkImage_readPixels_cachingHint">cachingHint</a> is <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, pixels may be retained locally. -If <a href="#SkImage_readPixels_cachingHint">cachingHint</a> is <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, pixels are not added to the local cache. +If <a href='#SkImage_readPixels_cachingHint'>cachingHint</a> is <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, pixels may be retained locally. +If <a href='#SkImage_readPixels_cachingHint'>cachingHint</a> is <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a>, pixels are not added to the local cache. ### Parameters -<table> <tr> <td><a name="SkImage_readPixels_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -destination width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkImage_readPixels_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -destination pixel storage</td> - </tr> <tr> <td><a name="SkImage_readPixels_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -destination row length</td> - </tr> <tr> <td><a name="SkImage_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkImage_width">width</a></td> - </tr> <tr> <td><a name="SkImage_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkImage_height">height</a></td> - </tr> <tr> <td><a name="SkImage_readPixels_cachingHint"> <code><strong>cachingHint </strong></code> </a></td> <td> -one of: <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a></td> +<table> <tr> <td><a name='SkImage_readPixels_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>destination width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkImage_readPixels_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>destination pixel storage</td> + </tr> + <tr> <td><a name='SkImage_readPixels_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>destination row length</td> + </tr> + <tr> <td><a name='SkImage_readPixels_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkImage_width'>width</a></td> + </tr> + <tr> <td><a name='SkImage_readPixels_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkImage_height'>height</a></td> + </tr> + <tr> <td><a name='SkImage_readPixels_cachingHint'><code><strong>cachingHint</strong></code></a></td> + <td>one of: <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkImage_readPixels_dstPixels">dstPixels</a> +true if pixels are copied to <a href='#SkImage_readPixels_dstPixels'>dstPixels</a> ### Example @@ -1552,59 +2024,66 @@ true if pixels are copied to <a href="#SkImage_readPixels_dstPixels">dstPixels</ ### See Also -<a href="#SkImage_scalePixels">scalePixels</a> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkImage_scalePixels'>scalePixels</a> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkImage_readPixels_2"></a> +<a name='SkImage_readPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& dst, int srcX, int srcY, CachingHint cachingHint = kAllow_CachingHint) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_readPixels'>readPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& dst, int srcX, int srcY, <a href='#SkImage_CachingHint'>CachingHint</a> cachingHint = <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Image">Image</a> to <a href="#SkImage_readPixels_2_dst">dst</a>. Copy starts at (<a href="#SkImage_readPixels_2_srcX">srcX</a>, <a href="#SkImage_readPixels_2_srcY">srcY</a>), and -does not exceed <a href="#Image">Image</a> (<a href="#SkImage_width">width</a>, <a href="#SkImage_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Image'>Image</a> to <a href='#SkImage_readPixels_2_dst'>dst</a>. Copy starts at (<a href='#SkImage_readPixels_2_srcX'>srcX</a>, <a href='#SkImage_readPixels_2_srcY'>srcY</a>), and +does not exceed <a href='#Image'>Image</a> (<a href='#SkImage_width'>width</a>, <a href='#SkImage_height'>height</a>). -<a href="#SkImage_readPixels_2_dst">dst</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, pixel storage, -and row bytes of destination. <a href="#SkImage_readPixels_2_dst">dst</a>.<a href="SkPixmap_Reference#SkPixmap">rowBytes</a> specifics the gap from one destination +<a href='#SkImage_readPixels_2_dst'>dst</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, pixel storage, +and row bytes of destination. <a href='#SkImage_readPixels_2_dst'>dst</a>.<a href='SkPixmap_Reference#SkPixmap'>rowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if: <table> <tr> - <td><a href="#SkImage_readPixels_2_dst">dst</a> pixel storage equals nullptr</td> </tr> <tr> - <td><a href="#SkImage_readPixels_2_dst">dst</a>.<a href="SkPixmap_Reference#SkPixmap">rowBytes</a> is less than <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a></td> </tr> <tr> - <td><a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr</td> </tr> + <td><a href='#SkImage_readPixels_2_dst'>dst</a> pixel storage equals nullptr</td> + </tr> <tr> + <td><a href='#SkImage_readPixels_2_dst'>dst</a>.<a href='SkPixmap_Reference#SkPixmap'>rowBytes</a> is less than <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a></td> + </tr> <tr> + <td><a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td> + </tr> </table> -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkImage_readPixels_2_dst">dst</a>.<a href="#SkImage_colorType">colorType</a> must match. -If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkImage_readPixels_2_dst">dst</a>.<a href="#SkImage_colorSpace">colorSpace</a> must match. -If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkImage_readPixels_2_dst">dst</a>.<a href="#SkImage_alphaType">alphaType</a> must -match. If <a href="#Image">Image</a> <a href="undocumented#Color_Space">Color Space</a> is nullptr, <a href="#SkImage_readPixels_2_dst">dst</a>.<a href="#SkImage_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkImage_readPixels_2_dst'>dst</a>.<a href='#SkImage_colorType'>colorType</a> must match. +If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkImage_readPixels_2_dst'>dst</a>.<a href='#SkImage_colorSpace'>colorSpace</a> must match. +If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkImage_readPixels_2_dst'>dst</a>.<a href='#SkImage_alphaType'>alphaType</a> must +match. If <a href='#Image'>Image</a> <a href='undocumented#Color_Space'>Color Space</a> is nullptr, <a href='#SkImage_readPixels_2_dst'>dst</a>.<a href='#SkImage_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkImage_readPixels_2_srcX">srcX</a> and <a href="#SkImage_readPixels_2_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkImage_width">width</a> or <a href="#SkImage_height">height</a> is zero or negative. -Returns false ifabs(srcX) >= <a href="#Image">Image</a> <a href="#SkImage_width">width</a>, -or ifabs(srcY) >= <a href="#Image">Image</a> <a href="#SkImage_height">height</a>. -If <a href="#SkImage_readPixels_2_cachingHint">cachingHint</a> is <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, pixels may be retained locally. -If <a href="#SkImage_readPixels_2_cachingHint">cachingHint</a> is <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, pixels are not added to the local cache. +<a href='#SkImage_readPixels_2_srcX'>srcX</a> and <a href='#SkImage_readPixels_2_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkImage_width'>width</a> or <a href='#SkImage_height'>height</a> is zero or negative. +Returns false ifabs(srcX) >= <a href='#Image'>Image</a> <a href='#SkImage_width'>width</a>, +or ifabs(srcY) >= <a href='#Image'>Image</a> <a href='#SkImage_height'>height</a>. + +If <a href='#SkImage_readPixels_2_cachingHint'>cachingHint</a> is <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, pixels may be retained locally. +If <a href='#SkImage_readPixels_2_cachingHint'>cachingHint</a> is <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a>, pixels are not added to the local cache. ### Parameters -<table> <tr> <td><a name="SkImage_readPixels_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> - </tr> <tr> <td><a name="SkImage_readPixels_2_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkImage_width">width</a></td> - </tr> <tr> <td><a name="SkImage_readPixels_2_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkImage_height">height</a></td> - </tr> <tr> <td><a name="SkImage_readPixels_2_cachingHint"> <code><strong>cachingHint </strong></code> </a></td> <td> -one of: <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a></td> +<table> <tr> <td><a name='SkImage_readPixels_2_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> + </tr> + <tr> <td><a name='SkImage_readPixels_2_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkImage_width'>width</a></td> + </tr> + <tr> <td><a name='SkImage_readPixels_2_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkImage_height'>height</a></td> + </tr> + <tr> <td><a name='SkImage_readPixels_2_cachingHint'><code><strong>cachingHint</strong></code></a></td> + <td>one of: <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkImage_readPixels_2_dst">dst</a> +true if pixels are copied to <a href='#SkImage_readPixels_2_dst'>dst</a> ### Example @@ -1612,55 +2091,57 @@ true if pixels are copied to <a href="#SkImage_readPixels_2_dst">dst</a> ### See Also -<a href="#SkImage_scalePixels">scalePixels</a> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkPixmap_Reference#SkPixmap_readPixels">SkPixmap::readPixels</a><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="SkPixmap_Reference#SkPixmap_readPixels_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkImage_scalePixels'>scalePixels</a> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkPixmap_Reference#SkPixmap_readPixels'>SkPixmap::readPixels</a><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='SkPixmap_Reference#SkPixmap_readPixels_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkImage_scalePixels"></a> +<a name='SkImage_scalePixels'></a> ## scalePixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality, - CachingHint cachingHint = kAllow_CachingHint) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_scalePixels'>scalePixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& dst, <a href='undocumented#SkFilterQuality'>SkFilterQuality</a> filterQuality, + <a href='#SkImage_CachingHint'>CachingHint</a> cachingHint = <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>) const </pre> -Copies <a href="#Image">Image</a> to <a href="#SkImage_scalePixels_dst">dst</a>, scaling pixels to fit <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_width">width</a> and <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_height">height</a>, and -converting pixels to match <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_colorType">colorType</a> and <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_alphaType">alphaType</a>. Returns true if -pixels are copied. Returns false if <a href="#SkImage_scalePixels_dst">dst</a>.addr() is nullptr, or <a href="#SkImage_scalePixels_dst">dst</a>.<a href="SkPixmap_Reference#SkPixmap">rowBytes</a> is -less than <a href="#SkImage_scalePixels_dst">dst</a> <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. +Copies <a href='#Image'>Image</a> to <a href='#SkImage_scalePixels_dst'>dst</a>, scaling pixels to fit <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_width'>width</a> and <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_height'>height</a>, and +converting pixels to match <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_colorType'>colorType</a> and <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_alphaType'>alphaType</a>. Returns true if +pixels are copied. Returns false if <a href='#SkImage_scalePixels_dst'>dst</a>.addr() is nullptr, or <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='SkPixmap_Reference#SkPixmap'>rowBytes</a> is +less than <a href='#SkImage_scalePixels_dst'>dst</a> <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a>. -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_colorType">colorType</a> must match. -If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_colorSpace">colorSpace</a> must match. -If <a href="#Image">Image</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_alphaType">alphaType</a> must -match. If <a href="#Image">Image</a> <a href="undocumented#Color_Space">Color Space</a> is nullptr, <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_colorType'>colorType</a> must match. +If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_colorSpace'>colorSpace</a> must match. +If <a href='#Image'>Image</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_alphaType'>alphaType</a> must +match. If <a href='#Image'>Image</a> <a href='undocumented#Color_Space'>Color Space</a> is nullptr, <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -Scales the image, with <a href="#SkImage_scalePixels_filterQuality">filterQuality</a>, to match <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_width">width</a> and <a href="#SkImage_scalePixels_dst">dst</a>.<a href="#SkImage_height">height</a>. -<a href="#SkImage_scalePixels_filterQuality">filterQuality</a> <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a> is fastest, typically implemented with -<a href="undocumented#Nearest_Neighbor">Filter Quality Nearest Neighbor</a>. <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a> is typically implemented with -<a href="undocumented#Bilerp">Filter Quality Bilerp</a>. <a href="undocumented#kMedium_SkFilterQuality">kMedium_SkFilterQuality</a> is typically implemented with -<a href="undocumented#Bilerp">Filter Quality Bilerp</a>, and <a href="undocumented#MipMap">Filter Quality MipMap</a> when size is reduced. -<a href="undocumented#kHigh_SkFilterQuality">kHigh_SkFilterQuality</a> is slowest, typically implemented with <a href="undocumented#BiCubic">Filter Quality BiCubic</a>. +Scales the image, with <a href='#SkImage_scalePixels_filterQuality'>filterQuality</a>, to match <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_width'>width</a> and <a href='#SkImage_scalePixels_dst'>dst</a>.<a href='#SkImage_height'>height</a>. +<a href='#SkImage_scalePixels_filterQuality'>filterQuality</a> <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a> is fastest, typically implemented with +<a href='undocumented#Nearest_Neighbor'>Filter Quality Nearest Neighbor</a>. <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a> is typically implemented with +<a href='undocumented#Bilerp'>Filter Quality Bilerp</a>. <a href='undocumented#kMedium_SkFilterQuality'>kMedium_SkFilterQuality</a> is typically implemented with +<a href='undocumented#Bilerp'>Filter Quality Bilerp</a>, and <a href='undocumented#MipMap'>Filter Quality MipMap</a> when size is reduced. +<a href='undocumented#kHigh_SkFilterQuality'>kHigh_SkFilterQuality</a> is slowest, typically implemented with <a href='undocumented#BiCubic'>Filter Quality BiCubic</a>. -If <a href="#SkImage_scalePixels_cachingHint">cachingHint</a> is <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, pixels may be retained locally. -If <a href="#SkImage_scalePixels_cachingHint">cachingHint</a> is <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>, pixels are not added to the local cache. +If <a href='#SkImage_scalePixels_cachingHint'>cachingHint</a> is <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, pixels may be retained locally. +If <a href='#SkImage_scalePixels_cachingHint'>cachingHint</a> is <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a>, pixels are not added to the local cache. ### Parameters -<table> <tr> <td><a name="SkImage_scalePixels_dst"> <code><strong>dst </strong></code> </a></td> <td> -destination <a href="SkPixmap_Reference#Pixmap">Pixmap</a>: <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels, row bytes</td> - </tr> <tr> <td><a name="SkImage_scalePixels_filterQuality"> <code><strong>filterQuality </strong></code> </a></td> <td> -one of: <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a>, <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a>, -<a href="undocumented#kMedium_SkFilterQuality">kMedium_SkFilterQuality</a>, <a href="undocumented#kHigh_SkFilterQuality">kHigh_SkFilterQuality</a></td> - </tr> <tr> <td><a name="SkImage_scalePixels_cachingHint"> <code><strong>cachingHint </strong></code> </a></td> <td> -one of: <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>, <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a></td> +<table> <tr> <td><a name='SkImage_scalePixels_dst'><code><strong>dst</strong></code></a></td> + <td>destination <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>: <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels, row bytes</td> + </tr> + <tr> <td><a name='SkImage_scalePixels_filterQuality'><code><strong>filterQuality</strong></code></a></td> + <td>one of: <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a>, +<a href='undocumented#kMedium_SkFilterQuality'>kMedium_SkFilterQuality</a>, <a href='undocumented#kHigh_SkFilterQuality'>kHigh_SkFilterQuality</a></td> + </tr> + <tr> <td><a name='SkImage_scalePixels_cachingHint'><code><strong>cachingHint</strong></code></a></td> + <td>one of: <a href='#SkImage_kAllow_CachingHint'>kAllow CachingHint</a>, <a href='#SkImage_kDisallow_CachingHint'>kDisallow CachingHint</a></td> </tr> </table> ### Return Value -true if pixels are scaled to fit <a href="#SkImage_scalePixels_dst">dst</a> +true if pixels are scaled to fit <a href='#SkImage_scalePixels_dst'>dst</a> ### Example @@ -1668,46 +2149,47 @@ true if pixels are scaled to fit <a href="#SkImage_scalePixels_dst">dst</a> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawImage">SkCanvas::drawImage</a><sup><a href="SkCanvas_Reference#SkCanvas_drawImage_2">[2]</a></sup> <a href="#SkImage_readPixels">readPixels</a><sup><a href="#SkImage_readPixels_2">[2]</a></sup> <a href="SkPixmap_Reference#SkPixmap_scalePixels">SkPixmap::scalePixels</a> +<a href='SkCanvas_Reference#SkCanvas_drawImage'>SkCanvas::drawImage</a><sup><a href='SkCanvas_Reference#SkCanvas_drawImage_2'>[2]</a></sup> <a href='#SkImage_readPixels'>readPixels</a><sup><a href='#SkImage_readPixels_2'>[2]</a></sup> <a href='SkPixmap_Reference#SkPixmap_scalePixels'>SkPixmap::scalePixels</a> --- -<a name="SkImage_encodeToData"></a> +<a name='SkImage_encodeToData'></a> ## encodeToData -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkData> encodeToData(SkEncodedImageFormat encodedImageFormat, int quality) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkImage_encodeToData'>encodeToData</a>(<a href='undocumented#SkEncodedImageFormat'>SkEncodedImageFormat</a> encodedImageFormat, int quality) const </pre> -Encodes <a href="#Image">Image</a> pixels, returning result as <a href="undocumented#SkData">SkData</a>. +Encodes <a href='#Image'>Image</a> pixels, returning result as <a href='undocumented#SkData'>SkData</a>. -Returns nullptr if encoding fails, or if <a href="#SkImage_encodeToData_encodedImageFormat">encodedImageFormat</a> is not supported. +Returns nullptr if encoding fails, or if <a href='#SkImage_encodeToData_encodedImageFormat'>encodedImageFormat</a> is not supported. -<a href="#Image">Image</a> encoding in a format requires both building with one or more of: +<a href='#Image'>Image</a> encoding in a format requires both building with one or more of: SK_HAS_JPEG_LIBRARY, SK_HAS_PNG_LIBRARY, SK_HAS_WEBP_LIBRARY; and platform support for the encoded format. -If SK_BUILD_FOR_MAC or SK_BUILD_FOR_IOS is defined, <a href="#SkImage_encodeToData_encodedImageFormat">encodedImageFormat</a> can -additionally be one of: <a href="undocumented#SkEncodedImageFormat_kICO">SkEncodedImageFormat::kICO</a>, <a href="undocumented#SkEncodedImageFormat_kBMP">SkEncodedImageFormat::kBMP</a>, -<a href="undocumented#SkEncodedImageFormat_kGIF">SkEncodedImageFormat::kGIF</a>. +If SK_BUILD_FOR_MAC or SK_BUILD_FOR_IOS is defined, <a href='#SkImage_encodeToData_encodedImageFormat'>encodedImageFormat</a> can +additionally be one of: <a href='undocumented#SkEncodedImageFormat_kICO'>SkEncodedImageFormat::kICO</a>, <a href='undocumented#SkEncodedImageFormat_kBMP'>SkEncodedImageFormat::kBMP</a>, +<a href='undocumented#SkEncodedImageFormat_kGIF'>SkEncodedImageFormat::kGIF</a>. -<a href="#SkImage_encodeToData_quality">quality</a> is a platform and format specific metric trading off size and encoding -error. When used, <a href="#SkImage_encodeToData_quality">quality</a> equaling 100 encodes with the least error. <a href="#SkImage_encodeToData_quality">quality</a> may +<a href='#SkImage_encodeToData_quality'>quality</a> is a platform and format specific metric trading off size and encoding +error. When used, <a href='#SkImage_encodeToData_quality'>quality</a> equaling 100 encodes with the least error. <a href='#SkImage_encodeToData_quality'>quality</a> may be ignored by the encoder. ### Parameters -<table> <tr> <td><a name="SkImage_encodeToData_encodedImageFormat"> <code><strong>encodedImageFormat </strong></code> </a></td> <td> -one of: <a href="undocumented#SkEncodedImageFormat_kJPEG">SkEncodedImageFormat::kJPEG</a>, <a href="undocumented#SkEncodedImageFormat_kPNG">SkEncodedImageFormat::kPNG</a>, -<a href="undocumented#SkEncodedImageFormat_kWEBP">SkEncodedImageFormat::kWEBP</a></td> - </tr> <tr> <td><a name="SkImage_encodeToData_quality"> <code><strong>quality </strong></code> </a></td> <td> -encoder specific metric with 100 equaling best</td> +<table> <tr> <td><a name='SkImage_encodeToData_encodedImageFormat'><code><strong>encodedImageFormat</strong></code></a></td> + <td>one of: <a href='undocumented#SkEncodedImageFormat_kJPEG'>SkEncodedImageFormat::kJPEG</a>, <a href='undocumented#SkEncodedImageFormat_kPNG'>SkEncodedImageFormat::kPNG</a>, +<a href='undocumented#SkEncodedImageFormat_kWEBP'>SkEncodedImageFormat::kWEBP</a></td> + </tr> + <tr> <td><a name='SkImage_encodeToData_quality'><code><strong>quality</strong></code></a></td> + <td>encoder specific metric with 100 equaling best</td> </tr> </table> ### Return Value -encoded <a href="#Image">Image</a>, or nullptr +encoded <a href='#Image'>Image</a>, or nullptr ### Example @@ -1715,26 +2197,26 @@ encoded <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_refEncodedData">refEncodedData</a> <a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> +<a href='#SkImage_refEncodedData'>refEncodedData</a> <a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a> --- -<a name="SkImage_encodeToData_2"></a> +<a name='SkImage_encodeToData_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkData> encodeToData() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkImage_encodeToData'>encodeToData</a>() const </pre> -Encodes <a href="#Image">Image</a> pixels, returning result as <a href="undocumented#SkData">SkData</a>. Returns existing encoded data -if present; otherwise, <a href="#Image">Image</a> is encoded with <a href="undocumented#SkEncodedImageFormat_kPNG">SkEncodedImageFormat::kPNG</a>. Skia -must be built with SK_HAS_PNG_LIBRARY to encode <a href="#Image">Image</a>. +Encodes <a href='#Image'>Image</a> pixels, returning result as <a href='undocumented#SkData'>SkData</a>. Returns existing encoded data +if present; otherwise, <a href='#Image'>Image</a> is encoded with <a href='undocumented#SkEncodedImageFormat_kPNG'>SkEncodedImageFormat::kPNG</a>. Skia +must be built with SK_HAS_PNG_LIBRARY to encode <a href='#Image'>Image</a>. Returns nullptr if existing encoded data is missing or invalid, and encoding fails. ### Return Value -encoded <a href="#Image">Image</a>, or nullptr +encoded <a href='#Image'>Image</a>, or nullptr ### Example @@ -1742,26 +2224,26 @@ encoded <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_refEncodedData">refEncodedData</a> <a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> +<a href='#SkImage_refEncodedData'>refEncodedData</a> <a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a> --- -<a name="SkImage_refEncodedData"></a> +<a name='SkImage_refEncodedData'></a> ## refEncodedData -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkData> refEncodedData() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkImage_refEncodedData'>refEncodedData</a>() const </pre> -Returns encoded <a href="#Image">Image</a> pixels as <a href="undocumented#SkData">SkData</a>, if <a href="#Image">Image</a> was created from supported +Returns encoded <a href='#Image'>Image</a> pixels as <a href='undocumented#SkData'>SkData</a>, if <a href='#Image'>Image</a> was created from supported encoded stream format. Platform support for formats vary and may require building with one or more of: SK_HAS_JPEG_LIBRARY, SK_HAS_PNG_LIBRARY, SK_HAS_WEBP_LIBRARY. -Returns nullptr if <a href="#Image">Image</a> contents are not encoded. +Returns nullptr if <a href='#Image'>Image</a> contents are not encoded. ### Return Value -encoded <a href="#Image">Image</a>, or nullptr +encoded <a href='#Image'>Image</a>, or nullptr ### Example @@ -1769,40 +2251,59 @@ encoded <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_encodeToData">encodeToData</a><sup><a href="#SkImage_encodeToData_2">[2]</a></sup> <a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> +<a href='#SkImage_encodeToData'>encodeToData</a><sup><a href='#SkImage_encodeToData_2'>[2]</a></sup> <a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a> --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_encodeToData'>encodeToData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns encoded <a href='#Image'>Image</a> as <a href='undocumented#SkData'>SkData</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_encodeToData'>encodeToData(SkEncodedImageFormat encodedImageFormat, int quality)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_encodeToData_2'>encodeToData</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_refEncodedData'>refEncodedData</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Image'>Image</a> encoded in <a href='undocumented#SkData'>SkData</a> if present</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkImage_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Image'>Image</a> to machine readable form</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkImage_encodeToData">encodeToData</a> | returns encoded <a href="#Image">Image</a> as <a href="undocumented#SkData">SkData</a> | -| | <a href="#SkImage_encodeToData">encodeToData(SkEncodedImageFormat encodedImageFormat, int quality)</a> const | -| | <a href="#SkImage_encodeToData_2">encodeToData</a> const | -| <a href="#SkImage_refEncodedData">refEncodedData</a> | returns <a href="#Image">Image</a> encoded in <a href="undocumented#SkData">SkData</a> if present | -| <a href="#SkImage_toString">toString</a> | converts <a href="#Image">Image</a> to machine readable form | -<a name="SkImage_toString"></a> +<a name='SkImage_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const char* toString(SkString* string) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const char* <a href='#SkImage_toString'>toString</a>(<a href='undocumented#SkString'>SkString</a>* string) const </pre> -Appends <a href="#Image">Image</a> description to <a href="#SkImage_toString_string">string</a>, including unique ID, width, height, and +Appends <a href='#Image'>Image</a> description to <a href='#SkImage_toString_string'>string</a>, including unique ID, width, height, and whether the image is opaque. ### Parameters -<table> <tr> <td><a name="SkImage_toString_string"> <code><strong>string </strong></code> </a></td> <td> -storage for description; existing content is preserved</td> +<table> <tr> <td><a name='SkImage_toString_string'><code><strong>string</strong></code></a></td> + <td>storage for description; existing content is preserved</td> </tr> </table> ### Return Value -<a href="#SkImage_toString_string">string</a> appended with <a href="#Image">Image</a> description +<a href='#SkImage_toString_string'>string</a> appended with <a href='#Image'>Image</a> description ### Example @@ -1810,33 +2311,33 @@ storage for description; existing content is preserved</td> ### See Also -<a href="SkPaint_Reference#SkPaint_toString">SkPaint::toString</a> +<a href='SkPaint_Reference#SkPaint_toString'>SkPaint::toString</a> --- -<a name="SkImage_makeSubset"></a> +<a name='SkImage_makeSubset'></a> ## makeSubset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeSubset(const SkIRect& subset) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_makeSubset'>makeSubset</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& subset) const </pre> -Returns <a href="#SkImage_makeSubset_subset">subset</a> of <a href="#Image">Image</a>. <a href="#SkImage_makeSubset_subset">subset</a> must be fully contained by <a href="#Image">Image</a> <a href="#SkImage_dimensions">dimensions</a>. +Returns <a href='#SkImage_makeSubset_subset'>subset</a> of <a href='#Image'>Image</a>. <a href='#SkImage_makeSubset_subset'>subset</a> must be fully contained by <a href='#Image'>Image</a> <a href='#SkImage_dimensions'>dimensions</a>. The implementation may share pixels, or may copy them. -Returns nullptr if <a href="#SkImage_makeSubset_subset">subset</a> is empty, or <a href="#SkImage_makeSubset_subset">subset</a> is not contained by bounds, or -pixels in <a href="#Image">Image</a> could not be read or copied. +Returns nullptr if <a href='#SkImage_makeSubset_subset'>subset</a> is empty, or <a href='#SkImage_makeSubset_subset'>subset</a> is not contained by bounds, or +pixels in <a href='#Image'>Image</a> could not be read or copied. ### Parameters -<table> <tr> <td><a name="SkImage_makeSubset_subset"> <code><strong>subset </strong></code> </a></td> <td> -bounds of returned <a href="#Image">Image</a></td> +<table> <tr> <td><a name='SkImage_makeSubset_subset'><code><strong>subset</strong></code></a></td> + <td>bounds of returned <a href='#Image'>Image</a></td> </tr> </table> ### Return Value -partial or full <a href="#Image">Image</a>, or nullptr +partial or full <a href='#Image'>Image</a>, or nullptr ### Example @@ -1844,36 +2345,37 @@ partial or full <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromEncoded">MakeFromEncoded</a> +<a href='#SkImage_MakeFromEncoded'>MakeFromEncoded</a> --- -<a name="SkImage_makeTextureImage"></a> +<a name='SkImage_makeTextureImage'></a> ## makeTextureImage -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeTextureImage(GrContext* context, SkColorSpace* dstColorSpace) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_makeTextureImage'>makeTextureImage</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkColorSpace'>SkColorSpace</a>* dstColorSpace) const </pre> -Returns <a href="#Image">Image</a> backed by <a href="undocumented#GPU_Texture">GPU Texture</a> associated with <a href="#SkImage_makeTextureImage_context">context</a>. Returned <a href="#Image">Image</a> is -compatible with <a href="SkSurface_Reference#Surface">Surface</a> created with <a href="#SkImage_makeTextureImage_dstColorSpace">dstColorSpace</a>. Returns original -<a href="#Image">Image</a> if <a href="#SkImage_makeTextureImage_context">context</a> and <a href="#SkImage_makeTextureImage_dstColorSpace">dstColorSpace</a> match. +Returns <a href='#Image'>Image</a> backed by <a href='undocumented#GPU_Texture'>GPU Texture</a> associated with <a href='#SkImage_makeTextureImage_context'>context</a>. Returned <a href='#Image'>Image</a> is +compatible with <a href='SkSurface_Reference#Surface'>Surface</a> created with <a href='#SkImage_makeTextureImage_dstColorSpace'>dstColorSpace</a>. Returns original +<a href='#Image'>Image</a> if <a href='#SkImage_makeTextureImage_context'>context</a> and <a href='#SkImage_makeTextureImage_dstColorSpace'>dstColorSpace</a> match. -Returns nullptr if <a href="#SkImage_makeTextureImage_context">context</a> is nullptr, or if <a href="#Image">Image</a> was created with another -<a href="undocumented#GrContext">GrContext</a>. +Returns nullptr if <a href='#SkImage_makeTextureImage_context'>context</a> is nullptr, or if <a href='#Image'>Image</a> was created with another +<a href='undocumented#GrContext'>GrContext</a>. ### Parameters -<table> <tr> <td><a name="SkImage_makeTextureImage_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_makeTextureImage_dstColorSpace"> <code><strong>dstColorSpace </strong></code> </a></td> <td> -range of colors of matching <a href="SkSurface_Reference#Surface">Surface</a> on GPU</td> +<table> <tr> <td><a name='SkImage_makeTextureImage_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_makeTextureImage_dstColorSpace'><code><strong>dstColorSpace</strong></code></a></td> + <td>range of colors of matching <a href='SkSurface_Reference#Surface'>Surface</a> on GPU</td> </tr> </table> ### Return Value -created <a href="#Image">Image</a>, or nullptr +created <a href='#Image'>Image</a>, or nullptr ### Example @@ -1881,26 +2383,26 @@ created <a href="#Image">Image</a>, or nullptr ### See Also -<a href="#SkImage_MakeFromTexture">MakeFromTexture</a><sup><a href="#SkImage_MakeFromTexture_2">[2]</a></sup> +<a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> --- -<a name="SkImage_makeNonTextureImage"></a> +<a name='SkImage_makeNonTextureImage'></a> ## makeNonTextureImage -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeNonTextureImage() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_makeNonTextureImage'>makeNonTextureImage</a>() const </pre> -Returns <a href="#Raster_Image">Raster Image</a> or <a href="#Lazy_Image">Lazy Image</a>. Copies <a href="#Image">Image</a> backed by <a href="undocumented#GPU_Texture">GPU Texture</a> into -CPU memory if needed. Returns original <a href="#Image">Image</a> if decoded in <a href="undocumented#Raster_Bitmap">Raster Bitmap</a>, +Returns <a href='#Raster_Image'>Raster Image</a> or <a href='#Lazy_Image'>Lazy Image</a>. Copies <a href='#Image'>Image</a> backed by <a href='undocumented#GPU_Texture'>GPU Texture</a> into +CPU memory if needed. Returns original <a href='#Image'>Image</a> if decoded in <a href='undocumented#Raster_Bitmap'>Raster Bitmap</a>, or if encoded in a stream. -Returns nullptr if backed by <a href="undocumented#GPU_Texture">GPU Texture</a> and copy fails. +Returns nullptr if backed by <a href='undocumented#GPU_Texture'>GPU Texture</a> and copy fails. ### Return Value -<a href="#Raster_Image">Raster Image</a>, <a href="#Lazy_Image">Lazy Image</a>, or nullptr +<a href='#Raster_Image'>Raster Image</a>, <a href='#Lazy_Image'>Lazy Image</a>, or nullptr ### Example @@ -1908,26 +2410,26 @@ Returns nullptr if backed by <a href="undocumented#GPU_Texture">GPU Texture</a> ### See Also -<a href="#SkImage_makeTextureImage">makeTextureImage</a> <a href="#SkImage_makeRasterImage">makeRasterImage</a> <a href="#SkImage_MakeBackendTextureFromSkImage">MakeBackendTextureFromSkImage</a> +<a href='#SkImage_makeTextureImage'>makeTextureImage</a> <a href='#SkImage_makeRasterImage'>makeRasterImage</a> <a href='#SkImage_MakeBackendTextureFromSkImage'>MakeBackendTextureFromSkImage</a> --- -<a name="SkImage_makeRasterImage"></a> +<a name='SkImage_makeRasterImage'></a> ## makeRasterImage -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeRasterImage() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_makeRasterImage'>makeRasterImage</a>() const </pre> -Returns <a href="#Raster_Image">Raster Image</a>. Copies <a href="#Image">Image</a> backed by <a href="undocumented#GPU_Texture">GPU Texture</a> into CPU memory, -or decodes <a href="#Image">Image</a> from <a href="#Lazy_Image">Lazy Image</a>. Returns original <a href="#Image">Image</a> if decoded in -<a href="undocumented#Raster_Bitmap">Raster Bitmap</a>. +Returns <a href='#Raster_Image'>Raster Image</a>. Copies <a href='#Image'>Image</a> backed by <a href='undocumented#GPU_Texture'>GPU Texture</a> into CPU memory, +or decodes <a href='#Image'>Image</a> from <a href='#Lazy_Image'>Lazy Image</a>. Returns original <a href='#Image'>Image</a> if decoded in +<a href='undocumented#Raster_Bitmap'>Raster Bitmap</a>. Returns nullptr if copy, decode, or pixel read fails. ### Return Value -<a href="#Raster_Image">Raster Image</a>, or nullptr +<a href='#Raster_Image'>Raster Image</a>, or nullptr ### Example @@ -1935,161 +2437,177 @@ Returns nullptr if copy, decode, or pixel read fails. ### See Also -<a href="#SkImage_isTextureBacked">isTextureBacked</a> <a href="#SkImage_isLazyGenerated">isLazyGenerated</a> <a href="#SkImage_MakeFromRaster">MakeFromRaster</a> +<a href='#SkImage_isTextureBacked'>isTextureBacked</a> <a href='#SkImage_isLazyGenerated'>isLazyGenerated</a> <a href='#SkImage_MakeFromRaster'>MakeFromRaster</a> --- -<a name="SkImage_makeWithFilter"></a> +<a name='SkImage_makeWithFilter'></a> ## makeWithFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeWithFilter(const SkImageFilter* filter, const SkIRect& subset, - const SkIRect& clipBounds, SkIRect* outSubset, SkIPoint* offset) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_makeWithFilter'>makeWithFilter</a>(const <a href='undocumented#SkImageFilter'>SkImageFilter</a>* filter, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& subset, + const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& clipBounds, <a href='SkIRect_Reference#SkIRect'>SkIRect</a>* outSubset, <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>* offset) const </pre> -Creates filtered <a href="#Image">Image</a>. <a href="#SkImage_makeWithFilter_filter">filter</a> processes original <a href="#Image">Image</a>, potentially changing -color, position, and size. <a href="#SkImage_makeWithFilter_subset">subset</a> is the bounds of original <a href="#Image">Image</a> processed -by <a href="#SkImage_makeWithFilter_filter">filter</a>. <a href="#SkImage_makeWithFilter_clipBounds">clipBounds</a> is the expected bounds of the filtered <a href="#Image">Image</a>. <a href="#SkImage_makeWithFilter_outSubset">outSubset</a> -is required storage for the actual bounds of the filtered <a href="#Image">Image</a>. <a href="#SkImage_makeWithFilter_offset">offset</a> is -required storage for translation of returned <a href="#Image">Image</a>. +Creates filtered <a href='#Image'>Image</a>. <a href='#SkImage_makeWithFilter_filter'>filter</a> processes original <a href='#Image'>Image</a>, potentially changing +color, position, and size. <a href='#SkImage_makeWithFilter_subset'>subset</a> is the bounds of original <a href='#Image'>Image</a> processed +by <a href='#SkImage_makeWithFilter_filter'>filter</a>. <a href='#SkImage_makeWithFilter_clipBounds'>clipBounds</a> is the expected bounds of the filtered <a href='#Image'>Image</a>. <a href='#SkImage_makeWithFilter_outSubset'>outSubset</a> +is required storage for the actual bounds of the filtered <a href='#Image'>Image</a>. <a href='#SkImage_makeWithFilter_offset'>offset</a> is +required storage for translation of returned <a href='#Image'>Image</a>. -Returns nullptr if <a href="#Image">Image</a> could not be created. If nullptr is returned, <a href="#SkImage_makeWithFilter_outSubset">outSubset</a> -and <a href="#SkImage_makeWithFilter_offset">offset</a> are undefined. +Returns nullptr if <a href='#Image'>Image</a> could not be created. If nullptr is returned, <a href='#SkImage_makeWithFilter_outSubset'>outSubset</a> +and <a href='#SkImage_makeWithFilter_offset'>offset</a> are undefined. -Useful for animation of <a href="undocumented#SkImageFilter">SkImageFilter</a> that varies size from frame to frame. -Returned <a href="#Image">Image</a> is created larger than required by <a href="#SkImage_makeWithFilter_filter">filter</a> so that <a href="undocumented#GPU_Texture">GPU Texture</a> -can be reused with different sized effects. <a href="#SkImage_makeWithFilter_outSubset">outSubset</a> describes the valid bounds -of <a href="undocumented#GPU_Texture">GPU Texture</a> returned. <a href="#SkImage_makeWithFilter_offset">offset</a> translates the returned <a href="#Image">Image</a> to keep subsequent +Useful for animation of <a href='undocumented#SkImageFilter'>SkImageFilter</a> that varies size from frame to frame. +Returned <a href='#Image'>Image</a> is created larger than required by <a href='#SkImage_makeWithFilter_filter'>filter</a> so that <a href='undocumented#GPU_Texture'>GPU Texture</a> +can be reused with different sized effects. <a href='#SkImage_makeWithFilter_outSubset'>outSubset</a> describes the valid bounds +of <a href='undocumented#GPU_Texture'>GPU Texture</a> returned. <a href='#SkImage_makeWithFilter_offset'>offset</a> translates the returned <a href='#Image'>Image</a> to keep subsequent animation frames aligned with respect to each other. ### Parameters -<table> <tr> <td><a name="SkImage_makeWithFilter_filter"> <code><strong>filter </strong></code> </a></td> <td> -how <a href="#Image">Image</a> is sampled when transformed</td> - </tr> <tr> <td><a name="SkImage_makeWithFilter_subset"> <code><strong>subset </strong></code> </a></td> <td> -bounds of <a href="#Image">Image</a> processed by <a href="#SkImage_makeWithFilter_filter">filter</a></td> - </tr> <tr> <td><a name="SkImage_makeWithFilter_clipBounds"> <code><strong>clipBounds </strong></code> </a></td> <td> -expected bounds of filtered <a href="#Image">Image</a></td> - </tr> <tr> <td><a name="SkImage_makeWithFilter_outSubset"> <code><strong>outSubset </strong></code> </a></td> <td> -storage for returned <a href="#Image">Image</a> bounds</td> - </tr> <tr> <td><a name="SkImage_makeWithFilter_offset"> <code><strong>offset </strong></code> </a></td> <td> -storage for returned <a href="#Image">Image</a> translation</td> +<table> <tr> <td><a name='SkImage_makeWithFilter_filter'><code><strong>filter</strong></code></a></td> + <td>how <a href='#Image'>Image</a> is sampled when transformed</td> + </tr> + <tr> <td><a name='SkImage_makeWithFilter_subset'><code><strong>subset</strong></code></a></td> + <td>bounds of <a href='#Image'>Image</a> processed by <a href='#SkImage_makeWithFilter_filter'>filter</a></td> + </tr> + <tr> <td><a name='SkImage_makeWithFilter_clipBounds'><code><strong>clipBounds</strong></code></a></td> + <td>expected bounds of filtered <a href='#Image'>Image</a></td> + </tr> + <tr> <td><a name='SkImage_makeWithFilter_outSubset'><code><strong>outSubset</strong></code></a></td> + <td>storage for returned <a href='#Image'>Image</a> bounds</td> + </tr> + <tr> <td><a name='SkImage_makeWithFilter_offset'><code><strong>offset</strong></code></a></td> + <td>storage for returned <a href='#Image'>Image</a> translation</td> </tr> </table> ### Return Value -filtered <a href="#Image">Image</a>, or nullptr +filtered <a href='#Image'>Image</a>, or nullptr ### Example -<div><fiddle-embed name="17547129251dd9607c381a3cc30cff15" gpu="true"><div>In each frame of the animation, filtered <a href="#Image">Image</a> is drawn in a different location. -By translating canvas by returned <a href="#SkImage_makeWithFilter_offset">offset</a>, <a href="#Image">Image</a> appears stationary. +<div><fiddle-embed name="17547129251dd9607c381a3cc30cff15" gpu="true"><div>In each frame of the animation, filtered <a href='#Image'>Image</a> is drawn in a different location. +By translating canvas by returned <a href='#SkImage_makeWithFilter_offset'>offset</a>, <a href='#Image'>Image</a> appears stationary. </div></fiddle-embed></div> ### See Also -<a href="#SkImage_makeShader">makeShader</a><sup><a href="#SkImage_makeShader_2">[2]</a></sup> <a href="SkPaint_Reference#SkPaint_setImageFilter">SkPaint::setImageFilter</a> +<a href='#SkImage_makeShader'>makeShader</a><sup><a href='#SkImage_makeShader_2'>[2]</a></sup> <a href='SkPaint_Reference#SkPaint_setImageFilter'>SkPaint::setImageFilter</a> --- -<a href="#SkImage_BackendTextureReleaseProc">BackendTextureReleaseProc</a> +# <a name='SkImage_BackendTextureReleaseProc'>Typedef SkImage::BackendTextureReleaseProc</a> +<a href='#SkImage_BackendTextureReleaseProc'>BackendTextureReleaseProc</a>Defines a function take one parameter of type +<a href='undocumented#GrBackendTexture'>GrBackendTexture</a> with no return value. -<a name="SkImage_MakeBackendTextureFromSkImage"></a> +<a name='SkImage_MakeBackendTextureFromSkImage'></a> ## MakeBackendTextureFromSkImage -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool MakeBackendTextureFromSkImage(GrContext* context, sk_sp<SkImage> image, - GrBackendTexture* backendTexture, - BackendTextureReleaseProc* backendTextureReleaseProc) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkImage_MakeBackendTextureFromSkImage'>MakeBackendTextureFromSkImage</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> image, + <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>* backendTexture, + <a href='#SkImage_BackendTextureReleaseProc'>BackendTextureReleaseProc</a>* backendTextureReleaseProc) </pre> -Creates a <a href="undocumented#GrBackendTexture">GrBackendTexture</a> from the provided <a href="#SkImage">SkImage</a>. Returns true and -stores result in <a href="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a> and <a href="#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc">backendTextureReleaseProc</a> if +Creates a <a href='undocumented#GrBackendTexture'>GrBackendTexture</a> from the provided <a href='#SkImage'>SkImage</a>. Returns true and +stores result in <a href='#SkImage_MakeBackendTextureFromSkImage_backendTexture'>backendTexture</a> and <a href='#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc'>backendTextureReleaseProc</a> if texture is created; otherwise, returns false and leaves -<a href="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a> and <a href="#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc">backendTextureReleaseProc</a> unmodified. +<a href='#SkImage_MakeBackendTextureFromSkImage_backendTexture'>backendTexture</a> and <a href='#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc'>backendTextureReleaseProc</a> unmodified. -Call <a href="#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc">backendTextureReleaseProc</a> after deleting <a href="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a>. -<a href="#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc">backendTextureReleaseProc</a> cleans up auxiliary data related to returned -<a href="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a>. The caller must delete returned <a href="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a> after use. +Call <a href='#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc'>backendTextureReleaseProc</a> after deleting <a href='#SkImage_MakeBackendTextureFromSkImage_backendTexture'>backendTexture</a>. +<a href='#SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc'>backendTextureReleaseProc</a> cleans up auxiliary data related to returned +<a href='#SkImage_MakeBackendTextureFromSkImage_backendTexture'>backendTexture</a>. The caller must delete returned <a href='#SkImage_MakeBackendTextureFromSkImage_backendTexture'>backendTexture</a> after use. -If <a href="#Image">Image</a> is both texture backed and singly referenced, <a href="#SkImage_MakeBackendTextureFromSkImage_image">image</a> is returned in -<a href="#SkImage_MakeBackendTextureFromSkImage_backendTexture">backendTexture</a> without conversion or making a copy. <a href="#Image">Image</a> is singly referenced +If <a href='#Image'>Image</a> is both texture backed and singly referenced, <a href='#SkImage_MakeBackendTextureFromSkImage_image'>image</a> is returned in +<a href='#SkImage_MakeBackendTextureFromSkImage_backendTexture'>backendTexture</a> without conversion or making a copy. <a href='#Image'>Image</a> is singly referenced if its was transferred solely using std::move(). -If <a href="#Image">Image</a> is not texture backed, returns texture with <a href="#Image">Image</a> contents. +If <a href='#Image'>Image</a> is not texture backed, returns texture with <a href='#Image'>Image</a> contents. ### Parameters -<table> <tr> <td><a name="SkImage_MakeBackendTextureFromSkImage_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkImage_MakeBackendTextureFromSkImage_image"> <code><strong>image </strong></code> </a></td> <td> -<a href="#Image">Image</a> used for texture</td> - </tr> <tr> <td><a name="SkImage_MakeBackendTextureFromSkImage_backendTexture"> <code><strong>backendTexture </strong></code> </a></td> <td> -storage for backend texture</td> - </tr> <tr> <td><a name="SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc"> <code><strong>backendTextureReleaseProc </strong></code> </a></td> <td> -storage for clean up function</td> +<table> <tr> <td><a name='SkImage_MakeBackendTextureFromSkImage_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkImage_MakeBackendTextureFromSkImage_image'><code><strong>image</strong></code></a></td> + <td><a href='#Image'>Image</a> used for texture</td> + </tr> + <tr> <td><a name='SkImage_MakeBackendTextureFromSkImage_backendTexture'><code><strong>backendTexture</strong></code></a></td> + <td>storage for back-end texture</td> + </tr> + <tr> <td><a name='SkImage_MakeBackendTextureFromSkImage_backendTextureReleaseProc'><code><strong>backendTextureReleaseProc</strong></code></a></td> + <td>storage for clean up function</td> </tr> </table> ### Return Value -true if backend texture was created +true if back-end texture was created ### Example -<div><fiddle-embed name="98e70337c2964abd2624239d28bbecd7" gpu="true"></fiddle-embed></div> +<div><fiddle-embed name="06aeb3cf63ffccf7b49fe556e5def351" gpu="true"></fiddle-embed></div> ### See Also -<a href="#SkImage_MakeFromTexture">MakeFromTexture</a><sup><a href="#SkImage_MakeFromTexture_2">[2]</a></sup> <a href="#SkImage_makeTextureImage">makeTextureImage</a> +<a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> <a href='#SkImage_makeTextureImage'>makeTextureImage</a> --- -## <a name="SkImage_LegacyBitmapMode"></a> Enum SkImage::LegacyBitmapMode +## <a name='SkImage_LegacyBitmapMode'>Enum SkImage::LegacyBitmapMode</a> + +Deprecated. soon <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkImage_LegacyBitmapMode">LegacyBitmapMode</a> { - <a href="#SkImage_kRO_LegacyBitmapMode">kRO LegacyBitmapMode</a>, + enum <a href='#SkImage_LegacyBitmapMode'>LegacyBitmapMode</a> { + <a href='#SkImage_kRO_LegacyBitmapMode'>kRO LegacyBitmapMode</a>, }; </pre> ### Constants -<table> - <tr> - <td><a name="SkImage_kRO_LegacyBitmapMode"> <code><strong>SkImage::kRO_LegacyBitmapMode </strong></code> </a></td><td>0</td><td>Returned bitmap is read-only and immutable. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkImage_kRO_LegacyBitmapMode'><code>SkImage::kRO_LegacyBitmapMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +returned bitmap is read-only and immutable</td> </tr> +</table> - - -<a name="SkImage_asLegacyBitmap"></a> +<a name='SkImage_asLegacyBitmap'></a> ## asLegacyBitmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode legacyBitmapMode = kRO_LegacyBitmapMode) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_asLegacyBitmap'>asLegacyBitmap</a>(<a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>* bitmap, <a href='#SkImage_LegacyBitmapMode'>LegacyBitmapMode</a> legacyBitmapMode = <a href='#SkImage_kRO_LegacyBitmapMode'>kRO LegacyBitmapMode</a>) const </pre> -Creates raster <a href="SkBitmap_Reference#Bitmap">Bitmap</a> with same pixels as <a href="#Image">Image</a>. If <a href="#SkImage_asLegacyBitmap_legacyBitmapMode">legacyBitmapMode</a> is -<a href="#SkImage_kRO_LegacyBitmapMode">kRO LegacyBitmapMode</a>, returned <a href="#SkImage_asLegacyBitmap_bitmap">bitmap</a> is read-only and immutable. -Returns true if <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is stored in <a href="#SkImage_asLegacyBitmap_bitmap">bitmap</a>. Returns false and resets <a href="#SkImage_asLegacyBitmap_bitmap">bitmap</a> if -<a href="SkBitmap_Reference#Bitmap">Bitmap</a> write did not succeed. +Creates raster <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> with same pixels as <a href='#Image'>Image</a>. If <a href='#SkImage_asLegacyBitmap_legacyBitmapMode'>legacyBitmapMode</a> is +<a href='#SkImage_kRO_LegacyBitmapMode'>kRO LegacyBitmapMode</a>, returned <a href='#SkImage_asLegacyBitmap_bitmap'>bitmap</a> is read-only and immutable. +Returns true if <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is stored in <a href='#SkImage_asLegacyBitmap_bitmap'>bitmap</a>. Returns false and resets <a href='#SkImage_asLegacyBitmap_bitmap'>bitmap</a> if +<a href='SkBitmap_Reference#Bitmap'>Bitmap</a> write did not succeed. ### Parameters -<table> <tr> <td><a name="SkImage_asLegacyBitmap_bitmap"> <code><strong>bitmap </strong></code> </a></td> <td> -storage for legacy <a href="SkBitmap_Reference#Bitmap">Bitmap</a></td> - </tr> <tr> <td><a name="SkImage_asLegacyBitmap_legacyBitmapMode"> <code><strong>legacyBitmapMode </strong></code> </a></td> <td> -to be deprecated</td> +<table> <tr> <td><a name='SkImage_asLegacyBitmap_bitmap'><code><strong>bitmap</strong></code></a></td> + <td>storage for legacy <a href='SkBitmap_Reference#Bitmap'>Bitmap</a></td> + </tr> + <tr> <td><a name='SkImage_asLegacyBitmap_legacyBitmapMode'><code><strong>legacyBitmapMode</strong></code></a></td> + <td>to be deprecated</td> </tr> </table> ### Return Value -true if <a href="SkBitmap_Reference#Bitmap">Bitmap</a> was created +true if <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> was created ### Example @@ -2097,23 +2615,23 @@ true if <a href="SkBitmap_Reference#Bitmap">Bitmap</a> was created ### See Also -<a href="#SkImage_MakeRasterData">MakeRasterData</a> <a href="#SkImage_makeRasterImage">makeRasterImage</a> <a href="#SkImage_makeNonTextureImage">makeNonTextureImage</a> +<a href='#SkImage_MakeRasterData'>MakeRasterData</a> <a href='#SkImage_makeRasterImage'>makeRasterImage</a> <a href='#SkImage_makeNonTextureImage'>makeNonTextureImage</a> --- -<a name="SkImage_isLazyGenerated"></a> +<a name='SkImage_isLazyGenerated'></a> ## isLazyGenerated -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isLazyGenerated() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkImage_isLazyGenerated'>isLazyGenerated</a>() const </pre> -Returns true if <a href="#Image">Image</a> is backed by an image-generator or other service that creates +Returns true if <a href='#Image'>Image</a> is backed by an image-generator or other service that creates and caches its pixels or texture on-demand. ### Return Value -true if <a href="#Image">Image</a> is created as needed +true if <a href='#Image'>Image</a> is created as needed ### Example @@ -2125,47 +2643,48 @@ true if <a href="#Image">Image</a> is created as needed ### See Also -<a href="#SkImage_isTextureBacked">isTextureBacked</a> MakeNonTextureImage +<a href='#SkImage_isTextureBacked'>isTextureBacked</a> MakeNonTextureImage --- -<a name="SkImage_makeColorSpace"></a> +<a name='SkImage_makeColorSpace'></a> ## makeColorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeColorSpace(sk_sp<SkColorSpace> target, SkTransferFunctionBehavior premulBehavior) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkImage'>SkImage</a>> <a href='#SkImage_makeColorSpace'>makeColorSpace</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> target, <a href='undocumented#SkTransferFunctionBehavior'>SkTransferFunctionBehavior</a> premulBehavior) const </pre> -Creates <a href="#Image">Image</a> in <a href="#SkImage_makeColorSpace_target">target</a> <a href="undocumented#Color_Space">Color Space</a>. -Returns nullptr if <a href="#Image">Image</a> could not be created. +Creates <a href='#Image'>Image</a> in <a href='#SkImage_makeColorSpace_target'>target</a> <a href='undocumented#Color_Space'>Color Space</a>. +Returns nullptr if <a href='#Image'>Image</a> could not be created. -Returns original <a href="#Image">Image</a> if it is in <a href="#SkImage_makeColorSpace_target">target</a> <a href="undocumented#Color_Space">Color Space</a>. -Otherwise, converts pixels from <a href="#Image">Image</a> <a href="undocumented#Color_Space">Color Space</a> to <a href="#SkImage_makeColorSpace_target">target</a> <a href="undocumented#Color_Space">Color Space</a>. -If <a href="#Image">Image</a> <a href="#SkImage_colorSpace">colorSpace</a> returns nullptr, <a href="#Image">Image</a> <a href="undocumented#Color_Space">Color Space</a> is assumed to be sRGB. +Returns original <a href='#Image'>Image</a> if it is in <a href='#SkImage_makeColorSpace_target'>target</a> <a href='undocumented#Color_Space'>Color Space</a>. +Otherwise, converts pixels from <a href='#Image'>Image</a> <a href='undocumented#Color_Space'>Color Space</a> to <a href='#SkImage_makeColorSpace_target'>target</a> <a href='undocumented#Color_Space'>Color Space</a>. +If <a href='#Image'>Image</a> <a href='#SkImage_colorSpace'>colorSpace</a> returns nullptr, <a href='#Image'>Image</a> <a href='undocumented#Color_Space'>Color Space</a> is assumed to be sRGB. -<a href="undocumented#SkTransferFunctionBehavior">SkTransferFunctionBehavior</a> is to be deprecated. +<a href='undocumented#SkTransferFunctionBehavior'>SkTransferFunctionBehavior</a> is to be deprecated. -Set <a href="#SkImage_makeColorSpace_premulBehavior">premulBehavior</a> to <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a> to convert <a href="#Image">Image</a> -pixels to a linear space, before converting to destination <a href="SkImageInfo_Reference#Color_Type">Color Type</a> -and <a href="undocumented#Color_Space">Color Space</a>. +Set <a href='#SkImage_makeColorSpace_premulBehavior'>premulBehavior</a> to <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a> to convert <a href='#Image'>Image</a> +pixels to a linear space, before converting to destination <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> +and <a href='undocumented#Color_Space'>Color Space</a>. -Set <a href="#SkImage_makeColorSpace_premulBehavior">premulBehavior</a> to <a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a> to treat <a href="#Image">Image</a> -pixels as linear, when converting to destination <a href="SkImageInfo_Reference#Color_Type">Color Type</a> -and <a href="undocumented#Color_Space">Color Space</a>, ignoring pixel encoding. +Set <a href='#SkImage_makeColorSpace_premulBehavior'>premulBehavior</a> to <a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a> to treat <a href='#Image'>Image</a> +pixels as linear, when converting to destination <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> +and <a href='undocumented#Color_Space'>Color Space</a>, ignoring pixel encoding. ### Parameters -<table> <tr> <td><a name="SkImage_makeColorSpace_target"> <code><strong>target </strong></code> </a></td> <td> -<a href="undocumented#Color_Space">Color Space</a> describing color range of returned <a href="#Image">Image</a></td> - </tr> <tr> <td><a name="SkImage_makeColorSpace_premulBehavior"> <code><strong>premulBehavior </strong></code> </a></td> <td> -one of: <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>, -<a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a></td> +<table> <tr> <td><a name='SkImage_makeColorSpace_target'><code><strong>target</strong></code></a></td> + <td><a href='undocumented#Color_Space'>Color Space</a> describing color range of returned <a href='#Image'>Image</a></td> + </tr> + <tr> <td><a name='SkImage_makeColorSpace_premulBehavior'><code><strong>premulBehavior</strong></code></a></td> + <td>one of: <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>, +<a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a></td> </tr> </table> ### Return Value -created <a href="#Image">Image</a> in <a href="#SkImage_makeColorSpace_target">target</a> <a href="undocumented#Color_Space">Color Space</a> +created <a href='#Image'>Image</a> in <a href='#SkImage_makeColorSpace_target'>target</a> <a href='undocumented#Color_Space'>Color Space</a> ### Example @@ -2173,7 +2692,7 @@ created <a href="#Image">Image</a> in <a href="#SkImage_makeColorSpace_target">t ### See Also -MakeFromPixture <a href="#SkImage_MakeFromTexture">MakeFromTexture</a><sup><a href="#SkImage_MakeFromTexture_2">[2]</a></sup> +MakeFromPixture <a href='#SkImage_MakeFromTexture'>MakeFromTexture</a><sup><a href='#SkImage_MakeFromTexture_2'>[2]</a></sup> --- diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md index 6acd4b64a8..f627ebe9ee 100644 --- a/site/user/api/SkMatrix_Reference.md +++ b/site/user/api/SkMatrix_Reference.md @@ -1,177 +1,684 @@ SkMatrix Reference === -# <a name="Matrix"></a> Matrix +# <a name='Matrix'>Matrix</a> -## <a name="Overview"></a> Overview +# <a name='SkMatrix'>Class SkMatrix</a> -## <a name="Overview_Subtopic"></a> Overview Subtopic +## <a name='Constant'>Constant</a> -| name | description | -| --- | --- | -| Constant | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkMatrix">SkMatrix</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -# <a name="SkMatrix"></a> Class SkMatrix -<a href="#Matrix">Matrix</a> holds a 3x3 matrix for transforming coordinates. This allows mapping -<a href="SkPoint_Reference#Point">Points</a> and <a href="SkPoint_Reference#Vector">Vectors</a> with translation, scaling, skewing, rotation, and +SkMatrix related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_ScaleToFit'>ScaleToFit</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>options to map <a href='SkRect_Reference#Rect'>Rects</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_TypeMask'>TypeMask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>bit field for <a href='#Matrix'>Matrix</a> complexity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kAScaleX'>kAScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kAScaleY'>kAScaleY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kASkewX'>kASkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kASkewY'>kASkewY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kATransX'>kATransX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kATransY'>kATransY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kAffine_Mask'>kAffine Mask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>skew or rotate <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kCenter_ScaleToFit'>kCenter ScaleToFit</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and aligns to center</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kEnd_ScaleToFit'>kEnd ScaleToFit</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and aligns to right and bottom</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kFill_ScaleToFit'>kFill ScaleToFit</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales in x and y to fill destination <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kIdentity_Mask'>kIdentity Mask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>identity <a href='#Matrix'>Matrix</a>; all bits clear</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMPersp0'>kMPersp0</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>input x perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMPersp1'>kMPersp1</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>input y perspective factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMPersp2'>kMPersp2</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>perspective bias</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMScaleX'>kMScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMScaleY'>kMScaleY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMSkewX'>kMSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMSkewY'>kMSkewY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMTransX'>kMTransX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kMTransY'>kMTransY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kPerspective_Mask'>kPerspective Mask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>perspective <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kScale_Mask'>kScale Mask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scale <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kStart_ScaleToFit'>kStart ScaleToFit</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and aligns to left and top</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_kTranslate_Mask'>kTranslate Mask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translation <a href='#Matrix'>Matrix</a></td> + </tr> +</table> +<a href='#Matrix'>Matrix</a> holds a 3x3 matrix for transforming coordinates. This allows mapping +<a href='SkPoint_Reference#Point'>Points</a> and <a href='SkPoint_Reference#Vector'>Vectors</a> with translation, scaling, skewing, rotation, and perspective. -<a href="#Matrix">Matrix</a> elements are in row major order. <a href="#Matrix">Matrix</a> does not have a constructor, -so it must be explicitly initialized. <a href="#SkMatrix_setIdentity">setIdentity</a> initializes <a href="#Matrix">Matrix</a> -so it has no effect. <a href="#SkMatrix_setTranslate">setTranslate</a>, <a href="#SkMatrix_setScale">setScale</a>, <a href="#SkMatrix_setSkew">setSkew</a>, <a href="#SkMatrix_setRotate">setRotate</a>, <a href="#SkMatrix_set9">set9</a> and <a href="#SkMatrix_setAll">setAll</a> -initializes all <a href="#Matrix">Matrix</a> elements with the corresponding mapping. - -<a href="#Matrix">Matrix</a> includes a hidden variable that classifies the type of matrix to -improve performance. <a href="#Matrix">Matrix</a> is not thread safe unless <a href="#SkMatrix_getType">getType</a> is called first. - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkMatrix_Concat">Concat</a> | returns the concatenation of <a href="#Matrix">Matrix</a> pair | -| I | returns a reference to a const identity <a href="#Matrix">Matrix</a> | -| <a href="#SkMatrix_InvalidMatrix">InvalidMatrix</a> | returns a reference to a const invalid <a href="#Matrix">Matrix</a> | -| <a href="#SkMatrix_MakeAll">MakeAll</a> | constructs all nine values | -| <a href="#SkMatrix_MakeRectToRect">MakeRectToRect</a> | constructs from source <a href="SkRect_Reference#Rect">Rect</a> to destination <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkMatrix_MakeScale">MakeScale</a> | constructs from scale in x and y | -| <a href="#SkMatrix_MakeTrans">MakeTrans</a> | constructs from translate in x and y | -| <a href="#SkMatrix_SetAffineIdentity">SetAffineIdentity</a> | sets 3x2 array to identity | -| <a href="#SkMatrix_asAffine">asAffine</a> | copies to 3x2 array | -| <a href="#SkMatrix_cheapEqualTo">cheapEqualTo</a> | compares <a href="#Matrix">Matrix</a> pair using memcmp() | -| <a href="#SkMatrix_decomposeScale">decomposeScale</a> | separates scale if possible | -| <a href="#SkMatrix_dirtyMatrixTypeCache">dirtyMatrixTypeCache</a> | sets internal cache to unknown state | -| <a href="#SkMatrix_dump">dump</a> | sends text representation using floats to standard output | -| <a href="#SkMatrix_fixedStepInX">fixedStepInX</a> | returns step in x for a position in y | -| <a href="#SkMatrix_get">get</a> | returns one of nine <a href="#Matrix">Matrix</a> values | -| <a href="#SkMatrix_get9">get9</a> | returns all nine <a href="#Matrix">Matrix</a> values | -| <a href="#SkMatrix_getMaxScale">getMaxScale</a> | returns maximum scaling, if possible | -| <a href="#SkMatrix_getMinMaxScales">getMinMaxScales</a> | returns minimum and maximum scaling, if possible | -| <a href="#SkMatrix_getMinScale">getMinScale</a> | returns minimum scaling, if possible | -| <a href="#SkMatrix_getPerspX">getPerspX</a> | returns input x perspective factor | -| <a href="#SkMatrix_getPerspY">getPerspY</a> | returns input y perspective factor | -| <a href="#SkMatrix_getScaleX">getScaleX</a> | returns horizontal scale factor | -| <a href="#SkMatrix_getScaleY">getScaleY</a> | returns vertical scale factor | -| <a href="#SkMatrix_getSkewX">getSkewX</a> | returns horizontal skew factor | -| <a href="#SkMatrix_getSkewY">getSkewY</a> | returns vertical skew factor | -| <a href="#SkMatrix_getTranslateX">getTranslateX</a> | returns horizontal translation | -| <a href="#SkMatrix_getTranslateY">getTranslateY</a> | returns vertical translation | -| <a href="#SkMatrix_getType">getType</a> | returns transform complexity | -| <a href="#SkMatrix_hasPerspective">hasPerspective</a> | returns if transform includes perspective | -| <a href="#SkMatrix_invert">invert</a> | returns inverse, if possible | -| <a href="#SkMatrix_isFinite">isFinite</a> | returns if all <a href="#Matrix">Matrix</a> values are not infinity, NaN | -| <a href="#SkMatrix_isFixedStepInX">isFixedStepInX</a> | returns if transformation supports fixed step in x | -| <a href="#SkMatrix_isIdentity">isIdentity</a> | returns if matrix equals the identity <a href="#Matrix">Matrix</a> | -| <a href="#SkMatrix_isScaleTranslate">isScaleTranslate</a> | returns if transform is limited to scale and translate | -| <a href="#SkMatrix_isSimilarity">isSimilarity</a> | returns if transform is limited to square scale and rotation | -| <a href="#SkMatrix_isTranslate">isTranslate</a> | returns if transform is limited to translate | -| <a href="#SkMatrix_mapHomogeneousPoints">mapHomogeneousPoints</a> | maps <a href="undocumented#Point3">Point3</a> array | -| <a href="#SkMatrix_mapPoints">mapPoints</a> | maps <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkMatrix_mapRadius">mapRadius</a> | returns mean radius of mapped <a href="undocumented#Circle">Circle</a> | -| <a href="#SkMatrix_mapRect">mapRect</a> | returns bounds of mapped <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkMatrix_mapRectScaleTranslate">mapRectScaleTranslate</a> | returns bounds of mapped <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkMatrix_mapRectToQuad">mapRectToQuad</a> | maps <a href="SkRect_Reference#Rect">Rect</a> to <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkMatrix_mapVector">mapVector</a> | maps <a href="SkPoint_Reference#Vector">Vector</a> | -| <a href="#SkMatrix_mapVectors">mapVectors</a> | maps <a href="SkPoint_Reference#Vector">Vector</a> array | -| <a href="#SkMatrix_mapXY">mapXY</a> | maps <a href="SkPoint_Reference#Point">Point</a> | -| <a href="#SkMatrix_postConcat">postConcat</a> | post-multiplies <a href="#Matrix">Matrix</a> by <a href="#Matrix">Matrix</a> parameter | -| <a href="#SkMatrix_postIDiv">postIDiv</a> | post-multiplies <a href="#Matrix">Matrix</a> by inverse scale | -| <a href="#SkMatrix_postRotate">postRotate</a> | post-multiplies <a href="#Matrix">Matrix</a> by rotation | -| <a href="#SkMatrix_postScale">postScale</a> | post-multiplies <a href="#Matrix">Matrix</a> by scale | -| <a href="#SkMatrix_postSkew">postSkew</a> | post-multiplies <a href="#Matrix">Matrix</a> by skew | -| <a href="#SkMatrix_postTranslate">postTranslate</a> | post-multiplies <a href="#Matrix">Matrix</a> by translation | -| <a href="#SkMatrix_preConcat">preConcat</a> | pre-multiplies <a href="#Matrix">Matrix</a> by <a href="#Matrix">Matrix</a> parameter | -| <a href="#SkMatrix_preRotate">preRotate</a> | pre-multiplies <a href="#Matrix">Matrix</a> by rotation | -| <a href="#SkMatrix_preScale">preScale</a> | pre-multiplies <a href="#Matrix">Matrix</a> by scale | -| <a href="#SkMatrix_preSkew">preSkew</a> | pre-multiplies <a href="#Matrix">Matrix</a> by skew | -| <a href="#SkMatrix_preTranslate">preTranslate</a> | pre-multiplies <a href="#Matrix">Matrix</a> by translation | -| <a href="#SkMatrix_preservesAxisAlignment">preservesAxisAlignment</a> | returns if mapping restricts to 90 degree multiples and mirroring | -| <a href="#SkMatrix_preservesRightAngles">preservesRightAngles</a> | returns if mapped 90 angle remains 90 degrees | -| <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> | returns if mapped <a href="SkRect_Reference#Rect">Rect</a> can be represented by another <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkMatrix_reset">reset</a> | sets <a href="#Matrix">Matrix</a> to identity | -| <a href="#SkMatrix_set">set</a> | sets one value | -| <a href="#SkMatrix_set9">set9</a> | sets all values from <a href="undocumented#Scalar">Scalar</a> array | -| <a href="#SkMatrix_setAffine">setAffine</a> | sets left two columns | -| <a href="#SkMatrix_setAll">setAll</a> | sets all values from parameters | -| <a href="#SkMatrix_setConcat">setConcat</a> | sets to <a href="#Matrix">Matrix</a> parameter multiplied by <a href="#Matrix">Matrix</a> parameter | -| <a href="#SkMatrix_setIdentity">setIdentity</a> | sets <a href="#Matrix">Matrix</a> to identity | -| <a href="#SkMatrix_setPerspX">setPerspX</a> | sets input x perspective factor | -| <a href="#SkMatrix_setPerspY">setPerspY</a> | sets input y perspective factor | -| <a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> | sets to map one to four points to an equal array of points | -| <a href="#SkMatrix_setRSXform">setRSXform</a> | sets to rotate, scale, and translate | -| <a href="#SkMatrix_setRectToRect">setRectToRect</a> | sets to map one <a href="SkRect_Reference#Rect">Rect</a> to another | -| <a href="#SkMatrix_setRotate">setRotate</a> | sets to rotate about a point | -| <a href="#SkMatrix_setScale">setScale</a> | sets to scale about a point | -| <a href="#SkMatrix_setScaleTranslate">setScaleTranslate</a> | sets to scale and translate | -| <a href="#SkMatrix_setScaleX">setScaleX</a> | sets horizontal scale factor | -| <a href="#SkMatrix_setScaleY">setScaleY</a> | sets vertical scale factor | -| <a href="#SkMatrix_setSinCos">setSinCos</a> | sets to rotate and scale about a point | -| <a href="#SkMatrix_setSkew">setSkew</a> | sets to skew about a point | -| <a href="#SkMatrix_setSkewX">setSkewX</a> | sets horizontal skew factor | -| <a href="#SkMatrix_setSkewY">setSkewY</a> | sets vertical skew factor | -| <a href="#SkMatrix_setTranslate">setTranslate</a> | sets to translate in x and y | -| <a href="#SkMatrix_setTranslateX">setTranslateX</a> | sets horizontal translation | -| <a href="#SkMatrix_setTranslateY">setTranslateY</a> | sets vertical translation | -| <a href="#SkMatrix_toString">toString</a> | converts <a href="#Matrix">Matrix</a> to machine readable form | - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#AffineIndex">AffineIndex</a> | affine member indices | -| <a href="#MemberIndex">MemberIndex</a> | member indices | -| <a href="#Property">Property</a> | values and attributes | -| <a href="#Set">Set</a> | set one or more matrix values | -| <a href="#Transform">Transform</a> | map points with <a href="#Matrix">Matrix</a> | -| <a href="#Utility">Utility</a> | rarely called management functions | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| I | returns a reference to a const identity <a href="#Matrix">Matrix</a> | -| <a href="#SkMatrix_InvalidMatrix">InvalidMatrix</a> | returns a reference to a const invalid <a href="#Matrix">Matrix</a> | -| <a href="#SkMatrix_MakeAll">MakeAll</a> | constructs all nine values | -| <a href="#SkMatrix_MakeRectToRect">MakeRectToRect</a> | constructs from source <a href="SkRect_Reference#Rect">Rect</a> to destination <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkMatrix_MakeScale">MakeScale</a> | constructs from scale in x and y | -| | <a href="#SkMatrix_MakeScale">MakeScale(SkScalar sx, SkScalar sy)</a> | -| | <a href="#SkMatrix_MakeScale_2">MakeScale(SkScalar scale)</a> | -| <a href="#SkMatrix_MakeTrans">MakeTrans</a> | constructs from translate in x and y | -| <a href="#SkMatrix_SetAffineIdentity">SetAffineIdentity</a> | sets 3x2 array to identity | -| <a href="#SkMatrix_asAffine">asAffine</a> | copies to 3x2 array | -| <a href="#SkMatrix_reset">reset</a> | sets <a href="#Matrix">Matrix</a> to identity | -| <a href="#SkMatrix_setAffine">setAffine</a> | sets left two columns | -| <a href="#SkMatrix_setConcat">setConcat</a> | sets to <a href="#Matrix">Matrix</a> parameter multiplied by <a href="#Matrix">Matrix</a> parameter | -| <a href="#SkMatrix_setIdentity">setIdentity</a> | sets <a href="#Matrix">Matrix</a> to identity | -| <a href="#SkMatrix_setRSXform">setRSXform</a> | sets to rotate, scale, and translate | -| <a href="#SkMatrix_setRotate">setRotate</a> | sets to rotate about a point | -| | <a href="#SkMatrix_setRotate">setRotate(SkScalar degrees, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_setRotate_2">setRotate(SkScalar degrees)</a> | -| <a href="#SkMatrix_setScale">setScale</a> | sets to scale about a point | -| | <a href="#SkMatrix_setScale">setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_setScale_2">setScale(SkScalar sx, SkScalar sy)</a> | -| <a href="#SkMatrix_setScaleTranslate">setScaleTranslate</a> | sets to scale and translate | -| <a href="#SkMatrix_setSinCos">setSinCos</a> | sets to rotate and scale about a point | -| | <a href="#SkMatrix_setSinCos">setSinCos(SkScalar sinValue, SkScalar cosValue, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_setSinCos_2">setSinCos(SkScalar sinValue, SkScalar cosValue)</a> | -| <a href="#SkMatrix_setSkew">setSkew</a> | sets to skew about a point | -| | <a href="#SkMatrix_setSkew">setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_setSkew_2">setSkew(SkScalar kx, SkScalar ky)</a> | -| <a href="#SkMatrix_setTranslate">setTranslate</a> | sets to translate in x and y | -| | <a href="#SkMatrix_setTranslate">setTranslate(SkScalar dx, SkScalar dy)</a> | -| | <a href="#SkMatrix_setTranslate_2">setTranslate(const SkVector& v)</a> | - -<a name="SkMatrix_MakeScale"></a> +<a href='#Matrix'>Matrix</a> elements are in row major order. <a href='#Matrix'>Matrix</a> does not have a constructor, +so it must be explicitly initialized. <a href='#SkMatrix_setIdentity'>setIdentity</a> initializes <a href='#Matrix'>Matrix</a> +so it has no effect. <a href='#SkMatrix_setTranslate'>setTranslate</a>, <a href='#SkMatrix_setScale'>setScale</a>, <a href='#SkMatrix_setSkew'>setSkew</a>, <a href='#SkMatrix_setRotate'>setRotate</a>, <a href='#SkMatrix_set9'>set9</a> and <a href='#SkMatrix_setAll'>setAll</a> +initializes all <a href='#Matrix'>Matrix</a> elements with the corresponding mapping. + +<a href='#Matrix'>Matrix</a> includes a hidden variable that classifies the type of matrix to +improve performance. <a href='#Matrix'>Matrix</a> is not thread safe unless <a href='#SkMatrix_getType'>getType</a> is called first. + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkMatrix'>SkMatrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkMatrix member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_Concat'>Concat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the concatenation of <a href='#Matrix'>Matrix</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>I</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns a reference to a const identity <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_InvalidMatrix'>InvalidMatrix</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns a reference to a const invalid <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeAll'>MakeAll</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs all nine values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from source <a href='SkRect_Reference#Rect'>Rect</a> to destination <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeScale'>MakeScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from scale in x and y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeTrans'>MakeTrans</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translate in x and y</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets 3x2 array to identity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_asAffine'>asAffine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies to 3x2 array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Matrix'>Matrix</a> pair using memcmp()</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_decomposeScale'>decomposeScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>separates scale if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets internal cache to unknown state</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_dump'>dump</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_fixedStepInX'>fixedStepInX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns step in x for a position in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_get'>get</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one of nine <a href='#Matrix'>Matrix</a> values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_get9'>get9</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns all nine <a href='#Matrix'>Matrix</a> values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getMaxScale'>getMaxScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns maximum scaling, if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns minimum and maximum scaling, if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getMinScale'>getMinScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns minimum scaling, if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getPerspX'>getPerspX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns input x perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getPerspY'>getPerspY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns input y perspective factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getScaleX'>getScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns horizontal scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getScaleY'>getScaleY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns vertical scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getSkewX'>getSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns horizontal skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getSkewY'>getSkewY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns vertical skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getTranslateX'>getTranslateX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns horizontal translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getTranslateY'>getTranslateY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns vertical translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getType'>getType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns transform complexity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_hasPerspective'>hasPerspective</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform includes perspective</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_invert'>invert</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns inverse, if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if all <a href='#Matrix'>Matrix</a> values are not infinity, NaN</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transformation supports fixed step in x</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isIdentity'>isIdentity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if matrix equals the identity <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform is limited to scale and translate</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isSimilarity'>isSimilarity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform is limited to square scale and rotation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isTranslate'>isTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform is limited to translate</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='undocumented#Point3'>Point3</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapPoints'>mapPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRadius'>mapRadius</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns mean radius of mapped <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRect'>mapRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of mapped <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of mapped <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkRect_Reference#Rect'>Rect</a> to <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVector'>mapVector</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Vector'>Vector</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVectors'>mapVectors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Vector'>Vector</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapXY'>mapXY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postConcat'>postConcat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by <a href='#Matrix'>Matrix</a> parameter</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postIDiv'>postIDiv</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by inverse scale</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postRotate'>postRotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by rotation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postScale'>postScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by scale</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postSkew'>postSkew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by skew</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postTranslate'>postTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preConcat'>preConcat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by <a href='#Matrix'>Matrix</a> parameter</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preRotate'>preRotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by rotation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preScale'>preScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by scale</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preSkew'>preSkew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by skew</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preTranslate'>preTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if mapping restricts to 90 degree multiples and mirroring</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if mapped 90 angle remains 90 degrees</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_rectStaysRect'>rectStaysRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if mapped <a href='SkRect_Reference#Rect'>Rect</a> can be represented by another <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Matrix'>Matrix</a> to identity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets one value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_set9'>set9</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets all values from <a href='undocumented#Scalar'>Scalar</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setAffine'>setAffine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets left two columns</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setAll'>setAll</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets all values from parameters</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setConcat'>setConcat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='#Matrix'>Matrix</a> parameter multiplied by <a href='#Matrix'>Matrix</a> parameter</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setIdentity'>setIdentity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Matrix'>Matrix</a> to identity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setPerspX'>setPerspX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets input x perspective factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setPerspY'>setPerspY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets input y perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to map one to four points to an equal array of points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRSXform'>setRSXform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to rotate, scale, and translate</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRectToRect'>setRectToRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to map one <a href='SkRect_Reference#Rect'>Rect</a> to another</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRotate'>setRotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to rotate about a point</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScale'>setScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to scale about a point</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScaleTranslate'>setScaleTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to scale and translate</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScaleX'>setScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets horizontal scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScaleY'>setScaleY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets vertical scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSinCos'>setSinCos</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to rotate and scale about a point</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkew'>setSkew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to skew about a point</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkewX'>setSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets horizontal skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkewY'>setSkewY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslate'>setTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to translate in x and y</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslateX'>setTranslateX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets horizontal translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslateY'>setTranslateY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets vertical translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Matrix'>Matrix</a> to machine readable form</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkMatrix global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#AffineIndex'>AffineIndex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>affine member indices</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#MemberIndex'>MemberIndex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member indices</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>values and attributes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets one or more matrix values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Transform'>Transform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>map points with <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkMatrix can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>I</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns a reference to a const identity <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_InvalidMatrix'>InvalidMatrix</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns a reference to a const invalid <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeAll'>MakeAll</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs all nine values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from source <a href='SkRect_Reference#Rect'>Rect</a> to destination <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeScale'>MakeScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from scale in x and y</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeScale'>MakeScale(SkScalar sx, SkScalar sy)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeScale_2'>MakeScale(SkScalar scale)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_MakeTrans'>MakeTrans</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translate in x and y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets 3x2 array to identity</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_asAffine'>asAffine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies to 3x2 array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Matrix'>Matrix</a> to identity</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setAffine'>setAffine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets left two columns</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setConcat'>setConcat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='#Matrix'>Matrix</a> parameter multiplied by <a href='#Matrix'>Matrix</a> parameter</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setIdentity'>setIdentity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Matrix'>Matrix</a> to identity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRSXform'>setRSXform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to rotate, scale, and translate</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRotate'>setRotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to rotate about a point</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRotate'>setRotate(SkScalar degrees, SkScalar px, SkScalar py)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRotate_2'>setRotate(SkScalar degrees)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScale'>setScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to scale about a point</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScale'>setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScale_2'>setScale(SkScalar sx, SkScalar sy)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScaleTranslate'>setScaleTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to scale and translate</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSinCos'>setSinCos</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to rotate and scale about a point</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSinCos'>setSinCos(SkScalar sinValue, SkScalar cosValue, SkScalar px, SkScalar py)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSinCos_2'>setSinCos(SkScalar sinValue, SkScalar cosValue)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkew'>setSkew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to skew about a point</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkew'>setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkew_2'>setSkew(SkScalar kx, SkScalar ky)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslate'>setTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to translate in x and y</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslate'>setTranslate(SkScalar dx, SkScalar dy)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslate_2'>setTranslate(const SkVector& v)</a></td> + </tr> +</table> + + +<a name='SkMatrix_MakeScale'></a> ## MakeScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkMatrix'>SkMatrix</a> SK_WARN_UNUSED_RESULT <a href='#SkMatrix_MakeScale'>MakeScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy) </pre> -Sets <a href="#Matrix">Matrix</a> to scale by (<a href="#SkMatrix_MakeScale_sx">sx</a>, <a href="#SkMatrix_MakeScale_sy">sy</a>). Returned matrix is: +Sets <a href='#Matrix'>Matrix</a> to scale by (<a href='#SkMatrix_MakeScale_sx'>sx</a>, <a href='#SkMatrix_MakeScale_sy'>sy</a>). Returned matrix is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | sx 0 0 | @@ -181,16 +688,17 @@ Sets <a href="#Matrix">Matrix</a> to scale by (<a href="#SkMatrix_MakeScale_sx"> ### Parameters -<table> <tr> <td><a name="SkMatrix_MakeScale_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeScale_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> +<table> <tr> <td><a name='SkMatrix_MakeScale_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeScale_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> </tr> </table> ### Return Value -<a href="#Matrix">Matrix</a> with scale +<a href='#Matrix'>Matrix</a> with scale ### Example @@ -198,17 +706,17 @@ vertical scale factor</td> ### See Also -<a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> <a href="#SkMatrix_preScale">preScale</a><sup><a href="#SkMatrix_preScale_2">[2]</a></sup> +<a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> <a href='#SkMatrix_preScale'>preScale</a><sup><a href='#SkMatrix_preScale_2'>[2]</a></sup> --- -<a name="SkMatrix_MakeScale_2"></a> +<a name='SkMatrix_MakeScale_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar scale) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkMatrix'>SkMatrix</a> SK_WARN_UNUSED_RESULT <a href='#SkMatrix_MakeScale'>MakeScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> scale) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#SkMatrix_MakeScale_2_scale">scale</a> by (<a href="#SkMatrix_MakeScale_2_scale">scale</a>, <a href="#SkMatrix_MakeScale_2_scale">scale</a>). Returned matrix is: +Sets <a href='#Matrix'>Matrix</a> to <a href='#SkMatrix_MakeScale_2_scale'>scale</a> by (<a href='#SkMatrix_MakeScale_2_scale'>scale</a>, <a href='#SkMatrix_MakeScale_2_scale'>scale</a>). Returned matrix is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scale 0 0 | @@ -218,14 +726,14 @@ Sets <a href="#Matrix">Matrix</a> to <a href="#SkMatrix_MakeScale_2_scale">scale ### Parameters -<table> <tr> <td><a name="SkMatrix_MakeScale_2_scale"> <code><strong>scale </strong></code> </a></td> <td> -horizontal and vertical <a href="#SkMatrix_MakeScale_2_scale">scale</a> factor</td> +<table> <tr> <td><a name='SkMatrix_MakeScale_2_scale'><code><strong>scale</strong></code></a></td> + <td>horizontal and vertical <a href='#SkMatrix_MakeScale_2_scale'>scale</a> factor</td> </tr> </table> ### Return Value -<a href="#Matrix">Matrix</a> with <a href="#SkMatrix_MakeScale_2_scale">scale</a> +<a href='#Matrix'>Matrix</a> with <a href='#SkMatrix_MakeScale_2_scale'>scale</a> ### Example @@ -233,18 +741,18 @@ horizontal and vertical <a href="#SkMatrix_MakeScale_2_scale">scale</a> factor</ ### See Also -<a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> <a href="#SkMatrix_preScale">preScale</a><sup><a href="#SkMatrix_preScale_2">[2]</a></sup> +<a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> <a href='#SkMatrix_preScale'>preScale</a><sup><a href='#SkMatrix_preScale_2'>[2]</a></sup> --- -<a name="SkMatrix_MakeTrans"></a> +<a name='SkMatrix_MakeTrans'></a> ## MakeTrans -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkMatrix'>SkMatrix</a> SK_WARN_UNUSED_RESULT <a href='#SkMatrix_MakeTrans'>MakeTrans</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Sets <a href="#Matrix">Matrix</a> to translate by (<a href="#SkMatrix_MakeTrans_dx">dx</a>, <a href="#SkMatrix_MakeTrans_dy">dy</a>). Returned matrix is: +Sets <a href='#Matrix'>Matrix</a> to translate by (<a href='#SkMatrix_MakeTrans_dx'>dx</a>, <a href='#SkMatrix_MakeTrans_dy'>dy</a>). Returned matrix is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 dx | @@ -254,16 +762,17 @@ Sets <a href="#Matrix">Matrix</a> to translate by (<a href="#SkMatrix_MakeTrans_ ### Parameters -<table> <tr> <td><a name="SkMatrix_MakeTrans_dx"> <code><strong>dx </strong></code> </a></td> <td> -horizontal translation</td> - </tr> <tr> <td><a name="SkMatrix_MakeTrans_dy"> <code><strong>dy </strong></code> </a></td> <td> -vertical translation</td> +<table> <tr> <td><a name='SkMatrix_MakeTrans_dx'><code><strong>dx</strong></code></a></td> + <td>horizontal translation</td> + </tr> + <tr> <td><a name='SkMatrix_MakeTrans_dy'><code><strong>dy</strong></code></a></td> + <td>vertical translation</td> </tr> </table> ### Return Value -<a href="#Matrix">Matrix</a> with translation +<a href='#Matrix'>Matrix</a> with translation ### Example @@ -271,20 +780,20 @@ vertical translation</td> ### See Also -<a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_postTranslate">postTranslate</a> <a href="#SkMatrix_preTranslate">preTranslate</a> +<a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_postTranslate'>postTranslate</a> <a href='#SkMatrix_preTranslate'>preTranslate</a> --- -<a name="SkMatrix_MakeAll"></a> +<a name='SkMatrix_MakeAll'></a> ## MakeAll -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkMatrix SK_WARN_UNUSED_RESULT MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, - SkScalar skewY, SkScalar scaleY, SkScalar transY, - SkScalar pers0, SkScalar pers1, SkScalar pers2) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkMatrix'>SkMatrix</a> SK_WARN_UNUSED_RESULT <a href='#SkMatrix_MakeAll'>MakeAll</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX, <a href='undocumented#SkScalar'>SkScalar</a> skewX, <a href='undocumented#SkScalar'>SkScalar</a> transX, + <a href='undocumented#SkScalar'>SkScalar</a> skewY, <a href='undocumented#SkScalar'>SkScalar</a> scaleY, <a href='undocumented#SkScalar'>SkScalar</a> transY, + <a href='undocumented#SkScalar'>SkScalar</a> pers0, <a href='undocumented#SkScalar'>SkScalar</a> pers1, <a href='undocumented#SkScalar'>SkScalar</a> pers2) </pre> -Sets <a href="#Matrix">Matrix</a> to: +Sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scaleX skewX transX | @@ -294,30 +803,38 @@ Sets <a href="#Matrix">Matrix</a> to: ### Parameters -<table> <tr> <td><a name="SkMatrix_MakeAll_scaleX"> <code><strong>scaleX </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_skewX"> <code><strong>skewX </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_transX"> <code><strong>transX </strong></code> </a></td> <td> -horizontal translation</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_skewY"> <code><strong>skewY </strong></code> </a></td> <td> -vertical skew factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_scaleY"> <code><strong>scaleY </strong></code> </a></td> <td> -vertical scale factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_transY"> <code><strong>transY </strong></code> </a></td> <td> -vertical translation</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_pers0"> <code><strong>pers0 </strong></code> </a></td> <td> -input x perspective factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_pers1"> <code><strong>pers1 </strong></code> </a></td> <td> -input y perspective factor</td> - </tr> <tr> <td><a name="SkMatrix_MakeAll_pers2"> <code><strong>pers2 </strong></code> </a></td> <td> -perspective scale factor</td> +<table> <tr> <td><a name='SkMatrix_MakeAll_scaleX'><code><strong>scaleX</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_skewX'><code><strong>skewX</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_transX'><code><strong>transX</strong></code></a></td> + <td>horizontal translation</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_skewY'><code><strong>skewY</strong></code></a></td> + <td>vertical skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_scaleY'><code><strong>scaleY</strong></code></a></td> + <td>vertical scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_transY'><code><strong>transY</strong></code></a></td> + <td>vertical translation</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_pers0'><code><strong>pers0</strong></code></a></td> + <td>input x perspective factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_pers1'><code><strong>pers1</strong></code></a></td> + <td>input y perspective factor</td> + </tr> + <tr> <td><a name='SkMatrix_MakeAll_pers2'><code><strong>pers2</strong></code></a></td> + <td>perspective scale factor</td> </tr> </table> ### Return Value -<a href="#Matrix">Matrix</a> constructed from parameters +<a href='#Matrix'>Matrix</a> constructed from parameters ### Example @@ -325,42 +842,60 @@ perspective scale factor</td> ### See Also -<a href="#SkMatrix_setAll">setAll</a> <a href="#SkMatrix_set9">set9</a> <a href="#SkMatrix_postConcat">postConcat</a> <a href="#SkMatrix_preConcat">preConcat</a> +<a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_postConcat'>postConcat</a> <a href='#SkMatrix_preConcat'>preConcat</a> --- -## <a name="SkMatrix_TypeMask"></a> Enum SkMatrix::TypeMask +## <a name='SkMatrix_TypeMask'>Enum SkMatrix::TypeMask</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkMatrix_TypeMask">TypeMask</a> { - <a href="#SkMatrix_kIdentity_Mask">kIdentity Mask</a> = 0, - <a href="#SkMatrix_kTranslate_Mask">kTranslate Mask</a> = 0x01, - <a href="#SkMatrix_kScale_Mask">kScale Mask</a> = 0x02, - <a href="#SkMatrix_kAffine_Mask">kAffine Mask</a> = 0x04, - <a href="#SkMatrix_kPerspective_Mask">kPerspective Mask</a> = 0x08, + enum <a href='#SkMatrix_TypeMask'>TypeMask</a> { + <a href='#SkMatrix_kIdentity_Mask'>kIdentity Mask</a> = 0, + <a href='#SkMatrix_kTranslate_Mask'>kTranslate Mask</a> = 0x01, + <a href='#SkMatrix_kScale_Mask'>kScale Mask</a> = 0x02, + <a href='#SkMatrix_kAffine_Mask'>kAffine Mask</a> = 0x04, + <a href='#SkMatrix_kPerspective_Mask'>kPerspective Mask</a> = 0x08, }; </pre> -Enum of bit fields for mask returned by <a href="#SkMatrix_getType">getType</a>. -Used to identify the complexity of <a href="#Matrix">Matrix</a>, to optimize performance. +Enum of bit fields for mask returned by <a href='#SkMatrix_getType'>getType</a>. +Used to identify the complexity of <a href='#Matrix'>Matrix</a>, to optimize performance. ### Constants -<table> - <tr> - <td><a name="SkMatrix_kIdentity_Mask"> <code><strong>SkMatrix::kIdentity_Mask </strong></code> </a></td><td>0</td><td>all bits clear if <a href="#Matrix">Matrix</a> is identity</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kIdentity_Mask'><code>SkMatrix::kIdentity_Mask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +all bits clear if <a href='#Matrix'>Matrix</a> is identity</td> </tr> <tr> - <td><a name="SkMatrix_kTranslate_Mask"> <code><strong>SkMatrix::kTranslate_Mask </strong></code> </a></td><td>1</td><td>set if <a href="#Matrix">Matrix</a> has translation</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kTranslate_Mask'><code>SkMatrix::kTranslate_Mask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if <a href='#Matrix'>Matrix</a> has translation</td> </tr> - <tr> - <td><a name="SkMatrix_kScale_Mask"> <code><strong>SkMatrix::kScale_Mask </strong></code> </a></td><td>2</td><td>set if <a href="#Matrix">Matrix</a> has x or y scale</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kScale_Mask'><code>SkMatrix::kScale_Mask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if <a href='#Matrix'>Matrix</a> has x or y scale</td> </tr> <tr> - <td><a name="SkMatrix_kAffine_Mask"> <code><strong>SkMatrix::kAffine_Mask </strong></code> </a></td><td>4</td><td>set if <a href="#Matrix">Matrix</a> skews or rotates</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kAffine_Mask'><code>SkMatrix::kAffine_Mask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if <a href='#Matrix'>Matrix</a> skews or rotates</td> </tr> - <tr> - <td><a name="SkMatrix_kPerspective_Mask"> <code><strong>SkMatrix::kPerspective_Mask </strong></code> </a></td><td>8</td><td>set if <a href="#Matrix">Matrix</a> has perspective</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kPerspective_Mask'><code>SkMatrix::kPerspective_Mask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if <a href='#Matrix'>Matrix</a> has perspective</td> </tr> </table> @@ -382,57 +917,137 @@ after setPolyToPoly: kTranslate_Mask kScale_Mask kAffine_Mask kPerspective_Mask ### See Also -<a href="#SkMatrix_getType">getType</a> - - - -## <a name="Property"></a> Property - -| name | description | -| --- | --- | -| <a href="#SkMatrix_decomposeScale">decomposeScale</a> | separates scale if possible | -| <a href="#SkMatrix_fixedStepInX">fixedStepInX</a> | returns step in x for a position in y | -| <a href="#SkMatrix_get">get</a> | returns one of nine <a href="#Matrix">Matrix</a> values | -| <a href="#SkMatrix_get9">get9</a> | returns all nine <a href="#Matrix">Matrix</a> values | -| <a href="#SkMatrix_getMaxScale">getMaxScale</a> | returns maximum scaling, if possible | -| <a href="#SkMatrix_getMinMaxScales">getMinMaxScales</a> | returns minimum and maximum scaling, if possible | -| <a href="#SkMatrix_getMinScale">getMinScale</a> | returns minimum scaling, if possible | -| <a href="#SkMatrix_getPerspX">getPerspX</a> | returns input x perspective factor | -| <a href="#SkMatrix_getPerspY">getPerspY</a> | returns input y perspective factor | -| <a href="#SkMatrix_getScaleX">getScaleX</a> | returns horizontal scale factor | -| <a href="#SkMatrix_getScaleY">getScaleY</a> | returns vertical scale factor | -| <a href="#SkMatrix_getSkewX">getSkewX</a> | returns horizontal skew factor | -| <a href="#SkMatrix_getSkewY">getSkewY</a> | returns vertical skew factor | -| <a href="#SkMatrix_getTranslateX">getTranslateX</a> | returns horizontal translation | -| <a href="#SkMatrix_getTranslateY">getTranslateY</a> | returns vertical translation | -| <a href="#SkMatrix_getType">getType</a> | returns transform complexity | -| <a href="#SkMatrix_hasPerspective">hasPerspective</a> | returns if transform includes perspective | -| <a href="#SkMatrix_isFinite">isFinite</a> | returns if all <a href="#Matrix">Matrix</a> values are not infinity, NaN | -| <a href="#SkMatrix_isFixedStepInX">isFixedStepInX</a> | returns if transformation supports fixed step in x | -| <a href="#SkMatrix_isIdentity">isIdentity</a> | returns if matrix equals the identity <a href="#Matrix">Matrix</a> | -| <a href="#SkMatrix_isScaleTranslate">isScaleTranslate</a> | returns if transform is limited to scale and translate | -| <a href="#SkMatrix_isSimilarity">isSimilarity</a> | returns if transform is limited to square scale and rotation | -| <a href="#SkMatrix_isTranslate">isTranslate</a> | returns if transform is limited to translate | -| <a href="#SkMatrix_preservesAxisAlignment">preservesAxisAlignment</a> | returns if mapping restricts to 90 degree multiples and mirroring | -| <a href="#SkMatrix_preservesRightAngles">preservesRightAngles</a> | returns if mapped 90 angle remains 90 degrees | -| <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> | returns if mapped <a href="SkRect_Reference#Rect">Rect</a> can be represented by another <a href="SkRect_Reference#Rect">Rect</a> | - -<a name="SkMatrix_getType"></a> +<a href='#SkMatrix_getType'>getType</a> + +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_decomposeScale'>decomposeScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>separates scale if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_fixedStepInX'>fixedStepInX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns step in x for a position in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_get'>get</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one of nine <a href='#Matrix'>Matrix</a> values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_get9'>get9</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns all nine <a href='#Matrix'>Matrix</a> values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getMaxScale'>getMaxScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns maximum scaling, if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns minimum and maximum scaling, if possible</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getMinScale'>getMinScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns minimum scaling, if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getPerspX'>getPerspX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns input x perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getPerspY'>getPerspY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns input y perspective factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getScaleX'>getScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns horizontal scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getScaleY'>getScaleY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns vertical scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getSkewX'>getSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns horizontal skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getSkewY'>getSkewY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns vertical skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getTranslateX'>getTranslateX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns horizontal translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getTranslateY'>getTranslateY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns vertical translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_getType'>getType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns transform complexity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_hasPerspective'>hasPerspective</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform includes perspective</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if all <a href='#Matrix'>Matrix</a> values are not infinity, NaN</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transformation supports fixed step in x</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isIdentity'>isIdentity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if matrix equals the identity <a href='#Matrix'>Matrix</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform is limited to scale and translate</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isSimilarity'>isSimilarity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform is limited to square scale and rotation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_isTranslate'>isTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if transform is limited to translate</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if mapping restricts to 90 degree multiples and mirroring</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if mapped 90 angle remains 90 degrees</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_rectStaysRect'>rectStaysRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if mapped <a href='SkRect_Reference#Rect'>Rect</a> can be represented by another <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> +</table> + + +<a name='SkMatrix_getType'></a> ## getType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -TypeMask getType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkMatrix_TypeMask'>TypeMask</a> <a href='#SkMatrix_getType'>getType</a>() const </pre> Returns a bit field describing the transformations the matrix may perform. The bit field is computed conservatively, so it may include -false positives. For example, when <a href="#SkMatrix_kPerspective_Mask">kPerspective Mask</a> is set, all +false positives. For example, when <a href='#SkMatrix_kPerspective_Mask'>kPerspective Mask</a> is set, all other bits are set. ### Return Value -<a href="#SkMatrix_kIdentity_Mask">kIdentity Mask</a>, or combinations of: <a href="#SkMatrix_kTranslate_Mask">kTranslate Mask</a>, <a href="#SkMatrix_kScale_Mask">kScale Mask</a>, -<a href="#SkMatrix_kAffine_Mask">kAffine Mask</a>, <a href="#SkMatrix_kPerspective_Mask">kPerspective Mask</a> +<a href='#SkMatrix_kIdentity_Mask'>kIdentity Mask</a>, or combinations of: <a href='#SkMatrix_kTranslate_Mask'>kTranslate Mask</a>, <a href='#SkMatrix_kScale_Mask'>kScale Mask</a>, +<a href='#SkMatrix_kAffine_Mask'>kAffine Mask</a>, <a href='#SkMatrix_kPerspective_Mask'>kPerspective Mask</a> ### Example @@ -449,18 +1064,18 @@ set all flags hex: f decimal: 15 ### See Also -<a href="#SkMatrix_TypeMask">TypeMask</a> +<a href='#SkMatrix_TypeMask'>TypeMask</a> --- -<a name="SkMatrix_isIdentity"></a> +<a name='SkMatrix_isIdentity'></a> ## isIdentity -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isIdentity() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_isIdentity'>isIdentity</a>() const </pre> -Returns true if <a href="#Matrix">Matrix</a> is identity. Identity matrix is: +Returns true if <a href='#Matrix'>Matrix</a> is identity. Identity matrix is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 0 | @@ -470,7 +1085,7 @@ Returns true if <a href="#Matrix">Matrix</a> is identity. Identity matrix is: ### Return Value -true if <a href="#Matrix">Matrix</a> has no effect +true if <a href='#Matrix'>Matrix</a> has no effect ### Example @@ -487,19 +1102,19 @@ is identity: false ### See Also -<a href="#SkMatrix_reset">reset</a> <a href="#SkMatrix_setIdentity">setIdentity</a> <a href="#SkMatrix_getType">getType</a> +<a href='#SkMatrix_reset'>reset</a> <a href='#SkMatrix_setIdentity'>setIdentity</a> <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_isScaleTranslate"></a> +<a name='SkMatrix_isScaleTranslate'></a> ## isScaleTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isScaleTranslate() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a>() const </pre> -Returns true if <a href="#Matrix">Matrix</a> at most scales and translates. <a href="#Matrix">Matrix</a> may be identity, -contain only scale elements, only translate elements, or both. <a href="#Matrix">Matrix</a> form is: +Returns true if <a href='#Matrix'>Matrix</a> at most scales and translates. <a href='#Matrix'>Matrix</a> may be identity, +contain only scale elements, only translate elements, or both. <a href='#Matrix'>Matrix</a> form is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scale-x 0 translate-x | @@ -509,7 +1124,7 @@ contain only scale elements, only translate elements, or both. <a href="#Matrix" ### Return Value -true if <a href="#Matrix">Matrix</a> is identity; or scales, translates, or both +true if <a href='#Matrix'>Matrix</a> is identity; or scales, translates, or both ### Example @@ -528,18 +1143,18 @@ is scale-translate: true ### See Also -<a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_isTranslate">isTranslate</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_getType">getType</a> +<a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_isTranslate'>isTranslate</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_isTranslate"></a> +<a name='SkMatrix_isTranslate'></a> ## isTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isTranslate() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_isTranslate'>isTranslate</a>() const </pre> -Returns true if <a href="#Matrix">Matrix</a> is identity, or translates. <a href="#Matrix">Matrix</a> form is: +Returns true if <a href='#Matrix'>Matrix</a> is identity, or translates. <a href='#Matrix'>Matrix</a> form is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 translate-x | @@ -549,7 +1164,7 @@ Returns true if <a href="#Matrix">Matrix</a> is identity, or translates. <a href ### Return Value -true if <a href="#Matrix">Matrix</a> is identity, or translates +true if <a href='#Matrix'>Matrix</a> is identity, or translates ### Example @@ -568,20 +1183,20 @@ is translate: false ### See Also -<a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_getType">getType</a> +<a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_rectStaysRect"></a> +<a name='SkMatrix_rectStaysRect'></a> ## rectStaysRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool rectStaysRect() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>() const </pre> -Returns true <a href="#Matrix">Matrix</a> maps <a href="SkRect_Reference#Rect">Rect</a> to another <a href="SkRect_Reference#Rect">Rect</a>. If true, <a href="#Matrix">Matrix</a> is identity, +Returns true <a href='#Matrix'>Matrix</a> maps <a href='SkRect_Reference#Rect'>Rect</a> to another <a href='SkRect_Reference#Rect'>Rect</a>. If true, <a href='#Matrix'>Matrix</a> is identity, or scales, or rotates a multiple of 90 degrees, or mirrors in x or y. In all -cases, <a href="#Matrix">Matrix</a> may also have translation. <a href="#Matrix">Matrix</a> form is either: +cases, <a href='#Matrix'>Matrix</a> may also have translation. <a href='#Matrix'>Matrix</a> form is either: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scale-x 0 translate-x | @@ -599,12 +1214,12 @@ or for non-zero values of scale-x, scale-y, rotate-x, and rotate-y. -Also called <a href="#SkMatrix_preservesAxisAlignment">preservesAxisAlignment</a>; use the one that provides better inline +Also called <a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a>; use the one that provides better inline documentation. ### Return Value -true if <a href="#Matrix">Matrix</a> maps one <a href="SkRect_Reference#Rect">Rect</a> into another +true if <a href='#Matrix'>Matrix</a> maps one <a href='SkRect_Reference#Rect'>Rect</a> into another ### Example @@ -623,20 +1238,20 @@ rectStaysRect: true ### See Also -<a href="#SkMatrix_preservesAxisAlignment">preservesAxisAlignment</a> <a href="#SkMatrix_preservesRightAngles">preservesRightAngles</a> +<a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a> <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a> --- -<a name="SkMatrix_preservesAxisAlignment"></a> +<a name='SkMatrix_preservesAxisAlignment'></a> ## preservesAxisAlignment -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool preservesAxisAlignment() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a>() const </pre> -Returns true <a href="#Matrix">Matrix</a> maps <a href="SkRect_Reference#Rect">Rect</a> to another <a href="SkRect_Reference#Rect">Rect</a>. If true, <a href="#Matrix">Matrix</a> is identity, +Returns true <a href='#Matrix'>Matrix</a> maps <a href='SkRect_Reference#Rect'>Rect</a> to another <a href='SkRect_Reference#Rect'>Rect</a>. If true, <a href='#Matrix'>Matrix</a> is identity, or scales, or rotates a multiple of 90 degrees, or mirrors in x or y. In all -cases, <a href="#Matrix">Matrix</a> may also have translation. <a href="#Matrix">Matrix</a> form is either: +cases, <a href='#Matrix'>Matrix</a> may also have translation. <a href='#Matrix'>Matrix</a> form is either: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scale-x 0 translate-x | @@ -654,12 +1269,12 @@ or for non-zero values of scale-x, scale-y, rotate-x, and rotate-y. -Also called <a href="#SkMatrix_rectStaysRect">rectStaysRect</a>; use the one that provides better inline +Also called <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>; use the one that provides better inline documentation. ### Return Value -true if <a href="#Matrix">Matrix</a> maps one <a href="SkRect_Reference#Rect">Rect</a> into another +true if <a href='#Matrix'>Matrix</a> maps one <a href='SkRect_Reference#Rect'>Rect</a> into another ### Example @@ -678,18 +1293,18 @@ preservesAxisAlignment: true ### See Also -<a href="#SkMatrix_rectStaysRect">rectStaysRect</a> <a href="#SkMatrix_preservesRightAngles">preservesRightAngles</a> +<a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a> --- -<a name="SkMatrix_hasPerspective"></a> +<a name='SkMatrix_hasPerspective'></a> ## hasPerspective -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool hasPerspective() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_hasPerspective'>hasPerspective</a>() const </pre> -Returns true if the matrix contains perspective elements. <a href="#Matrix">Matrix</a> form is: +Returns true if the matrix contains perspective elements. <a href='#Matrix'>Matrix</a> form is: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | -- -- -- | @@ -702,7 +1317,7 @@ not one. All other elements may have any value. ### Return Value -true if <a href="#Matrix">Matrix</a> is in most general form +true if <a href='#Matrix'>Matrix</a> is in most general form ### Example @@ -710,23 +1325,23 @@ true if <a href="#Matrix">Matrix</a> is in most general form ### See Also -<a href="#SkMatrix_setAll">setAll</a> <a href="#SkMatrix_set9">set9</a> <a href="#SkMatrix_MakeAll">MakeAll</a> +<a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a> --- -<a name="SkMatrix_isSimilarity"></a> +<a name='SkMatrix_isSimilarity'></a> ## isSimilarity -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_isSimilarity'>isSimilarity</a>(<a href='undocumented#SkScalar'>SkScalar</a> tol = <a href='undocumented#SK_ScalarNearlyZero'>SK ScalarNearlyZero</a>) const </pre> -Returns true if <a href="#Matrix">Matrix</a> contains only translation, rotation, reflection, and +Returns true if <a href='#Matrix'>Matrix</a> contains only translation, rotation, reflection, and uniform scale. -Returns false if <a href="#Matrix">Matrix</a> contains different scales, skewing, perspective, or +Returns false if <a href='#Matrix'>Matrix</a> contains different scales, skewing, perspective, or degenerate forms that collapse to a line or point. -Describes that the <a href="#Matrix">Matrix</a> makes rendering with and without the matrix are +Describes that the <a href='#Matrix'>Matrix</a> 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. @@ -734,37 +1349,37 @@ Preserves right angles, keeping the arms of the angle equal lengths. ### Parameters -<table> <tr> <td><a name="SkMatrix_isSimilarity_tol"> <code><strong>tol </strong></code> </a></td> <td> -to be deprecated</td> +<table> <tr> <td><a name='SkMatrix_isSimilarity_tol'><code><strong>tol</strong></code></a></td> + <td>to be deprecated</td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> only rotates, uniformly scales, translates +true if <a href='#Matrix'>Matrix</a> only rotates, uniformly scales, translates ### Example -<div><fiddle-embed name="98d60230ad633ae74d851de3a65d72d6"><div><a href="undocumented#String">String</a> is drawn four times through but only two are visible. Drawing the pair -with <a href="#SkMatrix_isSimilarity">isSimilarity</a> false reveals the pair not visible through the matrix. +<div><fiddle-embed name="8b37f4ae7fec1756433c0f984175fb14"><div><a href='undocumented#String'>String</a> is drawn four times through but only two are visible. Drawing the pair +with <a href='#SkMatrix_isSimilarity'>isSimilarity</a> false reveals the pair not visible through the matrix. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_isScaleTranslate">isScaleTranslate</a> <a href="#SkMatrix_preservesRightAngles">preservesRightAngles</a> <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> <a href="#SkMatrix_isFixedStepInX">isFixedStepInX</a> +<a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a> <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a> --- -<a name="SkMatrix_preservesRightAngles"></a> +<a name='SkMatrix_preservesRightAngles'></a> ## preservesRightAngles -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a>(<a href='undocumented#SkScalar'>SkScalar</a> tol = <a href='undocumented#SK_ScalarNearlyZero'>SK ScalarNearlyZero</a>) const </pre> -Returns true if <a href="#Matrix">Matrix</a> contains only translation, rotation, reflection, and +Returns true if <a href='#Matrix'>Matrix</a> contains only translation, rotation, reflection, and scale. Scale may differ along rotated axes. -Returns false if <a href="#Matrix">Matrix</a> skewing, perspective, or degenerate forms that collapse +Returns false if <a href='#Matrix'>Matrix</a> skewing, perspective, or degenerate forms that collapse to a line or point. Preserves right angles, but not requiring that the arms of the angle @@ -772,74 +1387,160 @@ retain equal lengths. ### Parameters -<table> <tr> <td><a name="SkMatrix_preservesRightAngles_tol"> <code><strong>tol </strong></code> </a></td> <td> -to be deprecated</td> +<table> <tr> <td><a name='SkMatrix_preservesRightAngles_tol'><code><strong>tol</strong></code></a></td> + <td>to be deprecated</td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> only rotates, scales, translates +true if <a href='#Matrix'>Matrix</a> only rotates, scales, translates ### Example -<div><fiddle-embed name="a3d5bfebc1c3423fb983d30aaf4ac5f4"><div>Equal scale is both similar and preserves right angles. +<div><fiddle-embed name="b9becf0dc24a9f00726e24a81fb72f16"><div>Equal scale is both similar and preserves right angles. Unequal scale is not similar but preserves right angles. Skews are not similar and do not preserve right angles. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_isScaleTranslate">isScaleTranslate</a> <a href="#SkMatrix_isSimilarity">isSimilarity</a> <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> <a href="#SkMatrix_isFixedStepInX">isFixedStepInX</a> +<a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a> <a href='#SkMatrix_isSimilarity'>isSimilarity</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a> --- -## <a name="MemberIndex"></a> MemberIndex +## <a name='MemberIndex'>MemberIndex</a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - static constexpr int <a href="#SkMatrix_kMScaleX">kMScaleX</a> = 0; - static constexpr int <a href="#SkMatrix_kMSkewX">kMSkewX</a> = 1; - static constexpr int <a href="#SkMatrix_kMTransX">kMTransX</a> = 2; - static constexpr int <a href="#SkMatrix_kMSkewY">kMSkewY</a> = 3; - static constexpr int <a href="#SkMatrix_kMScaleY">kMScaleY</a> = 4; - static constexpr int <a href="#SkMatrix_kMTransY">kMTransY</a> = 5; - static constexpr int <a href="#SkMatrix_kMPersp0">kMPersp0</a> = 6; - static constexpr int <a href="#SkMatrix_kMPersp1">kMPersp1</a> = 7; - static constexpr int <a href="#SkMatrix_kMPersp2">kMPersp2</a> = 8; -</pre> -<a href="#Matrix">Matrix</a> organizes its values in row order. These members correspond to -each value in <a href="#Matrix">Matrix</a>. ### Constants -<table> - <tr> - <td><a name="SkMatrix_kMScaleX"> <code><strong>SkMatrix::kMScaleX </strong></code> </a></td><td>0</td><td>horizontal scale factor</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal scale factor</td> </tr> <tr> - <td><a name="SkMatrix_kMSkewX"> <code><strong>SkMatrix::kMSkewX </strong></code> </a></td><td>1</td><td>horizontal skew factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal translation</td> </tr> <tr> - <td><a name="SkMatrix_kMTransX"> <code><strong>SkMatrix::kMTransX </strong></code> </a></td><td>2</td><td>horizontal translation</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical scale factor</td> </tr> <tr> - <td><a name="SkMatrix_kMSkewY"> <code><strong>SkMatrix::kMSkewY </strong></code> </a></td><td>3</td><td>vertical skew factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>input x perspective factor</td> </tr> <tr> - <td><a name="SkMatrix_kMScaleY"> <code><strong>SkMatrix::kMScaleY </strong></code> </a></td><td>4</td><td>vertical scale factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>input y perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_MemberIndex'><code>MemberIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>perspective bias</td> + </tr> +</table> + + +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> + static constexpr int <a href='#SkMatrix_kMScaleX'>kMScaleX</a> = 0; + static constexpr int <a href='#SkMatrix_kMSkewX'>kMSkewX</a> = 1; + static constexpr int <a href='#SkMatrix_kMTransX'>kMTransX</a> = 2; + static constexpr int <a href='#SkMatrix_kMSkewY'>kMSkewY</a> = 3; + static constexpr int <a href='#SkMatrix_kMScaleY'>kMScaleY</a> = 4; + static constexpr int <a href='#SkMatrix_kMTransY'>kMTransY</a> = 5; + static constexpr int <a href='#SkMatrix_kMPersp0'>kMPersp0</a> = 6; + static constexpr int <a href='#SkMatrix_kMPersp1'>kMPersp1</a> = 7; + static constexpr int <a href='#SkMatrix_kMPersp2'>kMPersp2</a> = 8; +</pre> + +<a href='#Matrix'>Matrix</a> organizes its values in row order. These members correspond to +each value in <a href='#Matrix'>Matrix</a>. + +### Constants + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMScaleX'><code>SkMatrix::kMScaleX</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +horizontal scale factor</td> </tr> <tr> - <td><a name="SkMatrix_kMTransY"> <code><strong>SkMatrix::kMTransY </strong></code> </a></td><td>5</td><td>vertical translation</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMSkewX'><code>SkMatrix::kMSkewX</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +horizontal skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMTransX'><code>SkMatrix::kMTransX</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +horizontal translation</td> </tr> <tr> - <td><a name="SkMatrix_kMPersp0"> <code><strong>SkMatrix::kMPersp0 </strong></code> </a></td><td>6</td><td>input x perspective factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMSkewY'><code>SkMatrix::kMSkewY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMScaleY'><code>SkMatrix::kMScaleY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +vertical scale factor</td> </tr> <tr> - <td><a name="SkMatrix_kMPersp1"> <code><strong>SkMatrix::kMPersp1 </strong></code> </a></td><td>7</td><td>input y perspective factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMTransY'><code>SkMatrix::kMTransY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +vertical translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMPersp0'><code>SkMatrix::kMPersp0</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>6</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +input x perspective factor</td> </tr> <tr> - <td><a name="SkMatrix_kMPersp2"> <code><strong>SkMatrix::kMPersp2 </strong></code> </a></td><td>8</td><td>perspective bias</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMPersp1'><code>SkMatrix::kMPersp1</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>7</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +input y perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMPersp2'><code>SkMatrix::kMPersp2</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +perspective bias</td> </tr> </table> @@ -849,17 +1550,58 @@ each value in <a href="#Matrix">Matrix</a>. ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_set">set</a> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_set'>set</a> + +## <a name='AffineIndex'>AffineIndex</a> + + + +### Constants + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_AffineIndex'><code>AffineIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_AffineIndex'><code>AffineIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_AffineIndex'><code>AffineIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_AffineIndex'><code>AffineIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_AffineIndex'><code>AffineIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>horizontal translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Matrix_AffineIndex'><code>AffineIndex</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#In Constant</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>vertical translation</td> + </tr> +</table> -## <a name="AffineIndex"></a> AffineIndex <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - static constexpr int <a href="#SkMatrix_kAScaleX">kAScaleX</a> = 0; - static constexpr int <a href="#SkMatrix_kASkewY">kASkewY</a> = 1; - static constexpr int <a href="#SkMatrix_kASkewX">kASkewX</a> = 2; - static constexpr int <a href="#SkMatrix_kAScaleY">kAScaleY</a> = 3; - static constexpr int <a href="#SkMatrix_kATransX">kATransX</a> = 4; - static constexpr int <a href="#SkMatrix_kATransY">kATransY</a> = 5; + static constexpr int <a href='#SkMatrix_kAScaleX'>kAScaleX</a> = 0; + static constexpr int <a href='#SkMatrix_kASkewY'>kASkewY</a> = 1; + static constexpr int <a href='#SkMatrix_kASkewX'>kASkewX</a> = 2; + static constexpr int <a href='#SkMatrix_kAScaleY'>kAScaleY</a> = 3; + static constexpr int <a href='#SkMatrix_kATransX'>kATransX</a> = 4; + static constexpr int <a href='#SkMatrix_kATransY'>kATransY</a> = 5; </pre> Affine arrays are in column major order to match the matrix used by @@ -867,64 +1609,111 @@ PDF and XPS. ### Constants -<table> - <tr> - <td><a name="SkMatrix_kAScaleX"> <code><strong>SkMatrix::kAScaleX </strong></code> </a></td><td>0</td><td>horizontal scale factor</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kAScaleX'><code>SkMatrix::kAScaleX</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +horizontal scale factor</td> </tr> <tr> - <td><a name="SkMatrix_kASkewY"> <code><strong>SkMatrix::kASkewY </strong></code> </a></td><td>1</td><td>vertical skew factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kASkewY'><code>SkMatrix::kASkewY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +vertical skew factor</td> </tr> - <tr> - <td><a name="SkMatrix_kASkewX"> <code><strong>SkMatrix::kASkewX </strong></code> </a></td><td>2</td><td>horizontal skew factor</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kASkewX'><code>SkMatrix::kASkewX</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +horizontal skew factor</td> </tr> <tr> - <td><a name="SkMatrix_kAScaleY"> <code><strong>SkMatrix::kAScaleY </strong></code> </a></td><td>3</td><td>vertical scale factor</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kAScaleY'><code>SkMatrix::kAScaleY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +vertical scale factor</td> </tr> - <tr> - <td><a name="SkMatrix_kATransX"> <code><strong>SkMatrix::kATransX </strong></code> </a></td><td>4</td><td>horizontal translation</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kATransX'><code>SkMatrix::kATransX</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +horizontal translation</td> </tr> <tr> - <td><a name="SkMatrix_kATransY"> <code><strong>SkMatrix::kATransY </strong></code> </a></td><td>5</td><td>vertical translation</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kATransY'><code>SkMatrix::kATransY</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +vertical translation</td> </tr> </table> ### See Also -<a href="#SkMatrix_SetAffineIdentity">SetAffineIdentity</a> <a href="#SkMatrix_asAffine">asAffine</a> <a href="#SkMatrix_setAffine">setAffine</a> +<a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a> <a href='#SkMatrix_asAffine'>asAffine</a> <a href='#SkMatrix_setAffine'>setAffine</a> + +## <a name='Operator'>Operator</a> + -## <a name="Operator"></a> Operator +SkMatrix operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_Concat'>Concat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the concatenation of <a href='#Matrix'>Matrix</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares <a href='#Matrix'>Matrix</a> pair using memcmp()</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_invert'>invert</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns inverse, if possible</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_notequal_operator'>operator!=(const SkMatrix& a, const SkMatrix& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_equal_operator'>operator==(const SkMatrix& a, const SkMatrix& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_array1_operator'>operator[](int index)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable reference to <a href='#Matrix'>Matrix</a> value</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_array_operator'>operator[](int index) const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Matrix'>Matrix</a> value</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkMatrix_Concat">Concat</a> | returns the concatenation of <a href="#Matrix">Matrix</a> pair | -| <a href="#SkMatrix_cheapEqualTo">cheapEqualTo</a> | compares <a href="#Matrix">Matrix</a> pair using memcmp() | -| <a href="#SkMatrix_invert">invert</a> | returns inverse, if possible | -| <a href="#SkMatrix_notequal_operator">operator!=(const SkMatrix& a, const SkMatrix& b)</a> | returns true if members are unequal | -| <a href="#SkMatrix_equal_operator">operator==(const SkMatrix& a, const SkMatrix& b)</a> | returns true if members are equal | -| <a href="#SkMatrix_array1_operator">operator[](int index)</a> | returns writable reference to <a href="#Matrix">Matrix</a> value | -| <a href="#SkMatrix_array_operator">operator[](int index) const</a> | returns <a href="#Matrix">Matrix</a> value | -<a name="SkMatrix_array_operator"></a> +<a name='SkMatrix_array_operator'></a> ## operator[] -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar operator[](int index) _const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_array1_operator'>operator[](int index)</a> _const </pre> -Returns one matrix value. Asserts if <a href="#SkMatrix_array_operator_index">index</a> is out of range and SK_DEBUG is +Returns one matrix value. Asserts if <a href='#SkMatrix_array_operator_index'>index</a> is out of range and SK_DEBUG is defined. ### Parameters -<table> <tr> <td><a name="SkMatrix_array_operator_index"> <code><strong>index </strong></code> </a></td> <td> -one of: <a href="#SkMatrix_kMScaleX">kMScaleX</a>, <a href="#SkMatrix_kMSkewX">kMSkewX</a>, <a href="#SkMatrix_kMTransX">kMTransX</a>, <a href="#SkMatrix_kMSkewY">kMSkewY</a>, <a href="#SkMatrix_kMScaleY">kMScaleY</a>, <a href="#SkMatrix_kMTransY">kMTransY</a>, -<a href="#SkMatrix_kMPersp0">kMPersp0</a>, <a href="#SkMatrix_kMPersp1">kMPersp1</a>, <a href="#SkMatrix_kMPersp2">kMPersp2</a></td> +<table> <tr> <td><a name='SkMatrix_array_operator_index'><code><strong>index</strong></code></a></td> + <td>one of: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, +<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a></td> </tr> </table> ### Return Value -value corresponding to <a href="#SkMatrix_array_operator_index">index</a> +value corresponding to <a href='#SkMatrix_array_operator_index'>index</a> ### Example @@ -941,31 +1730,31 @@ matrix[SkMatrix::kMScaleY] == 24 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_set">set</a> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_set'>set</a> --- -<a name="SkMatrix_get"></a> +<a name='SkMatrix_get'></a> ## get -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar get(int index) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_get'>get</a>(int index) const </pre> -Returns one matrix value. Asserts if <a href="#SkMatrix_get_index">index</a> is out of range and SK_DEBUG is +Returns one matrix value. Asserts if <a href='#SkMatrix_get_index'>index</a> is out of range and SK_DEBUG is defined. ### Parameters -<table> <tr> <td><a name="SkMatrix_get_index"> <code><strong>index </strong></code> </a></td> <td> -one of: <a href="#SkMatrix_kMScaleX">kMScaleX</a>, <a href="#SkMatrix_kMSkewX">kMSkewX</a>, <a href="#SkMatrix_kMTransX">kMTransX</a>, <a href="#SkMatrix_kMSkewY">kMSkewY</a>, <a href="#SkMatrix_kMScaleY">kMScaleY</a>, <a href="#SkMatrix_kMTransY">kMTransY</a>, -<a href="#SkMatrix_kMPersp0">kMPersp0</a>, <a href="#SkMatrix_kMPersp1">kMPersp1</a>, <a href="#SkMatrix_kMPersp2">kMPersp2</a></td> +<table> <tr> <td><a name='SkMatrix_get_index'><code><strong>index</strong></code></a></td> + <td>one of: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, +<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a></td> </tr> </table> ### Return Value -value corresponding to <a href="#SkMatrix_get_index">index</a> +value corresponding to <a href='#SkMatrix_get_index'>index</a> ### Example @@ -982,19 +1771,19 @@ matrix.get(SkMatrix::kMSkewY) == 24 ### See Also -<a href="#SkMatrix_array1_operator">operator[](int index)</a> <a href="#SkMatrix_set">set</a> +<a href='#SkMatrix_array1_operator'>operator[](int index)</a> <a href='#SkMatrix_set'>set</a> --- -<a name="SkMatrix_getScaleX"></a> +<a name='SkMatrix_getScaleX'></a> ## getScaleX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getScaleX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getScaleX'>getScaleX</a>() const </pre> Returns scale factor multiplied by x input, contributing to x output. -With <a href="#SkMatrix_mapPoints">mapPoints</a>, scales <a href="SkPoint_Reference#Point">Points</a> along the x-axis. +With <a href='#SkMatrix_mapPoints'>mapPoints</a>, scales <a href='SkPoint_Reference#Point'>Points</a> along the x-axis. ### Return Value @@ -1014,19 +1803,19 @@ matrix.getScaleX() == 42 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_getScaleY">getScaleY</a> <a href="#SkMatrix_setScaleX">setScaleX</a> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getScaleY'>getScaleY</a> <a href='#SkMatrix_setScaleX'>setScaleX</a> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> --- -<a name="SkMatrix_getScaleY"></a> +<a name='SkMatrix_getScaleY'></a> ## getScaleY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getScaleY() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getScaleY'>getScaleY</a>() const </pre> Returns scale factor multiplied by y input, contributing to y output. -With <a href="#SkMatrix_mapPoints">mapPoints</a>, scales <a href="SkPoint_Reference#Point">Points</a> along the y-axis. +With <a href='#SkMatrix_mapPoints'>mapPoints</a>, scales <a href='SkPoint_Reference#Point'>Points</a> along the y-axis. ### Return Value @@ -1046,20 +1835,20 @@ matrix.getScaleY() == 24 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_getScaleX">getScaleX</a> <a href="#SkMatrix_setScaleY">setScaleY</a> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getScaleX'>getScaleX</a> <a href='#SkMatrix_setScaleY'>setScaleY</a> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> --- -<a name="SkMatrix_getSkewY"></a> +<a name='SkMatrix_getSkewY'></a> ## getSkewY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getSkewY() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getSkewY'>getSkewY</a>() const </pre> Returns scale factor multiplied by x input, contributing to y output. -With <a href="#SkMatrix_mapPoints">mapPoints</a>, skews <a href="SkPoint_Reference#Point">Points</a> along the y-axis. -Skew x and y together can rotate <a href="SkPoint_Reference#Point">Points</a>. +With <a href='#SkMatrix_mapPoints'>mapPoints</a>, skews <a href='SkPoint_Reference#Point'>Points</a> along the y-axis. +Skew x and y together can rotate <a href='SkPoint_Reference#Point'>Points</a>. ### Return Value @@ -1079,20 +1868,20 @@ matrix.getSkewY() == 24 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_getSkewX">getSkewX</a> <a href="#SkMatrix_setSkewY">setSkewY</a> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getSkewX'>getSkewX</a> <a href='#SkMatrix_setSkewY'>setSkewY</a> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_getSkewX"></a> +<a name='SkMatrix_getSkewX'></a> ## getSkewX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getSkewX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getSkewX'>getSkewX</a>() const </pre> Returns scale factor multiplied by y input, contributing to x output. -With <a href="#SkMatrix_mapPoints">mapPoints</a>, skews <a href="SkPoint_Reference#Point">Points</a> along the x-axis. -Skew x and y together can rotate <a href="SkPoint_Reference#Point">Points</a>. +With <a href='#SkMatrix_mapPoints'>mapPoints</a>, skews <a href='SkPoint_Reference#Point'>Points</a> along the x-axis. +Skew x and y together can rotate <a href='SkPoint_Reference#Point'>Points</a>. ### Return Value @@ -1112,19 +1901,19 @@ matrix.getSkewX() == 42 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_getSkewY">getSkewY</a> <a href="#SkMatrix_setSkewX">setSkewX</a> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getSkewY'>getSkewY</a> <a href='#SkMatrix_setSkewX'>setSkewX</a> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_getTranslateX"></a> +<a name='SkMatrix_getTranslateX'></a> ## getTranslateX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getTranslateX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getTranslateX'>getTranslateX</a>() const </pre> Returns translation contributing to x output. -With <a href="#SkMatrix_mapPoints">mapPoints</a>, moves <a href="SkPoint_Reference#Point">Points</a> along the x-axis. +With <a href='#SkMatrix_mapPoints'>mapPoints</a>, moves <a href='SkPoint_Reference#Point'>Points</a> along the x-axis. ### Return Value @@ -1144,19 +1933,19 @@ matrix.getTranslateX() == 42 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_getTranslateY">getTranslateY</a> <a href="#SkMatrix_setTranslateX">setTranslateX</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getTranslateY'>getTranslateY</a> <a href='#SkMatrix_setTranslateX'>setTranslateX</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> --- -<a name="SkMatrix_getTranslateY"></a> +<a name='SkMatrix_getTranslateY'></a> ## getTranslateY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getTranslateY() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getTranslateY'>getTranslateY</a>() const </pre> Returns translation contributing to y output. -With <a href="#SkMatrix_mapPoints">mapPoints</a>, moves <a href="SkPoint_Reference#Point">Points</a> along the y-axis. +With <a href='#SkMatrix_mapPoints'>mapPoints</a>, moves <a href='SkPoint_Reference#Point'>Points</a> along the y-axis. ### Return Value @@ -1176,15 +1965,15 @@ matrix.getTranslateY() == 24 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_getTranslateX">getTranslateX</a> <a href="#SkMatrix_setTranslateY">setTranslateY</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getTranslateX'>getTranslateX</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> --- -<a name="SkMatrix_getPerspX"></a> +<a name='SkMatrix_getPerspX'></a> ## getPerspX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getPerspX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getPerspX'>getPerspX</a>() const </pre> Returns factor scaling input x relative to input y. @@ -1199,15 +1988,15 @@ input x perspective factor ### See Also -<a href="#SkMatrix_kMPersp0">kMPersp0</a> <a href="#SkMatrix_getPerspY">getPerspY</a> +<a href='#SkMatrix_kMPersp0'>kMPersp0</a> <a href='#SkMatrix_getPerspY'>getPerspY</a> --- -<a name="SkMatrix_getPerspY"></a> +<a name='SkMatrix_getPerspY'></a> ## getPerspY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getPerspY() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getPerspY'>getPerspY</a>() const </pre> Returns factor scaling input y relative to input x. @@ -1222,34 +2011,34 @@ input y perspective factor ### See Also -<a href="#SkMatrix_kMPersp1">kMPersp1</a> <a href="#SkMatrix_getPerspX">getPerspX</a> +<a href='#SkMatrix_kMPersp1'>kMPersp1</a> <a href='#SkMatrix_getPerspX'>getPerspX</a> --- -<a name="SkMatrix_array1_operator"></a> +<a name='SkMatrix_array1_operator'></a> ## operator[] -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar& operator[](int index) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a>& <a href='#SkMatrix_array1_operator'>operator[](int index)</a> </pre> -Returns writable <a href="#Matrix">Matrix</a> value. Asserts if <a href="#SkMatrix_array1_operator_index">index</a> is out of range and SK_DEBUG is -defined. Clears internal cache anticipating that caller will change <a href="#Matrix">Matrix</a> value. +Returns writable <a href='#Matrix'>Matrix</a> value. Asserts if <a href='#SkMatrix_array1_operator_index'>index</a> is out of range and SK_DEBUG is +defined. Clears internal cache anticipating that caller will change <a href='#Matrix'>Matrix</a> value. -Next call to read <a href="#Matrix">Matrix</a> state may recompute cache; subsequent writes to <a href="#Matrix">Matrix</a> -value must be followed by <a href="#SkMatrix_dirtyMatrixTypeCache">dirtyMatrixTypeCache</a>. +Next call to read <a href='#Matrix'>Matrix</a> state may recompute cache; subsequent writes to <a href='#Matrix'>Matrix</a> +value must be followed by <a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a>. ### Parameters -<table> <tr> <td><a name="SkMatrix_array1_operator_index"> <code><strong>index </strong></code> </a></td> <td> -one of: <a href="#SkMatrix_kMScaleX">kMScaleX</a>, <a href="#SkMatrix_kMSkewX">kMSkewX</a>, <a href="#SkMatrix_kMTransX">kMTransX</a>, <a href="#SkMatrix_kMSkewY">kMSkewY</a>, <a href="#SkMatrix_kMScaleY">kMScaleY</a>, <a href="#SkMatrix_kMTransY">kMTransY</a>, -<a href="#SkMatrix_kMPersp0">kMPersp0</a>, <a href="#SkMatrix_kMPersp1">kMPersp1</a>, <a href="#SkMatrix_kMPersp2">kMPersp2</a></td> +<table> <tr> <td><a name='SkMatrix_array1_operator_index'><code><strong>index</strong></code></a></td> + <td>one of: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, +<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a></td> </tr> </table> ### Return Value -writable value corresponding to <a href="#SkMatrix_array1_operator_index">index</a> +writable value corresponding to <a href='#SkMatrix_array1_operator_index'>index</a> ### Example @@ -1268,68 +2057,181 @@ after dirty cache: x = 66 ### See Also -<a href="#SkMatrix_get">get</a> <a href="#SkMatrix_dirtyMatrixTypeCache">dirtyMatrixTypeCache</a> <a href="#SkMatrix_set">set</a> +<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a> <a href='#SkMatrix_set'>set</a> --- -## <a name="Set"></a> Set - -| name | description | -| --- | --- | -| <a href="#SkMatrix_postConcat">postConcat</a> | post-multiplies <a href="#Matrix">Matrix</a> by <a href="#Matrix">Matrix</a> parameter | -| <a href="#SkMatrix_postIDiv">postIDiv</a> | post-multiplies <a href="#Matrix">Matrix</a> by inverse scale | -| <a href="#SkMatrix_postRotate">postRotate</a> | post-multiplies <a href="#Matrix">Matrix</a> by rotation | -| | <a href="#SkMatrix_postRotate">postRotate(SkScalar degrees, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_postRotate_2">postRotate(SkScalar degrees)</a> | -| <a href="#SkMatrix_postScale">postScale</a> | post-multiplies <a href="#Matrix">Matrix</a> by scale | -| | <a href="#SkMatrix_postScale">postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_postScale_2">postScale(SkScalar sx, SkScalar sy)</a> | -| <a href="#SkMatrix_postSkew">postSkew</a> | post-multiplies <a href="#Matrix">Matrix</a> by skew | -| | <a href="#SkMatrix_postSkew">postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_postSkew_2">postSkew(SkScalar kx, SkScalar ky)</a> | -| <a href="#SkMatrix_postTranslate">postTranslate</a> | post-multiplies <a href="#Matrix">Matrix</a> by translation | -| <a href="#SkMatrix_preConcat">preConcat</a> | pre-multiplies <a href="#Matrix">Matrix</a> by <a href="#Matrix">Matrix</a> parameter | -| <a href="#SkMatrix_preRotate">preRotate</a> | pre-multiplies <a href="#Matrix">Matrix</a> by rotation | -| | <a href="#SkMatrix_preRotate">preRotate(SkScalar degrees, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_preRotate_2">preRotate(SkScalar degrees)</a> | -| <a href="#SkMatrix_preScale">preScale</a> | pre-multiplies <a href="#Matrix">Matrix</a> by scale | -| | <a href="#SkMatrix_preScale">preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_preScale_2">preScale(SkScalar sx, SkScalar sy)</a> | -| <a href="#SkMatrix_preSkew">preSkew</a> | pre-multiplies <a href="#Matrix">Matrix</a> by skew | -| | <a href="#SkMatrix_preSkew">preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)</a> | -| | <a href="#SkMatrix_preSkew_2">preSkew(SkScalar kx, SkScalar ky)</a> | -| <a href="#SkMatrix_preTranslate">preTranslate</a> | pre-multiplies <a href="#Matrix">Matrix</a> by translation | -| <a href="#SkMatrix_set">set</a> | sets one value | -| <a href="#SkMatrix_set9">set9</a> | sets all values from <a href="undocumented#Scalar">Scalar</a> array | -| <a href="#SkMatrix_setAll">setAll</a> | sets all values from parameters | -| <a href="#SkMatrix_setPerspX">setPerspX</a> | sets input x perspective factor | -| <a href="#SkMatrix_setPerspY">setPerspY</a> | sets input y perspective factor | -| <a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> | sets to map one to four points to an equal array of points | -| <a href="#SkMatrix_setRectToRect">setRectToRect</a> | sets to map one <a href="SkRect_Reference#Rect">Rect</a> to another | -| <a href="#SkMatrix_setScaleX">setScaleX</a> | sets horizontal scale factor | -| <a href="#SkMatrix_setScaleY">setScaleY</a> | sets vertical scale factor | -| <a href="#SkMatrix_setSkewX">setSkewX</a> | sets horizontal skew factor | -| <a href="#SkMatrix_setSkewY">setSkewY</a> | sets vertical skew factor | -| <a href="#SkMatrix_setTranslateX">setTranslateX</a> | sets horizontal translation | -| <a href="#SkMatrix_setTranslateY">setTranslateY</a> | sets vertical translation | - -<a name="SkMatrix_set"></a> +## <a name='Set'>Set</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postConcat'>postConcat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by <a href='#Matrix'>Matrix</a> parameter</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postIDiv'>postIDiv</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by inverse scale</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postRotate'>postRotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by rotation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postRotate'>postRotate(SkScalar degrees, SkScalar px, SkScalar py)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postRotate_2'>postRotate(SkScalar degrees)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postScale'>postScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by scale</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postScale'>postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postScale_2'>postScale(SkScalar sx, SkScalar sy)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postSkew'>postSkew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by skew</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postSkew'>postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postSkew_2'>postSkew(SkScalar kx, SkScalar ky)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_postTranslate'>postTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>post-multiplies <a href='#Matrix'>Matrix</a> by translation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preConcat'>preConcat</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by <a href='#Matrix'>Matrix</a> parameter</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preRotate'>preRotate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by rotation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preRotate'>preRotate(SkScalar degrees, SkScalar px, SkScalar py)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preRotate_2'>preRotate(SkScalar degrees)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preScale'>preScale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by scale</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preScale'>preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preScale_2'>preScale(SkScalar sx, SkScalar sy)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preSkew'>preSkew</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by skew</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preSkew'>preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preSkew_2'>preSkew(SkScalar kx, SkScalar ky)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_preTranslate'>preTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pre-multiplies <a href='#Matrix'>Matrix</a> by translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets one value</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_set9'>set9</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets all values from <a href='undocumented#Scalar'>Scalar</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setAll'>setAll</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets all values from parameters</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setPerspX'>setPerspX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets input x perspective factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setPerspY'>setPerspY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets input y perspective factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to map one to four points to an equal array of points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setRectToRect'>setRectToRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to map one <a href='SkRect_Reference#Rect'>Rect</a> to another</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScaleX'>setScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets horizontal scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setScaleY'>setScaleY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets vertical scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkewX'>setSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets horizontal skew factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setSkewY'>setSkewY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets vertical skew factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslateX'>setTranslateX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets horizontal translation</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_setTranslateY'>setTranslateY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets vertical translation</td> + </tr> +</table> + + +<a name='SkMatrix_set'></a> ## set -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(int index, SkScalar value) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_set'>set</a>(int index, <a href='undocumented#SkScalar'>SkScalar</a> value) </pre> -Sets <a href="#Matrix">Matrix</a> <a href="#SkMatrix_set_value">value</a>. Asserts if <a href="#SkMatrix_set_index">index</a> is out of range and SK_DEBUG is +Sets <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_set_value'>value</a>. Asserts if <a href='#SkMatrix_set_index'>index</a> is out of range and SK_DEBUG is defined. Safer than operator[]; internal cache is always maintained. ### Parameters -<table> <tr> <td><a name="SkMatrix_set_index"> <code><strong>index </strong></code> </a></td> <td> -one of: <a href="#SkMatrix_kMScaleX">kMScaleX</a>, <a href="#SkMatrix_kMSkewX">kMSkewX</a>, <a href="#SkMatrix_kMTransX">kMTransX</a>, <a href="#SkMatrix_kMSkewY">kMSkewY</a>, <a href="#SkMatrix_kMScaleY">kMScaleY</a>, <a href="#SkMatrix_kMTransY">kMTransY</a>, -<a href="#SkMatrix_kMPersp0">kMPersp0</a>, <a href="#SkMatrix_kMPersp1">kMPersp1</a>, <a href="#SkMatrix_kMPersp2">kMPersp2</a></td> - </tr> <tr> <td><a name="SkMatrix_set_value"> <code><strong>value </strong></code> </a></td> <td> -<a href="undocumented#Scalar">Scalar</a> to store in <a href="#Matrix">Matrix</a></td> +<table> <tr> <td><a name='SkMatrix_set_index'><code><strong>index</strong></code></a></td> + <td>one of: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, +<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a></td> + </tr> + <tr> <td><a name='SkMatrix_set_value'><code><strong>value</strong></code></a></td> + <td><a href='undocumented#Scalar'>Scalar</a> to store in <a href='#Matrix'>Matrix</a></td> </tr> </table> @@ -1349,23 +2251,23 @@ after 2nd skew x mod: x = 66 ### See Also -operator[] <a href="#SkMatrix_get">get</a> +operator[] <a href='#SkMatrix_get'>get</a> --- -<a name="SkMatrix_setScaleX"></a> +<a name='SkMatrix_setScaleX'></a> ## setScaleX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setScaleX(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setScaleX'>setScaleX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> Sets horizontal scale factor. ### Parameters -<table> <tr> <td><a name="SkMatrix_setScaleX_v"> <code><strong>v </strong></code> </a></td> <td> -horizontal scale factor to store</td> +<table> <tr> <td><a name='SkMatrix_setScaleX_v'><code><strong>v</strong></code></a></td> + <td>horizontal scale factor to store</td> </tr> </table> @@ -1375,23 +2277,23 @@ horizontal scale factor to store</td> ### See Also -<a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_setScaleY">setScaleY</a> +<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_setScaleY'>setScaleY</a> --- -<a name="SkMatrix_setScaleY"></a> +<a name='SkMatrix_setScaleY'></a> ## setScaleY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setScaleY(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setScaleY'>setScaleY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> Sets vertical scale factor. ### Parameters -<table> <tr> <td><a name="SkMatrix_setScaleY_v"> <code><strong>v </strong></code> </a></td> <td> -vertical scale factor to store</td> +<table> <tr> <td><a name='SkMatrix_setScaleY_v'><code><strong>v</strong></code></a></td> + <td>vertical scale factor to store</td> </tr> </table> @@ -1401,23 +2303,23 @@ vertical scale factor to store</td> ### See Also -<a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_setScaleX">setScaleX</a> +<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_setScaleX'>setScaleX</a> --- -<a name="SkMatrix_setSkewY"></a> +<a name='SkMatrix_setSkewY'></a> ## setSkewY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSkewY(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setSkewY'>setSkewY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> Sets vertical skew factor. ### Parameters -<table> <tr> <td><a name="SkMatrix_setSkewY_v"> <code><strong>v </strong></code> </a></td> <td> -vertical skew factor to store</td> +<table> <tr> <td><a name='SkMatrix_setSkewY_v'><code><strong>v</strong></code></a></td> + <td>vertical skew factor to store</td> </tr> </table> @@ -1427,23 +2329,23 @@ vertical skew factor to store</td> ### See Also -<a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> <a href="#SkMatrix_setSkewX">setSkewX</a> +<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> <a href='#SkMatrix_setSkewX'>setSkewX</a> --- -<a name="SkMatrix_setSkewX"></a> +<a name='SkMatrix_setSkewX'></a> ## setSkewX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSkewX(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setSkewX'>setSkewX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> Sets horizontal skew factor. ### Parameters -<table> <tr> <td><a name="SkMatrix_setSkewX_v"> <code><strong>v </strong></code> </a></td> <td> -horizontal skew factor to store</td> +<table> <tr> <td><a name='SkMatrix_setSkewX_v'><code><strong>v</strong></code></a></td> + <td>horizontal skew factor to store</td> </tr> </table> @@ -1453,23 +2355,23 @@ horizontal skew factor to store</td> ### See Also -<a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> <a href="#SkMatrix_setSkewX">setSkewX</a> +<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> <a href='#SkMatrix_setSkewX'>setSkewX</a> --- -<a name="SkMatrix_setTranslateX"></a> +<a name='SkMatrix_setTranslateX'></a> ## setTranslateX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTranslateX(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setTranslateX'>setTranslateX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> Sets horizontal translation. ### Parameters -<table> <tr> <td><a name="SkMatrix_setTranslateX_v"> <code><strong>v </strong></code> </a></td> <td> -horizontal translation to store</td> +<table> <tr> <td><a name='SkMatrix_setTranslateX_v'><code><strong>v</strong></code></a></td> + <td>horizontal translation to store</td> </tr> </table> @@ -1479,23 +2381,23 @@ horizontal translation to store</td> ### See Also -<a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_setTranslateY">setTranslateY</a> +<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_setTranslateY'>setTranslateY</a> --- -<a name="SkMatrix_setTranslateY"></a> +<a name='SkMatrix_setTranslateY'></a> ## setTranslateY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTranslateY(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setTranslateY'>setTranslateY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> Sets vertical translation. ### Parameters -<table> <tr> <td><a name="SkMatrix_setTranslateY_v"> <code><strong>v </strong></code> </a></td> <td> -vertical translation to store</td> +<table> <tr> <td><a name='SkMatrix_setTranslateY_v'><code><strong>v</strong></code></a></td> + <td>vertical translation to store</td> </tr> </table> @@ -1505,24 +2407,24 @@ vertical translation to store</td> ### See Also -<a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_setTranslateX">setTranslateX</a> +<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_setTranslateX'>setTranslateX</a> --- -<a name="SkMatrix_setPerspX"></a> +<a name='SkMatrix_setPerspX'></a> ## setPerspX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPerspX(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setPerspX'>setPerspX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> -Sets input x perspective factor, which causes <a href="#SkMatrix_mapXY">mapXY</a> to vary input x inversely +Sets input x perspective factor, which causes <a href='#SkMatrix_mapXY'>mapXY</a> to vary input x inversely proportional to input y. ### Parameters -<table> <tr> <td><a name="SkMatrix_setPerspX_v"> <code><strong>v </strong></code> </a></td> <td> -perspective factor</td> +<table> <tr> <td><a name='SkMatrix_setPerspX_v'><code><strong>v</strong></code></a></td> + <td>perspective factor</td> </tr> </table> @@ -1532,24 +2434,24 @@ perspective factor</td> ### See Also -<a href="#SkMatrix_getPerspX">getPerspX</a> <a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setAll">setAll</a> <a href="#SkMatrix_set9">set9</a> <a href="#SkMatrix_MakeAll">MakeAll</a> +<a href='#SkMatrix_getPerspX'>getPerspX</a> <a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a> --- -<a name="SkMatrix_setPerspY"></a> +<a name='SkMatrix_setPerspY'></a> ## setPerspY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPerspY(SkScalar v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setPerspY'>setPerspY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v) </pre> -Sets input y perspective factor, which causes <a href="#SkMatrix_mapXY">mapXY</a> to vary input y inversely +Sets input y perspective factor, which causes <a href='#SkMatrix_mapXY'>mapXY</a> to vary input y inversely proportional to input x. ### Parameters -<table> <tr> <td><a name="SkMatrix_setPerspY_v"> <code><strong>v </strong></code> </a></td> <td> -perspective factor</td> +<table> <tr> <td><a name='SkMatrix_setPerspY_v'><code><strong>v</strong></code></a></td> + <td>perspective factor</td> </tr> </table> @@ -1559,16 +2461,16 @@ perspective factor</td> ### See Also -<a href="#SkMatrix_getPerspY">getPerspY</a> <a href="#SkMatrix_set">set</a> <a href="#SkMatrix_setAll">setAll</a> <a href="#SkMatrix_set9">set9</a> <a href="#SkMatrix_MakeAll">MakeAll</a> +<a href='#SkMatrix_getPerspY'>getPerspY</a> <a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a> --- -<a name="SkMatrix_setAll"></a> +<a name='SkMatrix_setAll'></a> ## setAll -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, - SkScalar transY, SkScalar persp0, SkScalar persp1, SkScalar persp2) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setAll'>setAll</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX, <a href='undocumented#SkScalar'>SkScalar</a> skewX, <a href='undocumented#SkScalar'>SkScalar</a> transX, <a href='undocumented#SkScalar'>SkScalar</a> skewY, <a href='undocumented#SkScalar'>SkScalar</a> scaleY, + <a href='undocumented#SkScalar'>SkScalar</a> transY, <a href='undocumented#SkScalar'>SkScalar</a> persp0, <a href='undocumented#SkScalar'>SkScalar</a> persp1, <a href='undocumented#SkScalar'>SkScalar</a> persp2) </pre> Sets all values from parameters. Sets matrix to: @@ -1581,24 +2483,32 @@ Sets all values from parameters. Sets matrix to: ### Parameters -<table> <tr> <td><a name="SkMatrix_setAll_scaleX"> <code><strong>scaleX </strong></code> </a></td> <td> -horizontal scale factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_skewX"> <code><strong>skewX </strong></code> </a></td> <td> -horizontal skew factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_transX"> <code><strong>transX </strong></code> </a></td> <td> -horizontal translation to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_skewY"> <code><strong>skewY </strong></code> </a></td> <td> -vertical skew factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_scaleY"> <code><strong>scaleY </strong></code> </a></td> <td> -vertical scale factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_transY"> <code><strong>transY </strong></code> </a></td> <td> -vertical translation to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_persp0"> <code><strong>persp0 </strong></code> </a></td> <td> -input x perspective factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_persp1"> <code><strong>persp1 </strong></code> </a></td> <td> -input y perspective factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setAll_persp2"> <code><strong>persp2 </strong></code> </a></td> <td> -perspective scale factor to store</td> +<table> <tr> <td><a name='SkMatrix_setAll_scaleX'><code><strong>scaleX</strong></code></a></td> + <td>horizontal scale factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_skewX'><code><strong>skewX</strong></code></a></td> + <td>horizontal skew factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_transX'><code><strong>transX</strong></code></a></td> + <td>horizontal translation to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_skewY'><code><strong>skewY</strong></code></a></td> + <td>vertical skew factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_scaleY'><code><strong>scaleY</strong></code></a></td> + <td>vertical scale factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_transY'><code><strong>transY</strong></code></a></td> + <td>vertical translation to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_persp0'><code><strong>persp0</strong></code></a></td> + <td>input x perspective factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_persp1'><code><strong>persp1</strong></code></a></td> + <td>input y perspective factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setAll_persp2'><code><strong>persp2</strong></code></a></td> + <td>perspective scale factor to store</td> </tr> </table> @@ -1608,31 +2518,31 @@ perspective scale factor to store</td> ### See Also -<a href="#SkMatrix_set9">set9</a> <a href="#SkMatrix_MakeAll">MakeAll</a> +<a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a> --- -<a name="SkMatrix_get9"></a> +<a name='SkMatrix_get9'></a> ## get9 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void get9(SkScalar buffer[9]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_get9'>get9</a>(<a href='undocumented#SkScalar'>SkScalar</a> buffer[9]) const </pre> -Copies nine <a href="undocumented#Scalar">Scalar</a> values contained by <a href="#Matrix">Matrix</a> into <a href="#SkMatrix_get9_buffer">buffer</a>, in member value -ascending order: <a href="#SkMatrix_kMScaleX">kMScaleX</a>, <a href="#SkMatrix_kMSkewX">kMSkewX</a>, <a href="#SkMatrix_kMTransX">kMTransX</a>, <a href="#SkMatrix_kMSkewY">kMSkewY</a>, <a href="#SkMatrix_kMScaleY">kMScaleY</a>, <a href="#SkMatrix_kMTransY">kMTransY</a>, -<a href="#SkMatrix_kMPersp0">kMPersp0</a>, <a href="#SkMatrix_kMPersp1">kMPersp1</a>, <a href="#SkMatrix_kMPersp2">kMPersp2</a>. +Copies nine <a href='undocumented#Scalar'>Scalar</a> values contained by <a href='#Matrix'>Matrix</a> into <a href='#SkMatrix_get9_buffer'>buffer</a>, in member value +ascending order: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, +<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a>. ### Parameters -<table> <tr> <td><a name="SkMatrix_get9_buffer"> <code><strong>buffer </strong></code> </a></td> <td> -storage for nine <a href="undocumented#Scalar">Scalar</a> values</td> +<table> <tr> <td><a name='SkMatrix_get9_buffer'><code><strong>buffer</strong></code></a></td> + <td>storage for nine <a href='undocumented#Scalar'>Scalar</a> values</td> </tr> </table> ### Example -<div><fiddle-embed name="df509d73b47cb98b0475e4465db7b246"> +<div><fiddle-embed name="379fc375e011050b54ed9df83c0996a7"> #### Example Output @@ -1646,20 +2556,20 @@ storage for nine <a href="undocumented#Scalar">Scalar</a> values</td> ### See Also -<a href="#SkMatrix_set9">set9</a> +<a href='#SkMatrix_set9'>set9</a> --- -<a name="SkMatrix_set9"></a> +<a name='SkMatrix_set9'></a> ## set9 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set9(const SkScalar buffer[9]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_set9'>set9</a>(const <a href='undocumented#SkScalar'>SkScalar</a> buffer[9]) </pre> -Sets <a href="#Matrix">Matrix</a> to nine <a href="undocumented#Scalar">Scalar</a> values in <a href="#SkMatrix_set9_buffer">buffer</a>, in member value ascending order: -<a href="#SkMatrix_kMScaleX">kMScaleX</a>, <a href="#SkMatrix_kMSkewX">kMSkewX</a>, <a href="#SkMatrix_kMTransX">kMTransX</a>, <a href="#SkMatrix_kMSkewY">kMSkewY</a>, <a href="#SkMatrix_kMScaleY">kMScaleY</a>, <a href="#SkMatrix_kMTransY">kMTransY</a>, <a href="#SkMatrix_kMPersp0">kMPersp0</a>, <a href="#SkMatrix_kMPersp1">kMPersp1</a>, -<a href="#SkMatrix_kMPersp2">kMPersp2</a>. +Sets <a href='#Matrix'>Matrix</a> to nine <a href='undocumented#Scalar'>Scalar</a> values in <a href='#SkMatrix_set9_buffer'>buffer</a>, in member value ascending order: +<a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, <a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, +<a href='#SkMatrix_kMPersp2'>kMPersp2</a>. Sets matrix to: @@ -1669,14 +2579,14 @@ Sets matrix to: | buffer[6] buffer[7] buffer[8] | </pre> -In the future, <a href="#SkMatrix_set9">set9</a> followed by <a href="#SkMatrix_get9">get9</a> may not return the same values. Since <a href="#Matrix">Matrix</a> +In the future, <a href='#SkMatrix_set9'>set9</a> followed by <a href='#SkMatrix_get9'>get9</a> may not return the same values. Since <a href='#Matrix'>Matrix</a> maps non-homogeneous coordinates, scaling all nine values produces an equivalent transformation, possibly improving precision. ### Parameters -<table> <tr> <td><a name="SkMatrix_set9_buffer"> <code><strong>buffer </strong></code> </a></td> <td> -nine <a href="undocumented#Scalar">Scalar</a> values</td> +<table> <tr> <td><a name='SkMatrix_set9_buffer'><code><strong>buffer</strong></code></a></td> + <td>nine <a href='undocumented#Scalar'>Scalar</a> values</td> </tr> </table> @@ -1686,18 +2596,18 @@ nine <a href="undocumented#Scalar">Scalar</a> values</td> ### See Also -<a href="#SkMatrix_setAll">setAll</a> <a href="#SkMatrix_get9">get9</a> <a href="#SkMatrix_MakeAll">MakeAll</a> +<a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_get9'>get9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a> --- -<a name="SkMatrix_reset"></a> +<a name='SkMatrix_reset'></a> ## reset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_reset'>reset</a>() </pre> -Sets <a href="#Matrix">Matrix</a> to identity; which has no effect on mapped <a href="SkPoint_Reference#Point">Points</a>. Sets <a href="#Matrix">Matrix</a> to: +Sets <a href='#Matrix'>Matrix</a> to identity; which has no effect on mapped <a href='SkPoint_Reference#Point'>Points</a>. Sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 0 | @@ -1705,7 +2615,7 @@ Sets <a href="#Matrix">Matrix</a> to identity; which has no effect on mapped <a | 0 0 1 | </pre> -Also called <a href="#SkMatrix_setIdentity">setIdentity</a>; use the one that provides better inline +Also called <a href='#SkMatrix_setIdentity'>setIdentity</a>; use the one that provides better inline documentation. ### Example @@ -1722,18 +2632,18 @@ m.isIdentity(): true ### See Also -<a href="#SkMatrix_isIdentity">isIdentity</a> <a href="#SkMatrix_setIdentity">setIdentity</a> +<a href='#SkMatrix_isIdentity'>isIdentity</a> <a href='#SkMatrix_setIdentity'>setIdentity</a> --- -<a name="SkMatrix_setIdentity"></a> +<a name='SkMatrix_setIdentity'></a> ## setIdentity -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setIdentity() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setIdentity'>setIdentity</a>() </pre> -Sets <a href="#Matrix">Matrix</a> to identity; which has no effect on mapped <a href="SkPoint_Reference#Point">Points</a>. Sets <a href="#Matrix">Matrix</a> to: +Sets <a href='#Matrix'>Matrix</a> to identity; which has no effect on mapped <a href='SkPoint_Reference#Point'>Points</a>. Sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 0 | @@ -1741,7 +2651,7 @@ Sets <a href="#Matrix">Matrix</a> to identity; which has no effect on mapped <a | 0 0 1 | </pre> -Also called <a href="#SkMatrix_reset">reset</a>; use the one that provides better inline +Also called <a href='#SkMatrix_reset'>reset</a>; use the one that provides better inline documentation. ### Example @@ -1758,25 +2668,26 @@ m.isIdentity(): true ### See Also -<a href="#SkMatrix_isIdentity">isIdentity</a> <a href="#SkMatrix_reset">reset</a> +<a href='#SkMatrix_isIdentity'>isIdentity</a> <a href='#SkMatrix_reset'>reset</a> --- -<a name="SkMatrix_setTranslate"></a> +<a name='SkMatrix_setTranslate'></a> ## setTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTranslate(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setTranslate'>setTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Sets <a href="#Matrix">Matrix</a> to translate by (<a href="#SkMatrix_setTranslate_dx">dx</a>, <a href="#SkMatrix_setTranslate_dy">dy</a>). +Sets <a href='#Matrix'>Matrix</a> to translate by (<a href='#SkMatrix_setTranslate_dx'>dx</a>, <a href='#SkMatrix_setTranslate_dy'>dy</a>). ### Parameters -<table> <tr> <td><a name="SkMatrix_setTranslate_dx"> <code><strong>dx </strong></code> </a></td> <td> -horizontal translation</td> - </tr> <tr> <td><a name="SkMatrix_setTranslate_dy"> <code><strong>dy </strong></code> </a></td> <td> -vertical translation</td> +<table> <tr> <td><a name='SkMatrix_setTranslate_dx'><code><strong>dx</strong></code></a></td> + <td>horizontal translation</td> + </tr> + <tr> <td><a name='SkMatrix_setTranslate_dy'><code><strong>dy</strong></code></a></td> + <td>vertical translation</td> </tr> </table> @@ -1786,22 +2697,22 @@ vertical translation</td> ### See Also -<a href="#SkMatrix_setTranslateX">setTranslateX</a> <a href="#SkMatrix_setTranslateY">setTranslateY</a> +<a href='#SkMatrix_setTranslateX'>setTranslateX</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a> --- -<a name="SkMatrix_setTranslate_2"></a> +<a name='SkMatrix_setTranslate_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTranslate(const SkVector& v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setTranslate'>setTranslate</a>(const <a href='SkPoint_Reference#SkVector'>SkVector</a>& v) </pre> -Sets <a href="#Matrix">Matrix</a> to translate by (<a href="#SkMatrix_setTranslate_2_v">v</a>.fX, <a href="#SkMatrix_setTranslate_2_v">v</a>.fY). +Sets <a href='#Matrix'>Matrix</a> to translate by (<a href='#SkMatrix_setTranslate_2_v'>v</a>.fX, <a href='#SkMatrix_setTranslate_2_v'>v</a>.fY). ### Parameters -<table> <tr> <td><a name="SkMatrix_setTranslate_2_v"> <code><strong>v </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Vector">Vector</a> containing horizontal and vertical translation</td> +<table> <tr> <td><a name='SkMatrix_setTranslate_2_v'><code><strong>v</strong></code></a></td> + <td><a href='SkPoint_Reference#Vector'>Vector</a> containing horizontal and vertical translation</td> </tr> </table> @@ -1811,30 +2722,33 @@ Sets <a href="#Matrix">Matrix</a> to translate by (<a href="#SkMatrix_setTransla ### See Also -<a href="#SkMatrix_setTranslateX">setTranslateX</a> <a href="#SkMatrix_setTranslateY">setTranslateY</a> <a href="#SkMatrix_MakeTrans">MakeTrans</a> +<a href='#SkMatrix_setTranslateX'>setTranslateX</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a> <a href='#SkMatrix_MakeTrans'>MakeTrans</a> --- -<a name="SkMatrix_setScale"></a> +<a name='SkMatrix_setScale'></a> ## setScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setScale'>setScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to scale by <a href="#SkMatrix_setScale_sx">sx</a> and <a href="#SkMatrix_setScale_sy">sy</a>, about a pivot point at (<a href="#SkMatrix_setScale_px">px</a>, <a href="#SkMatrix_setScale_py">py</a>). -The pivot point is unchanged when mapped with <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to scale by <a href='#SkMatrix_setScale_sx'>sx</a> and <a href='#SkMatrix_setScale_sy'>sy</a>, about a pivot point at (<a href='#SkMatrix_setScale_px'>px</a>, <a href='#SkMatrix_setScale_py'>py</a>). +The pivot point is unchanged when mapped with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkMatrix_setScale_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_setScale_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> - </tr> <tr> <td><a name="SkMatrix_setScale_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_setScale_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_setScale_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_setScale_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_setScale_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_setScale_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -1844,24 +2758,25 @@ pivot y</td> ### See Also -<a href="#SkMatrix_setScaleX">setScaleX</a> <a href="#SkMatrix_setScaleY">setScaleY</a> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> <a href="#SkMatrix_preScale">preScale</a><sup><a href="#SkMatrix_preScale_2">[2]</a></sup> <a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> +<a href='#SkMatrix_setScaleX'>setScaleX</a> <a href='#SkMatrix_setScaleY'>setScaleY</a> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> <a href='#SkMatrix_preScale'>preScale</a><sup><a href='#SkMatrix_preScale_2'>[2]</a></sup> <a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> --- -<a name="SkMatrix_setScale_2"></a> +<a name='SkMatrix_setScale_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setScale(SkScalar sx, SkScalar sy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setScale'>setScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy) </pre> -Sets <a href="#Matrix">Matrix</a> to scale by <a href="#SkMatrix_setScale_2_sx">sx</a> and <a href="#SkMatrix_setScale_2_sy">sy</a> about at pivot point at (0, 0). +Sets <a href='#Matrix'>Matrix</a> to scale by <a href='#SkMatrix_setScale_2_sx'>sx</a> and <a href='#SkMatrix_setScale_2_sy'>sy</a> about at pivot point at (0, 0). ### Parameters -<table> <tr> <td><a name="SkMatrix_setScale_2_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_setScale_2_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> +<table> <tr> <td><a name='SkMatrix_setScale_2_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_setScale_2_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> </tr> </table> @@ -1871,30 +2786,32 @@ vertical scale factor</td> ### See Also -<a href="#SkMatrix_setScaleX">setScaleX</a> <a href="#SkMatrix_setScaleY">setScaleY</a> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> <a href="#SkMatrix_preScale">preScale</a><sup><a href="#SkMatrix_preScale_2">[2]</a></sup> <a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> +<a href='#SkMatrix_setScaleX'>setScaleX</a> <a href='#SkMatrix_setScaleY'>setScaleY</a> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> <a href='#SkMatrix_preScale'>preScale</a><sup><a href='#SkMatrix_preScale_2'>[2]</a></sup> <a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> --- -<a name="SkMatrix_setRotate"></a> +<a name='SkMatrix_setRotate'></a> ## setRotate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setRotate(SkScalar degrees, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setRotate'>setRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to rotate by <a href="#SkMatrix_setRotate_degrees">degrees</a> about a pivot point at (<a href="#SkMatrix_setRotate_px">px</a>, <a href="#SkMatrix_setRotate_py">py</a>). -The pivot point is unchanged when mapped with <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to rotate by <a href='#SkMatrix_setRotate_degrees'>degrees</a> about a pivot point at (<a href='#SkMatrix_setRotate_px'>px</a>, <a href='#SkMatrix_setRotate_py'>py</a>). +The pivot point is unchanged when mapped with <a href='#Matrix'>Matrix</a>. -Positive <a href="#SkMatrix_setRotate_degrees">degrees</a> rotates clockwise. +Positive <a href='#SkMatrix_setRotate_degrees'>degrees</a> rotates clockwise. ### Parameters -<table> <tr> <td><a name="SkMatrix_setRotate_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -angle of axes relative to upright axes</td> - </tr> <tr> <td><a name="SkMatrix_setRotate_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_setRotate_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_setRotate_degrees'><code><strong>degrees</strong></code></a></td> + <td>angle of axes relative to upright axes</td> + </tr> + <tr> <td><a name='SkMatrix_setRotate_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_setRotate_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -1904,23 +2821,23 @@ pivot y</td> ### See Also -<a href="#SkMatrix_setSinCos">setSinCos</a><sup><a href="#SkMatrix_setSinCos_2">[2]</a></sup> <a href="#SkMatrix_preRotate">preRotate</a><sup><a href="#SkMatrix_preRotate_2">[2]</a></sup> <a href="#SkMatrix_postRotate">postRotate</a><sup><a href="#SkMatrix_postRotate_2">[2]</a></sup> +<a href='#SkMatrix_setSinCos'>setSinCos</a><sup><a href='#SkMatrix_setSinCos_2'>[2]</a></sup> <a href='#SkMatrix_preRotate'>preRotate</a><sup><a href='#SkMatrix_preRotate_2'>[2]</a></sup> <a href='#SkMatrix_postRotate'>postRotate</a><sup><a href='#SkMatrix_postRotate_2'>[2]</a></sup> --- -<a name="SkMatrix_setRotate_2"></a> +<a name='SkMatrix_setRotate_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setRotate(SkScalar degrees) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setRotate'>setRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees) </pre> -Sets <a href="#Matrix">Matrix</a> to rotate by <a href="#SkMatrix_setRotate_2_degrees">degrees</a> about a pivot point at (0, 0). -Positive <a href="#SkMatrix_setRotate_2_degrees">degrees</a> rotates clockwise. +Sets <a href='#Matrix'>Matrix</a> to rotate by <a href='#SkMatrix_setRotate_2_degrees'>degrees</a> about a pivot point at (0, 0). +Positive <a href='#SkMatrix_setRotate_2_degrees'>degrees</a> rotates clockwise. ### Parameters -<table> <tr> <td><a name="SkMatrix_setRotate_2_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -angle of axes relative to upright axes</td> +<table> <tr> <td><a name='SkMatrix_setRotate_2_degrees'><code><strong>degrees</strong></code></a></td> + <td>angle of axes relative to upright axes</td> </tr> </table> @@ -1930,33 +2847,36 @@ angle of axes relative to upright axes</td> ### See Also -<a href="#SkMatrix_setSinCos">setSinCos</a><sup><a href="#SkMatrix_setSinCos_2">[2]</a></sup> <a href="#SkMatrix_preRotate">preRotate</a><sup><a href="#SkMatrix_preRotate_2">[2]</a></sup> <a href="#SkMatrix_postRotate">postRotate</a><sup><a href="#SkMatrix_postRotate_2">[2]</a></sup> +<a href='#SkMatrix_setSinCos'>setSinCos</a><sup><a href='#SkMatrix_setSinCos_2'>[2]</a></sup> <a href='#SkMatrix_preRotate'>preRotate</a><sup><a href='#SkMatrix_preRotate_2'>[2]</a></sup> <a href='#SkMatrix_postRotate'>postRotate</a><sup><a href='#SkMatrix_postRotate_2'>[2]</a></sup> --- -<a name="SkMatrix_setSinCos"></a> +<a name='SkMatrix_setSinCos'></a> ## setSinCos -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSinCos(SkScalar sinValue, SkScalar cosValue, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setSinCos'>setSinCos</a>(<a href='undocumented#SkScalar'>SkScalar</a> sinValue, <a href='undocumented#SkScalar'>SkScalar</a> cosValue, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to rotate by <a href="#SkMatrix_setSinCos_sinValue">sinValue</a> and <a href="#SkMatrix_setSinCos_cosValue">cosValue</a>, about a pivot point at (<a href="#SkMatrix_setSinCos_px">px</a>, <a href="#SkMatrix_setSinCos_py">py</a>). -The pivot point is unchanged when mapped with <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to rotate by <a href='#SkMatrix_setSinCos_sinValue'>sinValue</a> and <a href='#SkMatrix_setSinCos_cosValue'>cosValue</a>, about a pivot point at (<a href='#SkMatrix_setSinCos_px'>px</a>, <a href='#SkMatrix_setSinCos_py'>py</a>). +The pivot point is unchanged when mapped with <a href='#Matrix'>Matrix</a>. -<a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkMatrix_setSinCos_sinValue">sinValue</a>, <a href="#SkMatrix_setSinCos_cosValue">cosValue</a>) describes the angle of rotation relative to (0, 1). -<a href="SkPoint_Reference#Vector">Vector</a> length specifies scale. +<a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkMatrix_setSinCos_sinValue'>sinValue</a>, <a href='#SkMatrix_setSinCos_cosValue'>cosValue</a>) describes the angle of rotation relative to (0, 1). +<a href='SkPoint_Reference#Vector'>Vector</a> length specifies scale. ### Parameters -<table> <tr> <td><a name="SkMatrix_setSinCos_sinValue"> <code><strong>sinValue </strong></code> </a></td> <td> -rotation vector x component</td> - </tr> <tr> <td><a name="SkMatrix_setSinCos_cosValue"> <code><strong>cosValue </strong></code> </a></td> <td> -rotation vector y component</td> - </tr> <tr> <td><a name="SkMatrix_setSinCos_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_setSinCos_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_setSinCos_sinValue'><code><strong>sinValue</strong></code></a></td> + <td>rotation vector x component</td> + </tr> + <tr> <td><a name='SkMatrix_setSinCos_cosValue'><code><strong>cosValue</strong></code></a></td> + <td>rotation vector y component</td> + </tr> + <tr> <td><a name='SkMatrix_setSinCos_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_setSinCos_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -1966,96 +2886,100 @@ pivot y</td> ### See Also -<a href="#SkMatrix_setRotate">setRotate</a><sup><a href="#SkMatrix_setRotate_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_setRSXform">setRSXform</a> +<a href='#SkMatrix_setRotate'>setRotate</a><sup><a href='#SkMatrix_setRotate_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_setRSXform'>setRSXform</a> --- -<a name="SkMatrix_setSinCos_2"></a> +<a name='SkMatrix_setSinCos_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSinCos(SkScalar sinValue, SkScalar cosValue) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setSinCos'>setSinCos</a>(<a href='undocumented#SkScalar'>SkScalar</a> sinValue, <a href='undocumented#SkScalar'>SkScalar</a> cosValue) </pre> -Sets <a href="#Matrix">Matrix</a> to rotate by <a href="#SkMatrix_setSinCos_2_sinValue">sinValue</a> and <a href="#SkMatrix_setSinCos_2_cosValue">cosValue</a>, about a pivot point at (0, 0). +Sets <a href='#Matrix'>Matrix</a> to rotate by <a href='#SkMatrix_setSinCos_2_sinValue'>sinValue</a> and <a href='#SkMatrix_setSinCos_2_cosValue'>cosValue</a>, about a pivot point at (0, 0). -<a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkMatrix_setSinCos_2_sinValue">sinValue</a>, <a href="#SkMatrix_setSinCos_2_cosValue">cosValue</a>) describes the angle of rotation relative to (0, 1). -<a href="SkPoint_Reference#Vector">Vector</a> length specifies scale. +<a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkMatrix_setSinCos_2_sinValue'>sinValue</a>, <a href='#SkMatrix_setSinCos_2_cosValue'>cosValue</a>) describes the angle of rotation relative to (0, 1). +<a href='SkPoint_Reference#Vector'>Vector</a> length specifies scale. ### Parameters -<table> <tr> <td><a name="SkMatrix_setSinCos_2_sinValue"> <code><strong>sinValue </strong></code> </a></td> <td> -rotation vector x component</td> - </tr> <tr> <td><a name="SkMatrix_setSinCos_2_cosValue"> <code><strong>cosValue </strong></code> </a></td> <td> -rotation vector y component</td> +<table> <tr> <td><a name='SkMatrix_setSinCos_2_sinValue'><code><strong>sinValue</strong></code></a></td> + <td>rotation vector x component</td> + </tr> + <tr> <td><a name='SkMatrix_setSinCos_2_cosValue'><code><strong>cosValue</strong></code></a></td> + <td>rotation vector y component</td> </tr> </table> ### Example -<div><fiddle-embed name="e37a94a53c959951b059fcd624639ef6"><div><a href="SkCanvas_Reference#Canvas">Canvas</a> needs offset after applying <a href="#Matrix">Matrix</a> to pivot about <a href="SkRect_Reference#Rect">Rect</a> center. +<div><fiddle-embed name="e37a94a53c959951b059fcd624639ef6"><div><a href='SkCanvas_Reference#Canvas'>Canvas</a> needs offset after applying <a href='#Matrix'>Matrix</a> to pivot about <a href='SkRect_Reference#Rect'>Rect</a> center. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_setRotate">setRotate</a><sup><a href="#SkMatrix_setRotate_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_setRSXform">setRSXform</a> +<a href='#SkMatrix_setRotate'>setRotate</a><sup><a href='#SkMatrix_setRotate_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_setRSXform'>setRSXform</a> --- -<a name="SkMatrix_setRSXform"></a> +<a name='SkMatrix_setRSXform'></a> ## setRSXform -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkMatrix& setRSXform(const SkRSXform& rsxForm) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_setRSXform'>setRSXform</a>(const <a href='undocumented#SkRSXform'>SkRSXform</a>& rsxForm) </pre> -Sets <a href="#Matrix">Matrix</a> to rotate, scale, and translate using a compressed matrix form. +Sets <a href='#Matrix'>Matrix</a> to rotate, scale, and translate using a compressed matrix form. -<a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkMatrix_setRSXform_rsxForm">rsxForm</a>.fSSin, <a href="#SkMatrix_setRSXform_rsxForm">rsxForm</a>.fSCos) describes the angle of rotation relative -to (0, 1). <a href="SkPoint_Reference#Vector">Vector</a> length specifies scale. Mapped point is rotated and scaled -by <a href="SkPoint_Reference#Vector">Vector</a>, then translated by (<a href="#SkMatrix_setRSXform_rsxForm">rsxForm</a>.fTx, <a href="#SkMatrix_setRSXform_rsxForm">rsxForm</a>.fTy). +<a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.fSSin, <a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.fSCos) describes the angle of rotation relative +to (0, 1). <a href='SkPoint_Reference#Vector'>Vector</a> length specifies scale. Mapped point is rotated and scaled +by <a href='SkPoint_Reference#Vector'>Vector</a>, then translated by (<a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.fTx, <a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.fTy). ### Parameters -<table> <tr> <td><a name="SkMatrix_setRSXform_rsxForm"> <code><strong>rsxForm </strong></code> </a></td> <td> -compressed <a href="undocumented#RSXform">RSXform</a> matrix</td> +<table> <tr> <td><a name='SkMatrix_setRSXform_rsxForm'><code><strong>rsxForm</strong></code></a></td> + <td>compressed <a href='undocumented#RSXform'>RSXform</a> matrix</td> </tr> </table> ### Return Value -reference to <a href="#Matrix">Matrix</a> +reference to <a href='#Matrix'>Matrix</a> ### Example -<div><fiddle-embed name="c3f5faddca466f78278b32b88fd5f5eb"><div><a href="SkCanvas_Reference#Canvas">Canvas</a> needs offset after applying <a href="#Matrix">Matrix</a> to pivot about <a href="SkRect_Reference#Rect">Rect</a> center. +<div><fiddle-embed name="c3f5faddca466f78278b32b88fd5f5eb"><div><a href='SkCanvas_Reference#Canvas'>Canvas</a> needs offset after applying <a href='#Matrix'>Matrix</a> to pivot about <a href='SkRect_Reference#Rect'>Rect</a> center. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_setSinCos">setSinCos</a><sup><a href="#SkMatrix_setSinCos_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> +<a href='#SkMatrix_setSinCos'>setSinCos</a><sup><a href='#SkMatrix_setSinCos_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> --- -<a name="SkMatrix_setSkew"></a> +<a name='SkMatrix_setSkew'></a> ## setSkew -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setSkew'>setSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to skew by <a href="#SkMatrix_setSkew_kx">kx</a> and <a href="#SkMatrix_setSkew_ky">ky</a>, about a pivot point at (<a href="#SkMatrix_setSkew_px">px</a>, <a href="#SkMatrix_setSkew_py">py</a>). -The pivot point is unchanged when mapped with <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to skew by <a href='#SkMatrix_setSkew_kx'>kx</a> and <a href='#SkMatrix_setSkew_ky'>ky</a>, about a pivot point at (<a href='#SkMatrix_setSkew_px'>px</a>, <a href='#SkMatrix_setSkew_py'>py</a>). +The pivot point is unchanged when mapped with <a href='#Matrix'>Matrix</a>. ### Parameters -<table> <tr> <td><a name="SkMatrix_setSkew_kx"> <code><strong>kx </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_setSkew_ky"> <code><strong>ky </strong></code> </a></td> <td> -vertical skew factor</td> - </tr> <tr> <td><a name="SkMatrix_setSkew_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_setSkew_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_setSkew_kx'><code><strong>kx</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_setSkew_ky'><code><strong>ky</strong></code></a></td> + <td>vertical skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_setSkew_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_setSkew_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2065,24 +2989,25 @@ pivot y</td> ### See Also -<a href="#SkMatrix_setSkewX">setSkewX</a> <a href="#SkMatrix_setSkewY">setSkewY</a> <a href="#SkMatrix_preSkew">preSkew</a><sup><a href="#SkMatrix_preSkew_2">[2]</a></sup> <a href="#SkMatrix_postSkew">postSkew</a><sup><a href="#SkMatrix_postSkew_2">[2]</a></sup> +<a href='#SkMatrix_setSkewX'>setSkewX</a> <a href='#SkMatrix_setSkewY'>setSkewY</a> <a href='#SkMatrix_preSkew'>preSkew</a><sup><a href='#SkMatrix_preSkew_2'>[2]</a></sup> <a href='#SkMatrix_postSkew'>postSkew</a><sup><a href='#SkMatrix_postSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_setSkew_2"></a> +<a name='SkMatrix_setSkew_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSkew(SkScalar kx, SkScalar ky) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setSkew'>setSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky) </pre> -Sets <a href="#Matrix">Matrix</a> to skew by <a href="#SkMatrix_setSkew_2_kx">kx</a> and <a href="#SkMatrix_setSkew_2_ky">ky</a>, about a pivot point at (0, 0). +Sets <a href='#Matrix'>Matrix</a> to skew by <a href='#SkMatrix_setSkew_2_kx'>kx</a> and <a href='#SkMatrix_setSkew_2_ky'>ky</a>, about a pivot point at (0, 0). ### Parameters -<table> <tr> <td><a name="SkMatrix_setSkew_2_kx"> <code><strong>kx </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_setSkew_2_ky"> <code><strong>ky </strong></code> </a></td> <td> -vertical skew factor</td> +<table> <tr> <td><a name='SkMatrix_setSkew_2_kx'><code><strong>kx</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_setSkew_2_ky'><code><strong>ky</strong></code></a></td> + <td>vertical skew factor</td> </tr> </table> @@ -2092,18 +3017,18 @@ vertical skew factor</td> ### See Also -<a href="#SkMatrix_setSkewX">setSkewX</a> <a href="#SkMatrix_setSkewY">setSkewY</a> <a href="#SkMatrix_preSkew">preSkew</a><sup><a href="#SkMatrix_preSkew_2">[2]</a></sup> <a href="#SkMatrix_postSkew">postSkew</a><sup><a href="#SkMatrix_postSkew_2">[2]</a></sup> +<a href='#SkMatrix_setSkewX'>setSkewX</a> <a href='#SkMatrix_setSkewY'>setSkewY</a> <a href='#SkMatrix_preSkew'>preSkew</a><sup><a href='#SkMatrix_preSkew_2'>[2]</a></sup> <a href='#SkMatrix_postSkew'>postSkew</a><sup><a href='#SkMatrix_postSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_setConcat"></a> +<a name='SkMatrix_setConcat'></a> ## setConcat -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setConcat(const SkMatrix& a, const SkMatrix& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setConcat'>setConcat</a>(const <a href='#SkMatrix'>SkMatrix</a>& a, const <a href='#SkMatrix'>SkMatrix</a>& b) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> <a href="#SkMatrix_setConcat_a">a</a> multiplied by <a href="#Matrix">Matrix</a> <a href="#SkMatrix_setConcat_b">b</a>. Either <a href="#SkMatrix_setConcat_a">a</a> or <a href="#SkMatrix_setConcat_b">b</a> may be this. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_setConcat_a'>a</a> multiplied by <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_setConcat_b'>b</a>. Either <a href='#SkMatrix_setConcat_a'>a</a> or <a href='#SkMatrix_setConcat_b'>b</a> may be this. Given: @@ -2113,7 +3038,7 @@ a = | D E F |, b = | M N O | | G H I | | P Q R | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | J K L | | AJ+BM+CP AK+BN+CQ AL+BO+CR | @@ -2123,34 +3048,35 @@ a * b = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR | ### Parameters -<table> <tr> <td><a name="SkMatrix_setConcat_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> on left side of multiply expression</td> - </tr> <tr> <td><a name="SkMatrix_setConcat_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> on right side of multiply expression</td> +<table> <tr> <td><a name='SkMatrix_setConcat_a'><code><strong>a</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> on left side of multiply expression</td> + </tr> + <tr> <td><a name='SkMatrix_setConcat_b'><code><strong>b</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> on right side of multiply expression</td> </tr> </table> ### Example -<div><fiddle-embed name="0381a10ac69bdefdf9d15b47cbb9fefe"><div><a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> creates perspective matrices, one the inverse of the other. +<div><fiddle-embed name="0381a10ac69bdefdf9d15b47cbb9fefe"><div><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> creates perspective matrices, one the inverse of the other. Multiplying the matrix by its inverse turns into an identity matrix. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_Concat">Concat</a> <a href="#SkMatrix_preConcat">preConcat</a> <a href="#SkMatrix_postConcat">postConcat</a> <a href="SkCanvas_Reference#SkCanvas_concat">SkCanvas::concat</a> +<a href='#SkMatrix_Concat'>Concat</a> <a href='#SkMatrix_preConcat'>preConcat</a> <a href='#SkMatrix_postConcat'>postConcat</a> <a href='SkCanvas_Reference#SkCanvas_concat'>SkCanvas::concat</a> --- -<a name="SkMatrix_preTranslate"></a> +<a name='SkMatrix_preTranslate'></a> ## preTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preTranslate(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preTranslate'>preTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from translation (<a href="#SkMatrix_preTranslate_dx">dx</a>, <a href="#SkMatrix_preTranslate_dy">dy</a>). -This can be thought of as moving the point to be mapped before applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from translation (<a href='#SkMatrix_preTranslate_dx'>dx</a>, <a href='#SkMatrix_preTranslate_dy'>dy</a>). +This can be thought of as moving the point to be mapped before applying <a href='#Matrix'>Matrix</a>. Given: @@ -2160,7 +3086,7 @@ Matrix = | D E F |, T(dx, dy) = | 0 1 dy | | G H I | | 0 0 1 | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | 1 0 dx | | A B A*dx+B*dy+C | @@ -2170,33 +3096,34 @@ Matrix * T(dx, dy) = | D E F | | 0 1 dy | = | D E D*dx+E*dy+F | ### Parameters -<table> <tr> <td><a name="SkMatrix_preTranslate_dx"> <code><strong>dx </strong></code> </a></td> <td> -x translation before applying <a href="#Matrix">Matrix</a></td> - </tr> <tr> <td><a name="SkMatrix_preTranslate_dy"> <code><strong>dy </strong></code> </a></td> <td> -y translation before applying <a href="#Matrix">Matrix</a></td> +<table> <tr> <td><a name='SkMatrix_preTranslate_dx'><code><strong>dx</strong></code></a></td> + <td>x translation before applying <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> <td><a name='SkMatrix_preTranslate_dy'><code><strong>dy</strong></code></a></td> + <td>y translation before applying <a href='#Matrix'>Matrix</a></td> </tr> </table> ### Example -<div><fiddle-embed name="08f6749933f4ce541073077ab506fd9b"></fiddle-embed></div> +<div><fiddle-embed name="f75a9b629aa6c51ed888f8799b5ba5f7"></fiddle-embed></div> ### See Also -<a href="#SkMatrix_postTranslate">postTranslate</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_MakeTrans">MakeTrans</a> +<a href='#SkMatrix_postTranslate'>postTranslate</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_MakeTrans'>MakeTrans</a> --- -<a name="SkMatrix_preScale"></a> +<a name='SkMatrix_preScale'></a> ## preScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preScale'>preScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from scaling by (<a href="#SkMatrix_preScale_sx">sx</a>, <a href="#SkMatrix_preScale_sy">sy</a>) -about pivot point (<a href="#SkMatrix_preScale_px">px</a>, <a href="#SkMatrix_preScale_py">py</a>). -This can be thought of as scaling about a pivot point before applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from scaling by (<a href='#SkMatrix_preScale_sx'>sx</a>, <a href='#SkMatrix_preScale_sy'>sy</a>) +about pivot point (<a href='#SkMatrix_preScale_px'>px</a>, <a href='#SkMatrix_preScale_py'>py</a>). +This can be thought of as scaling about a pivot point before applying <a href='#Matrix'>Matrix</a>. Given: @@ -2213,7 +3140,7 @@ dx = px - sx * px dy = py - sy * py </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | sx 0 dx | | A*sx B*sy A*dx+B*dy+C | @@ -2223,14 +3150,17 @@ Matrix * S(sx, sy, px, py) = | D E F | | 0 sy dy | = | D*sx E*sy D*dx+E*dy+F | ### Parameters -<table> <tr> <td><a name="SkMatrix_preScale_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_preScale_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> - </tr> <tr> <td><a name="SkMatrix_preScale_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_preScale_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_preScale_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_preScale_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_preScale_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_preScale_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2240,19 +3170,19 @@ pivot y</td> ### See Also -<a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> +<a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> --- -<a name="SkMatrix_preScale_2"></a> +<a name='SkMatrix_preScale_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preScale(SkScalar sx, SkScalar sy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preScale'>preScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from scaling by (<a href="#SkMatrix_preScale_2_sx">sx</a>, <a href="#SkMatrix_preScale_2_sy">sy</a>) +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from scaling by (<a href='#SkMatrix_preScale_2_sx'>sx</a>, <a href='#SkMatrix_preScale_2_sy'>sy</a>) about pivot point (0, 0). -This can be thought of as scaling about the origin before applying <a href="#Matrix">Matrix</a>. +This can be thought of as scaling about the origin before applying <a href='#Matrix'>Matrix</a>. Given: @@ -2262,7 +3192,7 @@ Matrix = | D E F |, S(sx, sy) = | 0 sy 0 | | G H I | | 0 0 1 | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | sx 0 0 | | A*sx B*sy C | @@ -2272,10 +3202,11 @@ Matrix * S(sx, sy) = | D E F | | 0 sy 0 | = | D*sx E*sy F | ### Parameters -<table> <tr> <td><a name="SkMatrix_preScale_2_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_preScale_2_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> +<table> <tr> <td><a name='SkMatrix_preScale_2_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_preScale_2_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> </tr> </table> @@ -2285,22 +3216,22 @@ vertical scale factor</td> ### See Also -<a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> +<a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> --- -<a name="SkMatrix_preRotate"></a> +<a name='SkMatrix_preRotate'></a> ## preRotate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preRotate(SkScalar degrees, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preRotate'>preRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from rotating by <a href="#SkMatrix_preRotate_degrees">degrees</a> -about pivot point (<a href="#SkMatrix_preRotate_px">px</a>, <a href="#SkMatrix_preRotate_py">py</a>). -This can be thought of as rotating about a pivot point before applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from rotating by <a href='#SkMatrix_preRotate_degrees'>degrees</a> +about pivot point (<a href='#SkMatrix_preRotate_px'>px</a>, <a href='#SkMatrix_preRotate_py'>py</a>). +This can be thought of as rotating about a pivot point before applying <a href='#Matrix'>Matrix</a>. -Positive <a href="#SkMatrix_preRotate_degrees">degrees</a> rotates clockwise. +Positive <a href='#SkMatrix_preRotate_degrees'>degrees</a> rotates clockwise. Given: @@ -2319,7 +3250,7 @@ dx = s * py + (1 - c) * px dy = -s * px + (1 - c) * py </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | c -s dx | | Ac+Bs -As+Bc A*dx+B*dy+C | @@ -2329,12 +3260,14 @@ Matrix * R(degrees, px, py) = | D E F | | s c dy | = | Dc+Es -Ds+Ec D*dx+E*dy+F ### Parameters -<table> <tr> <td><a name="SkMatrix_preRotate_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -angle of axes relative to upright axes</td> - </tr> <tr> <td><a name="SkMatrix_preRotate_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_preRotate_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_preRotate_degrees'><code><strong>degrees</strong></code></a></td> + <td>angle of axes relative to upright axes</td> + </tr> + <tr> <td><a name='SkMatrix_preRotate_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_preRotate_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2344,21 +3277,21 @@ pivot y</td> ### See Also -<a href="#SkMatrix_postRotate">postRotate</a><sup><a href="#SkMatrix_postRotate_2">[2]</a></sup> <a href="#SkMatrix_setRotate">setRotate</a><sup><a href="#SkMatrix_setRotate_2">[2]</a></sup> +<a href='#SkMatrix_postRotate'>postRotate</a><sup><a href='#SkMatrix_postRotate_2'>[2]</a></sup> <a href='#SkMatrix_setRotate'>setRotate</a><sup><a href='#SkMatrix_setRotate_2'>[2]</a></sup> --- -<a name="SkMatrix_preRotate_2"></a> +<a name='SkMatrix_preRotate_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preRotate(SkScalar degrees) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preRotate'>preRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from rotating by <a href="#SkMatrix_preRotate_2_degrees">degrees</a> +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from rotating by <a href='#SkMatrix_preRotate_2_degrees'>degrees</a> about pivot point (0, 0). -This can be thought of as rotating about the origin before applying <a href="#Matrix">Matrix</a>. +This can be thought of as rotating about the origin before applying <a href='#Matrix'>Matrix</a>. -Positive <a href="#SkMatrix_preRotate_2_degrees">degrees</a> rotates clockwise. +Positive <a href='#SkMatrix_preRotate_2_degrees'>degrees</a> rotates clockwise. Given: @@ -2375,7 +3308,7 @@ c = cos(degrees) s = sin(degrees) </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | c -s 0 | | Ac+Bs -As+Bc C | @@ -2385,8 +3318,8 @@ Matrix * R(degrees, px, py) = | D E F | | s c 0 | = | Dc+Es -Ds+Ec F | ### Parameters -<table> <tr> <td><a name="SkMatrix_preRotate_2_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -angle of axes relative to upright axes</td> +<table> <tr> <td><a name='SkMatrix_preRotate_2_degrees'><code><strong>degrees</strong></code></a></td> + <td>angle of axes relative to upright axes</td> </tr> </table> @@ -2396,20 +3329,20 @@ angle of axes relative to upright axes</td> ### See Also -<a href="#SkMatrix_postRotate">postRotate</a><sup><a href="#SkMatrix_postRotate_2">[2]</a></sup> <a href="#SkMatrix_setRotate">setRotate</a><sup><a href="#SkMatrix_setRotate_2">[2]</a></sup> +<a href='#SkMatrix_postRotate'>postRotate</a><sup><a href='#SkMatrix_postRotate_2'>[2]</a></sup> <a href='#SkMatrix_setRotate'>setRotate</a><sup><a href='#SkMatrix_setRotate_2'>[2]</a></sup> --- -<a name="SkMatrix_preSkew"></a> +<a name='SkMatrix_preSkew'></a> ## preSkew -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preSkew'>preSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from skewing by (<a href="#SkMatrix_preSkew_kx">kx</a>, <a href="#SkMatrix_preSkew_ky">ky</a>) -about pivot point (<a href="#SkMatrix_preSkew_px">px</a>, <a href="#SkMatrix_preSkew_py">py</a>). -This can be thought of as skewing about a pivot point before applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from skewing by (<a href='#SkMatrix_preSkew_kx'>kx</a>, <a href='#SkMatrix_preSkew_ky'>ky</a>) +about pivot point (<a href='#SkMatrix_preSkew_px'>px</a>, <a href='#SkMatrix_preSkew_py'>py</a>). +This can be thought of as skewing about a pivot point before applying <a href='#Matrix'>Matrix</a>. Given: @@ -2426,7 +3359,7 @@ dx = -kx * py dy = -ky * px </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | 1 kx dx | | A+B*ky A*kx+B A*dx+B*dy+C | @@ -2436,14 +3369,17 @@ Matrix * K(kx, ky, px, py) = | D E F | | ky 1 dy | = | D+E*ky D*kx+E D*dx+E*dy+ ### Parameters -<table> <tr> <td><a name="SkMatrix_preSkew_kx"> <code><strong>kx </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_preSkew_ky"> <code><strong>ky </strong></code> </a></td> <td> -vertical skew factor</td> - </tr> <tr> <td><a name="SkMatrix_preSkew_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_preSkew_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_preSkew_kx'><code><strong>kx</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_preSkew_ky'><code><strong>ky</strong></code></a></td> + <td>vertical skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_preSkew_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_preSkew_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2453,19 +3389,19 @@ pivot y</td> ### See Also -<a href="#SkMatrix_postSkew">postSkew</a><sup><a href="#SkMatrix_postSkew_2">[2]</a></sup> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> +<a href='#SkMatrix_postSkew'>postSkew</a><sup><a href='#SkMatrix_postSkew_2'>[2]</a></sup> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_preSkew_2"></a> +<a name='SkMatrix_preSkew_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preSkew(SkScalar kx, SkScalar ky) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preSkew'>preSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> constructed from skewing by (<a href="#SkMatrix_preSkew_2_kx">kx</a>, <a href="#SkMatrix_preSkew_2_ky">ky</a>) +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> constructed from skewing by (<a href='#SkMatrix_preSkew_2_kx'>kx</a>, <a href='#SkMatrix_preSkew_2_ky'>ky</a>) about pivot point (0, 0). -This can be thought of as skewing about the origin before applying <a href="#Matrix">Matrix</a>. +This can be thought of as skewing about the origin before applying <a href='#Matrix'>Matrix</a>. Given: @@ -2475,7 +3411,7 @@ Matrix = | D E F |, K(kx, ky) = | ky 1 0 | | G H I | | 0 0 1 | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | 1 kx 0 | | A+B*ky A*kx+B C | @@ -2485,10 +3421,11 @@ Matrix * K(kx, ky) = | D E F | | ky 1 0 | = | D+E*ky D*kx+E F | ### Parameters -<table> <tr> <td><a name="SkMatrix_preSkew_2_kx"> <code><strong>kx </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_preSkew_2_ky"> <code><strong>ky </strong></code> </a></td> <td> -vertical skew factor</td> +<table> <tr> <td><a name='SkMatrix_preSkew_2_kx'><code><strong>kx</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_preSkew_2_ky'><code><strong>ky</strong></code></a></td> + <td>vertical skew factor</td> </tr> </table> @@ -2498,19 +3435,19 @@ vertical skew factor</td> ### See Also -<a href="#SkMatrix_postSkew">postSkew</a><sup><a href="#SkMatrix_postSkew_2">[2]</a></sup> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> +<a href='#SkMatrix_postSkew'>postSkew</a><sup><a href='#SkMatrix_postSkew_2'>[2]</a></sup> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_preConcat"></a> +<a name='SkMatrix_preConcat'></a> ## preConcat -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void preConcat(const SkMatrix& other) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_preConcat'>preConcat</a>(const <a href='#SkMatrix'>SkMatrix</a>& other) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> multiplied by <a href="#Matrix">Matrix</a> <a href="#SkMatrix_preConcat_other">other</a>. -This can be thought of mapping by <a href="#SkMatrix_preConcat_other">other</a> before applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> multiplied by <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_preConcat_other'>other</a>. +This can be thought of mapping by <a href='#SkMatrix_preConcat_other'>other</a> before applying <a href='#Matrix'>Matrix</a>. Given: @@ -2520,7 +3457,7 @@ Matrix = | D E F |, other = | M N O | | G H I | | P Q R | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | J K L | | AJ+BM+CP AK+BN+CQ AL+BO+CR | @@ -2530,32 +3467,32 @@ Matrix * other = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR | ### Parameters -<table> <tr> <td><a name="SkMatrix_preConcat_other"> <code><strong>other </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> on right side of multiply expression</td> +<table> <tr> <td><a name='SkMatrix_preConcat_other'><code><strong>other</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> on right side of multiply expression</td> </tr> </table> ### Example -<div><fiddle-embed name="b07e62298e7b0ab5683db199faffceb2"><div><a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> creates perspective matrices, one the inverse of the <a href="#SkMatrix_preConcat_other">other</a>. +<div><fiddle-embed name="b07e62298e7b0ab5683db199faffceb2"><div><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> creates perspective matrices, one the inverse of the <a href='#SkMatrix_preConcat_other'>other</a>. Multiplying the matrix by its inverse turns into an identity matrix. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_postConcat">postConcat</a> <a href="#SkMatrix_setConcat">setConcat</a> <a href="#SkMatrix_Concat">Concat</a> +<a href='#SkMatrix_postConcat'>postConcat</a> <a href='#SkMatrix_setConcat'>setConcat</a> <a href='#SkMatrix_Concat'>Concat</a> --- -<a name="SkMatrix_postTranslate"></a> +<a name='SkMatrix_postTranslate'></a> ## postTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postTranslate(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postTranslate'>postTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from translation (<a href="#SkMatrix_postTranslate_dx">dx</a>, <a href="#SkMatrix_postTranslate_dy">dy</a>) multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as moving the point to be mapped after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from translation (<a href='#SkMatrix_postTranslate_dx'>dx</a>, <a href='#SkMatrix_postTranslate_dy'>dy</a>) multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as moving the point to be mapped after applying <a href='#Matrix'>Matrix</a>. Given: @@ -2565,7 +3502,7 @@ Matrix = | M N O |, T(dx, dy) = | 0 1 dy | | P Q R | | 0 0 1 | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 dx | | J K L | | J+dx*P K+dx*Q L+dx*R | @@ -2575,34 +3512,35 @@ T(dx, dy) * Matrix = | 0 1 dy | | M N O | = | M+dy*P N+dy*Q O+dy*R | ### Parameters -<table> <tr> <td><a name="SkMatrix_postTranslate_dx"> <code><strong>dx </strong></code> </a></td> <td> -x translation after applying <a href="#Matrix">Matrix</a></td> - </tr> <tr> <td><a name="SkMatrix_postTranslate_dy"> <code><strong>dy </strong></code> </a></td> <td> -y translation after applying <a href="#Matrix">Matrix</a></td> +<table> <tr> <td><a name='SkMatrix_postTranslate_dx'><code><strong>dx</strong></code></a></td> + <td>x translation after applying <a href='#Matrix'>Matrix</a></td> + </tr> + <tr> <td><a name='SkMatrix_postTranslate_dy'><code><strong>dy</strong></code></a></td> + <td>y translation after applying <a href='#Matrix'>Matrix</a></td> </tr> </table> ### Example -<div><fiddle-embed name="57e4cff302c0d754ac6c66050d741772"><div>Compare with <a href="#SkMatrix_preTranslate">preTranslate</a> example. +<div><fiddle-embed name="f5144ef4bd7cea294fad2f756ed335af"><div>Compare with <a href='#SkMatrix_preTranslate'>preTranslate</a> example. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_preTranslate">preTranslate</a> <a href="#SkMatrix_setTranslate">setTranslate</a><sup><a href="#SkMatrix_setTranslate_2">[2]</a></sup> <a href="#SkMatrix_MakeTrans">MakeTrans</a> +<a href='#SkMatrix_preTranslate'>preTranslate</a> <a href='#SkMatrix_setTranslate'>setTranslate</a><sup><a href='#SkMatrix_setTranslate_2'>[2]</a></sup> <a href='#SkMatrix_MakeTrans'>MakeTrans</a> --- -<a name="SkMatrix_postScale"></a> +<a name='SkMatrix_postScale'></a> ## postScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postScale'>postScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from scaling by (<a href="#SkMatrix_postScale_sx">sx</a>, <a href="#SkMatrix_postScale_sy">sy</a>) about pivot point -(<a href="#SkMatrix_postScale_px">px</a>, <a href="#SkMatrix_postScale_py">py</a>), multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as scaling about a pivot point after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from scaling by (<a href='#SkMatrix_postScale_sx'>sx</a>, <a href='#SkMatrix_postScale_sy'>sy</a>) about pivot point +(<a href='#SkMatrix_postScale_px'>px</a>, <a href='#SkMatrix_postScale_py'>py</a>), multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as scaling about a pivot point after applying <a href='#Matrix'>Matrix</a>. Given: @@ -2619,7 +3557,7 @@ dx = px - sx * px dy = py - sy * py </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | sx 0 dx | | J K L | | sx*J+dx*P sx*K+dx*Q sx*L+dx+R | @@ -2629,14 +3567,17 @@ S(sx, sy, px, py) * Matrix = | 0 sy dy | | M N O | = | sy*M+dy*P sy*N+dy*Q sy*O ### Parameters -<table> <tr> <td><a name="SkMatrix_postScale_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_postScale_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> - </tr> <tr> <td><a name="SkMatrix_postScale_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_postScale_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_postScale_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_postScale_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_postScale_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_postScale_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2646,19 +3587,19 @@ pivot y</td> ### See Also -<a href="#SkMatrix_preScale">preScale</a><sup><a href="#SkMatrix_preScale_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> +<a href='#SkMatrix_preScale'>preScale</a><sup><a href='#SkMatrix_preScale_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> --- -<a name="SkMatrix_postScale_2"></a> +<a name='SkMatrix_postScale_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postScale(SkScalar sx, SkScalar sy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postScale'>postScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from scaling by (<a href="#SkMatrix_postScale_2_sx">sx</a>, <a href="#SkMatrix_postScale_2_sy">sy</a>) about pivot point -(0, 0), multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as scaling about the origin after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from scaling by (<a href='#SkMatrix_postScale_2_sx'>sx</a>, <a href='#SkMatrix_postScale_2_sy'>sy</a>) about pivot point +(0, 0), multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as scaling about the origin after applying <a href='#Matrix'>Matrix</a>. Given: @@ -2668,7 +3609,7 @@ Matrix = | M N O |, S(sx, sy) = | 0 sy 0 | | P Q R | | 0 0 1 | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | sx 0 0 | | J K L | | sx*J sx*K sx*L | @@ -2678,10 +3619,11 @@ S(sx, sy) * Matrix = | 0 sy 0 | | M N O | = | sy*M sy*N sy*O | ### Parameters -<table> <tr> <td><a name="SkMatrix_postScale_2_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor</td> - </tr> <tr> <td><a name="SkMatrix_postScale_2_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor</td> +<table> <tr> <td><a name='SkMatrix_postScale_2_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor</td> + </tr> + <tr> <td><a name='SkMatrix_postScale_2_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor</td> </tr> </table> @@ -2691,21 +3633,21 @@ vertical scale factor</td> ### See Also -<a href="#SkMatrix_preScale">preScale</a><sup><a href="#SkMatrix_preScale_2">[2]</a></sup> <a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> +<a href='#SkMatrix_preScale'>preScale</a><sup><a href='#SkMatrix_preScale_2'>[2]</a></sup> <a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> --- -<a name="SkMatrix_postIDiv"></a> +<a name='SkMatrix_postIDiv'></a> ## postIDiv -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool postIDiv(int divx, int divy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_postIDiv'>postIDiv</a>(int divx, int divy) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from scaling by(1/<a href="#SkMatrix_postIDiv_divx">divx</a>, 1/<a href="#SkMatrix_postIDiv_divy">divy</a>) -about pivot point (px, py), multiplied by <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from scaling by(1/<a href='#SkMatrix_postIDiv_divx'>divx</a>, 1/<a href='#SkMatrix_postIDiv_divy'>divy</a>) +about pivot point (px, py), multiplied by <a href='#Matrix'>Matrix</a>. -Returns false if either <a href="#SkMatrix_postIDiv_divx">divx</a> or <a href="#SkMatrix_postIDiv_divy">divy</a> is zero. +Returns false if either <a href='#SkMatrix_postIDiv_divx'>divx</a> or <a href='#SkMatrix_postIDiv_divy'>divy</a> is zero. Given: @@ -2722,7 +3664,7 @@ sx = 1 / divx sy = 1 / divy </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | sx 0 0 | | J K L | | sx*J sx*K sx*L | @@ -2732,10 +3674,11 @@ I(divx, divy) * Matrix = | 0 sy 0 | | M N O | = | sy*M sy*N sy*O | ### Parameters -<table> <tr> <td><a name="SkMatrix_postIDiv_divx"> <code><strong>divx </strong></code> </a></td> <td> -integer divisor for inverse scale in x</td> - </tr> <tr> <td><a name="SkMatrix_postIDiv_divy"> <code><strong>divy </strong></code> </a></td> <td> -integer divisor for inverse scale in y</td> +<table> <tr> <td><a name='SkMatrix_postIDiv_divx'><code><strong>divx</strong></code></a></td> + <td>integer divisor for inverse scale in x</td> + </tr> + <tr> <td><a name='SkMatrix_postIDiv_divy'><code><strong>divy</strong></code></a></td> + <td>integer divisor for inverse scale in y</td> </tr> </table> @@ -2749,22 +3692,22 @@ true on successful scale ### See Also -<a href="#SkMatrix_postScale">postScale</a><sup><a href="#SkMatrix_postScale_2">[2]</a></sup> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> +<a href='#SkMatrix_postScale'>postScale</a><sup><a href='#SkMatrix_postScale_2'>[2]</a></sup> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> --- -<a name="SkMatrix_postRotate"></a> +<a name='SkMatrix_postRotate'></a> ## postRotate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postRotate(SkScalar degrees, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postRotate'>postRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from rotating by <a href="#SkMatrix_postRotate_degrees">degrees</a> about pivot point -(<a href="#SkMatrix_postRotate_px">px</a>, <a href="#SkMatrix_postRotate_py">py</a>), multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as rotating about a pivot point after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from rotating by <a href='#SkMatrix_postRotate_degrees'>degrees</a> about pivot point +(<a href='#SkMatrix_postRotate_px'>px</a>, <a href='#SkMatrix_postRotate_py'>py</a>), multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as rotating about a pivot point after applying <a href='#Matrix'>Matrix</a>. -Positive <a href="#SkMatrix_postRotate_degrees">degrees</a> rotates clockwise. +Positive <a href='#SkMatrix_postRotate_degrees'>degrees</a> rotates clockwise. Given: @@ -2783,7 +3726,7 @@ dx = s * py + (1 - c) * px dy = -s * px + (1 - c) * py </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |c -s dx| |J K L| |cJ-sM+dx*P cK-sN+dx*Q cL-sO+dx+R| @@ -2793,12 +3736,14 @@ R(degrees, px, py) * Matrix = |s c dy| |M N O| = |sJ+cM+dy*P sK+cN+dy*Q sL+cO+d ### Parameters -<table> <tr> <td><a name="SkMatrix_postRotate_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -angle of axes relative to upright axes</td> - </tr> <tr> <td><a name="SkMatrix_postRotate_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_postRotate_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_postRotate_degrees'><code><strong>degrees</strong></code></a></td> + <td>angle of axes relative to upright axes</td> + </tr> + <tr> <td><a name='SkMatrix_postRotate_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_postRotate_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2808,21 +3753,21 @@ pivot y</td> ### See Also -<a href="#SkMatrix_preRotate">preRotate</a><sup><a href="#SkMatrix_preRotate_2">[2]</a></sup> <a href="#SkMatrix_setRotate">setRotate</a><sup><a href="#SkMatrix_setRotate_2">[2]</a></sup> +<a href='#SkMatrix_preRotate'>preRotate</a><sup><a href='#SkMatrix_preRotate_2'>[2]</a></sup> <a href='#SkMatrix_setRotate'>setRotate</a><sup><a href='#SkMatrix_setRotate_2'>[2]</a></sup> --- -<a name="SkMatrix_postRotate_2"></a> +<a name='SkMatrix_postRotate_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postRotate(SkScalar degrees) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postRotate'>postRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from rotating by <a href="#SkMatrix_postRotate_2_degrees">degrees</a> about pivot point -(0, 0), multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as rotating about the origin after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from rotating by <a href='#SkMatrix_postRotate_2_degrees'>degrees</a> about pivot point +(0, 0), multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as rotating about the origin after applying <a href='#Matrix'>Matrix</a>. -Positive <a href="#SkMatrix_postRotate_2_degrees">degrees</a> rotates clockwise. +Positive <a href='#SkMatrix_postRotate_2_degrees'>degrees</a> rotates clockwise. Given: @@ -2839,7 +3784,7 @@ c = cos(degrees) s = sin(degrees) </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | c -s dx | | J K L | | cJ-sM cK-sN cL-sO | @@ -2849,8 +3794,8 @@ R(degrees, px, py) * Matrix = | s c dy | | M N O | = | sJ+cM sK+cN sL+cO | ### Parameters -<table> <tr> <td><a name="SkMatrix_postRotate_2_degrees"> <code><strong>degrees </strong></code> </a></td> <td> -angle of axes relative to upright axes</td> +<table> <tr> <td><a name='SkMatrix_postRotate_2_degrees'><code><strong>degrees</strong></code></a></td> + <td>angle of axes relative to upright axes</td> </tr> </table> @@ -2860,20 +3805,20 @@ angle of axes relative to upright axes</td> ### See Also -<a href="#SkMatrix_preRotate">preRotate</a><sup><a href="#SkMatrix_preRotate_2">[2]</a></sup> <a href="#SkMatrix_setRotate">setRotate</a><sup><a href="#SkMatrix_setRotate_2">[2]</a></sup> +<a href='#SkMatrix_preRotate'>preRotate</a><sup><a href='#SkMatrix_preRotate_2'>[2]</a></sup> <a href='#SkMatrix_setRotate'>setRotate</a><sup><a href='#SkMatrix_setRotate_2'>[2]</a></sup> --- -<a name="SkMatrix_postSkew"></a> +<a name='SkMatrix_postSkew'></a> ## postSkew -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postSkew'>postSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from skewing by (<a href="#SkMatrix_postSkew_kx">kx</a>, <a href="#SkMatrix_postSkew_ky">ky</a>) about pivot point -(<a href="#SkMatrix_postSkew_px">px</a>, <a href="#SkMatrix_postSkew_py">py</a>), multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as skewing about a pivot point after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from skewing by (<a href='#SkMatrix_postSkew_kx'>kx</a>, <a href='#SkMatrix_postSkew_ky'>ky</a>) about pivot point +(<a href='#SkMatrix_postSkew_px'>px</a>, <a href='#SkMatrix_postSkew_py'>py</a>), multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as skewing about a pivot point after applying <a href='#Matrix'>Matrix</a>. Given: @@ -2890,7 +3835,7 @@ dx = -kx * py dy = -ky * px </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 kx dx| |J K L| |J+kx*M+dx*P K+kx*N+dx*Q L+kx*O+dx+R| @@ -2900,14 +3845,17 @@ K(kx, ky, px, py) * Matrix = |ky 1 dy| |M N O| = |ky*J+M+dy*P ky*K+N+dy*Q ky*L+ ### Parameters -<table> <tr> <td><a name="SkMatrix_postSkew_kx"> <code><strong>kx </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_postSkew_ky"> <code><strong>ky </strong></code> </a></td> <td> -vertical skew factor</td> - </tr> <tr> <td><a name="SkMatrix_postSkew_px"> <code><strong>px </strong></code> </a></td> <td> -pivot x</td> - </tr> <tr> <td><a name="SkMatrix_postSkew_py"> <code><strong>py </strong></code> </a></td> <td> -pivot y</td> +<table> <tr> <td><a name='SkMatrix_postSkew_kx'><code><strong>kx</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_postSkew_ky'><code><strong>ky</strong></code></a></td> + <td>vertical skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_postSkew_px'><code><strong>px</strong></code></a></td> + <td>pivot x</td> + </tr> + <tr> <td><a name='SkMatrix_postSkew_py'><code><strong>py</strong></code></a></td> + <td>pivot y</td> </tr> </table> @@ -2917,19 +3865,19 @@ pivot y</td> ### See Also -<a href="#SkMatrix_preSkew">preSkew</a><sup><a href="#SkMatrix_preSkew_2">[2]</a></sup> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> +<a href='#SkMatrix_preSkew'>preSkew</a><sup><a href='#SkMatrix_preSkew_2'>[2]</a></sup> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_postSkew_2"></a> +<a name='SkMatrix_postSkew_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postSkew(SkScalar kx, SkScalar ky) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postSkew'>postSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> constructed from skewing by (<a href="#SkMatrix_postSkew_2_kx">kx</a>, <a href="#SkMatrix_postSkew_2_ky">ky</a>) about pivot point -(0, 0), multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of as skewing about the origin after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> constructed from skewing by (<a href='#SkMatrix_postSkew_2_kx'>kx</a>, <a href='#SkMatrix_postSkew_2_ky'>ky</a>) about pivot point +(0, 0), multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of as skewing about the origin after applying <a href='#Matrix'>Matrix</a>. Given: @@ -2939,7 +3887,7 @@ Matrix = | M N O |, K(kx, ky) = | ky 1 0 | | P Q R | | 0 0 1 | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 kx 0 | | J K L | | J+kx*M K+kx*N L+kx*O | @@ -2949,10 +3897,11 @@ K(kx, ky) * Matrix = | ky 1 0 | | M N O | = | ky*J+M ky*K+N ky*L+O | ### Parameters -<table> <tr> <td><a name="SkMatrix_postSkew_2_kx"> <code><strong>kx </strong></code> </a></td> <td> -horizontal skew factor</td> - </tr> <tr> <td><a name="SkMatrix_postSkew_2_ky"> <code><strong>ky </strong></code> </a></td> <td> -vertical skew factor</td> +<table> <tr> <td><a name='SkMatrix_postSkew_2_kx'><code><strong>kx</strong></code></a></td> + <td>horizontal skew factor</td> + </tr> + <tr> <td><a name='SkMatrix_postSkew_2_ky'><code><strong>ky</strong></code></a></td> + <td>vertical skew factor</td> </tr> </table> @@ -2962,19 +3911,19 @@ vertical skew factor</td> ### See Also -<a href="#SkMatrix_preSkew">preSkew</a><sup><a href="#SkMatrix_preSkew_2">[2]</a></sup> <a href="#SkMatrix_setSkew">setSkew</a><sup><a href="#SkMatrix_setSkew_2">[2]</a></sup> +<a href='#SkMatrix_preSkew'>preSkew</a><sup><a href='#SkMatrix_preSkew_2'>[2]</a></sup> <a href='#SkMatrix_setSkew'>setSkew</a><sup><a href='#SkMatrix_setSkew_2'>[2]</a></sup> --- -<a name="SkMatrix_postConcat"></a> +<a name='SkMatrix_postConcat'></a> ## postConcat -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void postConcat(const SkMatrix& other) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_postConcat'>postConcat</a>(const <a href='#SkMatrix'>SkMatrix</a>& other) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#Matrix">Matrix</a> <a href="#SkMatrix_postConcat_other">other</a> multiplied by <a href="#Matrix">Matrix</a>. -This can be thought of mapping by <a href="#SkMatrix_postConcat_other">other</a> after applying <a href="#Matrix">Matrix</a>. +Sets <a href='#Matrix'>Matrix</a> to <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_postConcat_other'>other</a> multiplied by <a href='#Matrix'>Matrix</a>. +This can be thought of mapping by <a href='#SkMatrix_postConcat_other'>other</a> after applying <a href='#Matrix'>Matrix</a>. Given: @@ -2984,7 +3933,7 @@ Matrix = | M N O |, other = | D E F | | P Q R | | G H I | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | J K L | | AJ+BM+CP AK+BN+CQ AL+BO+CR | @@ -2994,8 +3943,8 @@ other * Matrix = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR | ### Parameters -<table> <tr> <td><a name="SkMatrix_postConcat_other"> <code><strong>other </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> on left side of multiply expression</td> +<table> <tr> <td><a name='SkMatrix_postConcat_other'><code><strong>other</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> on left side of multiply expression</td> </tr> </table> @@ -3005,51 +3954,66 @@ other * Matrix = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR | ### See Also -<a href="#SkMatrix_preConcat">preConcat</a> <a href="#SkMatrix_setConcat">setConcat</a> <a href="#SkMatrix_Concat">Concat</a> +<a href='#SkMatrix_preConcat'>preConcat</a> <a href='#SkMatrix_setConcat'>setConcat</a> <a href='#SkMatrix_Concat'>Concat</a> --- -## <a name="SkMatrix_ScaleToFit"></a> Enum SkMatrix::ScaleToFit +## <a name='SkMatrix_ScaleToFit'>Enum SkMatrix::ScaleToFit</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkMatrix_ScaleToFit">ScaleToFit</a> { - <a href="#SkMatrix_kFill_ScaleToFit">kFill ScaleToFit</a>, - <a href="#SkMatrix_kStart_ScaleToFit">kStart ScaleToFit</a>, - <a href="#SkMatrix_kCenter_ScaleToFit">kCenter ScaleToFit</a>, - <a href="#SkMatrix_kEnd_ScaleToFit">kEnd ScaleToFit</a>, + enum <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> { + <a href='#SkMatrix_kFill_ScaleToFit'>kFill ScaleToFit</a>, + <a href='#SkMatrix_kStart_ScaleToFit'>kStart ScaleToFit</a>, + <a href='#SkMatrix_kCenter_ScaleToFit'>kCenter ScaleToFit</a>, + <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd ScaleToFit</a>, }; </pre> -<a href="#SkMatrix_ScaleToFit">ScaleToFit</a> describes how <a href="#Matrix">Matrix</a> is constructed to map one <a href="SkRect_Reference#Rect">Rect</a> to another. -<a href="#SkMatrix_ScaleToFit">ScaleToFit</a> may allow <a href="#Matrix">Matrix</a> to have unequal horizontal and vertical scaling, -or may restrict <a href="#Matrix">Matrix</a> to square scaling. If restricted, <a href="#SkMatrix_ScaleToFit">ScaleToFit</a> specifies -how <a href="#Matrix">Matrix</a> maps to the side or center of the destination <a href="SkRect_Reference#Rect">Rect</a>. +<a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> describes how <a href='#Matrix'>Matrix</a> is constructed to map one <a href='SkRect_Reference#Rect'>Rect</a> to another. +<a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> may allow <a href='#Matrix'>Matrix</a> to have unequal horizontal and vertical scaling, +or may restrict <a href='#Matrix'>Matrix</a> to square scaling. If restricted, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> specifies +how <a href='#Matrix'>Matrix</a> maps to the side or center of the destination <a href='SkRect_Reference#Rect'>Rect</a>. ### Constants -<table> - <tr> - <td><a name="SkMatrix_kFill_ScaleToFit"> <code><strong>SkMatrix::kFill_ScaleToFit </strong></code> </a></td><td>0</td><td>Computes <a href="#Matrix">Matrix</a> that scales in x and y independently, so that source <a href="SkRect_Reference#Rect">Rect</a> is -mapped to completely fill destination <a href="SkRect_Reference#Rect">Rect</a>. The aspect ratio of source <a href="SkRect_Reference#Rect">Rect</a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kFill_ScaleToFit'><code>SkMatrix::kFill_ScaleToFit</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Computes <a href='#Matrix'>Matrix</a> that scales in x and y independently, so that source <a href='SkRect_Reference#Rect'>Rect</a> is +mapped to completely fill destination <a href='SkRect_Reference#Rect'>Rect</a>. The aspect ratio of source <a href='SkRect_Reference#Rect'>Rect</a> may change. </td> </tr> <tr> - <td><a name="SkMatrix_kStart_ScaleToFit"> <code><strong>SkMatrix::kStart_ScaleToFit </strong></code> </a></td><td>1</td><td>Computes <a href="#Matrix">Matrix</a> that maintains source <a href="SkRect_Reference#Rect">Rect</a> aspect ratio, mapping source <a href="SkRect_Reference#Rect">Rect</a> -width or height to destination <a href="SkRect_Reference#Rect">Rect</a>. Aligns mapping to left and top edges -of destination <a href="SkRect_Reference#Rect">Rect</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kStart_ScaleToFit'><code>SkMatrix::kStart_ScaleToFit</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Computes <a href='#Matrix'>Matrix</a> that maintains source <a href='SkRect_Reference#Rect'>Rect</a> aspect ratio, mapping source <a href='SkRect_Reference#Rect'>Rect</a> +width or height to destination <a href='SkRect_Reference#Rect'>Rect</a>. Aligns mapping to left and top edges +of destination <a href='SkRect_Reference#Rect'>Rect</a>. </td> </tr> - <tr> - <td><a name="SkMatrix_kCenter_ScaleToFit"> <code><strong>SkMatrix::kCenter_ScaleToFit </strong></code> </a></td><td>2</td><td>Computes <a href="#Matrix">Matrix</a> that maintains source <a href="SkRect_Reference#Rect">Rect</a> aspect ratio, mapping source <a href="SkRect_Reference#Rect">Rect</a> -width or height to destination <a href="SkRect_Reference#Rect">Rect</a>. Aligns mapping to center of destination -<a href="SkRect_Reference#Rect">Rect</a>. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kCenter_ScaleToFit'><code>SkMatrix::kCenter_ScaleToFit</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Computes <a href='#Matrix'>Matrix</a> that maintains source <a href='SkRect_Reference#Rect'>Rect</a> aspect ratio, mapping source <a href='SkRect_Reference#Rect'>Rect</a> +width or height to destination <a href='SkRect_Reference#Rect'>Rect</a>. Aligns mapping to center of destination +<a href='SkRect_Reference#Rect'>Rect</a>. </td> </tr> <tr> - <td><a name="SkMatrix_kEnd_ScaleToFit"> <code><strong>SkMatrix::kEnd_ScaleToFit </strong></code> </a></td><td>3</td><td>Computes <a href="#Matrix">Matrix</a> that maintains source <a href="SkRect_Reference#Rect">Rect</a> aspect ratio, mapping source <a href="SkRect_Reference#Rect">Rect</a> -width or height to destination <a href="SkRect_Reference#Rect">Rect</a>. Aligns mapping to right and bottom -edges of destination <a href="SkRect_Reference#Rect">Rect</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kEnd_ScaleToFit'><code>SkMatrix::kEnd_ScaleToFit</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Computes <a href='#Matrix'>Matrix</a> that maintains source <a href='SkRect_Reference#Rect'>Rect</a> aspect ratio, mapping source <a href='SkRect_Reference#Rect'>Rect</a> +width or height to destination <a href='SkRect_Reference#Rect'>Rect</a>. Aligns mapping to right and bottom +edges of destination <a href='SkRect_Reference#Rect'>Rect</a>. </td> </tr> </table> @@ -3060,21 +4024,19 @@ edges of destination <a href="SkRect_Reference#Rect">Rect</a>. ### See Also -<a href="#SkMatrix_setRectToRect">setRectToRect</a> <a href="#SkMatrix_MakeRectToRect">MakeRectToRect</a> <a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> - - +<a href='#SkMatrix_setRectToRect'>setRectToRect</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a> <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> -<a name="SkMatrix_setRectToRect"></a> +<a name='SkMatrix_setRectToRect'></a> ## setRectToRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_setRectToRect'>setRectToRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> stf) </pre> -Sets <a href="#Matrix">Matrix</a> to scale and translate <a href="#SkMatrix_setRectToRect_src">src</a> <a href="SkRect_Reference#Rect">Rect</a> to <a href="#SkMatrix_setRectToRect_dst">dst</a> <a href="SkRect_Reference#Rect">Rect</a>. <a href="#SkMatrix_setRectToRect_stf">stf</a> selects whether -mapping completely fills <a href="#SkMatrix_setRectToRect_dst">dst</a> or preserves the aspect ratio, and how to align -<a href="#SkMatrix_setRectToRect_src">src</a> within <a href="#SkMatrix_setRectToRect_dst">dst</a>. Returns false if <a href="#SkMatrix_setRectToRect_src">src</a> is empty, and sets <a href="#Matrix">Matrix</a> to identity. -Returns true if <a href="#SkMatrix_setRectToRect_dst">dst</a> is empty, and sets <a href="#Matrix">Matrix</a> to: +Sets <a href='#Matrix'>Matrix</a> to scale and translate <a href='#SkMatrix_setRectToRect_src'>src</a> <a href='SkRect_Reference#Rect'>Rect</a> to <a href='#SkMatrix_setRectToRect_dst'>dst</a> <a href='SkRect_Reference#Rect'>Rect</a>. <a href='#SkMatrix_setRectToRect_stf'>stf</a> selects whether +mapping completely fills <a href='#SkMatrix_setRectToRect_dst'>dst</a> or preserves the aspect ratio, and how to align +<a href='#SkMatrix_setRectToRect_src'>src</a> within <a href='#SkMatrix_setRectToRect_dst'>dst</a>. Returns false if <a href='#SkMatrix_setRectToRect_src'>src</a> is empty, and sets <a href='#Matrix'>Matrix</a> to identity. +Returns true if <a href='#SkMatrix_setRectToRect_dst'>dst</a> is empty, and sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 0 0 0 | @@ -3084,19 +4046,21 @@ Returns true if <a href="#SkMatrix_setRectToRect_dst">dst</a> is empty, and sets ### Parameters -<table> <tr> <td><a name="SkMatrix_setRectToRect_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map from</td> - </tr> <tr> <td><a name="SkMatrix_setRectToRect_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map to</td> - </tr> <tr> <td><a name="SkMatrix_setRectToRect_stf"> <code><strong>stf </strong></code> </a></td> <td> -one of: <a href="#SkMatrix_kFill_ScaleToFit">kFill ScaleToFit</a>, <a href="#SkMatrix_kStart_ScaleToFit">kStart ScaleToFit</a>, -<a href="#SkMatrix_kCenter_ScaleToFit">kCenter ScaleToFit</a>, <a href="#SkMatrix_kEnd_ScaleToFit">kEnd ScaleToFit</a></td> +<table> <tr> <td><a name='SkMatrix_setRectToRect_src'><code><strong>src</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map from</td> + </tr> + <tr> <td><a name='SkMatrix_setRectToRect_dst'><code><strong>dst</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map to</td> + </tr> + <tr> <td><a name='SkMatrix_setRectToRect_stf'><code><strong>stf</strong></code></a></td> + <td>one of: <a href='#SkMatrix_kFill_ScaleToFit'>kFill ScaleToFit</a>, <a href='#SkMatrix_kStart_ScaleToFit'>kStart ScaleToFit</a>, +<a href='#SkMatrix_kCenter_ScaleToFit'>kCenter ScaleToFit</a>, <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd ScaleToFit</a></td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> can represent <a href="SkRect_Reference#Rect">Rect</a> mapping +true if <a href='#Matrix'>Matrix</a> can represent <a href='SkRect_Reference#Rect'>Rect</a> mapping ### Example @@ -3119,21 +4083,21 @@ src: 1, 2, 3, 4 dst: 5, 6, 8, 9 success: true ### See Also -<a href="#SkMatrix_MakeRectToRect">MakeRectToRect</a> <a href="#SkMatrix_ScaleToFit">ScaleToFit</a> <a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> <a href="SkRect_Reference#SkRect_isEmpty">SkRect::isEmpty</a> +<a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a> <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> <a href='SkRect_Reference#SkRect_isEmpty'>SkRect::isEmpty</a> --- -<a name="SkMatrix_MakeRectToRect"></a> +<a name='SkMatrix_MakeRectToRect'></a> ## MakeRectToRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkMatrix MakeRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> stf) </pre> -Returns <a href="#Matrix">Matrix</a> set to scale and translate <a href="#SkMatrix_MakeRectToRect_src">src</a> <a href="SkRect_Reference#Rect">Rect</a> to <a href="#SkMatrix_MakeRectToRect_dst">dst</a> <a href="SkRect_Reference#Rect">Rect</a>. <a href="#SkMatrix_MakeRectToRect_stf">stf</a> selects -whether mapping completely fills <a href="#SkMatrix_MakeRectToRect_dst">dst</a> or preserves the aspect ratio, and how to -align <a href="#SkMatrix_MakeRectToRect_src">src</a> within <a href="#SkMatrix_MakeRectToRect_dst">dst</a>. Returns the identity <a href="#Matrix">Matrix</a> if <a href="#SkMatrix_MakeRectToRect_src">src</a> is empty. If <a href="#SkMatrix_MakeRectToRect_dst">dst</a> is -empty, returns <a href="#Matrix">Matrix</a> set to: +Returns <a href='#Matrix'>Matrix</a> set to scale and translate <a href='#SkMatrix_MakeRectToRect_src'>src</a> <a href='SkRect_Reference#Rect'>Rect</a> to <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> <a href='SkRect_Reference#Rect'>Rect</a>. <a href='#SkMatrix_MakeRectToRect_stf'>stf</a> selects +whether mapping completely fills <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> or preserves the aspect ratio, and how to +align <a href='#SkMatrix_MakeRectToRect_src'>src</a> within <a href='#SkMatrix_MakeRectToRect_dst'>dst</a>. Returns the identity <a href='#Matrix'>Matrix</a> if <a href='#SkMatrix_MakeRectToRect_src'>src</a> is empty. If <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> is +empty, returns <a href='#Matrix'>Matrix</a> set to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 0 0 0 | @@ -3143,19 +4107,21 @@ empty, returns <a href="#Matrix">Matrix</a> set to: ### Parameters -<table> <tr> <td><a name="SkMatrix_MakeRectToRect_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map from</td> - </tr> <tr> <td><a name="SkMatrix_MakeRectToRect_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map to</td> - </tr> <tr> <td><a name="SkMatrix_MakeRectToRect_stf"> <code><strong>stf </strong></code> </a></td> <td> -one of: <a href="#SkMatrix_kFill_ScaleToFit">kFill ScaleToFit</a>, <a href="#SkMatrix_kStart_ScaleToFit">kStart ScaleToFit</a>, -<a href="#SkMatrix_kCenter_ScaleToFit">kCenter ScaleToFit</a>, <a href="#SkMatrix_kEnd_ScaleToFit">kEnd ScaleToFit</a></td> +<table> <tr> <td><a name='SkMatrix_MakeRectToRect_src'><code><strong>src</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map from</td> + </tr> + <tr> <td><a name='SkMatrix_MakeRectToRect_dst'><code><strong>dst</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map to</td> + </tr> + <tr> <td><a name='SkMatrix_MakeRectToRect_stf'><code><strong>stf</strong></code></a></td> + <td>one of: <a href='#SkMatrix_kFill_ScaleToFit'>kFill ScaleToFit</a>, <a href='#SkMatrix_kStart_ScaleToFit'>kStart ScaleToFit</a>, +<a href='#SkMatrix_kCenter_ScaleToFit'>kCenter ScaleToFit</a>, <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd ScaleToFit</a></td> </tr> </table> ### Return Value -<a href="#Matrix">Matrix</a> mapping <a href="#SkMatrix_MakeRectToRect_src">src</a> to <a href="#SkMatrix_MakeRectToRect_dst">dst</a> +<a href='#Matrix'>Matrix</a> mapping <a href='#SkMatrix_MakeRectToRect_src'>src</a> to <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> ### Example @@ -3178,39 +4144,41 @@ src: 1, 2, 3, 4 dst: 5, 6, 8, 9 ### See Also -<a href="#SkMatrix_setRectToRect">setRectToRect</a> <a href="#SkMatrix_ScaleToFit">ScaleToFit</a> <a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> <a href="SkRect_Reference#SkRect_isEmpty">SkRect::isEmpty</a> +<a href='#SkMatrix_setRectToRect'>setRectToRect</a> <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> <a href='SkRect_Reference#SkRect_isEmpty'>SkRect::isEmpty</a> --- -<a name="SkMatrix_setPolyToPoly"></a> +<a name='SkMatrix_setPolyToPoly'></a> ## setPolyToPoly -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setPolyToPoly(const SkPoint src[], const SkPoint dst[], int count) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> src[], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[], int count) </pre> -Sets <a href="#Matrix">Matrix</a> to map <a href="#SkMatrix_setPolyToPoly_src">src</a> to <a href="#SkMatrix_setPolyToPoly_dst">dst</a>. <a href="#SkMatrix_setPolyToPoly_count">count</a> must be zero or greater, and four or less. +Sets <a href='#Matrix'>Matrix</a> to map <a href='#SkMatrix_setPolyToPoly_src'>src</a> to <a href='#SkMatrix_setPolyToPoly_dst'>dst</a>. <a href='#SkMatrix_setPolyToPoly_count'>count</a> must be zero or greater, and four or less. -If <a href="#SkMatrix_setPolyToPoly_count">count</a> is zero, sets <a href="#Matrix">Matrix</a> to identity and returns true. -If <a href="#SkMatrix_setPolyToPoly_count">count</a> is one, sets <a href="#Matrix">Matrix</a> to translate and returns true. -If <a href="#SkMatrix_setPolyToPoly_count">count</a> is two or more, sets <a href="#Matrix">Matrix</a> to map <a href="SkPoint_Reference#Point">Points</a> if possible; returns false -if <a href="#Matrix">Matrix</a> cannot be constructed. If <a href="#SkMatrix_setPolyToPoly_count">count</a> is four, <a href="#Matrix">Matrix</a> may include +If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is zero, sets <a href='#Matrix'>Matrix</a> to identity and returns true. +If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is one, sets <a href='#Matrix'>Matrix</a> to translate and returns true. +If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is two or more, sets <a href='#Matrix'>Matrix</a> to map <a href='SkPoint_Reference#Point'>Points</a> if possible; returns false +if <a href='#Matrix'>Matrix</a> cannot be constructed. If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is four, <a href='#Matrix'>Matrix</a> may include perspective. ### Parameters -<table> <tr> <td><a name="SkMatrix_setPolyToPoly_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Points</a> to map from</td> - </tr> <tr> <td><a name="SkMatrix_setPolyToPoly_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Points</a> to map to</td> - </tr> <tr> <td><a name="SkMatrix_setPolyToPoly_count"> <code><strong>count </strong></code> </a></td> <td> -number of <a href="SkPoint_Reference#Point">Points</a> in <a href="#SkMatrix_setPolyToPoly_src">src</a> and <a href="#SkMatrix_setPolyToPoly_dst">dst</a></td> +<table> <tr> <td><a name='SkMatrix_setPolyToPoly_src'><code><strong>src</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Points</a> to map from</td> + </tr> + <tr> <td><a name='SkMatrix_setPolyToPoly_dst'><code><strong>dst</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Points</a> to map to</td> + </tr> + <tr> <td><a name='SkMatrix_setPolyToPoly_count'><code><strong>count</strong></code></a></td> + <td>number of <a href='SkPoint_Reference#Point'>Points</a> in <a href='#SkMatrix_setPolyToPoly_src'>src</a> and <a href='#SkMatrix_setPolyToPoly_dst'>dst</a></td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> was constructed successfully +true if <a href='#Matrix'>Matrix</a> was constructed successfully ### Example @@ -3218,32 +4186,32 @@ true if <a href="#Matrix">Matrix</a> was constructed successfully ### See Also -<a href="#SkMatrix_setRectToRect">setRectToRect</a> <a href="#SkMatrix_MakeRectToRect">MakeRectToRect</a> +<a href='#SkMatrix_setRectToRect'>setRectToRect</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a> --- -<a name="SkMatrix_invert"></a> +<a name='SkMatrix_invert'></a> ## invert -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT invert(SkMatrix* inverse) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkMatrix_invert'>invert</a>(<a href='#SkMatrix'>SkMatrix</a>* inverse) const </pre> -Sets <a href="#SkMatrix_invert_inverse">inverse</a> to reciprocal matrix, returning true if <a href="#Matrix">Matrix</a> can be inverted. -Geometrically, if <a href="#Matrix">Matrix</a> maps from source to destination, <a href="#SkMatrix_invert_inverse">inverse</a> <a href="#Matrix">Matrix</a> -maps from destination to source. If <a href="#Matrix">Matrix</a> can not be inverted, <a href="#SkMatrix_invert_inverse">inverse</a> is +Sets <a href='#SkMatrix_invert_inverse'>inverse</a> to reciprocal matrix, returning true if <a href='#Matrix'>Matrix</a> can be inverted. +Geometrically, if <a href='#Matrix'>Matrix</a> maps from source to destination, <a href='#SkMatrix_invert_inverse'>inverse</a> <a href='#Matrix'>Matrix</a> +maps from destination to source. If <a href='#Matrix'>Matrix</a> can not be inverted, <a href='#SkMatrix_invert_inverse'>inverse</a> is unchanged. ### Parameters -<table> <tr> <td><a name="SkMatrix_invert_inverse"> <code><strong>inverse </strong></code> </a></td> <td> -storage for inverted <a href="#Matrix">Matrix</a>; may be nullptr</td> +<table> <tr> <td><a name='SkMatrix_invert_inverse'><code><strong>inverse</strong></code></a></td> + <td>storage for inverted <a href='#Matrix'>Matrix</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> can be inverted +true if <a href='#Matrix'>Matrix</a> can be inverted ### Example @@ -3251,19 +4219,19 @@ true if <a href="#Matrix">Matrix</a> can be inverted ### See Also -<a href="#SkMatrix_Concat">Concat</a> +<a href='#SkMatrix_Concat'>Concat</a> --- -<a name="SkMatrix_SetAffineIdentity"></a> +<a name='SkMatrix_SetAffineIdentity'></a> ## SetAffineIdentity -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static void SetAffineIdentity(SkScalar affine[6]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static void <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a>(<a href='undocumented#SkScalar'>SkScalar</a> affine[6]) </pre> -Fills <a href="#SkMatrix_SetAffineIdentity_affine">affine</a> with identity values in column major order. -Sets <a href="#SkMatrix_SetAffineIdentity_affine">affine</a> to: +Fills <a href='#SkMatrix_SetAffineIdentity_affine'>affine</a> with identity values in column major order. +Sets <a href='#SkMatrix_SetAffineIdentity_affine'>affine</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 0 | @@ -3274,8 +4242,8 @@ Affine 3x2 matrices in column major order are used by OpenGL and XPS. ### Parameters -<table> <tr> <td><a name="SkMatrix_SetAffineIdentity_affine"> <code><strong>affine </strong></code> </a></td> <td> -storage for 3x2 <a href="#SkMatrix_SetAffineIdentity_affine">affine</a> matrix</td> +<table> <tr> <td><a name='SkMatrix_SetAffineIdentity_affine'><code><strong>affine</strong></code></a></td> + <td>storage for 3x2 <a href='#SkMatrix_SetAffineIdentity_affine'>affine</a> matrix</td> </tr> </table> @@ -3293,36 +4261,36 @@ ScaleX: 1 SkewY: 0 SkewX: 0 ScaleY: 1 TransX: 0 TransY: 0 ### See Also -<a href="#SkMatrix_setAffine">setAffine</a> <a href="#SkMatrix_asAffine">asAffine</a> +<a href='#SkMatrix_setAffine'>setAffine</a> <a href='#SkMatrix_asAffine'>asAffine</a> --- -<a name="SkMatrix_asAffine"></a> +<a name='SkMatrix_asAffine'></a> ## asAffine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT asAffine(SkScalar affine[6]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkMatrix_asAffine'>asAffine</a>(<a href='undocumented#SkScalar'>SkScalar</a> affine[6]) const </pre> -Fills <a href="#SkMatrix_asAffine_affine">affine</a> in column major order. Sets <a href="#SkMatrix_asAffine_affine">affine</a> to: +Fills <a href='#SkMatrix_asAffine_affine'>affine</a> in column major order. Sets <a href='#SkMatrix_asAffine_affine'>affine</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scale-x skew-x translate-x | | skew-y scale-y translate-y | </pre> -If <a href="#Matrix">Matrix</a> contains perspective, returns false and leaves <a href="#SkMatrix_asAffine_affine">affine</a> unchanged. +If <a href='#Matrix'>Matrix</a> contains perspective, returns false and leaves <a href='#SkMatrix_asAffine_affine'>affine</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkMatrix_asAffine_affine"> <code><strong>affine </strong></code> </a></td> <td> -storage for 3x2 <a href="#SkMatrix_asAffine_affine">affine</a> matrix; may be nullptr</td> +<table> <tr> <td><a name='SkMatrix_asAffine_affine'><code><strong>affine</strong></code></a></td> + <td>storage for 3x2 <a href='#SkMatrix_asAffine_affine'>affine</a> matrix; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> does not contain perspective +true if <a href='#Matrix'>Matrix</a> does not contain perspective ### Example @@ -3338,18 +4306,18 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7 ### See Also -<a href="#SkMatrix_setAffine">setAffine</a> <a href="#SkMatrix_SetAffineIdentity">SetAffineIdentity</a> +<a href='#SkMatrix_setAffine'>setAffine</a> <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a> --- -<a name="SkMatrix_setAffine"></a> +<a name='SkMatrix_setAffine'></a> ## setAffine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAffine(const SkScalar affine[6]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setAffine'>setAffine</a>(const <a href='undocumented#SkScalar'>SkScalar</a> affine[6]) </pre> -Sets <a href="#Matrix">Matrix</a> to <a href="#SkMatrix_setAffine_affine">affine</a> values, passed in column major order. Given <a href="#SkMatrix_setAffine_affine">affine</a>, +Sets <a href='#Matrix'>Matrix</a> to <a href='#SkMatrix_setAffine_affine'>affine</a> values, passed in column major order. Given <a href='#SkMatrix_setAffine_affine'>affine</a>, column, then row, as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> @@ -3357,7 +4325,7 @@ column, then row, as: | skew-y scale-y translate-y | </pre> -<a href="#Matrix">Matrix</a> is set, row, then column, to: +<a href='#Matrix'>Matrix</a> is set, row, then column, to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | scale-x skew-x translate-x | @@ -3367,8 +4335,8 @@ column, then row, as: ### Parameters -<table> <tr> <td><a name="SkMatrix_setAffine_affine"> <code><strong>affine </strong></code> </a></td> <td> -3x2 <a href="#SkMatrix_setAffine_affine">affine</a> matrix</td> +<table> <tr> <td><a name='SkMatrix_setAffine_affine'><code><strong>affine</strong></code></a></td> + <td>3x2 <a href='#SkMatrix_setAffine_affine'>affine</a> matrix</td> </tr> </table> @@ -3387,43 +4355,104 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7 ### See Also -<a href="#SkMatrix_asAffine">asAffine</a> <a href="#SkMatrix_SetAffineIdentity">SetAffineIdentity</a> +<a href='#SkMatrix_asAffine'>asAffine</a> <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a> --- -## <a name="Transform"></a> Transform - -| name | description | -| --- | --- | -| <a href="#SkMatrix_mapHomogeneousPoints">mapHomogeneousPoints</a> | maps <a href="undocumented#Point3">Point3</a> array | -| <a href="#SkMatrix_mapPoints">mapPoints</a> | maps <a href="SkPoint_Reference#Point">Point</a> array | -| | <a href="#SkMatrix_mapPoints">mapPoints(SkPoint dst[], const SkPoint src[], int count)</a> const | -| | <a href="#SkMatrix_mapPoints_2">mapPoints(SkPoint pts[], int count)</a> const | -| <a href="#SkMatrix_mapRadius">mapRadius</a> | returns mean radius of mapped <a href="undocumented#Circle">Circle</a> | -| <a href="#SkMatrix_mapRect">mapRect</a> | returns bounds of mapped <a href="SkRect_Reference#Rect">Rect</a> | -| | <a href="#SkMatrix_mapRect">mapRect(SkRect* dst, const SkRect& src)</a> const | -| | <a href="#SkMatrix_mapRect_2">mapRect(SkRect* rect)</a> const | -| <a href="#SkMatrix_mapRectScaleTranslate">mapRectScaleTranslate</a> | returns bounds of mapped <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkMatrix_mapRectToQuad">mapRectToQuad</a> | maps <a href="SkRect_Reference#Rect">Rect</a> to <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkMatrix_mapVector">mapVector</a> | maps <a href="SkPoint_Reference#Vector">Vector</a> | -| | <a href="#SkMatrix_mapVector">mapVector(SkScalar dx, SkScalar dy, SkVector* result)</a> const | -| | <a href="#SkMatrix_mapVector_2">mapVector(SkScalar dx, SkScalar dy)</a> const | -| <a href="#SkMatrix_mapVectors">mapVectors</a> | maps <a href="SkPoint_Reference#Vector">Vector</a> array | -| | <a href="#SkMatrix_mapVectors">mapVectors(SkVector dst[], const SkVector src[], int count)</a> const | -| | <a href="#SkMatrix_mapVectors_2">mapVectors(SkVector vecs[], int count)</a> const | -| <a href="#SkMatrix_mapXY">mapXY</a> | maps <a href="SkPoint_Reference#Point">Point</a> | -| | <a href="#SkMatrix_mapXY">mapXY(SkScalar x, SkScalar y, SkPoint* result)</a> const | -| | <a href="#SkMatrix_mapXY_2">mapXY(SkScalar x, SkScalar y)</a> const | - -<a name="SkMatrix_mapPoints"></a> +## <a name='Transform'>Transform</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='undocumented#Point3'>Point3</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapPoints'>mapPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapPoints'>mapPoints(SkPoint dst[], const SkPoint src[], int count)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapPoints_2'>mapPoints(SkPoint pts[], int count)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRadius'>mapRadius</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns mean radius of mapped <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRect'>mapRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of mapped <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRect'>mapRect(SkRect* dst, const SkRect& src)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRect_2'>mapRect(SkRect* rect)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds of mapped <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkRect_Reference#Rect'>Rect</a> to <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVector'>mapVector</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Vector'>Vector</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVector'>mapVector(SkScalar dx, SkScalar dy, SkVector* result)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVector_2'>mapVector(SkScalar dx, SkScalar dy)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVectors'>mapVectors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Vector'>Vector</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVectors'>mapVectors(SkVector dst[], const SkVector src[], int count)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapVectors_2'>mapVectors(SkVector vecs[], int count)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapXY'>mapXY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maps <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapXY'>mapXY(SkScalar x, SkScalar y, SkPoint* result)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_mapXY_2'>mapXY(SkScalar x, SkScalar y)</a> const</td> + </tr> +</table> + + +<a name='SkMatrix_mapPoints'></a> ## mapPoints -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapPoints(SkPoint dst[], const SkPoint src[], int count) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapPoints'>mapPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> src[], int count) const </pre> -Maps <a href="#SkMatrix_mapPoints_src">src</a> <a href="SkPoint_Reference#Point">Point</a> array of length <a href="#SkMatrix_mapPoints_count">count</a> to <a href="#SkMatrix_mapPoints_dst">dst</a> <a href="SkPoint_Reference#Point">Point</a> array of equal or greater -length. <a href="SkPoint_Reference#Point">Points</a> are mapped by multiplying each <a href="SkPoint_Reference#Point">Point</a> by <a href="#Matrix">Matrix</a>. Given: +Maps <a href='#SkMatrix_mapPoints_src'>src</a> <a href='SkPoint_Reference#Point'>Point</a> array of length <a href='#SkMatrix_mapPoints_count'>count</a> to <a href='#SkMatrix_mapPoints_dst'>dst</a> <a href='SkPoint_Reference#Point'>Point</a> array of equal or greater +length. <a href='SkPoint_Reference#Point'>Points</a> are mapped by multiplying each <a href='SkPoint_Reference#Point'>Point</a> by <a href='#Matrix'>Matrix</a>. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | x | @@ -3440,7 +4469,7 @@ for (i = 0; i < count; ++i) { } </pre> -each <a href="#SkMatrix_mapPoints_dst">dst</a> <a href="SkPoint_Reference#Point">Point</a> is computed as: +each <a href='#SkMatrix_mapPoints_dst'>dst</a> <a href='SkPoint_Reference#Point'>Point</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B C| |x| Ax+By+C Dx+Ey+F @@ -3448,16 +4477,18 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , ------- |G H I| |1| Gx+Hy+I Gx+Hy+I </pre> -<a href="#SkMatrix_mapPoints_src">src</a> and <a href="#SkMatrix_mapPoints_dst">dst</a> may point to the same storage. +<a href='#SkMatrix_mapPoints_src'>src</a> and <a href='#SkMatrix_mapPoints_dst'>dst</a> may point to the same storage. ### Parameters -<table> <tr> <td><a name="SkMatrix_mapPoints_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for mapped <a href="SkPoint_Reference#Point">Points</a></td> - </tr> <tr> <td><a name="SkMatrix_mapPoints_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Points</a> to transform</td> - </tr> <tr> <td><a name="SkMatrix_mapPoints_count"> <code><strong>count </strong></code> </a></td> <td> -number of <a href="SkPoint_Reference#Point">Points</a> to transform</td> +<table> <tr> <td><a name='SkMatrix_mapPoints_dst'><code><strong>dst</strong></code></a></td> + <td>storage for mapped <a href='SkPoint_Reference#Point'>Points</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapPoints_src'><code><strong>src</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Points</a> to transform</td> + </tr> + <tr> <td><a name='SkMatrix_mapPoints_count'><code><strong>count</strong></code></a></td> + <td>number of <a href='SkPoint_Reference#Point'>Points</a> to transform</td> </tr> </table> @@ -3467,18 +4498,18 @@ number of <a href="SkPoint_Reference#Point">Points</a> to transform</td> ### See Also -<a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> <a href="#SkMatrix_mapHomogeneousPoints">mapHomogeneousPoints</a> <a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> +<a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a> <a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> --- -<a name="SkMatrix_mapPoints_2"></a> +<a name='SkMatrix_mapPoints_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapPoints(SkPoint pts[], int count) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapPoints'>mapPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count) const </pre> -Maps <a href="#SkMatrix_mapPoints_2_pts">pts</a> <a href="SkPoint_Reference#Point">Point</a> array of length <a href="#SkMatrix_mapPoints_2_count">count</a> in place. <a href="SkPoint_Reference#Point">Points</a> are mapped by multiplying -each <a href="SkPoint_Reference#Point">Point</a> by <a href="#Matrix">Matrix</a>. Given: +Maps <a href='#SkMatrix_mapPoints_2_pts'>pts</a> <a href='SkPoint_Reference#Point'>Point</a> array of length <a href='#SkMatrix_mapPoints_2_count'>count</a> in place. <a href='SkPoint_Reference#Point'>Points</a> are mapped by multiplying +each <a href='SkPoint_Reference#Point'>Point</a> by <a href='#Matrix'>Matrix</a>. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | x | @@ -3495,7 +4526,7 @@ for (i = 0; i < count; ++i) { } </pre> -each resulting <a href="#SkMatrix_mapPoints_2_pts">pts</a> <a href="SkPoint_Reference#Point">Point</a> is computed as: +each resulting <a href='#SkMatrix_mapPoints_2_pts'>pts</a> <a href='SkPoint_Reference#Point'>Point</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B C| |x| Ax+By+C Dx+Ey+F @@ -3505,10 +4536,11 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , ------- ### Parameters -<table> <tr> <td><a name="SkMatrix_mapPoints_2_pts"> <code><strong>pts </strong></code> </a></td> <td> -storage for mapped <a href="SkPoint_Reference#Point">Points</a></td> - </tr> <tr> <td><a name="SkMatrix_mapPoints_2_count"> <code><strong>count </strong></code> </a></td> <td> -number of <a href="SkPoint_Reference#Point">Points</a> to transform</td> +<table> <tr> <td><a name='SkMatrix_mapPoints_2_pts'><code><strong>pts</strong></code></a></td> + <td>storage for mapped <a href='SkPoint_Reference#Point'>Points</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapPoints_2_count'><code><strong>count</strong></code></a></td> + <td>number of <a href='SkPoint_Reference#Point'>Points</a> to transform</td> </tr> </table> @@ -3518,19 +4550,19 @@ number of <a href="SkPoint_Reference#Point">Points</a> to transform</td> ### See Also -<a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> <a href="#SkMatrix_mapHomogeneousPoints">mapHomogeneousPoints</a> <a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> +<a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a> <a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> --- -<a name="SkMatrix_mapHomogeneousPoints"></a> +<a name='SkMatrix_mapHomogeneousPoints'></a> ## mapHomogeneousPoints -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapHomogeneousPoints(SkPoint3 dst[], const SkPoint3 src[], int count) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a>(<a href='undocumented#SkPoint3'>SkPoint3</a> dst[], const <a href='undocumented#SkPoint3'>SkPoint3</a> src[], int count) const </pre> -Maps <a href="#SkMatrix_mapHomogeneousPoints_src">src</a> <a href="undocumented#Point3">Point3</a> array of length <a href="#SkMatrix_mapHomogeneousPoints_count">count</a> to <a href="#SkMatrix_mapHomogeneousPoints_dst">dst</a> <a href="undocumented#Point3">Point3</a> array, which must of length <a href="#SkMatrix_mapHomogeneousPoints_count">count</a> or -greater. <a href="undocumented#Point3">Point3</a> array is mapped by multiplying each <a href="undocumented#Point3">Point3</a> by <a href="#Matrix">Matrix</a>. Given: +Maps <a href='#SkMatrix_mapHomogeneousPoints_src'>src</a> <a href='undocumented#Point3'>Point3</a> array of length <a href='#SkMatrix_mapHomogeneousPoints_count'>count</a> to <a href='#SkMatrix_mapHomogeneousPoints_dst'>dst</a> <a href='undocumented#Point3'>Point3</a> array, which must of length <a href='#SkMatrix_mapHomogeneousPoints_count'>count</a> or +greater. <a href='undocumented#Point3'>Point3</a> array is mapped by multiplying each <a href='undocumented#Point3'>Point3</a> by <a href='#Matrix'>Matrix</a>. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | x | @@ -3538,7 +4570,7 @@ Matrix = | D E F |, src = | y | | G H I | | z | </pre> -each resulting <a href="#SkMatrix_mapHomogeneousPoints_dst">dst</a> <a href="SkPoint_Reference#Point">Point</a> is computed as: +each resulting <a href='#SkMatrix_mapHomogeneousPoints_dst'>dst</a> <a href='SkPoint_Reference#Point'>Point</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B C| |x| @@ -3548,12 +4580,14 @@ Matrix * src = |D E F| |y| = |Ax+By+Cz Dx+Ey+Fz Gx+Hy+Iz| ### Parameters -<table> <tr> <td><a name="SkMatrix_mapHomogeneousPoints_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for mapped <a href="undocumented#Point3">Point3</a> array</td> - </tr> <tr> <td><a name="SkMatrix_mapHomogeneousPoints_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="undocumented#Point3">Point3</a> array to transform</td> - </tr> <tr> <td><a name="SkMatrix_mapHomogeneousPoints_count"> <code><strong>count </strong></code> </a></td> <td> -items in <a href="undocumented#Point3">Point3</a> array to transform</td> +<table> <tr> <td><a name='SkMatrix_mapHomogeneousPoints_dst'><code><strong>dst</strong></code></a></td> + <td>storage for mapped <a href='undocumented#Point3'>Point3</a> array</td> + </tr> + <tr> <td><a name='SkMatrix_mapHomogeneousPoints_src'><code><strong>src</strong></code></a></td> + <td><a href='undocumented#Point3'>Point3</a> array to transform</td> + </tr> + <tr> <td><a name='SkMatrix_mapHomogeneousPoints_count'><code><strong>count</strong></code></a></td> + <td>items in <a href='undocumented#Point3'>Point3</a> array to transform</td> </tr> </table> @@ -3563,18 +4597,18 @@ items in <a href="undocumented#Point3">Point3</a> array to transform</td> ### See Also -<a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> <a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> +<a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> <a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> --- -<a name="SkMatrix_mapXY"></a> +<a name='SkMatrix_mapXY'></a> ## mapXY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapXY(SkScalar x, SkScalar y, SkPoint* result) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapXY'>mapXY</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>* result) const </pre> -Maps <a href="SkPoint_Reference#Point">Point</a> (<a href="#SkMatrix_mapXY_x">x</a>, <a href="#SkMatrix_mapXY_y">y</a>) to <a href="#SkMatrix_mapXY_result">result</a>. <a href="SkPoint_Reference#Point">Point</a> is mapped by multiplying by <a href="#Matrix">Matrix</a>. Given: +Maps <a href='SkPoint_Reference#Point'>Point</a> (<a href='#SkMatrix_mapXY_x'>x</a>, <a href='#SkMatrix_mapXY_y'>y</a>) to <a href='#SkMatrix_mapXY_result'>result</a>. <a href='SkPoint_Reference#Point'>Point</a> is mapped by multiplying by <a href='#Matrix'>Matrix</a>. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | x | @@ -3582,7 +4616,7 @@ Matrix = | D E F |, pt = | y | | G H I | | 1 | </pre> -<a href="#SkMatrix_mapXY_result">result</a> is computed as: +<a href='#SkMatrix_mapXY_result'>result</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B C| |x| Ax+By+C Dx+Ey+F @@ -3592,12 +4626,14 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , ------- ### Parameters -<table> <tr> <td><a name="SkMatrix_mapXY_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="#SkMatrix_mapXY_x">x</a>-coordinate of <a href="SkPoint_Reference#Point">Point</a> to map</td> - </tr> <tr> <td><a name="SkMatrix_mapXY_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="#SkMatrix_mapXY_y">y</a>-coordinate of <a href="SkPoint_Reference#Point">Point</a> to map</td> - </tr> <tr> <td><a name="SkMatrix_mapXY_result"> <code><strong>result </strong></code> </a></td> <td> -storage for mapped <a href="SkPoint_Reference#Point">Point</a></td> +<table> <tr> <td><a name='SkMatrix_mapXY_x'><code><strong>x</strong></code></a></td> + <td><a href='#SkMatrix_mapXY_x'>x</a>-coordinate of <a href='SkPoint_Reference#Point'>Point</a> to map</td> + </tr> + <tr> <td><a name='SkMatrix_mapXY_y'><code><strong>y</strong></code></a></td> + <td><a href='#SkMatrix_mapXY_y'>y</a>-coordinate of <a href='SkPoint_Reference#Point'>Point</a> to map</td> + </tr> + <tr> <td><a name='SkMatrix_mapXY_result'><code><strong>result</strong></code></a></td> + <td>storage for mapped <a href='SkPoint_Reference#Point'>Point</a></td> </tr> </table> @@ -3607,17 +4643,17 @@ storage for mapped <a href="SkPoint_Reference#Point">Point</a></td> ### See Also -<a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> +<a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> --- -<a name="SkMatrix_mapXY_2"></a> +<a name='SkMatrix_mapXY_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPoint mapXY(SkScalar x, SkScalar y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkMatrix_mapXY'>mapXY</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const </pre> -Returns <a href="SkPoint_Reference#Point">Point</a> (<a href="#SkMatrix_mapXY_2_x">x</a>, <a href="#SkMatrix_mapXY_2_y">y</a>) multiplied by <a href="#Matrix">Matrix</a>. Given: +Returns <a href='SkPoint_Reference#Point'>Point</a> (<a href='#SkMatrix_mapXY_2_x'>x</a>, <a href='#SkMatrix_mapXY_2_y'>y</a>) multiplied by <a href='#Matrix'>Matrix</a>. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | x | @@ -3635,16 +4671,17 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , ------- ### Parameters -<table> <tr> <td><a name="SkMatrix_mapXY_2_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="#SkMatrix_mapXY_2_x">x</a>-coordinate of <a href="SkPoint_Reference#Point">Point</a> to map</td> - </tr> <tr> <td><a name="SkMatrix_mapXY_2_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="#SkMatrix_mapXY_2_y">y</a>-coordinate of <a href="SkPoint_Reference#Point">Point</a> to map</td> +<table> <tr> <td><a name='SkMatrix_mapXY_2_x'><code><strong>x</strong></code></a></td> + <td><a href='#SkMatrix_mapXY_2_x'>x</a>-coordinate of <a href='SkPoint_Reference#Point'>Point</a> to map</td> + </tr> + <tr> <td><a name='SkMatrix_mapXY_2_y'><code><strong>y</strong></code></a></td> + <td><a href='#SkMatrix_mapXY_2_y'>y</a>-coordinate of <a href='SkPoint_Reference#Point'>Point</a> to map</td> </tr> </table> ### Return Value -mapped <a href="SkPoint_Reference#Point">Point</a> +mapped <a href='SkPoint_Reference#Point'>Point</a> ### Example @@ -3652,20 +4689,20 @@ mapped <a href="SkPoint_Reference#Point">Point</a> ### See Also -<a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> +<a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> --- -<a name="SkMatrix_mapVectors"></a> +<a name='SkMatrix_mapVectors'></a> ## mapVectors -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapVectors(SkVector dst[], const SkVector src[], int count) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapVectors'>mapVectors</a>(<a href='SkPoint_Reference#SkVector'>SkVector</a> dst[], const <a href='SkPoint_Reference#SkVector'>SkVector</a> src[], int count) const </pre> -Maps <a href="#SkMatrix_mapVectors_src">src</a> <a href="SkPoint_Reference#Vector">Vector</a> array of length <a href="#SkMatrix_mapVectors_count">count</a> to <a href="SkPoint_Reference#Vector">Vector</a> <a href="SkPoint_Reference#Point">Point</a> array of equal or greater -length. <a href="SkPoint_Reference#Vector">Vectors</a> are mapped by multiplying each <a href="SkPoint_Reference#Vector">Vector</a> by <a href="#Matrix">Matrix</a>, treating -<a href="#Matrix">Matrix</a> translation as zero. Given: +Maps <a href='#SkMatrix_mapVectors_src'>src</a> <a href='SkPoint_Reference#Vector'>Vector</a> array of length <a href='#SkMatrix_mapVectors_count'>count</a> to <a href='SkPoint_Reference#Vector'>Vector</a> <a href='SkPoint_Reference#Point'>Point</a> array of equal or greater +length. <a href='SkPoint_Reference#Vector'>Vectors</a> are mapped by multiplying each <a href='SkPoint_Reference#Vector'>Vector</a> by <a href='#Matrix'>Matrix</a>, treating +<a href='#Matrix'>Matrix</a> translation as zero. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B 0 | | x | @@ -3682,7 +4719,7 @@ for (i = 0; i < count; ++i) { } </pre> -each <a href="#SkMatrix_mapVectors_dst">dst</a> <a href="SkPoint_Reference#Vector">Vector</a> is computed as: +each <a href='#SkMatrix_mapVectors_dst'>dst</a> <a href='SkPoint_Reference#Vector'>Vector</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B 0| |x| Ax+By Dx+Ey @@ -3690,16 +4727,18 @@ Matrix * src = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+I| = ------- , ------- |G H I| |1| Gx+Hy+I Gx+Hy+I </pre> -<a href="#SkMatrix_mapVectors_src">src</a> and <a href="#SkMatrix_mapVectors_dst">dst</a> may point to the same storage. +<a href='#SkMatrix_mapVectors_src'>src</a> and <a href='#SkMatrix_mapVectors_dst'>dst</a> may point to the same storage. ### Parameters -<table> <tr> <td><a name="SkMatrix_mapVectors_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for mapped <a href="SkPoint_Reference#Vector">Vectors</a></td> - </tr> <tr> <td><a name="SkMatrix_mapVectors_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Vector">Vectors</a> to transform</td> - </tr> <tr> <td><a name="SkMatrix_mapVectors_count"> <code><strong>count </strong></code> </a></td> <td> -number of <a href="SkPoint_Reference#Vector">Vectors</a> to transform</td> +<table> <tr> <td><a name='SkMatrix_mapVectors_dst'><code><strong>dst</strong></code></a></td> + <td>storage for mapped <a href='SkPoint_Reference#Vector'>Vectors</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapVectors_src'><code><strong>src</strong></code></a></td> + <td><a href='SkPoint_Reference#Vector'>Vectors</a> to transform</td> + </tr> + <tr> <td><a name='SkMatrix_mapVectors_count'><code><strong>count</strong></code></a></td> + <td>number of <a href='SkPoint_Reference#Vector'>Vectors</a> to transform</td> </tr> </table> @@ -3709,18 +4748,18 @@ number of <a href="SkPoint_Reference#Vector">Vectors</a> to transform</td> ### See Also -<a href="#SkMatrix_mapVector">mapVector</a><sup><a href="#SkMatrix_mapVector_2">[2]</a></sup> <a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> +<a href='#SkMatrix_mapVector'>mapVector</a><sup><a href='#SkMatrix_mapVector_2'>[2]</a></sup> <a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> --- -<a name="SkMatrix_mapVectors_2"></a> +<a name='SkMatrix_mapVectors_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapVectors(SkVector vecs[], int count) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapVectors'>mapVectors</a>(<a href='SkPoint_Reference#SkVector'>SkVector</a> vecs[], int count) const </pre> -Maps <a href="#SkMatrix_mapVectors_2_vecs">vecs</a> <a href="SkPoint_Reference#Vector">Vector</a> array of length <a href="#SkMatrix_mapVectors_2_count">count</a> in place, multiplying each <a href="SkPoint_Reference#Vector">Vector</a> by -<a href="#Matrix">Matrix</a>, treating <a href="#Matrix">Matrix</a> translation as zero. Given: +Maps <a href='#SkMatrix_mapVectors_2_vecs'>vecs</a> <a href='SkPoint_Reference#Vector'>Vector</a> array of length <a href='#SkMatrix_mapVectors_2_count'>count</a> in place, multiplying each <a href='SkPoint_Reference#Vector'>Vector</a> by +<a href='#Matrix'>Matrix</a>, treating <a href='#Matrix'>Matrix</a> translation as zero. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B 0 | | x | @@ -3737,7 +4776,7 @@ for (i = 0; i < count; ++i) { } </pre> -each result <a href="SkPoint_Reference#Vector">Vector</a> is computed as: +each result <a href='SkPoint_Reference#Vector'>Vector</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B 0| |x| Ax+By Dx+Ey @@ -3747,10 +4786,11 @@ Matrix * vec = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+I| = ------- , ------- ### Parameters -<table> <tr> <td><a name="SkMatrix_mapVectors_2_vecs"> <code><strong>vecs </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Vector">Vectors</a> to transform, and storage for mapped <a href="SkPoint_Reference#Vector">Vectors</a></td> - </tr> <tr> <td><a name="SkMatrix_mapVectors_2_count"> <code><strong>count </strong></code> </a></td> <td> -number of <a href="SkPoint_Reference#Vector">Vectors</a> to transform</td> +<table> <tr> <td><a name='SkMatrix_mapVectors_2_vecs'><code><strong>vecs</strong></code></a></td> + <td><a href='SkPoint_Reference#Vector'>Vectors</a> to transform, and storage for mapped <a href='SkPoint_Reference#Vector'>Vectors</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapVectors_2_count'><code><strong>count</strong></code></a></td> + <td>number of <a href='SkPoint_Reference#Vector'>Vectors</a> to transform</td> </tr> </table> @@ -3760,19 +4800,19 @@ number of <a href="SkPoint_Reference#Vector">Vectors</a> to transform</td> ### See Also -<a href="#SkMatrix_mapVector">mapVector</a><sup><a href="#SkMatrix_mapVector_2">[2]</a></sup> <a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> +<a href='#SkMatrix_mapVector'>mapVector</a><sup><a href='#SkMatrix_mapVector_2'>[2]</a></sup> <a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> --- -<a name="SkMatrix_mapVector"></a> +<a name='SkMatrix_mapVector'></a> ## mapVector -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapVector(SkScalar dx, SkScalar dy, SkVector* result) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapVector'>mapVector</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='SkPoint_Reference#SkVector'>SkVector</a>* result) const </pre> -Maps <a href="SkPoint_Reference#Vector">Vector</a> (x, y) to <a href="#SkMatrix_mapVector_result">result</a>. <a href="SkPoint_Reference#Vector">Vector</a> is mapped by multiplying by <a href="#Matrix">Matrix</a>, -treating <a href="#Matrix">Matrix</a> translation as zero. Given: +Maps <a href='SkPoint_Reference#Vector'>Vector</a> (x, y) to <a href='#SkMatrix_mapVector_result'>result</a>. <a href='SkPoint_Reference#Vector'>Vector</a> is mapped by multiplying by <a href='#Matrix'>Matrix</a>, +treating <a href='#Matrix'>Matrix</a> translation as zero. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B 0 | | dx | @@ -3780,7 +4820,7 @@ Matrix = | D E 0 |, vec = | dy | | G H I | | 1 | </pre> -each <a href="#SkMatrix_mapVector_result">result</a> <a href="SkPoint_Reference#Vector">Vector</a> is computed as: +each <a href='#SkMatrix_mapVector_result'>result</a> <a href='SkPoint_Reference#Vector'>Vector</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B 0| |dx| A*dx+B*dy D*dx+E*dy @@ -3790,12 +4830,14 @@ Matrix * vec = |D E 0| |dy| = |A*dx+B*dy D*dx+E*dy G*dx+H*dy+I| = ----------- , ### Parameters -<table> <tr> <td><a name="SkMatrix_mapVector_dx"> <code><strong>dx </strong></code> </a></td> <td> -x-coordinate of <a href="SkPoint_Reference#Vector">Vector</a> to map</td> - </tr> <tr> <td><a name="SkMatrix_mapVector_dy"> <code><strong>dy </strong></code> </a></td> <td> -y-coordinate of <a href="SkPoint_Reference#Vector">Vector</a> to map</td> - </tr> <tr> <td><a name="SkMatrix_mapVector_result"> <code><strong>result </strong></code> </a></td> <td> -storage for mapped <a href="SkPoint_Reference#Vector">Vector</a></td> +<table> <tr> <td><a name='SkMatrix_mapVector_dx'><code><strong>dx</strong></code></a></td> + <td>x-coordinate of <a href='SkPoint_Reference#Vector'>Vector</a> to map</td> + </tr> + <tr> <td><a name='SkMatrix_mapVector_dy'><code><strong>dy</strong></code></a></td> + <td>y-coordinate of <a href='SkPoint_Reference#Vector'>Vector</a> to map</td> + </tr> + <tr> <td><a name='SkMatrix_mapVector_result'><code><strong>result</strong></code></a></td> + <td>storage for mapped <a href='SkPoint_Reference#Vector'>Vector</a></td> </tr> </table> @@ -3805,17 +4847,17 @@ storage for mapped <a href="SkPoint_Reference#Vector">Vector</a></td> ### See Also -<a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> <a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> +<a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> <a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> --- -<a name="SkMatrix_mapVector_2"></a> +<a name='SkMatrix_mapVector_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkVector mapVector(SkScalar dx, SkScalar dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkMatrix_mapVector'>mapVector</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const </pre> -Returns <a href="SkPoint_Reference#Vector">Vector</a> (x, y) multiplied by <a href="#Matrix">Matrix</a>, treating <a href="#Matrix">Matrix</a> translation as zero. +Returns <a href='SkPoint_Reference#Vector'>Vector</a> (x, y) multiplied by <a href='#Matrix'>Matrix</a>, treating <a href='#Matrix'>Matrix</a> translation as zero. Given: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> @@ -3824,7 +4866,7 @@ Matrix = | D E 0 |, vec = | dy | | G H I | | 1 | </pre> -each result <a href="SkPoint_Reference#Vector">Vector</a> is computed as: +each result <a href='SkPoint_Reference#Vector'>Vector</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B 0| |dx| A*dx+B*dy D*dx+E*dy @@ -3834,16 +4876,17 @@ Matrix * vec = |D E 0| |dy| = |A*dx+B*dy D*dx+E*dy G*dx+H*dy+I| = ----------- , ### Parameters -<table> <tr> <td><a name="SkMatrix_mapVector_2_dx"> <code><strong>dx </strong></code> </a></td> <td> -x-coordinate of <a href="SkPoint_Reference#Vector">Vector</a> to map</td> - </tr> <tr> <td><a name="SkMatrix_mapVector_2_dy"> <code><strong>dy </strong></code> </a></td> <td> -y-coordinate of <a href="SkPoint_Reference#Vector">Vector</a> to map</td> +<table> <tr> <td><a name='SkMatrix_mapVector_2_dx'><code><strong>dx</strong></code></a></td> + <td>x-coordinate of <a href='SkPoint_Reference#Vector'>Vector</a> to map</td> + </tr> + <tr> <td><a name='SkMatrix_mapVector_2_dy'><code><strong>dy</strong></code></a></td> + <td>y-coordinate of <a href='SkPoint_Reference#Vector'>Vector</a> to map</td> </tr> </table> ### Return Value -mapped <a href="SkPoint_Reference#Vector">Vector</a> +mapped <a href='SkPoint_Reference#Vector'>Vector</a> ### Example @@ -3851,34 +4894,35 @@ mapped <a href="SkPoint_Reference#Vector">Vector</a> ### See Also -<a href="#SkMatrix_mapVectors">mapVectors</a><sup><a href="#SkMatrix_mapVectors_2">[2]</a></sup> <a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_mapXY">mapXY</a><sup><a href="#SkMatrix_mapXY_2">[2]</a></sup> +<a href='#SkMatrix_mapVectors'>mapVectors</a><sup><a href='#SkMatrix_mapVectors_2'>[2]</a></sup> <a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_mapXY'>mapXY</a><sup><a href='#SkMatrix_mapXY_2'>[2]</a></sup> --- -<a name="SkMatrix_mapRect"></a> +<a name='SkMatrix_mapRect'></a> ## mapRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool mapRect(SkRect* dst, const SkRect& src) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_mapRect'>mapRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src) const </pre> -Sets <a href="#SkMatrix_mapRect_dst">dst</a> to bounds of <a href="#SkMatrix_mapRect_src">src</a> corners mapped by <a href="#Matrix">Matrix</a>. -Returns true if mapped corners are <a href="#SkMatrix_mapRect_dst">dst</a> corners. +Sets <a href='#SkMatrix_mapRect_dst'>dst</a> to bounds of <a href='#SkMatrix_mapRect_src'>src</a> corners mapped by <a href='#Matrix'>Matrix</a>. +Returns true if mapped corners are <a href='#SkMatrix_mapRect_dst'>dst</a> corners. -Returned value is the same as calling <a href="#SkMatrix_rectStaysRect">rectStaysRect</a>. +Returned value is the same as calling <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>. ### Parameters -<table> <tr> <td><a name="SkMatrix_mapRect_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for bounds of mapped <a href="SkPoint_Reference#Point">Points</a></td> - </tr> <tr> <td><a name="SkMatrix_mapRect_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map</td> +<table> <tr> <td><a name='SkMatrix_mapRect_dst'><code><strong>dst</strong></code></a></td> + <td>storage for bounds of mapped <a href='SkPoint_Reference#Point'>Points</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapRect_src'><code><strong>src</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map</td> </tr> </table> ### Return Value -true if <a href="#SkMatrix_mapRect_dst">dst</a> is equivalent to mapped <a href="#SkMatrix_mapRect_src">src</a> +true if <a href='#SkMatrix_mapRect_dst'>dst</a> is equivalent to mapped <a href='#SkMatrix_mapRect_src'>src</a> ### Example @@ -3886,25 +4930,25 @@ true if <a href="#SkMatrix_mapRect_dst">dst</a> is equivalent to mapped <a href= ### See Also -<a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> +<a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> --- -<a name="SkMatrix_mapRect_2"></a> +<a name='SkMatrix_mapRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool mapRect(SkRect* rect) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_mapRect'>mapRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* rect) const </pre> -Sets <a href="#SkMatrix_mapRect_2_rect">rect</a> to bounds of <a href="#SkMatrix_mapRect_2_rect">rect</a> corners mapped by <a href="#Matrix">Matrix</a>. -Returns true if mapped corners are computed <a href="#SkMatrix_mapRect_2_rect">rect</a> corners. +Sets <a href='#SkMatrix_mapRect_2_rect'>rect</a> to bounds of <a href='#SkMatrix_mapRect_2_rect'>rect</a> corners mapped by <a href='#Matrix'>Matrix</a>. +Returns true if mapped corners are computed <a href='#SkMatrix_mapRect_2_rect'>rect</a> corners. -Returned value is the same as calling <a href="#SkMatrix_rectStaysRect">rectStaysRect</a>. +Returned value is the same as calling <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>. ### Parameters -<table> <tr> <td><a name="SkMatrix_mapRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td> -rectangle to map, and storage for bounds of mapped corners</td> +<table> <tr> <td><a name='SkMatrix_mapRect_2_rect'><code><strong>rect</strong></code></a></td> + <td>rectangle to map, and storage for bounds of mapped corners</td> </tr> </table> @@ -3918,24 +4962,24 @@ true if result is equivalent to mapped src ### See Also -<a href="#SkMatrix_mapRectScaleTranslate">mapRectScaleTranslate</a> <a href="#SkMatrix_mapPoints">mapPoints</a><sup><a href="#SkMatrix_mapPoints_2">[2]</a></sup> <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> +<a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a> <a href='#SkMatrix_mapPoints'>mapPoints</a><sup><a href='#SkMatrix_mapPoints_2'>[2]</a></sup> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> --- -<a name="SkMatrix_mapRectToQuad"></a> +<a name='SkMatrix_mapRectToQuad'></a> ## mapRectToQuad -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[4], const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect) const </pre> -Maps four corners of <a href="#SkMatrix_mapRectToQuad_rect">rect</a> to <a href="#SkMatrix_mapRectToQuad_dst">dst</a>. <a href="SkPoint_Reference#Point">Points</a> are mapped by multiplying each -<a href="#SkMatrix_mapRectToQuad_rect">rect</a> corner by <a href="#Matrix">Matrix</a>. <a href="#SkMatrix_mapRectToQuad_rect">rect</a> corner is processed in this order: -(<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fLeft, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fTop), (<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fRight, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fTop), (<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fRight, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fBottom), -(<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fLeft, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fBottom). +Maps four corners of <a href='#SkMatrix_mapRectToQuad_rect'>rect</a> to <a href='#SkMatrix_mapRectToQuad_dst'>dst</a>. <a href='SkPoint_Reference#Point'>Points</a> are mapped by multiplying each +<a href='#SkMatrix_mapRectToQuad_rect'>rect</a> corner by <a href='#Matrix'>Matrix</a>. <a href='#SkMatrix_mapRectToQuad_rect'>rect</a> corner is processed in this order: +(<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fLeft, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fTop), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fRight, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fTop), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fRight, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fBottom), +(<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fLeft, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fBottom). -<a href="#SkMatrix_mapRectToQuad_rect">rect</a> may be empty: <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fLeft may be greater than or equal to <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fRight; -<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fTop may be greater than or equal to <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fBottom. +<a href='#SkMatrix_mapRectToQuad_rect'>rect</a> may be empty: <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fLeft may be greater than or equal to <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fRight; +<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fTop may be greater than or equal to <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fBottom. Given: @@ -3945,9 +4989,9 @@ Matrix = | D E F |, pt = | y | | G H I | | 1 | </pre> -where pt is initialized from each of (<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fLeft, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fTop), -(<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fRight, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fTop), (<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fRight, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fBottom), (<a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fLeft, <a href="#SkMatrix_mapRectToQuad_rect">rect</a>.fBottom), -each <a href="#SkMatrix_mapRectToQuad_dst">dst</a> <a href="SkPoint_Reference#Point">Point</a> is computed as: +where pt is initialized from each of (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fLeft, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fTop), +(<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fRight, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fTop), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fRight, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fBottom), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fLeft, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.fBottom), +each <a href='#SkMatrix_mapRectToQuad_dst'>dst</a> <a href='SkPoint_Reference#Point'>Point</a> is computed as: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> |A B C| |x| Ax+By+C Dx+Ey+F @@ -3957,10 +5001,11 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , ------- ### Parameters -<table> <tr> <td><a name="SkMatrix_mapRectToQuad_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for mapped corner <a href="SkPoint_Reference#Point">Points</a></td> - </tr> <tr> <td><a name="SkMatrix_mapRectToQuad_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map</td> +<table> <tr> <td><a name='SkMatrix_mapRectToQuad_dst'><code><strong>dst</strong></code></a></td> + <td>storage for mapped corner <a href='SkPoint_Reference#Point'>Points</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapRectToQuad_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map</td> </tr> </table> @@ -3970,27 +5015,28 @@ storage for mapped corner <a href="SkPoint_Reference#Point">Points</a></td> ### See Also -<a href="#SkMatrix_mapRect">mapRect</a><sup><a href="#SkMatrix_mapRect_2">[2]</a></sup> <a href="#SkMatrix_mapRectScaleTranslate">mapRectScaleTranslate</a> +<a href='#SkMatrix_mapRect'>mapRect</a><sup><a href='#SkMatrix_mapRect_2'>[2]</a></sup> <a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a> --- -<a name="SkMatrix_mapRectScaleTranslate"></a> +<a name='SkMatrix_mapRectScaleTranslate'></a> ## mapRectScaleTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void mapRectScaleTranslate(SkRect* dst, const SkRect& src) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src) const </pre> -Sets <a href="#SkMatrix_mapRectScaleTranslate_dst">dst</a> to bounds of <a href="#SkMatrix_mapRectScaleTranslate_src">src</a> corners mapped by <a href="#Matrix">Matrix</a>. If matrix contains +Sets <a href='#SkMatrix_mapRectScaleTranslate_dst'>dst</a> to bounds of <a href='#SkMatrix_mapRectScaleTranslate_src'>src</a> corners mapped by <a href='#Matrix'>Matrix</a>. If matrix contains elements other than scale or translate: asserts if SK_DEBUG is defined; otherwise, results are undefined. ### Parameters -<table> <tr> <td><a name="SkMatrix_mapRectScaleTranslate_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for bounds of mapped <a href="SkPoint_Reference#Point">Points</a></td> - </tr> <tr> <td><a name="SkMatrix_mapRectScaleTranslate_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to map</td> +<table> <tr> <td><a name='SkMatrix_mapRectScaleTranslate_dst'><code><strong>dst</strong></code></a></td> + <td>storage for bounds of mapped <a href='SkPoint_Reference#Point'>Points</a></td> + </tr> + <tr> <td><a name='SkMatrix_mapRectScaleTranslate_src'><code><strong>src</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to map</td> </tr> </table> @@ -4000,32 +5046,32 @@ storage for bounds of mapped <a href="SkPoint_Reference#Point">Points</a></td> ### See Also -<a href="#SkMatrix_mapRect">mapRect</a><sup><a href="#SkMatrix_mapRect_2">[2]</a></sup> <a href="#SkMatrix_mapRectToQuad">mapRectToQuad</a> <a href="#SkMatrix_isScaleTranslate">isScaleTranslate</a> <a href="#SkMatrix_rectStaysRect">rectStaysRect</a> +<a href='#SkMatrix_mapRect'>mapRect</a><sup><a href='#SkMatrix_mapRect_2'>[2]</a></sup> <a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a> <a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> --- -<a name="SkMatrix_mapRadius"></a> +<a name='SkMatrix_mapRadius'></a> ## mapRadius -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar mapRadius(SkScalar radius) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_mapRadius'>mapRadius</a>(<a href='undocumented#SkScalar'>SkScalar</a> radius) const </pre> -Returns geometric mean <a href="#SkMatrix_mapRadius_radius">radius</a> of ellipse formed by constructing <a href="undocumented#Circle">Circle</a> of -size <a href="#SkMatrix_mapRadius_radius">radius</a>, and mapping constructed <a href="undocumented#Circle">Circle</a> with <a href="#Matrix">Matrix</a>. The result squared is +Returns geometric mean <a href='#SkMatrix_mapRadius_radius'>radius</a> of ellipse formed by constructing <a href='undocumented#Circle'>Circle</a> of +size <a href='#SkMatrix_mapRadius_radius'>radius</a>, and mapping constructed <a href='undocumented#Circle'>Circle</a> with <a href='#Matrix'>Matrix</a>. The result squared is equal to the major axis length times the minor axis length. -Result is not meaningful if <a href="#Matrix">Matrix</a> contains perspective elements. +Result is not meaningful if <a href='#Matrix'>Matrix</a> contains perspective elements. ### Parameters -<table> <tr> <td><a name="SkMatrix_mapRadius_radius"> <code><strong>radius </strong></code> </a></td> <td> -<a href="undocumented#Circle">Circle</a> size to map</td> +<table> <tr> <td><a name='SkMatrix_mapRadius_radius'><code><strong>radius</strong></code></a></td> + <td><a href='undocumented#Circle'>Circle</a> size to map</td> </tr> </table> ### Return Value -average mapped <a href="#SkMatrix_mapRadius_radius">radius</a> +average mapped <a href='#SkMatrix_mapRadius_radius'>radius</a> ### Example @@ -4035,27 +5081,27 @@ the area enclosed by the ellipse major and minor axes. ### See Also -<a href="#SkMatrix_mapVector">mapVector</a><sup><a href="#SkMatrix_mapVector_2">[2]</a></sup> +<a href='#SkMatrix_mapVector'>mapVector</a><sup><a href='#SkMatrix_mapVector_2'>[2]</a></sup> --- -<a name="SkMatrix_isFixedStepInX"></a> +<a name='SkMatrix_isFixedStepInX'></a> ## isFixedStepInX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isFixedStepInX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a>() const </pre> -Returns true if a unit step in x at some y mapped through <a href="#Matrix">Matrix</a> can be -represented by a constant <a href="SkPoint_Reference#Vector">Vector</a>. Returns true if <a href="#SkMatrix_getType">getType</a> returns <a href="#SkMatrix_kIdentity_Mask">kIdentity Mask</a>, -or combinations of: <a href="#SkMatrix_kTranslate_Mask">kTranslate Mask</a>, <a href="#SkMatrix_kScale_Mask">kScale Mask</a>, and <a href="#SkMatrix_kAffine_Mask">kAffine Mask</a>. +Returns true if a unit step in x at some y mapped through <a href='#Matrix'>Matrix</a> can be +represented by a constant <a href='SkPoint_Reference#Vector'>Vector</a>. Returns true if <a href='#SkMatrix_getType'>getType</a> returns <a href='#SkMatrix_kIdentity_Mask'>kIdentity Mask</a>, +or combinations of: <a href='#SkMatrix_kTranslate_Mask'>kTranslate Mask</a>, <a href='#SkMatrix_kScale_Mask'>kScale Mask</a>, and <a href='#SkMatrix_kAffine_Mask'>kAffine Mask</a>. -May return true if <a href="#SkMatrix_getType">getType</a> returns <a href="#SkMatrix_kPerspective_Mask">kPerspective Mask</a>, but only when <a href="#Matrix">Matrix</a> +May return true if <a href='#SkMatrix_getType'>getType</a> returns <a href='#SkMatrix_kPerspective_Mask'>kPerspective Mask</a>, but only when <a href='#Matrix'>Matrix</a> does not include rotation or skewing along the y-axis. ### Return Value -true if <a href="#Matrix">Matrix</a> does not have complex perspective +true if <a href='#Matrix'>Matrix</a> does not have complex perspective ### Example @@ -4086,30 +5132,30 @@ isFixedStepInX: false ### See Also -<a href="#SkMatrix_fixedStepInX">fixedStepInX</a> <a href="#SkMatrix_getType">getType</a> +<a href='#SkMatrix_fixedStepInX'>fixedStepInX</a> <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_fixedStepInX"></a> +<a name='SkMatrix_fixedStepInX'></a> ## fixedStepInX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkVector fixedStepInX(SkScalar y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkMatrix_fixedStepInX'>fixedStepInX</a>(<a href='undocumented#SkScalar'>SkScalar</a> y) const </pre> -Returns <a href="SkPoint_Reference#Vector">Vector</a> representing a unit step in x at <a href="#SkMatrix_fixedStepInX_y">y</a> mapped through <a href="#Matrix">Matrix</a>. -If <a href="#SkMatrix_isFixedStepInX">isFixedStepInX</a> is false, returned value is undefined. +Returns <a href='SkPoint_Reference#Vector'>Vector</a> representing a unit step in x at <a href='#SkMatrix_fixedStepInX_y'>y</a> mapped through <a href='#Matrix'>Matrix</a>. +If <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a> is false, returned value is undefined. ### Parameters -<table> <tr> <td><a name="SkMatrix_fixedStepInX_y"> <code><strong>y </strong></code> </a></td> <td> -position of line parallel to x-axis</td> +<table> <tr> <td><a name='SkMatrix_fixedStepInX_y'><code><strong>y</strong></code></a></td> + <td>position of line parallel to x-axis</td> </tr> </table> ### Return Value -<a href="SkPoint_Reference#Vector">Vector</a> advance of mapped unit step in x +<a href='SkPoint_Reference#Vector'>Vector</a> advance of mapped unit step in x ### Example @@ -4117,37 +5163,37 @@ position of line parallel to x-axis</td> ### See Also -<a href="#SkMatrix_isFixedStepInX">isFixedStepInX</a> <a href="#SkMatrix_getType">getType</a> +<a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a> <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_cheapEqualTo"></a> +<a name='SkMatrix_cheapEqualTo'></a> ## cheapEqualTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool cheapEqualTo(const SkMatrix& m) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a>(const <a href='#SkMatrix'>SkMatrix</a>& m) const </pre> -Returns true if <a href="#Matrix">Matrix</a> equals <a href="#SkMatrix_cheapEqualTo_m">m</a>, using an efficient comparison. +Returns true if <a href='#Matrix'>Matrix</a> equals <a href='#SkMatrix_cheapEqualTo_m'>m</a>, using an efficient comparison. Returns false when the sign of zero values is the different; when one matrix has positive zero value and the other has negative zero value. -Returns true even when both <a href="#Matrix">Matrices</a> contain NaN. +Returns true even when both <a href='#Matrix'>Matrices</a> contain NaN. NaN never equals any value, including itself. To improve performance, NaN values are treated as bit patterns that are equal if their bit patterns are equal. ### Parameters -<table> <tr> <td><a name="SkMatrix_cheapEqualTo_m"> <code><strong>m </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to compare</td> +<table> <tr> <td><a name='SkMatrix_cheapEqualTo_m'><code><strong>m</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#SkMatrix_cheapEqualTo_m">m</a> and <a href="#Matrix">Matrix</a> are represented by identical bit patterns +true if <a href='#SkMatrix_cheapEqualTo_m'>m</a> and <a href='#Matrix'>Matrix</a> are represented by identical bit patterns ### Example @@ -4166,33 +5212,34 @@ both NaN: a != b a.cheapEqualTo(b): true ### See Also -<a href="#SkMatrix_equal_operator">operator==(const SkMatrix& a, const SkMatrix& b)</a> +<a href='#SkMatrix_equal_operator'>operator==(const SkMatrix& a, const SkMatrix& b)</a> --- -<a name="SkMatrix_equal_operator"></a> +<a name='SkMatrix_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkMatrix& a, const SkMatrix& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_equal_operator'>operator==(const SkMatrix& a, const SkMatrix& b)</a> </pre> -Compares <a href="#SkMatrix_equal_operator_a">a</a> and <a href="#SkMatrix_equal_operator_b">b</a>; returns true if <a href="#SkMatrix_equal_operator_a">a</a> and <a href="#SkMatrix_equal_operator_b">b</a> are numerically equal. Returns true -even if sign of zero values are different. Returns false if either <a href="#Matrix">Matrix</a> -contains NaN, even if the other <a href="#Matrix">Matrix</a> also contains NaN. +Compares <a href='#SkMatrix_equal_operator_a'>a</a> and <a href='#SkMatrix_equal_operator_b'>b</a>; returns true if <a href='#SkMatrix_equal_operator_a'>a</a> and <a href='#SkMatrix_equal_operator_b'>b</a> are numerically equal. Returns true +even if sign of zero values are different. Returns false if either <a href='#Matrix'>Matrix</a> +contains NaN, even if the other <a href='#Matrix'>Matrix</a> also contains NaN. ### Parameters -<table> <tr> <td><a name="SkMatrix_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to compare</td> - </tr> <tr> <td><a name="SkMatrix_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to compare</td> +<table> <tr> <td><a name='SkMatrix_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to compare</td> + </tr> + <tr> <td><a name='SkMatrix_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> <a href="#SkMatrix_equal_operator_a">a</a> and <a href="#Matrix">Matrix</a> <a href="#SkMatrix_equal_operator_b">b</a> are numerically equal +true if <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_equal_operator_a'>a</a> and <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_equal_operator_b'>b</a> are numerically equal ### Example @@ -4208,33 +5255,34 @@ identity: a == b a.cheapEqualTo(b): true ### See Also -<a href="#SkMatrix_cheapEqualTo">cheapEqualTo</a> <a href="#SkMatrix_notequal_operator">operator!=(const SkMatrix& a, const SkMatrix& b)</a> +<a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a> <a href='#SkMatrix_notequal_operator'>operator!=(const SkMatrix& a, const SkMatrix& b)</a> --- -<a name="SkMatrix_notequal_operator"></a> +<a name='SkMatrix_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkMatrix& a, const SkMatrix& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_notequal_operator'>operator!=(const SkMatrix& a, const SkMatrix& b)</a> </pre> -Compares <a href="#SkMatrix_notequal_operator_a">a</a> and <a href="#SkMatrix_notequal_operator_b">b</a>; returns true if <a href="#SkMatrix_notequal_operator_a">a</a> and <a href="#SkMatrix_notequal_operator_b">b</a> are not numerically equal. Returns false -even if sign of zero values are different. Returns true if either <a href="#Matrix">Matrix</a> -contains NaN, even if the other <a href="#Matrix">Matrix</a> also contains NaN. +Compares <a href='#SkMatrix_notequal_operator_a'>a</a> and <a href='#SkMatrix_notequal_operator_b'>b</a>; returns true if <a href='#SkMatrix_notequal_operator_a'>a</a> and <a href='#SkMatrix_notequal_operator_b'>b</a> are not numerically equal. Returns false +even if sign of zero values are different. Returns true if either <a href='#Matrix'>Matrix</a> +contains NaN, even if the other <a href='#Matrix'>Matrix</a> also contains NaN. ### Parameters -<table> <tr> <td><a name="SkMatrix_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to compare</td> - </tr> <tr> <td><a name="SkMatrix_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> to compare</td> +<table> <tr> <td><a name='SkMatrix_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to compare</td> + </tr> + <tr> <td><a name='SkMatrix_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Matrix">Matrix</a> <a href="#SkMatrix_notequal_operator_a">a</a> and <a href="#Matrix">Matrix</a> <a href="#SkMatrix_notequal_operator_b">b</a> are numerically not equal +true if <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_notequal_operator_a'>a</a> and <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_notequal_operator_b'>b</a> are numerically not equal ### Example @@ -4242,28 +5290,41 @@ true if <a href="#Matrix">Matrix</a> <a href="#SkMatrix_notequal_operator_a">a</ ### See Also -<a href="#SkMatrix_cheapEqualTo">cheapEqualTo</a> <a href="#SkMatrix_equal_operator">operator==(const SkMatrix& a, const SkMatrix& b)</a> +<a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a> <a href='#SkMatrix_equal_operator'>operator==(const SkMatrix& a, const SkMatrix& b)</a> --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> -| name | description | -| --- | --- | -| <a href="#SkMatrix_dirtyMatrixTypeCache">dirtyMatrixTypeCache</a> | sets internal cache to unknown state | -| <a href="#SkMatrix_dump">dump</a> | sends text representation using floats to standard output | -| <a href="#SkMatrix_toString">toString</a> | converts <a href="#Matrix">Matrix</a> to machine readable form | -<a name="SkMatrix_dump"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets internal cache to unknown state</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_dump'>dump</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkMatrix_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Matrix'>Matrix</a> to machine readable form</td> + </tr> +</table> + + +<a name='SkMatrix_dump'></a> ## dump -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_dump'>dump</a>() const </pre> -Writes text representation of <a href="#Matrix">Matrix</a> to standard output. Floating point values +Writes text representation of <a href='#Matrix'>Matrix</a> to standard output. Floating point values are written with limited precision; it may not be possible to reconstruct -original <a href="#Matrix">Matrix</a> from output. +original <a href='#Matrix'>Matrix</a> from output. ### Example @@ -4281,25 +5342,25 @@ matrix != nearlyEqual ### See Also -<a href="#SkMatrix_toString">toString</a> +<a href='#SkMatrix_toString'>toString</a> --- -<a name="SkMatrix_toString"></a> +<a name='SkMatrix_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_toString'>toString</a>(<a href='undocumented#SkString'>SkString</a>* str) const </pre> -Creates string representation of <a href="#Matrix">Matrix</a>. Floating point values +Creates string representation of <a href='#Matrix'>Matrix</a>. Floating point values are written with limited precision; it may not be possible to reconstruct -original <a href="#Matrix">Matrix</a> from output. +original <a href='#Matrix'>Matrix</a> from output. ### Parameters -<table> <tr> <td><a name="SkMatrix_toString_str"> <code><strong>str </strong></code> </a></td> <td> -storage for string representation of <a href="#Matrix">Matrix</a></td> +<table> <tr> <td><a name='SkMatrix_toString_str'><code><strong>str</strong></code></a></td> + <td>storage for string representation of <a href='#Matrix'>Matrix</a></td> </tr> </table> @@ -4319,20 +5380,20 @@ matrix != nearlyEqual ### See Also -<a href="#SkMatrix_dump">dump</a> +<a href='#SkMatrix_dump'>dump</a> --- -<a name="SkMatrix_getMinScale"></a> +<a name='SkMatrix_getMinScale'></a> ## getMinScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getMinScale() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getMinScale'>getMinScale</a>() const </pre> -Returns the minimum scaling factor of <a href="#Matrix">Matrix</a> by decomposing the scaling and +Returns the minimum scaling factor of <a href='#Matrix'>Matrix</a> by decomposing the scaling and skewing elements. -Returns -1 if scale factor overflows or <a href="#Matrix">Matrix</a> contains perspective. +Returns -1 if scale factor overflows or <a href='#Matrix'>Matrix</a> contains perspective. ### Return Value @@ -4352,20 +5413,20 @@ matrix.getMinScale() 24 ### See Also -<a href="#SkMatrix_getMaxScale">getMaxScale</a> <a href="#SkMatrix_getMinMaxScales">getMinMaxScales</a> +<a href='#SkMatrix_getMaxScale'>getMaxScale</a> <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a> --- -<a name="SkMatrix_getMaxScale"></a> +<a name='SkMatrix_getMaxScale'></a> ## getMaxScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getMaxScale() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getMaxScale'>getMaxScale</a>() const </pre> -Returns the maximum scaling factor of <a href="#Matrix">Matrix</a> by decomposing the scaling and +Returns the maximum scaling factor of <a href='#Matrix'>Matrix</a> by decomposing the scaling and skewing elements. -Returns -1 if scale factor overflows or <a href="#Matrix">Matrix</a> contains perspective. +Returns -1 if scale factor overflows or <a href='#Matrix'>Matrix</a> contains perspective. ### Return Value @@ -4385,28 +5446,28 @@ matrix.getMaxScale() 42 ### See Also -<a href="#SkMatrix_getMinScale">getMinScale</a> <a href="#SkMatrix_getMinMaxScales">getMinMaxScales</a> +<a href='#SkMatrix_getMinScale'>getMinScale</a> <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a> --- -<a name="SkMatrix_getMinMaxScales"></a> +<a name='SkMatrix_getMinMaxScales'></a> ## getMinMaxScales -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT getMinMaxScales(SkScalar scaleFactors[2]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleFactors[2]) const </pre> -Sets <a href="#SkMatrix_getMinMaxScales_scaleFactors">scaleFactors</a>[0] to the minimum scaling factor, and <a href="#SkMatrix_getMinMaxScales_scaleFactors">scaleFactors</a>[1] to the +Sets <a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a>[0] to the minimum scaling factor, and <a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a>[1] to the maximum scaling factor. Scaling factors are computed by decomposing -the <a href="#Matrix">Matrix</a> scaling and skewing elements. +the <a href='#Matrix'>Matrix</a> scaling and skewing elements. -Returns true if <a href="#SkMatrix_getMinMaxScales_scaleFactors">scaleFactors</a> are found; otherwise, returns false and sets -<a href="#SkMatrix_getMinMaxScales_scaleFactors">scaleFactors</a> to undefined values. +Returns true if <a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a> are found; otherwise, returns false and sets +<a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a> to undefined values. ### Parameters -<table> <tr> <td><a name="SkMatrix_getMinMaxScales_scaleFactors"> <code><strong>scaleFactors </strong></code> </a></td> <td> -storage for minimum and maximum scale factors</td> +<table> <tr> <td><a name='SkMatrix_getMinMaxScales_scaleFactors'><code><strong>scaleFactors</strong></code></a></td> + <td>storage for minimum and maximum scale factors</td> </tr> </table> @@ -4428,42 +5489,43 @@ matrix.getMinMaxScales() false 2 2 ### See Also -<a href="#SkMatrix_getMinScale">getMinScale</a> <a href="#SkMatrix_getMaxScale">getMaxScale</a> +<a href='#SkMatrix_getMinScale'>getMinScale</a> <a href='#SkMatrix_getMaxScale'>getMaxScale</a> --- -<a name="SkMatrix_decomposeScale"></a> +<a name='SkMatrix_decomposeScale'></a> ## decomposeScale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool decomposeScale(SkSize* scale, SkMatrix* remaining = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_decomposeScale'>decomposeScale</a>(<a href='undocumented#SkSize'>SkSize</a>* scale, <a href='#SkMatrix'>SkMatrix</a>* remaining = nullptr) const </pre> -Decomposes <a href="#Matrix">Matrix</a> into <a href="#SkMatrix_decomposeScale_scale">scale</a> components and whatever remains. Returns false if -<a href="#Matrix">Matrix</a> could not be decomposed. +Decomposes <a href='#Matrix'>Matrix</a> into <a href='#SkMatrix_decomposeScale_scale'>scale</a> components and whatever remains. Returns false if +<a href='#Matrix'>Matrix</a> could not be decomposed. -Sets <a href="#SkMatrix_decomposeScale_scale">scale</a> to portion of <a href="#Matrix">Matrix</a> that scales in x and y. Sets <a href="#SkMatrix_decomposeScale_remaining">remaining</a> to <a href="#Matrix">Matrix</a> -with x and y scaling factored out. <a href="#SkMatrix_decomposeScale_remaining">remaining</a> may be passed as nullptr -to determine if <a href="#Matrix">Matrix</a> can be decomposed without computing remainder. +Sets <a href='#SkMatrix_decomposeScale_scale'>scale</a> to portion of <a href='#Matrix'>Matrix</a> that scales in x and y. Sets <a href='#SkMatrix_decomposeScale_remaining'>remaining</a> to <a href='#Matrix'>Matrix</a> +with x and y scaling factored out. <a href='#SkMatrix_decomposeScale_remaining'>remaining</a> may be passed as nullptr +to determine if <a href='#Matrix'>Matrix</a> can be decomposed without computing remainder. -Returns true if <a href="#SkMatrix_decomposeScale_scale">scale</a> components are found. <a href="#SkMatrix_decomposeScale_scale">scale</a> and <a href="#SkMatrix_decomposeScale_remaining">remaining</a> are -unchanged if <a href="#Matrix">Matrix</a> contains perspective; <a href="#SkMatrix_decomposeScale_scale">scale</a> factors are not finite, or +Returns true if <a href='#SkMatrix_decomposeScale_scale'>scale</a> components are found. <a href='#SkMatrix_decomposeScale_scale'>scale</a> and <a href='#SkMatrix_decomposeScale_remaining'>remaining</a> are +unchanged if <a href='#Matrix'>Matrix</a> contains perspective; <a href='#SkMatrix_decomposeScale_scale'>scale</a> factors are not finite, or are nearly zero. -On success<a href="#Matrix">Matrix</a> = <a href="#SkMatrix_decomposeScale_scale">scale</a> * Remaining +On success<a href='#Matrix'>Matrix</a> = <a href='#SkMatrix_decomposeScale_scale'>scale</a> * Remaining ### Parameters -<table> <tr> <td><a name="SkMatrix_decomposeScale_scale"> <code><strong>scale </strong></code> </a></td> <td> -x and y scaling factors; may be nullptr</td> - </tr> <tr> <td><a name="SkMatrix_decomposeScale_remaining"> <code><strong>remaining </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> without scaling; may be nullptr</td> +<table> <tr> <td><a name='SkMatrix_decomposeScale_scale'><code><strong>scale</strong></code></a></td> + <td>x and y scaling factors; may be nullptr</td> + </tr> + <tr> <td><a name='SkMatrix_decomposeScale_remaining'><code><strong>remaining</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> without scaling; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#SkMatrix_decomposeScale_scale">scale</a> can be computed +true if <a href='#SkMatrix_decomposeScale_scale'>scale</a> can be computed ### Example @@ -4482,18 +5544,18 @@ success: true scale: 0.5, 0.25 ### See Also -<a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_MakeScale">MakeScale</a><sup><a href="#SkMatrix_MakeScale_2">[2]</a></sup> +<a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_MakeScale'>MakeScale</a><sup><a href='#SkMatrix_MakeScale_2'>[2]</a></sup> --- -<a name="SkMatrix_I"></a> +<a name='SkMatrix_I'></a> ## I -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static const SkMatrix& I() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static const <a href='#SkMatrix'>SkMatrix</a>& I() </pre> -Returns reference to const identity <a href="#Matrix">Matrix</a>. Returned <a href="#Matrix">Matrix</a> is set to: +Returns reference to const identity <a href='#Matrix'>Matrix</a>. Returned <a href='#Matrix'>Matrix</a> is set to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | 1 0 0 | @@ -4503,7 +5565,7 @@ Returns reference to const identity <a href="#Matrix">Matrix</a>. Returned <a hr ### Return Value -const identity <a href="#Matrix">Matrix</a> +const identity <a href='#Matrix'>Matrix</a> ### Example @@ -4520,18 +5582,18 @@ m2 == m3 ### See Also -<a href="#SkMatrix_reset">reset</a> <a href="#SkMatrix_setIdentity">setIdentity</a> +<a href='#SkMatrix_reset'>reset</a> <a href='#SkMatrix_setIdentity'>setIdentity</a> --- -<a name="SkMatrix_InvalidMatrix"></a> +<a name='SkMatrix_InvalidMatrix'></a> ## InvalidMatrix -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static const SkMatrix& InvalidMatrix() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static const <a href='#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_InvalidMatrix'>InvalidMatrix</a>() </pre> -Returns reference to a const <a href="#Matrix">Matrix</a> with invalid values. Returned <a href="#Matrix">Matrix</a> is set +Returns reference to a const <a href='#Matrix'>Matrix</a> with invalid values. Returned <a href='#Matrix'>Matrix</a> is set to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> @@ -4542,7 +5604,7 @@ to: ### Return Value -const invalid <a href="#Matrix">Matrix</a> +const invalid <a href='#Matrix'>Matrix</a> ### Example @@ -4558,18 +5620,18 @@ scaleX 3.40282e+38 ### See Also -SeeAlso <a href="#SkMatrix_getType">getType</a> +SeeAlso <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_Concat"></a> +<a name='SkMatrix_Concat'></a> ## Concat -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkMatrix Concat(const SkMatrix& a, const SkMatrix& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_Concat'>Concat</a>(const <a href='#SkMatrix'>SkMatrix</a>& a, const <a href='#SkMatrix'>SkMatrix</a>& b) </pre> -Returns <a href="#Matrix">Matrix</a> <a href="#SkMatrix_Concat_a">a</a> multiplied by <a href="#Matrix">Matrix</a> <a href="#SkMatrix_Concat_b">b</a>. +Returns <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_Concat_a'>a</a> multiplied by <a href='#Matrix'>Matrix</a> <a href='#SkMatrix_Concat_b'>b</a>. Given: @@ -4579,7 +5641,7 @@ a = | D E F |, b = | M N O | | G H I | | P Q R | </pre> -sets <a href="#Matrix">Matrix</a> to: +sets <a href='#Matrix'>Matrix</a> to: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | A B C | | J K L | | AJ+BM+CP AK+BN+CQ AL+BO+CR | @@ -4589,38 +5651,39 @@ a * b = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR | ### Parameters -<table> <tr> <td><a name="SkMatrix_Concat_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> on left side of multiply expression</td> - </tr> <tr> <td><a name="SkMatrix_Concat_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Matrix">Matrix</a> on right side of multiply expression</td> +<table> <tr> <td><a name='SkMatrix_Concat_a'><code><strong>a</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> on left side of multiply expression</td> + </tr> + <tr> <td><a name='SkMatrix_Concat_b'><code><strong>b</strong></code></a></td> + <td><a href='#Matrix'>Matrix</a> on right side of multiply expression</td> </tr> </table> ### Return Value -<a href="#Matrix">Matrix</a> computed from <a href="#SkMatrix_Concat_a">a</a> times <a href="#SkMatrix_Concat_b">b</a> +<a href='#Matrix'>Matrix</a> computed from <a href='#SkMatrix_Concat_a'>a</a> times <a href='#SkMatrix_Concat_b'>b</a> ### Example -<div><fiddle-embed name="6b4562c7052da94f3d5b2412dca41946"><div><a href="#SkMatrix_setPolyToPoly">setPolyToPoly</a> creates perspective matrices, one the inverse of the other. +<div><fiddle-embed name="6b4562c7052da94f3d5b2412dca41946"><div><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> creates perspective matrices, one the inverse of the other. Multiplying the matrix by its inverse turns into an identity matrix. </div></fiddle-embed></div> ### See Also -<a href="#SkMatrix_preConcat">preConcat</a> <a href="#SkMatrix_postConcat">postConcat</a> +<a href='#SkMatrix_preConcat'>preConcat</a> <a href='#SkMatrix_postConcat'>postConcat</a> --- -<a name="SkMatrix_dirtyMatrixTypeCache"></a> +<a name='SkMatrix_dirtyMatrixTypeCache'></a> ## dirtyMatrixTypeCache -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dirtyMatrixTypeCache() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a>() </pre> Sets internal cache to unknown state. Use to force update after repeated -modifications to <a href="#Matrix">Matrix</a> element reference returned by <a href="#SkMatrix_array1_operator">operator[](int index)</a>. +modifications to <a href='#Matrix'>Matrix</a> element reference returned by <a href='#SkMatrix_array1_operator'>operator[](int index)</a>. ### Example @@ -4639,18 +5702,18 @@ after dirty cache: x = 66 ### See Also -<a href="#SkMatrix_array1_operator">operator[](int index)</a> <a href="#SkMatrix_getType">getType</a> +<a href='#SkMatrix_array1_operator'>operator[](int index)</a> <a href='#SkMatrix_getType'>getType</a> --- -<a name="SkMatrix_setScaleTranslate"></a> +<a name='SkMatrix_setScaleTranslate'></a> ## setScaleTranslate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMatrix_setScaleTranslate'>setScaleTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> tx, <a href='undocumented#SkScalar'>SkScalar</a> ty) </pre> -Initializes <a href="#Matrix">Matrix</a> with scale and translate elements. +Initializes <a href='#Matrix'>Matrix</a> with scale and translate elements. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> | sx 0 tx | @@ -4660,14 +5723,17 @@ Initializes <a href="#Matrix">Matrix</a> with scale and translate elements. ### Parameters -<table> <tr> <td><a name="SkMatrix_setScaleTranslate_sx"> <code><strong>sx </strong></code> </a></td> <td> -horizontal scale factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setScaleTranslate_sy"> <code><strong>sy </strong></code> </a></td> <td> -vertical scale factor to store</td> - </tr> <tr> <td><a name="SkMatrix_setScaleTranslate_tx"> <code><strong>tx </strong></code> </a></td> <td> -horizontal translation to store</td> - </tr> <tr> <td><a name="SkMatrix_setScaleTranslate_ty"> <code><strong>ty </strong></code> </a></td> <td> -vertical translation to store</td> +<table> <tr> <td><a name='SkMatrix_setScaleTranslate_sx'><code><strong>sx</strong></code></a></td> + <td>horizontal scale factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setScaleTranslate_sy'><code><strong>sy</strong></code></a></td> + <td>vertical scale factor to store</td> + </tr> + <tr> <td><a name='SkMatrix_setScaleTranslate_tx'><code><strong>tx</strong></code></a></td> + <td>horizontal translation to store</td> + </tr> + <tr> <td><a name='SkMatrix_setScaleTranslate_ty'><code><strong>ty</strong></code></a></td> + <td>vertical translation to store</td> </tr> </table> @@ -4685,15 +5751,15 @@ vertical translation to store</td> ### See Also -<a href="#SkMatrix_setScale">setScale</a><sup><a href="#SkMatrix_setScale_2">[2]</a></sup> <a href="#SkMatrix_preTranslate">preTranslate</a> <a href="#SkMatrix_postTranslate">postTranslate</a> +<a href='#SkMatrix_setScale'>setScale</a><sup><a href='#SkMatrix_setScale_2'>[2]</a></sup> <a href='#SkMatrix_preTranslate'>preTranslate</a> <a href='#SkMatrix_postTranslate'>postTranslate</a> --- -<a name="SkMatrix_isFinite"></a> +<a name='SkMatrix_isFinite'></a> ## isFinite -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isFinite() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkMatrix_isFinite'>isFinite</a>() const </pre> Returns true if all elements of the matrix are finite. Returns false if any diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index dddba108c8..122a4d2b2a 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -1,283 +1,964 @@ SkPaint Reference === -# <a name="Paint"></a> Paint +# <a name='Paint'>Paint</a> -## <a name="Overview"></a> Overview - -## <a name="Overview_Subtopic"></a> Overview Subtopic - -| name | description | -| --- | --- | -| <a href="#Class_or_Struct">Class or Struct</a> | embedded struct and class members | -| <a href="#Constant">Constant</a> | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkPaint">SkPaint</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | - -# <a name="SkPaint"></a> Class SkPaint -<a href="#Paint">Paint</a> controls options applied when drawing and measuring. <a href="#Paint">Paint</a> collects all -options outside of the <a href="SkCanvas_Reference#Clip">Canvas Clip</a> and <a href="SkCanvas_Reference#Matrix">Canvas Matrix</a>. +# <a name='SkPaint'>Class SkPaint</a> +<a href='#Paint'>Paint</a> controls options applied when drawing and measuring. <a href='#Paint'>Paint</a> collects all +options outside of the <a href='SkCanvas_Reference#Clip'>Canvas Clip</a> and <a href='SkCanvas_Reference#Matrix'>Canvas Matrix</a>. Various options apply to text, strokes and fills, and images. Some options may not be implemented on all platforms; in these cases, setting -the option has no effect. Some options are conveniences that duplicate <a href="SkCanvas_Reference#Canvas">Canvas</a> +the option has no effect. Some options are conveniences that duplicate <a href='SkCanvas_Reference#Canvas'>Canvas</a> functionality; for instance, text size is identical to matrix scale. -<a href="#Paint">Paint</a> options are rarely exclusive; each option modifies a stage of the drawing -pipeline and multiple pipeline stages may be affected by a single <a href="#Paint">Paint</a>. +<a href='#Paint'>Paint</a> options are rarely exclusive; each option modifies a stage of the drawing +pipeline and multiple pipeline stages may be affected by a single <a href='#Paint'>Paint</a>. -<a href="#Paint">Paint</a> collects effects and filters that describe single-pass and multiple-pass +<a href='#Paint'>Paint</a> collects effects and filters that describe single-pass and multiple-pass algorithms that alter the drawing geometry, color, and transparency. For instance, -<a href="#Paint">Paint</a> does not directly implement dashing or blur, but contains the objects that do so. +<a href='#Paint'>Paint</a> does not directly implement dashing or blur, but contains the objects that do so. -The objects contained by <a href="#Paint">Paint</a> are opaque, and cannot be edited outside of the <a href="#Paint">Paint</a> +The objects contained by <a href='#Paint'>Paint</a> are opaque, and cannot be edited outside of the <a href='#Paint'>Paint</a> to affect it. The implementation is free to defer computations associated with the -<a href="#Paint">Paint</a>, or ignore them altogether. For instance, some GPU implementations draw all -<a href="SkPath_Reference#Path">Path</a> geometries with Anti-aliasing, regardless of how <a href="#SkPaint_kAntiAlias_Flag">SkPaint::kAntiAlias Flag</a> -is set in <a href="#Paint">Paint</a>. +<a href='#Paint'>Paint</a>, or ignore them altogether. For instance, some GPU implementations draw all +<a href='SkPath_Reference#Path'>Path</a> geometries with Anti-aliasing, regardless of how <a href='#SkPaint_kAntiAlias_Flag'>SkPaint::kAntiAlias Flag</a> +is set in <a href='#Paint'>Paint</a>. -<a href="#Paint">Paint</a> describes a single color, a single font, a single image quality, and so on. +<a href='#Paint'>Paint</a> 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 -<a href="undocumented#Shader">Shader</a> attached to <a href="#Paint">Paint</a>. +<a href='undocumented#Shader'>Shader</a> attached to <a href='#Paint'>Paint</a>. -## <a name="Related_Function"></a> Related Function +## Overview -| name | description | -| --- | --- | -| <a href="#Alpha_Methods">Alpha Methods</a> | get and set <a href="SkColor_Reference#Alpha">Alpha</a> | -| Anti-alias | approximating coverage with transparency | -| <a href="#Automatic_Hinting">Automatic Hinting</a> | always adjust glyph paths | -| <a href="#Blend_Mode_Methods">Blend Mode Methods</a> | get and set <a href="undocumented#Blend_Mode">Blend Mode</a> | -| <a href="#Color_Filter_Methods">Color Filter Methods</a> | get and set <a href="undocumented#Color_Filter">Color Filter</a> | -| <a href="#Color_Methods">Color Methods</a> | get and set <a href="SkColor_Reference#Color">Color</a> | -| <a href="#Device_Text">Device Text</a> | increase precision of glyph position | -| <a href="#Dither">Dither</a> | distributing color error | -| <a href="#Draw_Looper_Methods">Draw Looper Methods</a> | get and set <a href="undocumented#Draw_Looper">Draw Looper</a> | -| <a href="#Fake_Bold">Fake Bold</a> | approximate font styles | -| <a href="#Fast_Bounds">Fast Bounds</a> | approximate area required by <a href="#Paint">Paint</a> | -| <a href="#Fill_Path">Fill Path</a> | make <a href="SkPath_Reference#Path">Path</a> from <a href="undocumented#Path_Effect">Path Effect</a>, stroking | -| <a href="#Filter_Quality_Methods">Filter Quality Methods</a> | get and set <a href="undocumented#Filter_Quality">Filter Quality</a> | -| <a href="#SkPaint_Flags">Flags</a> | attributes represented by single bits | -| <a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | custom sized bitmap <a href="undocumented#Glyph">Glyphs</a> | -| <a href="#Font_Metrics">Font Metrics</a> | common glyph dimensions | -| <a href="#Full_Hinting_Spacing">Full Hinting Spacing</a> | glyph spacing affected by hinting | -| <a href="#SkPaint_Hinting">Hinting</a> | glyph outline adjustment | -| <a href="#Image_Filter_Methods">Image Filter Methods</a> | get and set <a href="undocumented#Image_Filter">Image Filter</a> | -| <a href="#Initializers">Initializers</a> | constructors and initialization | -| <a href="#LCD_Text">LCD Text</a> | text relying on the order of <a href="SkColor_Reference#RGB">Color RGB</a> stripes | -| <a href="#Linear_Text">Linear Text</a> | selects text rendering as <a href="undocumented#Glyph">Glyph</a> or <a href="SkPath_Reference#Path">Path</a> | -| <a href="#Management">Management</a> | paint copying, moving, comparing | -| <a href="#Mask_Filter_Methods">Mask Filter Methods</a> | get and set <a href="undocumented#Mask_Filter">Mask Filter</a> | -| <a href="#Measure_Text">Measure Text</a> | width, height, bounds of text | -| <a href="#Miter_Limit">Miter Limit</a> | maximum length of stroked corners | -| <a href="#Path_Effect_Methods">Path Effect Methods</a> | get and set <a href="undocumented#Path_Effect">Path Effect</a> | -| <a href="#Shader_Methods">Shader Methods</a> | get and set <a href="undocumented#Shader">Shader</a> | -| <a href="#Stroke_Cap">Stroke Cap</a> | decorations at ends of open strokes | -| <a href="#Stroke_Join">Stroke Join</a> | decoration at corners of strokes | -| <a href="#Stroke_Width">Stroke Width</a> | thickness perpendicular to geometry | -| <a href="#SkPaint_Style">Style</a> | geometry filling, stroking | -| <a href="#Style_Fill">Style Fill</a> | fill and stroke | -| <a href="#Style_Hairline">Style Hairline</a> | lines and curves with minimal width | -| <a href="#Style_Stroke">Style Stroke</a> | lines and curves with width | -| <a href="#Subpixel_Text">Subpixel Text</a> | uses pixel transparency to represent fractional offset | -| <a href="#Text_Align">Text Align</a> | text placement relative to position | -| <a href="#Text_Encoding">Text Encoding</a> | text encoded as characters or <a href="undocumented#Glyph">Glyphs</a> | -| <a href="#Text_Intercepts">Text Intercepts</a> | advanced underline, strike through | -| <a href="#Text_Path">Text Path</a> | geometry of <a href="undocumented#Glyph">Glyphs</a> | -| <a href="#Text_Scale_X">Text Scale X</a> | text horizontal scale | -| <a href="#Text_Size">Text Size</a> | overall height in points | -| <a href="#Text_Skew_X">Text Skew X</a> | text horizontal slant | -| <a href="#Typeface_Methods">Typeface Methods</a> | get and set <a href="undocumented#Typeface">Typeface</a> | -| <a href="#Utility">Utility</a> | rarely called management functions | -| <a href="#Vertical_Text">Vertical Text</a> | orient text from top to bottom | - -## <a name="Constant"></a> Constant +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkPaint'>SkPaint</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Struct'>Struct Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded struct members</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkPaint_Align">Align</a> | glyph locations relative to text position | -| <a href="#SkPaint_Cap">Cap</a> | start and end geometry on stroked shapes | -| <a href="#SkPaint_Flags">Flags</a> | values described by bits and masks | -| <a href="#SkPaint_Hinting">Hinting</a> | level of glyph outline adjustment | -| <a href="#SkPaint_Join">Join</a> | corner geometry on stroked shapes | -| <a href="#SkPaint_Style">Style</a> | stroke, fill, or both | -| <a href="#SkPaint_TextEncoding">TextEncoding</a> | character or glyph encoded size | -## <a name="Class_or_Struct"></a> Class or Struct +## <a name='Related_Function'>Related Function</a> -| name | description | -| --- | --- | -| <a href="#SkPaint_FontMetrics">FontMetrics</a> | values computed by <a href="undocumented#Font_Manager">Font Manager</a> using <a href="undocumented#Typeface">Typeface</a> | -## <a name="Constructor"></a> Constructor +SkPaint global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Alpha_Methods'>Alpha Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='SkColor_Reference#Alpha'>Alpha</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Anti-alias</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>approximating coverage with transparency</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Automatic_Hinting'>Automatic Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>always adjust glyph paths</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Blend_Mode_Methods'>Blend Mode Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Blend_Mode'>Blend Mode</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Filter_Methods'>Color Filter Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Color_Filter'>Color Filter</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Color_Methods'>Color Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Device_Text'>Device Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>increase precision of glyph position</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Dither'>Dither</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>distributing color error</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Draw_Looper_Methods'>Draw Looper Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Draw_Looper'>Draw Looper</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Fake_Bold'>Fake Bold</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>approximate font styles</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Fast_Bounds'>Fast Bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>approximate area required by <a href='#Paint'>Paint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Fill_Path'>Fill Path</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>make <a href='SkPath_Reference#Path'>Path</a> from <a href='undocumented#Path_Effect'>Path Effect</a>, stroking</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Filter_Quality_Methods'>Filter Quality Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Filter_Quality'>Filter Quality</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Flags'>Flags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>attributes represented by single bits</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>custom sized bitmap <a href='undocumented#Glyph'>Glyphs</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Font_Metrics'>Font Metrics</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>common glyph dimensions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Full_Hinting_Spacing'>Full Hinting Spacing</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>glyph spacing affected by hinting</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Hinting'>Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>glyph outline adjustment</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Image_Filter_Methods'>Image Filter Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Image_Filter'>Image Filter</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Initializers'>Initializers</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructors and initialization</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#LCD_Text'>LCD Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>text relying on the order of <a href='SkColor_Reference#RGB'>Color RGB</a> stripes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Linear_Text'>Linear Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>selects text rendering as <a href='undocumented#Glyph'>Glyph</a> or <a href='SkPath_Reference#Path'>Path</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Management'>Management</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>paint copying, moving, comparing</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Mask_Filter_Methods'>Mask Filter Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Mask_Filter'>Mask Filter</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Measure_Text'>Measure Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>width, height, bounds of text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Miter_Limit'>Miter Limit</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maximum length of stroked corners</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Path_Effect_Methods'>Path Effect Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Path_Effect'>Path Effect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Shader_Methods'>Shader Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Shader'>Shader</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Stroke_Cap'>Stroke Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>decorations at ends of open strokes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Stroke_Join'>Stroke Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>decoration at corners of strokes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Stroke_Width'>Stroke Width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>thickness perpendicular to geometry</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Style'>Style</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>geometry filling, stroking</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Style_Fill'>Style Fill</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fill and stroke</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Style_Hairline'>Style Hairline</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>lines and curves with minimal width</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Style_Stroke'>Style Stroke</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>lines and curves with width</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Subpixel_Text'>Subpixel Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses pixel transparency to represent fractional offset</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Align'>Text Align</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>text placement relative to position</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Encoding'>Text Encoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>text encoded as characters or <a href='undocumented#Glyph'>Glyphs</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Intercepts'>Text Intercepts</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>advanced underline, strike through</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Path'>Text Path</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>geometry of <a href='undocumented#Glyph'>Glyphs</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Scale_X'>Text Scale X</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>text horizontal scale</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Size'>Text Size</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>overall height in points</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Text_Skew_X'>Text Skew X</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>text horizontal slant</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Typeface_Methods'>Typeface Methods</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>get and set <a href='undocumented#Typeface'>Typeface</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Vertical_Text'>Vertical Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orient text from top to bottom</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkPaint_empty_constructor">SkPaint()</a> | constructs with default values | -| <a href="#SkPaint_move_SkPaint">SkPaint(SkPaint&& paint)</a> | moves paint without copying it | -| <a href="#SkPaint_copy_const_SkPaint">SkPaint(const SkPaint& paint)</a> | makes a shallow copy | -| <a href="#SkPaint_destructor">~SkPaint()</a> | decreases <a href="undocumented#Reference_Count">Reference Count</a> of owned objects | -## <a name="Operator"></a> Operator +## <a name='Constant'>Constant</a> -| name | description | -| --- | --- | -| <a href="#SkPaint_notequal_operator">operator!=(const SkPaint& a, const SkPaint& b)</a> | compares paints for inequality | -| <a href="#SkPaint_move_operator">operator=(SkPaint&& paint)</a> | moves paint without copying it | -| <a href="#SkPaint_copy_operator">operator=(const SkPaint& paint)</a> | makes a shallow copy | -| <a href="#SkPaint_equal_operator">operator==(const SkPaint& a, const SkPaint& b)</a> | compares paints for equality | -## <a name="Member_Function"></a> Member Function +SkPaint related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Align'>Align</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>glyph locations relative to text position</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Cap'>Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>start and end geometry on stroked shapes</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Flags'>Flags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>values described by bits and masks</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Hinting'>Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>level of glyph outline adjustment</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Join'>Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>corner geometry on stroked shapes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_Style'>Style</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>stroke, fill, or both</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_TextEncoding'>TextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>character or glyph encoded size</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kAlignCount'>kAlignCount</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>number of different <a href='#Text_Align'>Text Align</a> values defined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kAllFlags'>kAllFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask of all <a href='#SkPaint_Flags'>Flags</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting Anti-alias</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Automatic_Hinting'>Automatic Hinting</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kBevel_Join'>kBevel Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>connects outside edges</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kButt_Cap'>kButt Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>no stroke extension</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kCapCount'>kCapCount</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>number of different <a href='#Stroke_Cap'>Stroke Cap</a> values defined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kCenter_Align'>kCenter Align</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>centers line of glyphs by its width or height</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kDefault_Cap'>kDefault Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>equivalent to <a href='#SkPaint_kButt_Cap'>kButt Cap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kDefault_Join'>kDefault Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>equivalent to <a href='#SkPaint_kMiter_Join'>kMiter Join</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kDither_Flag'>kDither Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Dither'>Dither</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Fake_Bold'>Fake Bold</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kFill_Style'>kFill Style</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>set to fill geometry</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kFull_Hinting'>kFull Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>modifies glyph outlines for maxiumum constrast</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kGlyphID_TextEncoding'>kGlyphID TextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses two byte words to represent glyph indices</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kJoinCount'>kJoinCount</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>number of different <a href='#Stroke_Join'>Stroke Join</a> values defined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#LCD_Text'>LCD Text</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kLast_Cap'>kLast Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>largest <a href='#Stroke_Cap'>Stroke Cap</a> value</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kLast_Join'>kLast Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>equivalent to the largest value for <a href='#Stroke_Join'>Stroke Join</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kLeft_Align'>kLeft Align</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>positions glyph by computed font offset</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Linear_Text'>Linear Text</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kMiter_Join'>kMiter Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>extends to <a href='#Miter_Limit'>Miter Limit</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kNo_Hinting'>kNo Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>glyph outlines unchanged</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>glyph outlines modified to improve constrast</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kRight_Align'>kRight Align</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves lines of glyphs by its width or height</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kRound_Cap'>kRound Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds circle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kRound_Join'>kRound Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds circle</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>minimal modification to improve constrast</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kSquare_Cap'>kSquare Cap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds square</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to stroke and fill geometry</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kStroke_Style'>kStroke Style</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>set to stroke geometry</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kStyleCount'>kStyleCount</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>number of different <a href='#SkPaint_Style'>Style</a> values defined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Subpixel_Text'>Subpixel Text</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kUTF16_TextEncoding'>kUTF16 TextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses two byte words to represent most of Unicode</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kUTF32_TextEncoding'>kUTF32 TextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses four byte words to represent all of Unicode</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uses bytes to represent UTF-8 or ASCII</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>mask for setting <a href='#Vertical_Text'>Vertical Text</a></td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkPaint_breakText">breakText</a> | returns text that fits in a width | -| <a href="#SkPaint_canComputeFastBounds">canComputeFastBounds</a> | returns true if settings allow for fast bounds computation | -| <a href="#SkPaint_computeFastBounds">computeFastBounds</a> | returns fill bounds for quick reject tests | -| <a href="#SkPaint_computeFastStrokeBounds">computeFastStrokeBounds</a> | returns stroke bounds for quick reject tests | -| <a href="#SkPaint_containsText">containsText</a> | returns if all text corresponds to <a href="undocumented#Glyph">Glyphs</a> | -| <a href="#SkPaint_countText">countText</a> | returns number of <a href="undocumented#Glyph">Glyphs</a> in text | -| <a href="#SkPaint_doComputeFastBounds">doComputeFastBounds</a> | returns bounds for quick reject tests | -| <a href="#SkPaint_getAlpha">getAlpha</a> | returns <a href="SkColor_Reference#Alpha">Color Alpha</a>, color opacity | -| <a href="#SkPaint_getBlendMode">getBlendMode</a> | returns <a href="undocumented#Blend_Mode">Blend Mode</a>, how colors combine with <a href="undocumented#Device">Device</a> | -| <a href="#SkPaint_getColor">getColor</a> | returns <a href="SkColor_Reference#Alpha">Color Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a>, one drawing color | -| <a href="#SkPaint_getColorFilter">getColorFilter</a> | returns <a href="undocumented#Color_Filter">Color Filter</a>, how colors are altered | -| <a href="#SkPaint_getDrawLooper">getDrawLooper</a> | returns <a href="undocumented#Draw_Looper">Draw Looper</a>, multiple layers | -| <a href="#SkPaint_getFillPath">getFillPath</a> | returns fill path equivalent to stroke | -| <a href="#SkPaint_getFilterQuality">getFilterQuality</a> | returns <a href="undocumented#Filter_Quality">Filter Quality</a>, image filtering level | -| <a href="#SkPaint_getFlags">getFlags</a> | returns <a href="#SkPaint_Flags">Flags</a> stored in a bit field | -| <a href="#SkPaint_getFontBounds">getFontBounds</a> | returns union all glyph bounds | -| <a href="#SkPaint_getFontMetrics">getFontMetrics</a> | returns <a href="undocumented#Typeface">Typeface</a> metrics scaled by text size | -| <a href="#SkPaint_getFontSpacing">getFontSpacing</a> | returns recommended spacing between lines | -| <a href="#SkPaint_getHash">getHash</a> | returns a shallow hash for equality checks | -| <a href="#SkPaint_getHinting">getHinting</a> | returns <a href="#SkPaint_Hinting">Hinting</a>, glyph outline adjustment level | -| <a href="#SkPaint_getImageFilter">getImageFilter</a> | returns <a href="undocumented#Image_Filter">Image Filter</a>, alter pixels; blur | -| <a href="#SkPaint_getMaskFilter">getMaskFilter</a> | returns <a href="undocumented#Mask_Filter">Mask Filter</a>, alterations to <a href="undocumented#Mask_Alpha">Mask Alpha</a> | -| <a href="#SkPaint_getPathEffect">getPathEffect</a> | returns <a href="undocumented#Path_Effect">Path Effect</a>, modifications to path geometry; dashing | -| <a href="#SkPaint_getPosTextHIntercepts">getPosTextHIntercepts</a> | returns where lines intersect horizontally positioned text; underlines | -| <a href="#SkPaint_getPosTextIntercepts">getPosTextIntercepts</a> | returns where lines intersect positioned text; underlines | -| <a href="#SkPaint_getPosTextPath">getPosTextPath</a> | returns <a href="SkPath_Reference#Path">Path</a> equivalent to positioned text | -| <a href="#SkPaint_getShader">getShader</a> | returns <a href="undocumented#Shader">Shader</a>, multiple drawing colors; gradients | -| <a href="#SkPaint_getStrokeCap">getStrokeCap</a> | returns <a href="#SkPaint_Cap">Cap</a>, the area drawn at path ends | -| <a href="#SkPaint_getStrokeJoin">getStrokeJoin</a> | returns <a href="#SkPaint_Join">Join</a>, geometry on path corners | -| <a href="#SkPaint_getStrokeMiter">getStrokeMiter</a> | returns <a href="#Miter_Limit">Miter Limit</a>, angles with sharp corners | -| <a href="#SkPaint_getStrokeWidth">getStrokeWidth</a> | returns thickness of the stroke | -| <a href="#SkPaint_getStyle">getStyle</a> | returns <a href="#SkPaint_Style">Style</a>: stroke, fill, or both | -| <a href="#SkPaint_getTextAlign">getTextAlign</a> | returns <a href="#SkPaint_Align">Align</a>: left, center, or right | -| <a href="#SkPaint_getTextBlobIntercepts">getTextBlobIntercepts</a> | returns where lines intersect <a href="undocumented#Text_Blob">Text Blob</a>; underlines | -| <a href="#SkPaint_getTextEncoding">getTextEncoding</a> | returns character or glyph encoded size | -| <a href="#SkPaint_getTextIntercepts">getTextIntercepts</a> | returns where lines intersect text; underlines | -| <a href="#SkPaint_getTextPath">getTextPath</a> | returns <a href="SkPath_Reference#Path">Path</a> equivalent to text | -| <a href="#SkPaint_getTextScaleX">getTextScaleX</a> | returns the text horizontal scale; condensed text | -| <a href="#SkPaint_getTextSize">getTextSize</a> | returns text size in points | -| <a href="#SkPaint_getTextSkewX">getTextSkewX</a> | returns the text horizontal skew; oblique text | -| <a href="#SkPaint_getTextWidths">getTextWidths</a> | returns advance and bounds for each glyph in text | -| <a href="#SkPaint_getTypeface">getTypeface</a> | returns <a href="undocumented#Typeface">Typeface</a>, font description | -| <a href="#SkPaint_glyphsToUnichars">glyphsToUnichars</a> | converts <a href="undocumented#Glyph">Glyphs</a> into text | -| <a href="#SkPaint_isAntiAlias">isAntiAlias</a> | returns true if Anti-alias is set | -| <a href="#SkPaint_isAutohinted">isAutohinted</a> | returns true if <a href="undocumented#Glyph">Glyphs</a> are always hinted | -| <a href="#SkPaint_isDither">isDither</a> | returns true if <a href="#Dither">Dither</a> is set | -| <a href="#SkPaint_isEmbeddedBitmapText">isEmbeddedBitmapText</a> | returns true if <a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> is set | -| <a href="#SkPaint_isFakeBoldText">isFakeBoldText</a> | returns true if <a href="#Fake_Bold">Fake Bold</a> is set | -| <a href="#SkPaint_isLCDRenderText">isLCDRenderText</a> | returns true if <a href="#LCD_Text">LCD Text</a> is set | -| <a href="#SkPaint_isLinearText">isLinearText</a> | returns true if text is converted to <a href="SkPath_Reference#Path">Path</a> | -| <a href="#SkPaint_isSrcOver">isSrcOver</a> | returns true if <a href="undocumented#Blend_Mode">Blend Mode</a> is <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a> | -| <a href="#SkPaint_isSubpixelText">isSubpixelText</a> | returns true if <a href="#Subpixel_Text">Subpixel Text</a> is set | -| <a href="#SkPaint_isVerticalText">isVerticalText</a> | returns true if <a href="#Vertical_Text">Vertical Text</a> is set | -| <a href="#SkPaint_measureText">measureText</a> | returns advance width and bounds of text | -| <a href="#SkPaint_nothingToDraw">nothingToDraw</a> | returns true if <a href="#Paint">Paint</a> prevents all drawing | -| <a href="#SkPaint_refColorFilter">refColorFilter</a> | references <a href="undocumented#Color_Filter">Color Filter</a>, how colors are altered | -| <a href="#SkPaint_refDrawLooper">refDrawLooper</a> | references <a href="undocumented#Draw_Looper">Draw Looper</a>, multiple layers | -| <a href="#SkPaint_refImageFilter">refImageFilter</a> | references <a href="undocumented#Image_Filter">Image Filter</a>, alter pixels; blur | -| <a href="#SkPaint_refMaskFilter">refMaskFilter</a> | references <a href="undocumented#Mask_Filter">Mask Filter</a>, alterations to <a href="undocumented#Mask_Alpha">Mask Alpha</a> | -| <a href="#SkPaint_refPathEffect">refPathEffect</a> | references <a href="undocumented#Path_Effect">Path Effect</a>, modifications to path geometry; dashing | -| <a href="#SkPaint_refShader">refShader</a> | references <a href="undocumented#Shader">Shader</a>, multiple drawing colors; gradients | -| <a href="#SkPaint_refTypeface">refTypeface</a> | references <a href="undocumented#Typeface">Typeface</a>, font description | -| <a href="#SkPaint_reset">reset</a> | sets to default values | -| <a href="#SkPaint_setARGB">setARGB</a> | sets color by component | -| <a href="#SkPaint_setAlpha">setAlpha</a> | sets <a href="SkColor_Reference#Alpha">Color Alpha</a>, color opacity | -| <a href="#SkPaint_setAntiAlias">setAntiAlias</a> | sets or clears Anti-alias | -| <a href="#SkPaint_setAutohinted">setAutohinted</a> | sets <a href="undocumented#Glyph">Glyphs</a> to always be hinted | -| <a href="#SkPaint_setBlendMode">setBlendMode</a> | sets <a href="undocumented#Blend_Mode">Blend Mode</a>, how colors combine with destination | -| <a href="#SkPaint_setColor">setColor</a> | sets <a href="SkColor_Reference#Alpha">Color Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a>, one drawing color | -| <a href="#SkPaint_setColorFilter">setColorFilter</a> | sets <a href="undocumented#Color_Filter">Color Filter</a>, alters color | -| <a href="#SkPaint_setDither">setDither</a> | sets or clears <a href="#Dither">Dither</a> | -| <a href="#SkPaint_setDrawLooper">setDrawLooper</a> | sets <a href="undocumented#Draw_Looper">Draw Looper</a>, multiple layers | -| <a href="#SkPaint_setEmbeddedBitmapText">setEmbeddedBitmapText</a> | sets or clears <a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | -| <a href="#SkPaint_setFakeBoldText">setFakeBoldText</a> | sets or clears <a href="#Fake_Bold">Fake Bold</a> | -| <a href="#SkPaint_setFilterQuality">setFilterQuality</a> | sets <a href="undocumented#Filter_Quality">Filter Quality</a>, the image filtering level | -| <a href="#SkPaint_setFlags">setFlags</a> | sets multiple <a href="#SkPaint_Flags">Flags</a> in a bit field | -| <a href="#SkPaint_setHinting">setHinting</a> | sets <a href="#SkPaint_Hinting">Hinting</a>, glyph outline adjustment level | -| <a href="#SkPaint_setImageFilter">setImageFilter</a> | sets <a href="undocumented#Image_Filter">Image Filter</a>, alter pixels; blur | -| <a href="#SkPaint_setLCDRenderText">setLCDRenderText</a> | sets or clears <a href="#LCD_Text">LCD Text</a> | -| <a href="#SkPaint_setLinearText">setLinearText</a> | converts to <a href="SkPath_Reference#Path">Path</a> before draw or measure | -| <a href="#SkPaint_setMaskFilter">setMaskFilter</a> | sets <a href="undocumented#Mask_Filter">Mask Filter</a>, alterations to <a href="undocumented#Mask_Alpha">Mask Alpha</a> | -| <a href="#SkPaint_setPathEffect">setPathEffect</a> | sets <a href="undocumented#Path_Effect">Path Effect</a>, modifications to path geometry; dashing | -| <a href="#SkPaint_setShader">setShader</a> | sets <a href="undocumented#Shader">Shader</a>, multiple drawing colors; gradients | -| <a href="#SkPaint_setStrokeCap">setStrokeCap</a> | sets <a href="#SkPaint_Cap">Cap</a>, the area drawn at path ends | -| <a href="#SkPaint_setStrokeJoin">setStrokeJoin</a> | sets <a href="#SkPaint_Join">Join</a>, geometry on path corners | -| <a href="#SkPaint_setStrokeMiter">setStrokeMiter</a> | sets <a href="#Miter_Limit">Miter Limit</a>, angles with sharp corners | -| <a href="#SkPaint_setStrokeWidth">setStrokeWidth</a> | sets thickness of the stroke | -| <a href="#SkPaint_setStyle">setStyle</a> | sets <a href="#SkPaint_Style">Style</a>: stroke, fill, or both | -| <a href="#SkPaint_setSubpixelText">setSubpixelText</a> | sets or clears <a href="#Subpixel_Text">Subpixel Text</a> | -| <a href="#SkPaint_setTextAlign">setTextAlign</a> | sets <a href="#SkPaint_Align">Align</a>: left, center, or right | -| <a href="#SkPaint_setTextEncoding">setTextEncoding</a> | sets character or glyph encoded size | -| <a href="#SkPaint_setTextScaleX">setTextScaleX</a> | sets the text horizontal scale; condensed text | -| <a href="#SkPaint_setTextSize">setTextSize</a> | sets text size in points | -| <a href="#SkPaint_setTextSkewX">setTextSkewX</a> | sets the text horizontal skew; oblique text | -| <a href="#SkPaint_setTypeface">setTypeface</a> | sets <a href="undocumented#Typeface">Typeface</a>, font description | -| <a href="#SkPaint_setVerticalText">setVerticalText</a> | sets or clears <a href="#Vertical_Text">Vertical Text</a> | -| <a href="#SkPaint_textToGlyphs">textToGlyphs</a> | converts text into glyph indices | -| <a href="#SkPaint_toString">toString</a> | converts <a href="#Paint">Paint</a> to machine readable form | - -## <a name="Initializers"></a> Initializers - -<a name="SkPaint_empty_constructor"></a> + +## <a name='Struct'>Struct</a> + + +SkPaint uses C++ structs to declare the public data structures and interfaces. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics'>FontMetrics</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>values computed by <a href='undocumented#Font_Manager'>Font Manager</a> using <a href='undocumented#Typeface'>Typeface</a></td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkPaint can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_empty_constructor'>SkPaint()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_move_SkPaint'>SkPaint(SkPaint&& paint)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves paint without copying it</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_copy_const_SkPaint'>SkPaint(const SkPaint& paint)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_destructor'>~SkPaint()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>decreases <a href='undocumented#Reference_Count'>Reference Count</a> of owned objects</td> + </tr> +</table> + + +## <a name='Operator'>Operator</a> + + +SkPaint operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_notequal_operator'>operator!=(const SkPaint& a, const SkPaint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares paints for inequality</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_move_operator'>operator=(SkPaint&& paint)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves paint without copying it</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_copy_operator'>operator=(const SkPaint& paint)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_equal_operator'>operator==(const SkPaint& a, const SkPaint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares paints for equality</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkPaint member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_breakText'>breakText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns text that fits in a width</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_canComputeFastBounds'>canComputeFastBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if settings allow for fast bounds computation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_computeFastBounds'>computeFastBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns fill bounds for quick reject tests</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_computeFastStrokeBounds'>computeFastStrokeBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns stroke bounds for quick reject tests</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_containsText'>containsText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if all text corresponds to <a href='undocumented#Glyph'>Glyphs</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_countText'>countText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of <a href='undocumented#Glyph'>Glyphs</a> in text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_doComputeFastBounds'>doComputeFastBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds for quick reject tests</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getAlpha'>getAlpha</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkColor_Reference#Alpha'>Color Alpha</a>, color opacity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getBlendMode'>getBlendMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Blend_Mode'>Blend Mode</a>, how colors combine with <a href='undocumented#Device'>Device</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getColor'>getColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkColor_Reference#Alpha'>Color Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a>, one drawing color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getColorFilter'>getColorFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Color_Filter'>Color Filter</a>, how colors are altered</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getDrawLooper'>getDrawLooper</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Draw_Looper'>Draw Looper</a>, multiple layers</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getFillPath'>getFillPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns fill path equivalent to stroke</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getFilterQuality'>getFilterQuality</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Filter_Quality'>Filter Quality</a>, image filtering level</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getFlags'>getFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPaint_Flags'>Flags</a> stored in a bit field</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getFontBounds'>getFontBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns union all glyph bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getFontMetrics'>getFontMetrics</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Typeface'>Typeface</a> metrics scaled by text size</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getFontSpacing'>getFontSpacing</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns recommended spacing between lines</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getHash'>getHash</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns a shallow hash for equality checks</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getHinting'>getHinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPaint_Hinting'>Hinting</a>, glyph outline adjustment level</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getImageFilter'>getImageFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Image_Filter'>Image Filter</a>, alter pixels; blur</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getMaskFilter'>getMaskFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Mask_Filter'>Mask Filter</a>, alterations to <a href='undocumented#Mask_Alpha'>Mask Alpha</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getPathEffect'>getPathEffect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Path_Effect'>Path Effect</a>, modifications to path geometry; dashing</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getPosTextHIntercepts'>getPosTextHIntercepts</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns where lines intersect horizontally positioned text; underlines</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getPosTextIntercepts'>getPosTextIntercepts</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns where lines intersect positioned text; underlines</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getPosTextPath'>getPosTextPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPath_Reference#Path'>Path</a> equivalent to positioned text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getShader'>getShader</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Shader'>Shader</a>, multiple drawing colors; gradients</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getStrokeCap'>getStrokeCap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPaint_Cap'>Cap</a>, the area drawn at path ends</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getStrokeJoin'>getStrokeJoin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPaint_Join'>Join</a>, geometry on path corners</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getStrokeMiter'>getStrokeMiter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Miter_Limit'>Miter Limit</a>, angles with sharp corners</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getStrokeWidth'>getStrokeWidth</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns thickness of the stroke</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getStyle'>getStyle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPaint_Style'>Style</a>: stroke, fill, or both</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextAlign'>getTextAlign</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPaint_Align'>Align</a>: left, center, or right</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextBlobIntercepts'>getTextBlobIntercepts</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns where lines intersect <a href='undocumented#Text_Blob'>Text Blob</a>; underlines</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextEncoding'>getTextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns character or glyph encoded size</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextIntercepts'>getTextIntercepts</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns where lines intersect text; underlines</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextPath'>getTextPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPath_Reference#Path'>Path</a> equivalent to text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextScaleX'>getTextScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the text horizontal scale; condensed text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextSize'>getTextSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns text size in points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextSkewX'>getTextSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the text horizontal skew; oblique text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTextWidths'>getTextWidths</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns advance and bounds for each glyph in text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_getTypeface'>getTypeface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Typeface'>Typeface</a>, font description</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_glyphsToUnichars'>glyphsToUnichars</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='undocumented#Glyph'>Glyphs</a> into text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isAntiAlias'>isAntiAlias</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if Anti-alias is set</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isAutohinted'>isAutohinted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='undocumented#Glyph'>Glyphs</a> are always hinted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isDither'>isDither</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Dither'>Dither</a> is set</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isEmbeddedBitmapText'>isEmbeddedBitmapText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a> is set</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isFakeBoldText'>isFakeBoldText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Fake_Bold'>Fake Bold</a> is set</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isLCDRenderText'>isLCDRenderText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#LCD_Text'>LCD Text</a> is set</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isLinearText'>isLinearText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if text is converted to <a href='SkPath_Reference#Path'>Path</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isSrcOver'>isSrcOver</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='undocumented#Blend_Mode'>Blend Mode</a> is <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isSubpixelText'>isSubpixelText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Subpixel_Text'>Subpixel Text</a> is set</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_isVerticalText'>isVerticalText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Vertical_Text'>Vertical Text</a> is set</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_measureText'>measureText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns advance width and bounds of text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_nothingToDraw'>nothingToDraw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Paint'>Paint</a> prevents all drawing</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refColorFilter'>refColorFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Color_Filter'>Color Filter</a>, how colors are altered</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refDrawLooper'>refDrawLooper</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Draw_Looper'>Draw Looper</a>, multiple layers</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refImageFilter'>refImageFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Image_Filter'>Image Filter</a>, alter pixels; blur</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refMaskFilter'>refMaskFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Mask_Filter'>Mask Filter</a>, alterations to <a href='undocumented#Mask_Alpha'>Mask Alpha</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refPathEffect'>refPathEffect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Path_Effect'>Path Effect</a>, modifications to path geometry; dashing</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refShader'>refShader</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Shader'>Shader</a>, multiple drawing colors; gradients</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_refTypeface'>refTypeface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>references <a href='undocumented#Typeface'>Typeface</a>, font description</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to default values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setARGB'>setARGB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets color by component</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setAlpha'>setAlpha</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkColor_Reference#Alpha'>Color Alpha</a>, color opacity</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setAntiAlias'>setAntiAlias</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears Anti-alias</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setAutohinted'>setAutohinted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Glyph'>Glyphs</a> to always be hinted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setBlendMode'>setBlendMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Blend_Mode'>Blend Mode</a>, how colors combine with destination</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setColor'>setColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkColor_Reference#Alpha'>Color Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a>, one drawing color</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setColorFilter'>setColorFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Color_Filter'>Color Filter</a>, alters color</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setDither'>setDither</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears <a href='#Dither'>Dither</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setDrawLooper'>setDrawLooper</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Draw_Looper'>Draw Looper</a>, multiple layers</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setEmbeddedBitmapText'>setEmbeddedBitmapText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears <a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setFakeBoldText'>setFakeBoldText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears <a href='#Fake_Bold'>Fake Bold</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setFilterQuality'>setFilterQuality</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Filter_Quality'>Filter Quality</a>, the image filtering level</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setFlags'>setFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets multiple <a href='#SkPaint_Flags'>Flags</a> in a bit field</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setHinting'>setHinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkPaint_Hinting'>Hinting</a>, glyph outline adjustment level</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setImageFilter'>setImageFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Image_Filter'>Image Filter</a>, alter pixels; blur</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setLCDRenderText'>setLCDRenderText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears <a href='#LCD_Text'>LCD Text</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setLinearText'>setLinearText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts to <a href='SkPath_Reference#Path'>Path</a> before draw or measure</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setMaskFilter'>setMaskFilter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Mask_Filter'>Mask Filter</a>, alterations to <a href='undocumented#Mask_Alpha'>Mask Alpha</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setPathEffect'>setPathEffect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Path_Effect'>Path Effect</a>, modifications to path geometry; dashing</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setShader'>setShader</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Shader'>Shader</a>, multiple drawing colors; gradients</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setStrokeCap'>setStrokeCap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkPaint_Cap'>Cap</a>, the area drawn at path ends</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setStrokeJoin'>setStrokeJoin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkPaint_Join'>Join</a>, geometry on path corners</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setStrokeMiter'>setStrokeMiter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Miter_Limit'>Miter Limit</a>, angles with sharp corners</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setStrokeWidth'>setStrokeWidth</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets thickness of the stroke</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setStyle'>setStyle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkPaint_Style'>Style</a>: stroke, fill, or both</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setSubpixelText'>setSubpixelText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears <a href='#Subpixel_Text'>Subpixel Text</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setTextAlign'>setTextAlign</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkPaint_Align'>Align</a>: left, center, or right</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setTextEncoding'>setTextEncoding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets character or glyph encoded size</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setTextScaleX'>setTextScaleX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets the text horizontal scale; condensed text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setTextSize'>setTextSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets text size in points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setTextSkewX'>setTextSkewX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets the text horizontal skew; oblique text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setTypeface'>setTypeface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Typeface'>Typeface</a>, font description</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_setVerticalText'>setVerticalText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets or clears <a href='#Vertical_Text'>Vertical Text</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_textToGlyphs'>textToGlyphs</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts text into glyph indices</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Paint'>Paint</a> to machine readable form</td> + </tr> +</table> + + +## <a name='Initializers'>Initializers</a> + +<a name='SkPaint_empty_constructor'></a> ## SkPaint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPaint() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint'>SkPaint</a>() </pre> -Constructs <a href="#Paint">Paint</a> with default values. +Constructs <a href='#Paint'>Paint</a> with default values. | attribute | default value | | --- | --- | | Anti-alias | false | -| <a href="undocumented#Blend_Mode">Blend Mode</a> | <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a> | -| <a href="SkColor_Reference#Color">Color</a> | <a href="SkColor_Reference#SK_ColorBLACK">SK ColorBLACK</a> | -| <a href="SkColor_Reference#Alpha">Color Alpha</a> | 255 | -| <a href="undocumented#Color_Filter">Color Filter</a> | nullptr | -| <a href="#Dither">Dither</a> | false | -| <a href="undocumented#Draw_Looper">Draw Looper</a> | nullptr | -| <a href="#Fake_Bold">Fake Bold</a> | false | -| <a href="undocumented#Filter_Quality">Filter Quality</a> | <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a> | -| <a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | false | -| <a href="#Automatic_Hinting">Automatic Hinting</a> | false | -| <a href="#Full_Hinting_Spacing">Full Hinting Spacing</a> | false | -| <a href="#SkPaint_Hinting">Hinting</a> | <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> | -| <a href="undocumented#Image_Filter">Image Filter</a> | nullptr | -| <a href="#LCD_Text">LCD Text</a> | false | -| <a href="#Linear_Text">Linear Text</a> | false | -| <a href="#Miter_Limit">Miter Limit</a> | 4 | -| <a href="undocumented#Mask_Filter">Mask Filter</a> | nullptr | -| <a href="undocumented#Path_Effect">Path Effect</a> | nullptr | -| <a href="undocumented#Shader">Shader</a> | nullptr | -| <a href="#SkPaint_Style">Style</a> | <a href="#SkPaint_kFill_Style">kFill Style</a> | -| <a href="#Text_Align">Text Align</a> | <a href="#SkPaint_kLeft_Align">kLeft Align</a> | -| <a href="#Text_Encoding">Text Encoding</a> | <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a> | -| <a href="#Text_Scale_X">Text Scale X</a> | 1 | -| <a href="#Text_Size">Text Size</a> | 12 | -| <a href="#Text_Skew_X">Text Skew X</a> | 0 | -| <a href="undocumented#Typeface">Typeface</a> | nullptr | -| <a href="#Stroke_Cap">Stroke Cap</a> | <a href="#SkPaint_kButt_Cap">kButt Cap</a> | -| <a href="#Stroke_Join">Stroke Join</a> | <a href="#SkPaint_kMiter_Join">kMiter Join</a> | -| <a href="#Stroke_Width">Stroke Width</a> | 0 | -| <a href="#Subpixel_Text">Subpixel Text</a> | false | -| <a href="#Vertical_Text">Vertical Text</a> | false | +| <a href='undocumented#Blend_Mode'>Blend Mode</a> | <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a> | +| <a href='SkColor_Reference#Color'>Color</a> | <a href='SkColor_Reference#SK_ColorBLACK'>SK ColorBLACK</a> | +| <a href='SkColor_Reference#Alpha'>Color Alpha</a> | 255 | +| <a href='undocumented#Color_Filter'>Color Filter</a> | nullptr | +| <a href='#Dither'>Dither</a> | false | +| <a href='undocumented#Draw_Looper'>Draw Looper</a> | nullptr | +| <a href='#Fake_Bold'>Fake Bold</a> | false | +| <a href='undocumented#Filter_Quality'>Filter Quality</a> | <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a> | +| <a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a> | false | +| <a href='#Automatic_Hinting'>Automatic Hinting</a> | false | +| <a href='#Full_Hinting_Spacing'>Full Hinting Spacing</a> | false | +| <a href='#SkPaint_Hinting'>Hinting</a> | <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a> | +| <a href='undocumented#Image_Filter'>Image Filter</a> | nullptr | +| <a href='#LCD_Text'>LCD Text</a> | false | +| <a href='#Linear_Text'>Linear Text</a> | false | +| <a href='#Miter_Limit'>Miter Limit</a> | 4 | +| <a href='undocumented#Mask_Filter'>Mask Filter</a> | nullptr | +| <a href='undocumented#Path_Effect'>Path Effect</a> | nullptr | +| <a href='undocumented#Shader'>Shader</a> | nullptr | +| <a href='#SkPaint_Style'>Style</a> | <a href='#SkPaint_kFill_Style'>kFill Style</a> | +| <a href='#Text_Align'>Text Align</a> | <a href='#SkPaint_kLeft_Align'>kLeft Align</a> | +| <a href='#Text_Encoding'>Text Encoding</a> | <a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a> | +| <a href='#Text_Scale_X'>Text Scale X</a> | 1 | +| <a href='#Text_Size'>Text Size</a> | 12 | +| <a href='#Text_Skew_X'>Text Skew X</a> | 0 | +| <a href='undocumented#Typeface'>Typeface</a> | nullptr | +| <a href='#Stroke_Cap'>Stroke Cap</a> | <a href='#SkPaint_kButt_Cap'>kButt Cap</a> | +| <a href='#Stroke_Join'>Stroke Join</a> | <a href='#SkPaint_kMiter_Join'>kMiter Join</a> | +| <a href='#Stroke_Width'>Stroke Width</a> | 0 | +| <a href='#Subpixel_Text'>Subpixel Text</a> | false | +| <a href='#Vertical_Text'>Vertical Text</a> | false | The flags, text size, hinting, and miter limit may be overridden at compile time by defining paint default values. The overrides may be included in "SkUserConfig.h" or predefined by the @@ -285,7 +966,7 @@ build system. ### Return Value -default initialized <a href="#Paint">Paint</a> +default initialized <a href='#Paint'>Paint</a> ### Example @@ -293,32 +974,32 @@ default initialized <a href="#Paint">Paint</a> --- -<a name="SkPaint_copy_const_SkPaint"></a> +<a name='SkPaint_copy_const_SkPaint'></a> ## SkPaint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPaint(const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint'>SkPaint</a>(const <a href='#SkPaint'>SkPaint</a>& paint) </pre> -Makes a shallow copy of <a href="#Paint">Paint</a>. <a href="undocumented#Typeface">Typeface</a>, <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Draw_Looper">Draw Looper</a>, and <a href="undocumented#Image_Filter">Image Filter</a> are shared -between the original <a href="#SkPaint_copy_const_SkPaint_paint">paint</a> and the copy. Objects containing <a href="undocumented#Reference_Count">Reference Count</a> increment +Makes a shallow copy of <a href='#Paint'>Paint</a>. <a href='undocumented#Typeface'>Typeface</a>, <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Draw_Looper'>Draw Looper</a>, and <a href='undocumented#Image_Filter'>Image Filter</a> are shared +between the original <a href='#SkPaint_copy_const_SkPaint_paint'>paint</a> and the copy. Objects containing <a href='undocumented#Reference_Count'>Reference Count</a> increment their references by one. -The referenced objects <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Draw_Looper">Draw Looper</a>, and <a href="undocumented#Image_Filter">Image Filter</a> cannot be modified after they are created. -This prevents objects with <a href="undocumented#Reference_Count">Reference Count</a> from being modified once <a href="#Paint">Paint</a> refers to them. +The referenced objects <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Draw_Looper'>Draw Looper</a>, and <a href='undocumented#Image_Filter'>Image Filter</a> cannot be modified after they are created. +This prevents objects with <a href='undocumented#Reference_Count'>Reference Count</a> from being modified once <a href='#Paint'>Paint</a> refers to them. ### Parameters -<table> <tr> <td><a name="SkPaint_copy_const_SkPaint_paint"> <code><strong>paint </strong></code> </a></td> <td> -original to copy</td> +<table> <tr> <td><a name='SkPaint_copy_const_SkPaint_paint'><code><strong>paint</strong></code></a></td> + <td>original to copy</td> </tr> </table> ### Return Value -shallow copy of <a href="#SkPaint_copy_const_SkPaint_paint">paint</a> +shallow copy of <a href='#SkPaint_copy_const_SkPaint_paint'>paint</a> ### Example @@ -335,28 +1016,28 @@ SK_ColorBLUE == paint2.getColor() --- -<a name="SkPaint_move_SkPaint"></a> +<a name='SkPaint_move_SkPaint'></a> ## SkPaint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPaint(SkPaint&& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint'>SkPaint</a>(<a href='#SkPaint'>SkPaint</a>&& paint) </pre> Implements a move constructor to avoid increasing the reference counts -of objects referenced by the <a href="#SkPaint_move_SkPaint_paint">paint</a>. +of objects referenced by the <a href='#SkPaint_move_SkPaint_paint'>paint</a>. -After the call, <a href="#SkPaint_move_SkPaint_paint">paint</a> is undefined, and can be safely destructed. +After the call, <a href='#SkPaint_move_SkPaint_paint'>paint</a> is undefined, and can be safely destructed. ### Parameters -<table> <tr> <td><a name="SkPaint_move_SkPaint_paint"> <code><strong>paint </strong></code> </a></td> <td> -original to move</td> +<table> <tr> <td><a name='SkPaint_move_SkPaint_paint'><code><strong>paint</strong></code></a></td> + <td>original to move</td> </tr> </table> ### Return Value -content of <a href="#SkPaint_move_SkPaint_paint">paint</a> +content of <a href='#SkPaint_move_SkPaint_paint'>paint</a> ### Example @@ -372,15 +1053,15 @@ path effect unique: true --- -<a name="SkPaint_reset"></a> +<a name='SkPaint_reset'></a> ## reset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_reset'>reset</a>() </pre> -Sets all <a href="#Paint">Paint</a> contents to their initial values. This is equivalent to replacing -<a href="#Paint">Paint</a> with the result of <a href="#SkPaint_empty_constructor">SkPaint()</a>. +Sets all <a href='#Paint'>Paint</a> contents to their initial values. This is equivalent to replacing +<a href='#Paint'>Paint</a> with the result of <a href='#SkPaint_empty_constructor'>SkPaint()</a>. ### Example @@ -396,45 +1077,45 @@ paint1 == paint2 --- -<a name="SkPaint_destructor"></a> +<a name='SkPaint_destructor'></a> ## ~SkPaint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -~SkPaint() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_destructor'>~SkPaint</a>() </pre> -Decreases <a href="#Paint">Paint</a> <a href="undocumented#Reference_Count">Reference Count</a> of owned objects: <a href="undocumented#Typeface">Typeface</a>, <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Draw_Looper">Draw Looper</a>, and <a href="undocumented#Image_Filter">Image Filter</a>. If the -objects containing <a href="undocumented#Reference_Count">Reference Count</a> go to zero, they are deleted. +Decreases <a href='#Paint'>Paint</a> <a href='undocumented#Reference_Count'>Reference Count</a> of owned objects: <a href='undocumented#Typeface'>Typeface</a>, <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Draw_Looper'>Draw Looper</a>, and <a href='undocumented#Image_Filter'>Image Filter</a>. If the +objects containing <a href='undocumented#Reference_Count'>Reference Count</a> go to zero, they are deleted. --- -## <a name="Management"></a> Management +## <a name='Management'>Management</a> -<a name="SkPaint_copy_operator"></a> +<a name='SkPaint_copy_operator'></a> ## operator= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPaint& operator=(const SkPaint& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint'>SkPaint</a>& <a href='#SkPaint_copy_operator'>operator=(const SkPaint& paint)</a> </pre> -Makes a shallow copy of <a href="#Paint">Paint</a>. <a href="undocumented#Typeface">Typeface</a>, <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Shader">Shader</a>, -<a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Draw_Looper">Draw Looper</a>, and <a href="undocumented#Image_Filter">Image Filter</a> are shared -between the original <a href="#SkPaint_copy_operator_paint">paint</a> and the copy. Objects containing <a href="undocumented#Reference_Count">Reference Count</a> in the +Makes a shallow copy of <a href='#Paint'>Paint</a>. <a href='undocumented#Typeface'>Typeface</a>, <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Shader'>Shader</a>, +<a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Draw_Looper'>Draw Looper</a>, and <a href='undocumented#Image_Filter'>Image Filter</a> are shared +between the original <a href='#SkPaint_copy_operator_paint'>paint</a> and the copy. Objects containing <a href='undocumented#Reference_Count'>Reference Count</a> in the prior destination are decreased by one, and the referenced objects are deleted if the -resulting count is zero. Objects containing <a href="undocumented#Reference_Count">Reference Count</a> in the parameter <a href="#SkPaint_copy_operator_paint">paint</a> -are increased by one. <a href="#SkPaint_copy_operator_paint">paint</a> is unmodified. +resulting count is zero. Objects containing <a href='undocumented#Reference_Count'>Reference Count</a> in the parameter <a href='#SkPaint_copy_operator_paint'>paint</a> +are increased by one. <a href='#SkPaint_copy_operator_paint'>paint</a> is unmodified. ### Parameters -<table> <tr> <td><a name="SkPaint_copy_operator_paint"> <code><strong>paint </strong></code> </a></td> <td> -original to copy</td> +<table> <tr> <td><a name='SkPaint_copy_operator_paint'><code><strong>paint</strong></code></a></td> + <td>original to copy</td> </tr> </table> ### Return Value -content of <a href="#SkPaint_copy_operator_paint">paint</a> +content of <a href='#SkPaint_copy_operator_paint'>paint</a> ### Example @@ -451,30 +1132,30 @@ SK_ColorRED == paint2.getColor() --- -<a name="SkPaint_move_operator"></a> +<a name='SkPaint_move_operator'></a> ## operator= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPaint& operator=(SkPaint&& paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint'>SkPaint</a>& <a href='#SkPaint_move_operator'>operator=(SkPaint&& paint)</a> </pre> -Moves the <a href="#SkPaint_move_operator_paint">paint</a> to avoid increasing the reference counts -of objects referenced by the <a href="#SkPaint_move_operator_paint">paint</a> parameter. Objects containing <a href="undocumented#Reference_Count">Reference Count</a> in the +Moves the <a href='#SkPaint_move_operator_paint'>paint</a> to avoid increasing the reference counts +of objects referenced by the <a href='#SkPaint_move_operator_paint'>paint</a> parameter. Objects containing <a href='undocumented#Reference_Count'>Reference Count</a> in the prior destination are decreased by one; those objects are deleted if the resulting count is zero. -After the call, <a href="#SkPaint_move_operator_paint">paint</a> is undefined, and can be safely destructed. +After the call, <a href='#SkPaint_move_operator_paint'>paint</a> is undefined, and can be safely destructed. ### Parameters -<table> <tr> <td><a name="SkPaint_move_operator_paint"> <code><strong>paint </strong></code> </a></td> <td> -original to move</td> +<table> <tr> <td><a name='SkPaint_move_operator_paint'><code><strong>paint</strong></code></a></td> + <td>original to move</td> </tr> </table> ### Return Value -content of <a href="#SkPaint_move_operator_paint">paint</a> +content of <a href='#SkPaint_move_operator_paint'>paint</a> ### Example @@ -490,29 +1171,30 @@ SK_ColorRED == paint2.getColor() --- -<a name="SkPaint_equal_operator"></a> +<a name='SkPaint_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkPaint& a, const SkPaint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_equal_operator'>operator==(const SkPaint& a, const SkPaint& b)</a> </pre> -Compares <a href="#SkPaint_equal_operator_a">a</a> and <a href="#SkPaint_equal_operator_b">b</a>, and returns true if <a href="#SkPaint_equal_operator_a">a</a> and <a href="#SkPaint_equal_operator_b">b</a> are equivalent. May return false -if <a href="undocumented#Typeface">Typeface</a>, <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Draw_Looper">Draw Looper</a>, or <a href="undocumented#Image_Filter">Image Filter</a> have identical contents but different pointers. +Compares <a href='#SkPaint_equal_operator_a'>a</a> and <a href='#SkPaint_equal_operator_b'>b</a>, and returns true if <a href='#SkPaint_equal_operator_a'>a</a> and <a href='#SkPaint_equal_operator_b'>b</a> are equivalent. May return false +if <a href='undocumented#Typeface'>Typeface</a>, <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Draw_Looper'>Draw Looper</a>, or <a href='undocumented#Image_Filter'>Image Filter</a> have identical contents but different pointers. ### Parameters -<table> <tr> <td><a name="SkPaint_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Paint">Paint</a> to compare</td> - </tr> <tr> <td><a name="SkPaint_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Paint">Paint</a> to compare</td> +<table> <tr> <td><a name='SkPaint_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Paint'>Paint</a> to compare</td> + </tr> + <tr> <td><a name='SkPaint_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Paint'>Paint</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Paint">Paint</a> pair are equivalent +true if <a href='#Paint'>Paint</a> pair are equivalent ### Example @@ -529,33 +1211,34 @@ paint1 != paint2 ### See Also -<a href="#SkPaint_notequal_operator">operator!=(const SkPaint& a, const SkPaint& b)</a> +<a href='#SkPaint_notequal_operator'>operator!=(const SkPaint& a, const SkPaint& b)</a> --- -<a name="SkPaint_notequal_operator"></a> +<a name='SkPaint_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkPaint& a, const SkPaint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_notequal_operator'>operator!=(const SkPaint& a, const SkPaint& b)</a> </pre> -Compares <a href="#SkPaint_notequal_operator_a">a</a> and <a href="#SkPaint_notequal_operator_b">b</a>, and returns true if <a href="#SkPaint_notequal_operator_a">a</a> and <a href="#SkPaint_notequal_operator_b">b</a> are not equivalent. May return true -if <a href="undocumented#Typeface">Typeface</a>, <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Color_Filter">Color Filter</a>, -<a href="undocumented#Draw_Looper">Draw Looper</a>, or <a href="undocumented#Image_Filter">Image Filter</a> have identical contents but different pointers. +Compares <a href='#SkPaint_notequal_operator_a'>a</a> and <a href='#SkPaint_notequal_operator_b'>b</a>, and returns true if <a href='#SkPaint_notequal_operator_a'>a</a> and <a href='#SkPaint_notequal_operator_b'>b</a> are not equivalent. May return true +if <a href='undocumented#Typeface'>Typeface</a>, <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Shader'>Shader</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, +<a href='undocumented#Draw_Looper'>Draw Looper</a>, or <a href='undocumented#Image_Filter'>Image Filter</a> have identical contents but different pointers. ### Parameters -<table> <tr> <td><a name="SkPaint_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Paint">Paint</a> to compare</td> - </tr> <tr> <td><a name="SkPaint_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Paint">Paint</a> to compare</td> +<table> <tr> <td><a name='SkPaint_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Paint'>Paint</a> to compare</td> + </tr> + <tr> <td><a name='SkPaint_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Paint'>Paint</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Paint">Paint</a> pair are not equivalent +true if <a href='#Paint'>Paint</a> pair are not equivalent ### Example @@ -572,23 +1255,23 @@ paint1 == paint2 ### See Also -<a href="#SkPaint_equal_operator">operator==(const SkPaint& a, const SkPaint& b)</a> +<a href='#SkPaint_equal_operator'>operator==(const SkPaint& a, const SkPaint& b)</a> --- -<a name="SkPaint_getHash"></a> +<a name='SkPaint_getHash'></a> ## getHash -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t getHash() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkPaint_getHash'>getHash</a>() const </pre> -Returns a hash generated from <a href="#Paint">Paint</a> values and pointers. +Returns a hash generated from <a href='#Paint'>Paint</a> values and pointers. Identical hashes guarantee that the paints are equivalent, but differing hashes do not guarantee that the paints have differing contents. -If <a href="#SkPaint_equal_operator">operator==(const SkPaint& a, const SkPaint& b)</a> returns true for two paints, +If <a href='#SkPaint_equal_operator'>operator==(const SkPaint& a, const SkPaint& b)</a> returns true for two paints, their hashes are also equal. The hash returned is platform and implementation specific. @@ -612,31 +1295,37 @@ paint1.getHash() == paint2.getHash() --- -## <a name="Hinting"></a> Hinting +## <a name='Hinting'>Hinting</a> -## <a name="SkPaint_Hinting"></a> Enum SkPaint::Hinting +## <a name='SkPaint_Hinting'>Enum SkPaint::Hinting</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#Hinting">Hinting</a> { - <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> = 0, - <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a> = 1, - <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> = 2, - <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> = 3, + enum <a href='#SkPaint_Hinting'>Hinting</a> { + <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a> = 0, + <a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a> = 1, + <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a> = 2, + <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a> = 3, }; </pre> -<a href="#Hinting">Hinting</a> adjusts the glyph outlines so that the shape provides a uniform -look at a given point size on font engines that support it. <a href="#Hinting">Hinting</a> may have a +<a href='#SkPaint_Hinting'>Hinting</a> adjusts the glyph outlines so that the shape provides a uniform +look at a given point size on font engines that support it. <a href='#SkPaint_Hinting'>Hinting</a> may have a muted effect or no effect at all depending on the platform. The four levels roughly control corresponding features on platforms that use FreeType -as the <a href="undocumented#Engine">Font Engine</a>. +as the <a href='undocumented#Engine'>Font Engine</a>. ### Constants -<table> - <tr> - <td><a name="SkPaint_kNo_Hinting"> <code><strong>SkPaint::kNo_Hinting </strong></code> </a></td><td>0</td><td>Leaves glyph outlines unchanged from their native representation. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kNo_Hinting'><code>SkPaint::kNo_Hinting</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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 outline being loaded should not be fitted to the pixel grid but simply scaled @@ -644,23 +1333,32 @@ to 26.6 fractional pixels. </td> </tr> <tr> - <td><a name="SkPaint_kSlight_Hinting"> <code><strong>SkPaint::kSlight_Hinting </strong></code> </a></td><td>1</td><td>Modifies glyph outlines minimally to improve constrast. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kSlight_Hinting'><code>SkPaint::kSlight_Hinting</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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 lighter hinting algorithm for non-monochrome modes. -Generated <a href="undocumented#Glyph">Glyphs</a> may be fuzzy but better resemble their original shape. +Generated <a href='undocumented#Glyph'>Glyphs</a> may be fuzzy but better resemble their original shape. </td> </tr> - <tr> - <td><a name="SkPaint_kNormal_Hinting"> <code><strong>SkPaint::kNormal_Hinting </strong></code> </a></td><td>2</td><td>Modifies glyph outlines to improve constrast. This is the default. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kNormal_Hinting'><code>SkPaint::kNormal_Hinting</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +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. </td> </tr> <tr> - <td><a name="SkPaint_kFull_Hinting"> <code><strong>SkPaint::kFull_Hinting </strong></code> </a></td><td>3</td><td>Modifies glyph outlines for maxiumum constrast. With FreeType, this selects -FT_LOAD_TARGET_LCD or FT_LOAD_TARGET_LCD_V if <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> is set. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kFull_Hinting'><code>SkPaint::kFull_Hinting</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Modifies glyph outlines for maxiumum constrast. With FreeType, this selects +FT_LOAD_TARGET_LCD or FT_LOAD_TARGET_LCD_V if <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> is set. FT_LOAD_TARGET_LCD is a variant of FT_LOAD_TARGET_NORMAL optimized for horizontally decimated LCD displays; FT_LOAD_TARGET_LCD_V is a variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays. @@ -668,25 +1366,28 @@ variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays </tr> </table> -On Windows with DirectWrite, <a href="#Hinting">Hinting</a> has no effect. +On <a href='undocumented#OS_X'>OS X</a> and iOS, hinting controls whether <a href='undocumented#Core_Graphics'>Core Graphics</a> dilates the font outlines +to account for LCD text. No hinting uses <a href='undocumented#Core_Text'>Core Text</a> gray scale output. +Normal hinting uses <a href='undocumented#Core_Text'>Core Text</a> LCD output. If <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> is clear, +the LCD output is reduced to a single grayscale channel. -<a href="#Hinting">Hinting</a> defaults to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a>. -Set <a href="undocumented#SkPaintDefaults_Hinting">SkPaintDefaults Hinting</a> at compile time to change the default setting. +On Windows with DirectWrite, <a href='#SkPaint_Hinting'>Hinting</a> has no effect. +<a href='#SkPaint_Hinting'>Hinting</a> defaults to <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a>. +Set <a href='undocumented#SkPaintDefaults_Hinting'>SkPaintDefaults Hinting</a> at compile time to change the default setting. - -<a name="SkPaint_getHinting"></a> +<a name='SkPaint_getHinting'></a> ## getHinting -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Hinting getHinting() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_Hinting'>Hinting</a> <a href='#SkPaint_getHinting'>getHinting</a>() const </pre> Returns level of glyph outline adjustment. ### Return Value -one of: <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>, <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a>, <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a>, <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> +one of: <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a>, <a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a>, <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a>, <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a> ### Example @@ -702,27 +1403,27 @@ SkPaint::kNormal_Hinting == paint.getHinting() --- -<a name="SkPaint_setHinting"></a> +<a name='SkPaint_setHinting'></a> ## setHinting -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setHinting(Hinting hintingLevel) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setHinting'>setHinting</a>(<a href='#SkPaint_Hinting'>Hinting</a> hintingLevel) </pre> Sets level of glyph outline adjustment. -Does not check for valid values of <a href="#SkPaint_setHinting_hintingLevel">hintingLevel</a>. +Does not check for valid values of <a href='#SkPaint_setHinting_hintingLevel'>hintingLevel</a>. -| <a href="#Hinting">Hinting</a> | value | effect on generated glyph outlines | +| <a href='#SkPaint_Hinting'>Hinting</a> | value | effect on generated glyph outlines | | --- | --- | --- | -| <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> | 0 | leaves glyph outlines unchanged from their native representation | -| <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a> | 1 | modifies glyph outlines minimally to improve contrast | -| <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> | 2 | modifies glyph outlines to improve contrast | -| <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> | 3 | modifies glyph outlines for maximum contrast | +| <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a> | 0 | leaves glyph outlines unchanged from their native representation | +| <a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a> | 1 | modifies glyph outlines minimally to improve contrast | +| <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a> | 2 | modifies glyph outlines to improve contrast | +| <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a> | 3 | modifies glyph outlines for maximum contrast | ### Parameters -<table> <tr> <td><a name="SkPaint_setHinting_hintingLevel"> <code><strong>hintingLevel </strong></code> </a></td> <td> -one of: <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>, <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a>, <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a>, <a href="#SkPaint_kFull_Hinting">kFull Hinting</a></td> +<table> <tr> <td><a name='SkPaint_setHinting_hintingLevel'><code><strong>hintingLevel</strong></code></a></td> + <td>one of: <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a>, <a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a>, <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a>, <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a></td> </tr> </table> @@ -740,106 +1441,152 @@ paint1 == paint2 --- -## <a name="Flags"></a> Flags +## <a name='Flags'>Flags</a> -## <a name="SkPaint_Flags"></a> Enum SkPaint::Flags +## <a name='SkPaint_Flags'>Enum SkPaint::Flags</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#Flags">Flags</a> { - <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> = 0x01, - <a href="#SkPaint_kDither_Flag">kDither Flag</a> = 0x04, - <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> = 0x20, - <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> = 0x40, - <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> = 0x80, - <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> = 0x200, - <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> = 0x400, - <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a> = 0x800, - <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> = 0x1000, - - <a href="#SkPaint_kAllFlags">kAllFlags</a> = 0xFFFF, + enum <a href='#SkPaint_Flags'>Flags</a> { + <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> = 0x01, + <a href='#SkPaint_kDither_Flag'>kDither Flag</a> = 0x04, + <a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a> = 0x20, + <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> = 0x40, + <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> = 0x80, + <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> = 0x200, + <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> = 0x400, + <a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a> = 0x800, + <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> = 0x1000, + + <a href='#SkPaint_kAllFlags'>kAllFlags</a> = 0xFFFF, }; </pre> -The bit values stored in <a href="#Flags">Flags</a>. -The default value for <a href="#Flags">Flags</a>, normally zero, can be changed at compile time -with a custom definition of <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a>. -All flags can be read and written explicitly; <a href="#Flags">Flags</a> allows manipulating +The bit values stored in <a href='#SkPaint_Flags'>Flags</a>. +The default value for <a href='#SkPaint_Flags'>Flags</a>, normally zero, can be changed at compile time +with a custom definition of <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a>. +All flags can be read and written explicitly; <a href='#SkPaint_Flags'>Flags</a> allows manipulating multiple settings at once. ### Constants -<table> - <tr> - <td><a name="SkPaint_kAntiAlias_Flag"> <code><strong>SkPaint::kAntiAlias_Flag </strong></code> </a></td><td>0x0001</td><td>mask for setting Anti-alias</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kAntiAlias_Flag'><code>SkPaint::kAntiAlias_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0001</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Anti-alias</td> </tr> <tr> - <td><a name="SkPaint_kDither_Flag"> <code><strong>SkPaint::kDither_Flag </strong></code> </a></td><td>0x0004</td><td>mask for setting <a href="#Dither">Dither</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kDither_Flag'><code>SkPaint::kDither_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0004</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Dither</td> </tr> - <tr> - <td><a name="SkPaint_kFakeBoldText_Flag"> <code><strong>SkPaint::kFakeBoldText_Flag </strong></code> </a></td><td>0x0020</td><td>mask for setting <a href="#Fake_Bold">Fake Bold</a></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kFakeBoldText_Flag'><code>SkPaint::kFakeBoldText_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0020</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Fake_Bold</td> </tr> <tr> - <td><a name="SkPaint_kLinearText_Flag"> <code><strong>SkPaint::kLinearText_Flag </strong></code> </a></td><td>0x0040</td><td>mask for setting <a href="#Linear_Text">Linear Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kLinearText_Flag'><code>SkPaint::kLinearText_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0040</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Linear_Text</td> </tr> - <tr> - <td><a name="SkPaint_kSubpixelText_Flag"> <code><strong>SkPaint::kSubpixelText_Flag </strong></code> </a></td><td>0x0080</td><td>mask for setting <a href="#Subpixel_Text">Subpixel Text</a></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kSubpixelText_Flag'><code>SkPaint::kSubpixelText_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0080</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Subpixel_Text</td> </tr> <tr> - <td><a name="SkPaint_kLCDRenderText_Flag"> <code><strong>SkPaint::kLCDRenderText_Flag </strong></code> </a></td><td>0x0200</td><td>mask for setting <a href="#LCD_Text">LCD Text</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kLCDRenderText_Flag'><code>SkPaint::kLCDRenderText_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0200</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting LCD_Text</td> </tr> - <tr> - <td><a name="SkPaint_kEmbeddedBitmapText_Flag"> <code><strong>SkPaint::kEmbeddedBitmapText_Flag </strong></code> </a></td><td>0x0400</td><td>mask for setting <a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kEmbeddedBitmapText_Flag'><code>SkPaint::kEmbeddedBitmapText_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0400</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Font_Embedded_Bitmaps</td> </tr> <tr> - <td><a name="SkPaint_kAutoHinting_Flag"> <code><strong>SkPaint::kAutoHinting_Flag </strong></code> </a></td><td>0x0800</td><td>mask for setting <a href="#Automatic_Hinting">Automatic Hinting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kAutoHinting_Flag'><code>SkPaint::kAutoHinting_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0800</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Automatic_Hinting</td> </tr> - <tr> - <td><a name="SkPaint_kVerticalText_Flag"> <code><strong>SkPaint::kVerticalText_Flag </strong></code> </a></td><td>0x1000</td><td>mask for setting <a href="#Vertical_Text">Vertical Text</a></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kVerticalText_Flag'><code>SkPaint::kVerticalText_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x1000</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask for setting Vertical_Text</td> </tr> <tr> - <td><a name="SkPaint_kAllFlags"> <code><strong>SkPaint::kAllFlags </strong></code> </a></td><td>0xFFFF</td><td>mask of all <a href="#Flags">Flags</a>, including private flags and flags reserved for future use</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kAllFlags'><code>SkPaint::kAllFlags</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFFF</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +mask of all <a href='#SkPaint_Flags'>Flags</a>, including private flags and flags reserved for future use</td> </tr> -<a href="#Flags">Flags</a> default to all flags clear, disabling the associated feature. - +<a href='#SkPaint_Flags'>Flags</a> default to all flags clear, disabling the associated feature. +</table> +## <a name='SkPaint_ReserveFlags'>Enum SkPaint::ReserveFlags</a> -## <a name="SkPaint_ReserveFlags"></a> Enum SkPaint::ReserveFlags +Deprecated. soonOnly valid for Android framework. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_ReserveFlags">ReserveFlags</a> { - <a href="#SkPaint_kUnderlineText_ReserveFlag">kUnderlineText ReserveFlag</a> = 0x08, - <a href="#SkPaint_kStrikeThruText_ReserveFlag">kStrikeThruText ReserveFlag</a> = 0x10, + enum <a href='#SkPaint_ReserveFlags'>ReserveFlags</a> { + <a href='#SkPaint_kUnderlineText_ReserveFlag'>kUnderlineText ReserveFlag</a> = 0x08, + <a href='#SkPaint_kStrikeThruText_ReserveFlag'>kStrikeThruText ReserveFlag</a> = 0x10, }; </pre> ### Constants -<table> - <tr> - <td><a name="SkPaint_kUnderlineText_ReserveFlag"> <code><strong>SkPaint::kUnderlineText_ReserveFlag </strong></code> </a></td><td>0x0008</td><td>soon</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kUnderlineText_ReserveFlag'><code>SkPaint::kUnderlineText_ReserveFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0008</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Deprecated. + +soon</td> </tr> <tr> - <td><a name="SkPaint_kStrikeThruText_ReserveFlag"> <code><strong>SkPaint::kStrikeThruText_ReserveFlag </strong></code> </a></td><td>0x0010</td><td>soon</td> - </tr> - + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kStrikeThruText_ReserveFlag'><code>SkPaint::kStrikeThruText_ReserveFlag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0010</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Deprecated. +soon</td> + </tr> +</table> -<a name="SkPaint_getFlags"></a> +<a name='SkPaint_getFlags'></a> ## getFlags -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t getFlags() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkPaint_getFlags'>getFlags</a>() const </pre> -Returns paint settings described by <a href="#Flags">Flags</a>. Each setting uses one -bit, and can be tested with <a href="#Flags">Flags</a> members. +Returns paint settings described by <a href='#SkPaint_Flags'>Flags</a>. Each setting uses one +bit, and can be tested with <a href='#SkPaint_Flags'>Flags</a> members. ### Return Value -zero, one, or more bits described by <a href="#Flags">Flags</a> +zero, one, or more bits described by <a href='#SkPaint_Flags'>Flags</a> ### Example @@ -855,20 +1602,20 @@ zero, one, or more bits described by <a href="#Flags">Flags</a> --- -<a name="SkPaint_setFlags"></a> +<a name='SkPaint_setFlags'></a> ## setFlags -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setFlags(uint32_t flags) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setFlags'>setFlags</a>(uint32_t flags) </pre> -Replaces <a href="#Flags">Flags</a> with <a href="#SkPaint_setFlags_flags">flags</a>, the union of the <a href="#Flags">Flags</a> members. -All <a href="#Flags">Flags</a> members may be cleared, or one or more may be set. +Replaces <a href='#SkPaint_Flags'>Flags</a> with <a href='#SkPaint_setFlags_flags'>flags</a>, the union of the <a href='#SkPaint_Flags'>Flags</a> members. +All <a href='#SkPaint_Flags'>Flags</a> members may be cleared, or one or more may be set. ### Parameters -<table> <tr> <td><a name="SkPaint_setFlags_flags"> <code><strong>flags </strong></code> </a></td> <td> -union of <a href="#Flags">Flags</a> for <a href="#Paint">Paint</a></td> +<table> <tr> <td><a name='SkPaint_setFlags_flags'><code><strong>flags</strong></code></a></td> + <td>union of <a href='#SkPaint_Flags'>Flags</a> for <a href='#Paint'>Paint</a></td> </tr> </table> @@ -887,50 +1634,50 @@ paint.isDither() --- -## <a name="Anti-alias"></a> Anti-alias +## <a name='Anti-alias'>Anti-alias</a> Anti-alias drawing approximates partial pixel coverage with transparency. -If <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is clear, pixel centers contained by the shape edge are drawn opaque. -If <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is set, pixels are drawn with <a href="SkColor_Reference#Alpha">Color Alpha</a> equal to their coverage. +If <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> is clear, pixel centers contained by the shape edge are drawn opaque. +If <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> is set, pixels are drawn with <a href='SkColor_Reference#Alpha'>Color Alpha</a> equal to their coverage. -The rule for <a href="undocumented#Alias">Aliased</a> pixels is inconsistent across platforms. A shape edge +The rule for <a href='undocumented#Alias'>Aliased</a> pixels is inconsistent across platforms. A shape edge passing through the pixel center may, but is not required to, draw the pixel. -<a href="undocumented#Raster_Engine">Raster Engine</a> draws <a href="undocumented#Alias">Aliased</a> pixels whose centers are on or to the right of the start of an -active <a href="SkPath_Reference#Path">Path</a> edge, and whose center is to the left of the end of the active <a href="SkPath_Reference#Path">Path</a> edge. +<a href='undocumented#Raster_Engine'>Raster Engine</a> draws <a href='undocumented#Alias'>Aliased</a> pixels whose centers are on or to the right of the start of an +active <a href='SkPath_Reference#Path'>Path</a> edge, and whose center is to the left of the end of the active <a href='SkPath_Reference#Path'>Path</a> edge. A platform may only support Anti-aliased drawing. Some GPU-backed platforms use -<a href="undocumented#Supersampling">Supersampling</a> to Anti-alias all drawing, and have no mechanism to selectively -<a href="undocumented#Alias">Alias</a>. +<a href='undocumented#Supersampling'>Supersampling</a> to Anti-alias all drawing, and have no mechanism to selectively +<a href='undocumented#Alias'>Alias</a>. The amount of coverage computed for Anti-aliased pixels also varies across platforms. Anti-alias is disabled by default. -Anti-alias can be enabled by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> +Anti-alias can be enabled by default by setting <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a> to <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> at compile time. ### Example <div><fiddle-embed name="a6575a49467ce8d28bb01cc7638fa04d"><div>A red line is drawn with transparency on the edges to make it look smoother. A blue line draws only where the pixel centers are contained. -The lines are drawn into <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, then drawn magnified to make the -<a href="undocumented#Alias">Aliasing</a> easier to see. +The lines are drawn into <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, then drawn magnified to make the +<a href='undocumented#Alias'>Aliasing</a> easier to see. </div></fiddle-embed></div> -<a name="SkPaint_isAntiAlias"></a> +<a name='SkPaint_isAntiAlias'></a> ## isAntiAlias -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isAntiAlias() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isAntiAlias'>isAntiAlias</a>() const </pre> -If true, pixels on the active edges of <a href="SkPath_Reference#Path">Path</a> may be drawn with partial transparency. +If true, pixels on the active edges of <a href='SkPath_Reference#Path'>Path</a> may be drawn with partial transparency. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a>. ### Return Value -<a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> state +<a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> state ### Example @@ -947,23 +1694,23 @@ paint.isAntiAlias() == !!(paint.getFlags() & SkPaint::kAntiAlias_Flag) --- -<a name="SkPaint_setAntiAlias"></a> +<a name='SkPaint_setAntiAlias'></a> ## setAntiAlias -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAntiAlias(bool aa) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setAntiAlias'>setAntiAlias</a>(bool aa) </pre> -Requests, but does not require, that <a href="SkPath_Reference#Path">Path</a> edge pixels draw opaque or with +Requests, but does not require, that <a href='SkPath_Reference#Path'>Path</a> edge pixels draw opaque or with partial transparency. -Sets <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> if <a href="#SkPaint_setAntiAlias_aa">aa</a> is true. -Clears <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> if <a href="#SkPaint_setAntiAlias_aa">aa</a> is false. +Sets <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> if <a href='#SkPaint_setAntiAlias_aa'>aa</a> is true. +Clears <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> if <a href='#SkPaint_setAntiAlias_aa'>aa</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setAntiAlias_aa"> <code><strong>aa </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a></td> +<table> <tr> <td><a name='SkPaint_setAntiAlias_aa'><code><strong>aa</strong></code></a></td> + <td>setting for <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a></td> </tr> </table> @@ -981,24 +1728,24 @@ paint1 == paint2 --- -## <a name="Dither"></a> Dither +## <a name='Dither'>Dither</a> -<a href="#Dither">Dither</a> increases fidelity by adjusting the color of adjacent pixels. +<a href='#Dither'>Dither</a> increases fidelity by adjusting the color of adjacent pixels. This can help to smooth color transitions and reducing banding in gradients. -Dithering lessens visible banding from <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> -and <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a> gradients, -and improves rendering into a <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> <a href="SkSurface_Reference#Surface">Surface</a>. +Dithering lessens visible banding from <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> +and <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> gradients, +and improves rendering into a <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>. Dithering is always enabled for linear gradients drawing into -<a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> <a href="SkSurface_Reference#Surface">Surface</a> and <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a> <a href="SkSurface_Reference#Surface">Surface</a>. -<a href="#Dither">Dither</a> cannot be enabled for <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a> <a href="SkSurface_Reference#Surface">Surface</a> and -<a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> <a href="SkSurface_Reference#Surface">Surface</a>. +<a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a> and <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>. +<a href='#Dither'>Dither</a> cannot be enabled for <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a> and +<a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> <a href='SkSurface_Reference#Surface'>Surface</a>. -<a href="#Dither">Dither</a> is disabled by default. -<a href="#Dither">Dither</a> can be enabled by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to <a href="#SkPaint_kDither_Flag">kDither Flag</a> +<a href='#Dither'>Dither</a> is disabled by default. +<a href='#Dither'>Dither</a> can be enabled by default by setting <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a> to <a href='#SkPaint_kDither_Flag'>kDither Flag</a> at compile time. -Some platform implementations may ignore dithering. SetSK_IGNORE_GPU_DITHERto ignore <a href="#Dither">Dither</a> on <a href="undocumented#GPU_Surface">GPU Surface</a>. +Some platform implementations may ignore dithering. SetSK_IGNORE_GPU_DITHERto ignore <a href='#Dither'>Dither</a> on <a href='undocumented#GPU_Surface'>GPU Surface</a>. ### Example @@ -1009,24 +1756,24 @@ alternating nearby colors from pixel to pixel. ### Example <div><fiddle-embed name="76d4d4a7931a48495e4d5f54e073be53"><div>Dithering introduces subtle adjustments to color to smooth gradients. -Drawing the gradient repeatedly with <a href="undocumented#SkBlendMode_kPlus">SkBlendMode::kPlus</a> exaggerates the +Drawing the gradient repeatedly with <a href='undocumented#SkBlendMode_kPlus'>SkBlendMode::kPlus</a> exaggerates the dither, making it easier to see. </div></fiddle-embed></div> -<a name="SkPaint_isDither"></a> +<a name='SkPaint_isDither'></a> ## isDither -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isDither() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isDither'>isDither</a>() const </pre> If true, color error may be distributed to smooth color transition. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kDither_Flag">kDither Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kDither_Flag'>kDither Flag</a>. ### Return Value -<a href="#SkPaint_kDither_Flag">kDither Flag</a> state +<a href='#SkPaint_kDither_Flag'>kDither Flag</a> state ### Example @@ -1043,22 +1790,22 @@ paint.isDither() == !!(paint.getFlags() & SkPaint::kDither_Flag) --- -<a name="SkPaint_setDither"></a> +<a name='SkPaint_setDither'></a> ## setDither -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setDither(bool dither) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setDither'>setDither</a>(bool dither) </pre> Requests, but does not require, to distribute color error. -Sets <a href="#SkPaint_kDither_Flag">kDither Flag</a> if <a href="#SkPaint_setDither_dither">dither</a> is true. -Clears <a href="#SkPaint_kDither_Flag">kDither Flag</a> if <a href="#SkPaint_setDither_dither">dither</a> is false. +Sets <a href='#SkPaint_kDither_Flag'>kDither Flag</a> if <a href='#SkPaint_setDither_dither'>dither</a> is true. +Clears <a href='#SkPaint_kDither_Flag'>kDither Flag</a> if <a href='#SkPaint_setDither_dither'>dither</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setDither_dither"> <code><strong>dither </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kDither_Flag">kDither Flag</a></td> +<table> <tr> <td><a name='SkPaint_setDither_dither'><code><strong>dither</strong></code></a></td> + <td>setting for <a href='#SkPaint_kDither_Flag'>kDither Flag</a></td> </tr> </table> @@ -1076,60 +1823,60 @@ paint1 == paint2 ### See Also -<a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> +<a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> --- ### See Also -Gradient <a href="SkColor_Reference#RGB">Color RGB</a>-565 +Gradient <a href='SkColor_Reference#RGB'>Color RGB</a>-565 -## <a name="Device_Text"></a> Device Text +## <a name='Device_Text'>Device Text</a> -<a href="#LCD_Text">LCD Text</a> and <a href="#Subpixel_Text">Subpixel Text</a> increase the precision of glyph position. +<a href='#LCD_Text'>LCD Text</a> and <a href='#Subpixel_Text'>Subpixel Text</a> increase the precision of glyph position. -When set, <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> takes advantage of the organization of <a href="SkColor_Reference#RGB">Color RGB</a> stripes that +When set, <a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> takes advantage of the organization of <a href='SkColor_Reference#RGB'>Color RGB</a> stripes that create a color, and relies on the small size of the stripe and visual perception to make the color fringing imperceptible. -<a href="#LCD_Text">LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order -the color components as <a href="SkColor_Reference#RGB">Color RGB</a> or <a href="SkColor_Reference#RBG">Color RBG</a>. +<a href='#LCD_Text'>LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order +the color components as <a href='SkColor_Reference#RGB'>Color RGB</a> or <a href='SkColor_Reference#RBG'>Color RBG</a>. -<a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> uses the pixel transparency to represent a fractional offset. +<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> uses the pixel transparency to represent a fractional offset. As the opaqueness of the color increases, the edge of the glyph appears to move towards the outside of the pixel. Either or both techniques can be enabled. -<a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> and <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> are clear by default. -<a href="#LCD_Text">LCD Text</a> or <a href="#Subpixel_Text">Subpixel Text</a> can be enabled by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to -<a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> or <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> (or both) at compile time. +<a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> and <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> are clear by default. +<a href='#LCD_Text'>LCD Text</a> or <a href='#Subpixel_Text'>Subpixel Text</a> can be enabled by default by setting <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a> to +<a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> or <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> (or both) at compile time. ### Example -<div><fiddle-embed name="4606ae1be792d6bc46d496432f050ee9"><div>Four commas are drawn normally and with combinations of <a href="#LCD_Text">LCD Text</a> and <a href="#Subpixel_Text">Subpixel Text</a>. -When <a href="#Subpixel_Text">Subpixel Text</a> is disabled, the comma <a href="undocumented#Glyph">Glyphs</a> are identical, but not evenly spaced. -When <a href="#Subpixel_Text">Subpixel Text</a> is enabled, the comma <a href="undocumented#Glyph">Glyphs</a> are unique, but appear evenly spaced. +<div><fiddle-embed name="4606ae1be792d6bc46d496432f050ee9"><div>Four commas are drawn normally and with combinations of <a href='#LCD_Text'>LCD Text</a> and <a href='#Subpixel_Text'>Subpixel Text</a>. +When <a href='#Subpixel_Text'>Subpixel Text</a> is disabled, the comma <a href='undocumented#Glyph'>Glyphs</a> are identical, but not evenly spaced. +When <a href='#Subpixel_Text'>Subpixel Text</a> is enabled, the comma <a href='undocumented#Glyph'>Glyphs</a> are unique, but appear evenly spaced. </div></fiddle-embed></div> -## <a name="Linear_Text"></a> Linear Text +## <a name='Linear_Text'>Linear Text</a> -<a href="#Linear_Text">Linear Text</a> selects whether text is rendered as a <a href="undocumented#Glyph">Glyph</a> or as a <a href="SkPath_Reference#Path">Path</a>. -If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is set, it has the same effect as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a>. -If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is clear, it is the same as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>. +<a href='#Linear_Text'>Linear Text</a> selects whether text is rendered as a <a href='undocumented#Glyph'>Glyph</a> or as a <a href='SkPath_Reference#Path'>Path</a>. +If <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> is set, it has the same effect as setting <a href='#SkPaint_Hinting'>Hinting</a> to <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a>. +If <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> is clear, it is the same as setting <a href='#SkPaint_Hinting'>Hinting</a> to <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a>. -<a name="SkPaint_isLinearText"></a> +<a name='SkPaint_isLinearText'></a> ## isLinearText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isLinearText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isLinearText'>isLinearText</a>() const </pre> -If true, text is converted to <a href="SkPath_Reference#Path">Path</a> before drawing and measuring. +If true, text is converted to <a href='SkPath_Reference#Path'>Path</a> before drawing and measuring. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a>. ### Return Value -<a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> state +<a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> state ### Example @@ -1137,27 +1884,27 @@ Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkP ### See Also -<a href="#SkPaint_setLinearText">setLinearText</a> <a href="#SkPaint_Hinting">Hinting</a> +<a href='#SkPaint_setLinearText'>setLinearText</a> <a href='#SkPaint_Hinting'>Hinting</a> --- -<a name="SkPaint_setLinearText"></a> +<a name='SkPaint_setLinearText'></a> ## setLinearText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLinearText(bool linearText) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setLinearText'>setLinearText</a>(bool linearText) </pre> -If true, text is converted to <a href="SkPath_Reference#Path">Path</a> before drawing and measuring. -By default, <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is clear. +If true, text is converted to <a href='SkPath_Reference#Path'>Path</a> before drawing and measuring. +By default, <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> is clear. -Sets <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> if <a href="#SkPaint_setLinearText_linearText">linearText</a> is true. -Clears <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> if <a href="#SkPaint_setLinearText_linearText">linearText</a> is false. +Sets <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> if <a href='#SkPaint_setLinearText_linearText'>linearText</a> is true. +Clears <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a> if <a href='#SkPaint_setLinearText_linearText'>linearText</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setLinearText_linearText"> <code><strong>linearText </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a></td> +<table> <tr> <td><a name='SkPaint_setLinearText_linearText'><code><strong>linearText</strong></code></a></td> + <td>setting for <a href='#SkPaint_kLinearText_Flag'>kLinearText Flag</a></td> </tr> </table> @@ -1167,30 +1914,30 @@ setting for <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a></td> ### See Also -<a href="#SkPaint_isLinearText">isLinearText</a> <a href="#SkPaint_Hinting">Hinting</a> +<a href='#SkPaint_isLinearText'>isLinearText</a> <a href='#SkPaint_Hinting'>Hinting</a> --- -## <a name="Subpixel_Text"></a> Subpixel Text +## <a name='Subpixel_Text'>Subpixel Text</a> -<a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> uses the pixel transparency to represent a fractional offset. +<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> uses the pixel transparency to represent a fractional offset. As the opaqueness of the color increases, the edge of the glyph appears to move towards the outside of the pixel. -<a name="SkPaint_isSubpixelText"></a> +<a name='SkPaint_isSubpixelText'></a> ## isSubpixelText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isSubpixelText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isSubpixelText'>isSubpixelText</a>() const </pre> -If true, <a href="undocumented#Glyph">Glyphs</a> at different sub-pixel positions may differ on pixel edge coverage. +If true, <a href='undocumented#Glyph'>Glyphs</a> at different sub-pixel positions may differ on pixel edge coverage. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a>. ### Return Value -<a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> state +<a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> state ### Example @@ -1207,22 +1954,22 @@ paint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag) --- -<a name="SkPaint_setSubpixelText"></a> +<a name='SkPaint_setSubpixelText'></a> ## setSubpixelText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setSubpixelText(bool subpixelText) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setSubpixelText'>setSubpixelText</a>(bool subpixelText) </pre> -Requests, but does not require, that <a href="undocumented#Glyph">Glyphs</a> respect sub-pixel positioning. +Requests, but does not require, that <a href='undocumented#Glyph'>Glyphs</a> respect sub-pixel positioning. -Sets <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> if <a href="#SkPaint_setSubpixelText_subpixelText">subpixelText</a> is true. -Clears <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> if <a href="#SkPaint_setSubpixelText_subpixelText">subpixelText</a> is false. +Sets <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> if <a href='#SkPaint_setSubpixelText_subpixelText'>subpixelText</a> is true. +Clears <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a> if <a href='#SkPaint_setSubpixelText_subpixelText'>subpixelText</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setSubpixelText_subpixelText"> <code><strong>subpixelText </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a></td> +<table> <tr> <td><a name='SkPaint_setSubpixelText_subpixelText'><code><strong>subpixelText</strong></code></a></td> + <td>setting for <a href='#SkPaint_kSubpixelText_Flag'>kSubpixelText Flag</a></td> </tr> </table> @@ -1240,28 +1987,28 @@ paint1 == paint2 --- -## <a name="LCD_Text"></a> LCD Text +## <a name='LCD_Text'>LCD Text</a> -When set, <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> takes advantage of the organization of <a href="SkColor_Reference#RGB">Color RGB</a> stripes that +When set, <a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> takes advantage of the organization of <a href='SkColor_Reference#RGB'>Color RGB</a> stripes that create a color, and relies on the small size of the stripe and visual perception to make the color fringing imperceptible. -<a href="#LCD_Text">LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order -the color components as <a href="SkColor_Reference#RGB">Color RGB</a> or <a href="SkColor_Reference#RBG">Color RBG</a>. +<a href='#LCD_Text'>LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order +the color components as <a href='SkColor_Reference#RGB'>Color RGB</a> or <a href='SkColor_Reference#RBG'>Color RBG</a>. -<a name="SkPaint_isLCDRenderText"></a> +<a name='SkPaint_isLCDRenderText'></a> ## isLCDRenderText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isLCDRenderText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isLCDRenderText'>isLCDRenderText</a>() const </pre> -If true, <a href="undocumented#Glyph">Glyphs</a> may use LCD striping to improve glyph edges. +If true, <a href='undocumented#Glyph'>Glyphs</a> may use LCD striping to improve glyph edges. -Returns true if <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> is set. +Returns true if <a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> is set. ### Return Value -<a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> state +<a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> state ### Example @@ -1278,22 +2025,22 @@ paint.isLCDRenderText() == !!(paint.getFlags() & SkPaint::kLCDRenderText_Flag) --- -<a name="SkPaint_setLCDRenderText"></a> +<a name='SkPaint_setLCDRenderText'></a> ## setLCDRenderText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLCDRenderText(bool lcdText) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setLCDRenderText'>setLCDRenderText</a>(bool lcdText) </pre> -Requests, but does not require, that <a href="undocumented#Glyph">Glyphs</a> use LCD striping for glyph edges. +Requests, but does not require, that <a href='undocumented#Glyph'>Glyphs</a> use LCD striping for glyph edges. -Sets <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> if <a href="#SkPaint_setLCDRenderText_lcdText">lcdText</a> is true. -Clears <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> if <a href="#SkPaint_setLCDRenderText_lcdText">lcdText</a> is false. +Sets <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> if <a href='#SkPaint_setLCDRenderText_lcdText'>lcdText</a> is true. +Clears <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a> if <a href='#SkPaint_setLCDRenderText_lcdText'>lcdText</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setLCDRenderText_lcdText"> <code><strong>lcdText </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a></td> +<table> <tr> <td><a name='SkPaint_setLCDRenderText_lcdText'><code><strong>lcdText</strong></code></a></td> + <td>setting for <a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText Flag</a></td> </tr> </table> @@ -1311,20 +2058,20 @@ paint1 == paint2 --- -## <a name="Font_Embedded_Bitmaps"></a> Font Embedded Bitmaps +## <a name='Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a> -<a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> allows selecting custom sized bitmap <a href="undocumented#Glyph">Glyphs</a>. -<a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> when set chooses an embedded bitmap glyph over an outline contained +<a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a> allows selecting custom sized bitmap <a href='undocumented#Glyph'>Glyphs</a>. +<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> when set chooses an embedded bitmap glyph over an outline contained in a font if the platform supports this option. -FreeType selects the bitmap glyph if available when <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set, and selects -the outline glyph if <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is clear. +FreeType selects the bitmap glyph if available when <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> is set, and selects +the outline glyph if <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> is clear. Windows may select the bitmap glyph but is not required to do so. -<a href="undocumented#OS_X">OS X</a> and iOS do not support this option. +<a href='undocumented#OS_X'>OS X</a> and iOS do not support this option. -<a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> is disabled by default. -<a href="#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> can be enabled by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to -<a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> at compile time. +<a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a> is disabled by default. +<a href='#Font_Embedded_Bitmaps'>Font Embedded Bitmaps</a> can be enabled by default by setting <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a> to +<a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> at compile time. ### Example @@ -1351,20 +2098,20 @@ Windows may select the bitmap glyph but is not required to do so. </pre> -<a name="SkPaint_isEmbeddedBitmapText"></a> +<a name='SkPaint_isEmbeddedBitmapText'></a> ## isEmbeddedBitmapText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isEmbeddedBitmapText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isEmbeddedBitmapText'>isEmbeddedBitmapText</a>() const </pre> -If true, <a href="undocumented#Engine">Font Engine</a> may return <a href="undocumented#Glyph">Glyphs</a> from font bitmaps instead of from outlines. +If true, <a href='undocumented#Engine'>Font Engine</a> may return <a href='undocumented#Glyph'>Glyphs</a> from font bitmaps instead of from outlines. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a>. ### Return Value -<a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> state +<a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> state ### Example @@ -1381,22 +2128,22 @@ paint.isEmbeddedBitmapText() == !!(paint.getFlags() & SkPaint::kEmbeddedBitmapTe --- -<a name="SkPaint_setEmbeddedBitmapText"></a> +<a name='SkPaint_setEmbeddedBitmapText'></a> ## setEmbeddedBitmapText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setEmbeddedBitmapText(bool useEmbeddedBitmapText) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setEmbeddedBitmapText'>setEmbeddedBitmapText</a>(bool useEmbeddedBitmapText) </pre> Requests, but does not require, to use bitmaps in fonts instead of outlines. -Sets <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> if <a href="#SkPaint_setEmbeddedBitmapText_useEmbeddedBitmapText">useEmbeddedBitmapText</a> is true. -Clears <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> if <a href="#SkPaint_setEmbeddedBitmapText_useEmbeddedBitmapText">useEmbeddedBitmapText</a> is false. +Sets <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> if <a href='#SkPaint_setEmbeddedBitmapText_useEmbeddedBitmapText'>useEmbeddedBitmapText</a> is true. +Clears <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a> if <a href='#SkPaint_setEmbeddedBitmapText_useEmbeddedBitmapText'>useEmbeddedBitmapText</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setEmbeddedBitmapText_useEmbeddedBitmapText"> <code><strong>useEmbeddedBitmapText </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a></td> +<table> <tr> <td><a name='SkPaint_setEmbeddedBitmapText_useEmbeddedBitmapText'><code><strong>useEmbeddedBitmapText</strong></code></a></td> + <td>setting for <a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText Flag</a></td> </tr> </table> @@ -1414,31 +2161,31 @@ paint1 == paint2 --- -## <a name="Automatic_Hinting"></a> Automatic Hinting +## <a name='Automatic_Hinting'>Automatic Hinting</a> -If <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> or <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>, <a href="#Automatic_Hinting">Automatic Hinting</a> -instructs the <a href="undocumented#Font_Manager">Font Manager</a> to always hint <a href="undocumented#Glyph">Glyphs</a>. -<a href="#Automatic_Hinting">Automatic Hinting</a> has no effect if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> or -<a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a>. +If <a href='#SkPaint_Hinting'>Hinting</a> is set to <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a> or <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a>, <a href='#Automatic_Hinting'>Automatic Hinting</a> +instructs the <a href='undocumented#Font_Manager'>Font Manager</a> to always hint <a href='undocumented#Glyph'>Glyphs</a>. +<a href='#Automatic_Hinting'>Automatic Hinting</a> has no effect if <a href='#SkPaint_Hinting'>Hinting</a> is set to <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a> or +<a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a>. -<a href="#Automatic_Hinting">Automatic Hinting</a> only affects platforms that use FreeType as the <a href="undocumented#Font_Manager">Font Manager</a>. +<a href='#Automatic_Hinting'>Automatic Hinting</a> only affects platforms that use FreeType as the <a href='undocumented#Font_Manager'>Font Manager</a>. -<a name="SkPaint_isAutohinted"></a> +<a name='SkPaint_isAutohinted'></a> ## isAutohinted -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isAutohinted() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isAutohinted'>isAutohinted</a>() const </pre> -If true, and if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> or <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>, and if -platform uses FreeType as the <a href="undocumented#Font_Manager">Font Manager</a>, instruct the <a href="undocumented#Font_Manager">Font Manager</a> to always hint -<a href="undocumented#Glyph">Glyphs</a>. +If true, and if <a href='#SkPaint_Hinting'>Hinting</a> is set to <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a> or <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a>, and if +platform uses FreeType as the <a href='undocumented#Font_Manager'>Font Manager</a>, instruct the <a href='undocumented#Font_Manager'>Font Manager</a> to always hint +<a href='undocumented#Glyph'>Glyphs</a>. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a>. ### Return Value -<a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a> state +<a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a> state ### Example @@ -1455,31 +2202,31 @@ paint.isAutohinted() == !!(paint.getFlags() & SkPaint::kAutoHinting_Flag) ### See Also -<a href="#SkPaint_setAutohinted">setAutohinted</a> <a href="#SkPaint_Hinting">Hinting</a> +<a href='#SkPaint_setAutohinted'>setAutohinted</a> <a href='#SkPaint_Hinting'>Hinting</a> --- -<a name="SkPaint_setAutohinted"></a> +<a name='SkPaint_setAutohinted'></a> ## setAutohinted -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAutohinted(bool useAutohinter) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setAutohinted'>setAutohinted</a>(bool useAutohinter) </pre> -If <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> or <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> and <a href="#SkPaint_setAutohinted_useAutohinter">useAutohinter</a> is set, -instruct the <a href="undocumented#Font_Manager">Font Manager</a> to always hint <a href="undocumented#Glyph">Glyphs</a>. -<a href="#Automatic_Hinting">Automatic Hinting</a> has no effect if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> or -<a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a>. +If <a href='#SkPaint_Hinting'>Hinting</a> is set to <a href='#SkPaint_kNormal_Hinting'>kNormal Hinting</a> or <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a> and <a href='#SkPaint_setAutohinted_useAutohinter'>useAutohinter</a> is set, +instruct the <a href='undocumented#Font_Manager'>Font Manager</a> to always hint <a href='undocumented#Glyph'>Glyphs</a>. +<a href='#Automatic_Hinting'>Automatic Hinting</a> has no effect if <a href='#SkPaint_Hinting'>Hinting</a> is set to <a href='#SkPaint_kNo_Hinting'>kNo Hinting</a> or +<a href='#SkPaint_kSlight_Hinting'>kSlight Hinting</a>. -Only affects platforms that use FreeType as the <a href="undocumented#Font_Manager">Font Manager</a>. +Only affects platforms that use FreeType as the <a href='undocumented#Font_Manager'>Font Manager</a>. -Sets <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a> if <a href="#SkPaint_setAutohinted_useAutohinter">useAutohinter</a> is true. -Clears <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a> if <a href="#SkPaint_setAutohinted_useAutohinter">useAutohinter</a> is false. +Sets <a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a> if <a href='#SkPaint_setAutohinted_useAutohinter'>useAutohinter</a> is true. +Clears <a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a> if <a href='#SkPaint_setAutohinted_useAutohinter'>useAutohinter</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setAutohinted_useAutohinter"> <code><strong>useAutohinter </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a></td> +<table> <tr> <td><a name='SkPaint_setAutohinted_useAutohinter'><code><strong>useAutohinter</strong></code></a></td> + <td>setting for <a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting Flag</a></td> </tr> </table> @@ -1489,50 +2236,50 @@ setting for <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a></td> ### See Also -<a href="#SkPaint_isAutohinted">isAutohinted</a> <a href="#SkPaint_Hinting">Hinting</a> +<a href='#SkPaint_isAutohinted'>isAutohinted</a> <a href='#SkPaint_Hinting'>Hinting</a> --- -## <a name="Vertical_Text"></a> Vertical Text +## <a name='Vertical_Text'>Vertical Text</a> -<a href="undocumented#Text">Text</a> may be drawn by positioning each glyph, or by positioning the first glyph and -using <a href="undocumented#Advance">Font Advance</a> to position subsequent <a href="undocumented#Glyph">Glyphs</a>. By default, each successive glyph -is positioned to the right of the preceding glyph. <a href="#Vertical_Text">Vertical Text</a> sets successive -<a href="undocumented#Glyph">Glyphs</a> to position below the preceding glyph. +<a href='undocumented#Text'>Text</a> may be drawn by positioning each glyph, or by positioning the first glyph and +using <a href='undocumented#Advance'>Font Advance</a> to position subsequent <a href='undocumented#Glyph'>Glyphs</a>. By default, each successive glyph +is positioned to the right of the preceding glyph. <a href='#Vertical_Text'>Vertical Text</a> sets successive +<a href='undocumented#Glyph'>Glyphs</a> to position below the preceding glyph. -Skia can translate text character codes as a series of <a href="undocumented#Glyph">Glyphs</a>, but does not implement +Skia can translate text character codes as a series of <a href='undocumented#Glyph'>Glyphs</a>, but does not implement font substitution, textual substitution, line layout, or contextual spacing like Kerning pairs. Use -a text shaping engine like <a href="http://harfbuzz.org/">HarfBuzz</a> to translate text runs +a text shaping engine like <a href='https://harfbuzz.org/'>HarfBuzz</a></a> to translate text runs into glyph series. -<a href="#Vertical_Text">Vertical Text</a> is clear if text is drawn left to right or set if drawn from top to bottom. +<a href='#Vertical_Text'>Vertical Text</a> is clear if text is drawn left to right or set if drawn from top to bottom. -<a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> if clear draws text left to right. -<a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> if set draws text top to bottom. +<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if clear draws text left to right. +<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if set draws text top to bottom. -<a href="#Vertical_Text">Vertical Text</a> is clear by default. -<a href="#Vertical_Text">Vertical Text</a> can be set by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to -<a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> at compile time. +<a href='#Vertical_Text'>Vertical Text</a> is clear by default. +<a href='#Vertical_Text'>Vertical Text</a> can be set by default by setting <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a> to +<a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> at compile time. ### Example <div><fiddle-embed name="8df5800819311b71373d9abb669b49b8"></fiddle-embed></div> -<a name="SkPaint_isVerticalText"></a> +<a name='SkPaint_isVerticalText'></a> ## isVerticalText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isVerticalText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isVerticalText'>isVerticalText</a>() const </pre> -If true, <a href="undocumented#Glyph">Glyphs</a> are drawn top to bottom instead of left to right. +If true, <a href='undocumented#Glyph'>Glyphs</a> are drawn top to bottom instead of left to right. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a>. ### Return Value -<a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> state +<a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> state ### Example @@ -1549,23 +2296,23 @@ paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag) --- -<a name="SkPaint_setVerticalText"></a> +<a name='SkPaint_setVerticalText'></a> ## setVerticalText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setVerticalText(bool verticalText) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setVerticalText'>setVerticalText</a>(bool verticalText) </pre> If true, text advance positions the next glyph below the previous glyph instead of to the right of previous glyph. -Sets <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> if vertical is true. -Clears <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> if vertical is false. +Sets <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if vertical is true. +Clears <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if vertical is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setVerticalText_verticalText"> <code><strong>verticalText </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a></td> +<table> <tr> <td><a name='SkPaint_setVerticalText_verticalText'><code><strong>verticalText</strong></code></a></td> + <td>setting for <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a></td> </tr> </table> @@ -1583,40 +2330,40 @@ paint1 == paint2 --- -## <a name="Fake_Bold"></a> Fake Bold +## <a name='Fake_Bold'>Fake Bold</a> -<a href="#Fake_Bold">Fake Bold</a> approximates the bold font style accompanying a normal font when a bold font face +<a href='#Fake_Bold'>Fake Bold</a> approximates the bold font style accompanying a normal font when a bold font face is not available. Skia does not provide font substitution; it is up to the client to find the -bold font face using the platform <a href="undocumented#Font_Manager">Font Manager</a>. +bold font face using the platform <a href='undocumented#Font_Manager'>Font Manager</a>. -Use <a href="#Text_Skew_X">Text Skew X</a> to approximate an italic font style when the italic font face +Use <a href='#Text_Skew_X'>Text Skew X</a> to approximate an italic font style when the italic font face is not available. A FreeType based port may define SK_USE_FREETYPE_EMBOLDEN at compile time to direct -the font engine to create the bold <a href="undocumented#Glyph">Glyphs</a>. Otherwise, the extra bold is computed -by increasing the stroke width and setting the <a href="#SkPaint_Style">Style</a> to <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> as needed. +the font engine to create the bold <a href='undocumented#Glyph'>Glyphs</a>. Otherwise, the extra bold is computed +by increasing the stroke width and setting the <a href='#SkPaint_Style'>Style</a> to <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a> as needed. -<a href="#Fake_Bold">Fake Bold</a> is disabled by default. +<a href='#Fake_Bold'>Fake Bold</a> is disabled by default. ### Example <div><fiddle-embed name="e811f4829a2daaaeaad3795504a7e02a"></fiddle-embed></div> -<a name="SkPaint_isFakeBoldText"></a> +<a name='SkPaint_isFakeBoldText'></a> ## isFakeBoldText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isFakeBoldText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isFakeBoldText'>isFakeBoldText</a>() const </pre> If true, approximate bold by increasing the stroke width when creating glyph bitmaps from outlines. -Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a>. +Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a>. ### Return Value -<a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> state +<a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a> state ### Example @@ -1633,22 +2380,22 @@ paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag) --- -<a name="SkPaint_setFakeBoldText"></a> +<a name='SkPaint_setFakeBoldText'></a> ## setFakeBoldText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setFakeBoldText(bool fakeBoldText) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setFakeBoldText'>setFakeBoldText</a>(bool fakeBoldText) </pre> Use increased stroke width when creating glyph bitmaps to approximate a bold typeface. -Sets <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> if <a href="#SkPaint_setFakeBoldText_fakeBoldText">fakeBoldText</a> is true. -Clears <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> if <a href="#SkPaint_setFakeBoldText_fakeBoldText">fakeBoldText</a> is false. +Sets <a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a> if <a href='#SkPaint_setFakeBoldText_fakeBoldText'>fakeBoldText</a> is true. +Clears <a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a> if <a href='#SkPaint_setFakeBoldText_fakeBoldText'>fakeBoldText</a> is false. ### Parameters -<table> <tr> <td><a name="SkPaint_setFakeBoldText_fakeBoldText"> <code><strong>fakeBoldText </strong></code> </a></td> <td> -setting for <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a></td> +<table> <tr> <td><a name='SkPaint_setFakeBoldText_fakeBoldText'><code><strong>fakeBoldText</strong></code></a></td> + <td>setting for <a href='#SkPaint_kFakeBoldText_Flag'>kFakeBoldText Flag</a></td> </tr> </table> @@ -1666,73 +2413,81 @@ paint1 == paint2 --- -## <a name="Full_Hinting_Spacing"></a> Full Hinting Spacing +## <a name='Full_Hinting_Spacing'>Full Hinting Spacing</a> -if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>, <a href="#Full_Hinting_Spacing">Full Hinting Spacing</a> adjusts the character -spacing by the difference of the hinted and Unhinted <a href="undocumented#Left_Side_Bearing">Left Side Bearing</a> and -<a href="undocumented#Right_Side_Bearing">Right Side Bearing</a>. <a href="#Full_Hinting_Spacing">Full Hinting Spacing</a> only applies to platforms that use -FreeType as their <a href="undocumented#Engine">Font Engine</a>. +if <a href='#SkPaint_Hinting'>Hinting</a> is set to <a href='#SkPaint_kFull_Hinting'>kFull Hinting</a>, <a href='#Full_Hinting_Spacing'>Full Hinting Spacing</a> adjusts the character +spacing by the difference of the hinted and Unhinted <a href='undocumented#Left_Side_Bearing'>Left Side Bearing</a> and +<a href='undocumented#Right_Side_Bearing'>Right Side Bearing</a>. <a href='#Full_Hinting_Spacing'>Full Hinting Spacing</a> only applies to platforms that use +FreeType as their <a href='undocumented#Engine'>Font Engine</a>. -<a href="#Full_Hinting_Spacing">Full Hinting Spacing</a> is not related to text Kerning, where the space between +<a href='#Full_Hinting_Spacing'>Full Hinting Spacing</a> is not related to text Kerning, where the space between a specific pair of characters is adjusted using data in the font Kerning tables. -<a name="SkPaint_isDevKernText"></a> +<a name='SkPaint_isDevKernText'></a> ## isDevKernText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isDevKernText() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isDevKernText'>isDevKernText</a>() const </pre> +Deprecated. + --- -<a name="SkPaint_setDevKernText"></a> +<a name='SkPaint_setDevKernText'></a> ## setDevKernText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setDevKernText(bool) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setDevKernText'>setDevKernText</a>(bool) </pre> +Deprecated. + --- -## <a name="Filter_Quality_Methods"></a> Filter Quality Methods +## <a name='Filter_Quality_Methods'>Filter Quality Methods</a> -<a href="undocumented#Filter_Quality">Filter Quality</a> trades speed for image filtering when the image is scaled. -A lower <a href="undocumented#Filter_Quality">Filter Quality</a> draws faster, but has less fidelity. -A higher <a href="undocumented#Filter_Quality">Filter Quality</a> draws slower, but looks better. -If the image is drawn without scaling, the <a href="undocumented#Filter_Quality">Filter Quality</a> choice will not result +<a href='undocumented#Filter_Quality'>Filter Quality</a> trades speed for image filtering when the image is scaled. +A lower <a href='undocumented#Filter_Quality'>Filter Quality</a> draws faster, but has less fidelity. +A higher <a href='undocumented#Filter_Quality'>Filter Quality</a> draws slower, but looks better. +If the image is drawn without scaling, the <a href='undocumented#Filter_Quality'>Filter Quality</a> choice will not result in a noticeable difference. -<a href="undocumented#Filter_Quality">Filter Quality</a> is used in <a href="#Paint">Paint</a> passed as a parameter to +<a href='undocumented#Filter_Quality'>Filter Quality</a> is used in <a href='#Paint'>Paint</a> passed as a parameter to <table> <tr> - <td><a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a></td> </tr> <tr> - <td><a href="SkCanvas_Reference#SkCanvas_drawBitmapRect">SkCanvas::drawBitmapRect</a></td> </tr> <tr> - <td><a href="SkCanvas_Reference#SkCanvas_drawImage">SkCanvas::drawImage</a></td> </tr> <tr> - <td><a href="SkCanvas_Reference#SkCanvas_drawImageRect">SkCanvas::drawImageRect</a></td> </tr> + <td><a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a></td> + </tr> <tr> + <td><a href='SkCanvas_Reference#SkCanvas_drawBitmapRect'>SkCanvas::drawBitmapRect</a></td> + </tr> <tr> + <td><a href='SkCanvas_Reference#SkCanvas_drawImage'>SkCanvas::drawImage</a></td> + </tr> <tr> + <td><a href='SkCanvas_Reference#SkCanvas_drawImageRect'>SkCanvas::drawImageRect</a></td> + </tr> </table> -and when <a href="#Paint">Paint</a> has a <a href="undocumented#Shader">Shader</a> specialization that uses <a href="SkImage_Reference#Image">Image</a> or <a href="SkBitmap_Reference#Bitmap">Bitmap</a>. +and when <a href='#Paint'>Paint</a> has a <a href='undocumented#Shader'>Shader</a> specialization that uses <a href='SkImage_Reference#Image'>Image</a> or <a href='SkBitmap_Reference#Bitmap'>Bitmap</a>. -<a href="undocumented#Filter_Quality">Filter Quality</a> is <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a> by default. +<a href='undocumented#Filter_Quality'>Filter Quality</a> is <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a> by default. ### Example <div><fiddle-embed name="69369cff2f5b145a6f616092513266a0"></fiddle-embed></div> -<a name="SkPaint_getFilterQuality"></a> +<a name='SkPaint_getFilterQuality'></a> ## getFilterQuality -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkFilterQuality getFilterQuality() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkFilterQuality'>SkFilterQuality</a> <a href='#SkPaint_getFilterQuality'>getFilterQuality</a>() const </pre> -Returns <a href="undocumented#Filter_Quality">Filter Quality</a>, the image filtering level. A lower setting +Returns <a href='undocumented#Filter_Quality'>Filter Quality</a>, the image filtering level. A lower setting draws faster; a higher setting looks better when the image is scaled. ### Return Value -one of: <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a>, <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a>, -<a href="undocumented#kMedium_SkFilterQuality">kMedium_SkFilterQuality</a>, <a href="undocumented#kHigh_SkFilterQuality">kHigh_SkFilterQuality</a> +one of: <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a>, +<a href='undocumented#kMedium_SkFilterQuality'>kMedium_SkFilterQuality</a>, <a href='undocumented#kHigh_SkFilterQuality'>kHigh_SkFilterQuality</a> ### Example @@ -1748,22 +2503,22 @@ kNone_SkFilterQuality == paint.getFilterQuality() --- -<a name="SkPaint_setFilterQuality"></a> +<a name='SkPaint_setFilterQuality'></a> ## setFilterQuality -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setFilterQuality(SkFilterQuality quality) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setFilterQuality'>setFilterQuality</a>(<a href='undocumented#SkFilterQuality'>SkFilterQuality</a> quality) </pre> -Sets <a href="undocumented#Filter_Quality">Filter Quality</a>, the image filtering level. A lower setting +Sets <a href='undocumented#Filter_Quality'>Filter Quality</a>, the image filtering level. A lower setting draws faster; a higher setting looks better when the image is scaled. -Does not check to see if <a href="#SkPaint_setFilterQuality_quality">quality</a> is valid. +Does not check to see if <a href='#SkPaint_setFilterQuality_quality'>quality</a> is valid. ### Parameters -<table> <tr> <td><a name="SkPaint_setFilterQuality_quality"> <code><strong>quality </strong></code> </a></td> <td> -one of: <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a>, <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a>, -<a href="undocumented#kMedium_SkFilterQuality">kMedium_SkFilterQuality</a>, <a href="undocumented#kHigh_SkFilterQuality">kHigh_SkFilterQuality</a></td> +<table> <tr> <td><a name='SkPaint_setFilterQuality_quality'><code><strong>quality</strong></code></a></td> + <td>one of: <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a>, +<a href='undocumented#kMedium_SkFilterQuality'>kMedium_SkFilterQuality</a>, <a href='undocumented#kHigh_SkFilterQuality'>kHigh_SkFilterQuality</a></td> </tr> </table> @@ -1781,30 +2536,30 @@ kHigh_SkFilterQuality == paint.getFilterQuality() ### See Also -<a href="undocumented#SkFilterQuality">SkFilterQuality</a> <a href="undocumented#Image_Scaling">Image Scaling</a> +<a href='undocumented#SkFilterQuality'>SkFilterQuality</a> <a href='undocumented#Image_Scaling'>Image Scaling</a> --- -## <a name="Color_Methods"></a> Color Methods +## <a name='Color_Methods'>Color Methods</a> | name | description | | --- | --- | -| <a href="#SkPaint_getColor">getColor</a> | returns <a href="SkColor_Reference#Alpha">Color Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a>, one drawing color | -| <a href="#SkPaint_setColor">setColor</a> | sets <a href="SkColor_Reference#Alpha">Color Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a>, one drawing color | +| <a href='#SkPaint_getColor'>getColor</a> | returns <a href='SkColor_Reference#Alpha'>Color Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a>, one drawing color | +| <a href='#SkPaint_setColor'>setColor</a> | sets <a href='SkColor_Reference#Alpha'>Color Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a>, one drawing color | -<a href="SkColor_Reference#Color">Color</a> specifies the <a href="SkColor_Reference#RGB_Red">Color RGB Red</a>, <a href="SkColor_Reference#RGB_Blue">Color RGB Blue</a>, <a href="SkColor_Reference#RGB_Green">Color RGB Green</a>, and <a href="SkColor_Reference#Alpha">Color Alpha</a> +<a href='SkColor_Reference#Color'>Color</a> specifies the <a href='SkColor_Reference#RGB_Red'>Color RGB Red</a>, <a href='SkColor_Reference#RGB_Blue'>Color RGB Blue</a>, <a href='SkColor_Reference#RGB_Green'>Color RGB Green</a>, and <a href='SkColor_Reference#Alpha'>Color Alpha</a> values used to draw a filled or stroked shape in a 32-bit value. Each component occupies 8-bits, ranging from zero: no contribution; to 255: full intensity. All values in any combination are valid. -<a href="SkColor_Reference#Color">Color</a> is not <a href="undocumented#Premultiply">Premultiplied</a>; <a href="SkColor_Reference#Alpha">Color Alpha</a> sets the transparency independent of -<a href="SkColor_Reference#RGB">Color RGB</a>: <a href="SkColor_Reference#RGB_Red">Color RGB Red</a>, <a href="SkColor_Reference#RGB_Blue">Color RGB Blue</a>, and <a href="SkColor_Reference#RGB_Green">Color RGB Green</a>. +<a href='SkColor_Reference#Color'>Color</a> is not <a href='undocumented#Premultiply'>Premultiplied</a>; <a href='SkColor_Reference#Alpha'>Color Alpha</a> sets the transparency independent of +<a href='SkColor_Reference#RGB'>Color RGB</a>: <a href='SkColor_Reference#RGB_Red'>Color RGB Red</a>, <a href='SkColor_Reference#RGB_Blue'>Color RGB Blue</a>, and <a href='SkColor_Reference#RGB_Green'>Color RGB Green</a>. -The bit positions of <a href="SkColor_Reference#Alpha">Color Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a> are independent of the bit +The bit positions of <a href='SkColor_Reference#Alpha'>Color Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a> are independent of the bit positions on the output device, which may have more or fewer bits, and may have a different arrangement. -| bit positions | <a href="SkColor_Reference#Alpha">Color Alpha</a> | <a href="SkColor_Reference#RGB_Red">Color RGB Red</a> | <a href="SkColor_Reference#RGB_Blue">Color RGB Blue</a> | <a href="SkColor_Reference#RGB_Green">Color RGB Green</a> | +| bit positions | <a href='SkColor_Reference#Alpha'>Color Alpha</a> | <a href='SkColor_Reference#RGB_Red'>Color RGB Red</a> | <a href='SkColor_Reference#RGB_Blue'>Color RGB Blue</a> | <a href='SkColor_Reference#RGB_Green'>Color RGB Green</a> | | --- | --- | --- | --- | --- | | | 31 - 24 | 23 - 16 | 15 - 8 | 7 - 0 | @@ -1812,20 +2567,20 @@ a different arrangement. <div><fiddle-embed name="214b559d75c65a7bef6ef4be1f860053"></fiddle-embed></div> -<a name="SkPaint_getColor"></a> +<a name='SkPaint_getColor'></a> ## getColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColor getColor() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkPaint_getColor'>getColor</a>() const </pre> -Retrieves <a href="SkColor_Reference#Alpha">Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a>, <a href="undocumented#Unpremultiply">Unpremultiplied</a>, packed into 32 bits. -Use helpers <a href="SkColor_Reference#SkColorGetA">SkColorGetA</a>, <a href="SkColor_Reference#SkColorGetR">SkColorGetR</a>, <a href="SkColor_Reference#SkColorGetG">SkColorGetG</a>, and <a href="SkColor_Reference#SkColorGetB">SkColorGetB</a> to extract +Retrieves <a href='SkColor_Reference#Alpha'>Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a>, <a href='undocumented#Unpremultiply'>Unpremultiplied</a>, packed into 32 bits. +Use helpers <a href='SkColor_Reference#SkColorGetA'>SkColorGetA</a>, <a href='SkColor_Reference#SkColorGetR'>SkColorGetR</a>, <a href='SkColor_Reference#SkColorGetG'>SkColorGetG</a>, and <a href='SkColor_Reference#SkColorGetB'>SkColorGetB</a> to extract a color component. ### Return Value -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#ARGB">Color ARGB</a> +<a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#ARGB'>Color ARGB</a> ### Example @@ -1841,24 +2596,24 @@ Yellow is 100% red, 100% green, and 0% blue. ### See Also -<a href="SkColor_Reference#SkColor">SkColor</a> +<a href='SkColor_Reference#SkColor'>SkColor</a> --- -<a name="SkPaint_setColor"></a> +<a name='SkPaint_setColor'></a> ## setColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setColor(SkColor color) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setColor'>setColor</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> color) </pre> -Sets <a href="SkColor_Reference#Alpha">Alpha</a> and <a href="SkColor_Reference#RGB">Color RGB</a> used when stroking and filling. The <a href="#SkPaint_setColor_color">color</a> is a 32-bit value, -<a href="undocumented#Unpremultiply">Unpremultiplied</a>, packing 8-bit components for <a href="SkColor_Reference#Alpha">Alpha</a>, <a href="SkColor_Reference#RGB_Red">Red</a>, <a href="SkColor_Reference#RGB_Blue">Blue</a>, and <a href="SkColor_Reference#RGB_Green">Green</a>. +Sets <a href='SkColor_Reference#Alpha'>Alpha</a> and <a href='SkColor_Reference#RGB'>Color RGB</a> used when stroking and filling. The <a href='#SkPaint_setColor_color'>color</a> is a 32-bit value, +<a href='undocumented#Unpremultiply'>Unpremultiplied</a>, packing 8-bit components for <a href='SkColor_Reference#Alpha'>Alpha</a>, <a href='SkColor_Reference#RGB_Red'>Red</a>, <a href='SkColor_Reference#RGB_Blue'>Blue</a>, and <a href='SkColor_Reference#RGB_Green'>Green</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_setColor_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#ARGB">Color ARGB</a></td> +<table> <tr> <td><a name='SkPaint_setColor_color'><code><strong>color</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#ARGB'>Color ARGB</a></td> </tr> </table> @@ -1876,26 +2631,26 @@ green1 == green2 ### See Also -<a href="SkColor_Reference#SkColor">SkColor</a> <a href="#SkPaint_setARGB">setARGB</a> <a href="SkColor_Reference#SkColorSetARGB">SkColorSetARGB</a> +<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkPaint_setARGB'>setARGB</a> <a href='SkColor_Reference#SkColorSetARGB'>SkColorSetARGB</a> --- -## <a name="Alpha_Methods"></a> Alpha Methods +## <a name='Alpha_Methods'>Alpha Methods</a> -<a href="SkColor_Reference#Alpha">Color Alpha</a> sets the transparency independent of <a href="SkColor_Reference#RGB">Color RGB</a>: <a href="SkColor_Reference#RGB_Red">Color RGB Red</a>, <a href="SkColor_Reference#RGB_Blue">Color RGB Blue</a>, and <a href="SkColor_Reference#RGB_Green">Color RGB Green</a>. +<a href='SkColor_Reference#Alpha'>Color Alpha</a> sets the transparency independent of <a href='SkColor_Reference#RGB'>Color RGB</a>: <a href='SkColor_Reference#RGB_Red'>Color RGB Red</a>, <a href='SkColor_Reference#RGB_Blue'>Color RGB Blue</a>, and <a href='SkColor_Reference#RGB_Green'>Color RGB Green</a>. -<a name="SkPaint_getAlpha"></a> +<a name='SkPaint_getAlpha'></a> ## getAlpha -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint8_t getAlpha() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint8_t <a href='#SkPaint_getAlpha'>getAlpha</a>() const </pre> -Retrieves <a href="SkColor_Reference#Alpha">Alpha</a> from the <a href="SkColor_Reference#Color">Color</a> used when stroking and filling. +Retrieves <a href='SkColor_Reference#Alpha'>Alpha</a> from the <a href='SkColor_Reference#Color'>Color</a> used when stroking and filling. ### Return Value -<a href="SkColor_Reference#Alpha">Alpha</a> ranging from zero, fully transparent, to 255, fully opaque +<a href='SkColor_Reference#Alpha'>Alpha</a> ranging from zero, fully transparent, to 255, fully opaque ### Example @@ -1911,23 +2666,23 @@ Retrieves <a href="SkColor_Reference#Alpha">Alpha</a> from the <a href="SkColor_ --- -<a name="SkPaint_setAlpha"></a> +<a name='SkPaint_setAlpha'></a> ## setAlpha -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAlpha(U8CPU a) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setAlpha'>setAlpha</a>(<a href='undocumented#U8CPU'>U8CPU</a> a) </pre> -Replaces <a href="SkColor_Reference#Alpha">Alpha</a>, leaving <a href="SkColor_Reference#RGB">Color RGB</a> +Replaces <a href='SkColor_Reference#Alpha'>Alpha</a>, leaving <a href='SkColor_Reference#RGB'>Color RGB</a> unchanged. An out of range value triggers an assert in the debug -build. <a href="#SkPaint_setAlpha_a">a</a> is <a href="#SkPaint_setAlpha_a">a</a> value from zero to 255. -<a href="#SkPaint_setAlpha_a">a</a> set to zero makes <a href="SkColor_Reference#Color">Color</a> fully transparent; <a href="#SkPaint_setAlpha_a">a</a> set to 255 makes <a href="SkColor_Reference#Color">Color</a> +build. <a href='#SkPaint_setAlpha_a'>a</a> is <a href='#SkPaint_setAlpha_a'>a</a> value from zero to 255. +<a href='#SkPaint_setAlpha_a'>a</a> set to zero makes <a href='SkColor_Reference#Color'>Color</a> fully transparent; <a href='#SkPaint_setAlpha_a'>a</a> set to 255 makes <a href='SkColor_Reference#Color'>Color</a> fully opaque. ### Parameters -<table> <tr> <td><a name="SkPaint_setAlpha_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="SkColor_Reference#Alpha">Alpha</a> component of <a href="SkColor_Reference#Color">Color</a></td> +<table> <tr> <td><a name='SkPaint_setAlpha_a'><code><strong>a</strong></code></a></td> + <td><a href='SkColor_Reference#Alpha'>Alpha</a> component of <a href='SkColor_Reference#Color'>Color</a></td> </tr> </table> @@ -1945,26 +2700,29 @@ fully opaque. --- -<a name="SkPaint_setARGB"></a> +<a name='SkPaint_setARGB'></a> ## setARGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setARGB'>setARGB</a>(<a href='undocumented#U8CPU'>U8CPU</a> a, <a href='undocumented#U8CPU'>U8CPU</a> r, <a href='undocumented#U8CPU'>U8CPU</a> g, <a href='undocumented#U8CPU'>U8CPU</a> b) </pre> -Sets <a href="SkColor_Reference#Color">Color</a> used when drawing solid fills. The color components range from 0 to 255. -The color is <a href="undocumented#Unpremultiply">Unpremultiplied</a>; <a href="SkColor_Reference#Alpha">Alpha</a> sets the transparency independent of <a href="SkColor_Reference#RGB">Color RGB</a>. +Sets <a href='SkColor_Reference#Color'>Color</a> used when drawing solid fills. The color components range from 0 to 255. +The color is <a href='undocumented#Unpremultiply'>Unpremultiplied</a>; <a href='SkColor_Reference#Alpha'>Alpha</a> sets the transparency independent of <a href='SkColor_Reference#RGB'>Color RGB</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_setARGB_a"> <code><strong>a </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#Alpha">Color Alpha</a>, from fully transparent (0) to fully opaque (255)</td> - </tr> <tr> <td><a name="SkPaint_setARGB_r"> <code><strong>r </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#RGB_Red">Color RGB Red</a>, from no red (0) to full red (255)</td> - </tr> <tr> <td><a name="SkPaint_setARGB_g"> <code><strong>g </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#RGB_Green">Color RGB Green</a>, from no green (0) to full green (255)</td> - </tr> <tr> <td><a name="SkPaint_setARGB_b"> <code><strong>b </strong></code> </a></td> <td> -amount of <a href="SkColor_Reference#RGB_Blue">Color RGB Blue</a>, from no blue (0) to full blue (255)</td> +<table> <tr> <td><a name='SkPaint_setARGB_a'><code><strong>a</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#Alpha'>Color Alpha</a>, from fully transparent (0) to fully opaque (255)</td> + </tr> + <tr> <td><a name='SkPaint_setARGB_r'><code><strong>r</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#RGB_Red'>Color RGB Red</a>, from no red (0) to full red (255)</td> + </tr> + <tr> <td><a name='SkPaint_setARGB_g'><code><strong>g</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#RGB_Green'>Color RGB Green</a>, from no green (0) to full green (255)</td> + </tr> + <tr> <td><a name='SkPaint_setARGB_b'><code><strong>b</strong></code></a></td> + <td>amount of <a href='SkColor_Reference#RGB_Blue'>Color RGB Blue</a>, from no blue (0) to full blue (255)</td> </tr> </table> @@ -1982,115 +2740,125 @@ transRed1 == transRed2 ### See Also -<a href="#SkPaint_setColor">setColor</a> <a href="SkColor_Reference#SkColorSetARGB">SkColorSetARGB</a> +<a href='#SkPaint_setColor'>setColor</a> <a href='SkColor_Reference#SkColorSetARGB'>SkColorSetARGB</a> --- -## <a name="Style"></a> Style +## <a name='Style'>Style</a> -<a href="#Style">Style</a> specifies if the geometry is filled, stroked, or both filled and stroked. -Some shapes ignore <a href="#Style">Style</a> and are always drawn filled or stroked. +<a href='#SkPaint_Style'>Style</a> specifies if the geometry is filled, stroked, or both filled and stroked. +Some shapes ignore <a href='#SkPaint_Style'>Style</a> and are always drawn filled or stroked. -Set <a href="#Style">Style</a> to <a href="#SkPaint_kFill_Style">kFill Style</a> to fill the shape. +Set <a href='#SkPaint_Style'>Style</a> to <a href='#SkPaint_kFill_Style'>kFill Style</a> to fill the shape. The fill covers the area inside the geometry for most shapes. -Set <a href="#Style">Style</a> to <a href="#SkPaint_kStroke_Style">kStroke Style</a> to stroke the shape. +Set <a href='#SkPaint_Style'>Style</a> to <a href='#SkPaint_kStroke_Style'>kStroke Style</a> to stroke the shape. -## <a name="Style_Fill"></a> Style Fill +## <a name='Style_Fill'>Style Fill</a> ### See Also -<a href="SkPath_Reference#Fill_Type">Path Fill Type</a> +<a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> -## <a name="Style_Stroke"></a> Style Stroke +## <a name='Style_Stroke'>Style Stroke</a> The stroke covers the area described by following the shape edge with a pen or brush of -<a href="#Stroke_Width">Stroke Width</a>. The area covered where the shape starts and stops is described by <a href="#Stroke_Cap">Stroke Cap</a>. -The area covered where the shape turns a corner is described by <a href="#Stroke_Join">Stroke Join</a>. +<a href='#Stroke_Width'>Stroke Width</a>. The area covered where the shape starts and stops is described by <a href='#Stroke_Cap'>Stroke Cap</a>. +The area covered where the shape turns a corner is described by <a href='#Stroke_Join'>Stroke Join</a>. The stroke is centered on the shape; it extends equally on either side of the shape edge. -As <a href="#Stroke_Width">Stroke Width</a> gets smaller, the drawn path frame is thinner. <a href="#Stroke_Width">Stroke Width</a> less than one -may have gaps, and if <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is set, <a href="SkColor_Reference#Alpha">Color Alpha</a> will increase to visually decrease coverage. +As <a href='#Stroke_Width'>Stroke Width</a> gets smaller, the drawn path frame is thinner. <a href='#Stroke_Width'>Stroke Width</a> less than one +may have gaps, and if <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> is set, <a href='SkColor_Reference#Alpha'>Color Alpha</a> will increase to visually decrease coverage. -## <a name="Style_Hairline"></a> Style Hairline +## <a name='Style_Hairline'>Style Hairline</a> -<a href="#Stroke_Width">Stroke Width</a> of zero has a special meaning and switches drawing to use <a href="#Style_Hairline">Hairline</a>. -<a href="#Style_Hairline">Hairline</a> draws the thinnest continuous frame. If <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is clear, adjacent pixels +<a href='#Stroke_Width'>Stroke Width</a> of zero has a special meaning and switches drawing to use <a href='#Style_Hairline'>Hairline</a>. +<a href='#Style_Hairline'>Hairline</a> draws the thinnest continuous frame. If <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> is clear, adjacent pixels flow horizontally, vertically,or diagonally. -<a href="SkPath_Reference#Path">Path</a> drawing with <a href="#Style_Hairline">Hairline</a> may hit the same pixel more than once. For instance, <a href="SkPath_Reference#Path">Path</a> containing -two lines in one <a href="SkPath_Reference#Contour">Path Contour</a> will draw the corner point once, but may both lines may draw the adjacent -pixel. If <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is set, transparency is applied twice, resulting in a darker pixel. Some +<a href='SkPath_Reference#Path'>Path</a> drawing with <a href='#Style_Hairline'>Hairline</a> may hit the same pixel more than once. For instance, <a href='SkPath_Reference#Path'>Path</a> containing +two lines in one <a href='SkPath_Reference#Contour'>Path Contour</a> will draw the corner point once, but may both lines may draw the adjacent +pixel. If <a href='#SkPaint_kAntiAlias_Flag'>kAntiAlias Flag</a> is set, transparency is applied twice, resulting in a darker pixel. Some GPU-backed implementations apply transparency at a later drawing stage, avoiding double hit pixels while stroking. -## <a name="SkPaint_Style"></a> Enum SkPaint::Style +## <a name='SkPaint_Style'>Enum SkPaint::Style</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_Style">Style</a> { - <a href="#SkPaint_kFill_Style">kFill Style</a>, - <a href="#SkPaint_kStroke_Style">kStroke Style</a>, - <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>, + enum <a href='#SkPaint_Style'>Style</a> { + <a href='#SkPaint_kFill_Style'>kFill Style</a>, + <a href='#SkPaint_kStroke_Style'>kStroke Style</a>, + <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a>, }; - static constexpr int <a href="#SkPaint_kStyleCount">kStyleCount</a> = <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> + 1; + static constexpr int <a href='#SkPaint_kStyleCount'>kStyleCount</a> = <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a> + 1; </pre> -Set <a href="#SkPaint_Style">Style</a> to fill, stroke, or both fill and stroke geometry. +Set <a href='#SkPaint_Style'>Style</a> to fill, stroke, or both fill and stroke geometry. The stroke and fill share all paint attributes; for instance, they are drawn with the same color. -Use <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> to avoid hitting the same pixels twice with a stroke draw and +Use <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a> to avoid hitting the same pixels twice with a stroke draw and a fill draw. ### Constants -<table> - <tr> - <td><a name="SkPaint_kFill_Style"> <code><strong>SkPaint::kFill_Style </strong></code> </a></td><td>0</td><td>Set to fill geometry. -Applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circles</a>, <a href="undocumented#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. -<a href="SkBitmap_Reference#Bitmap">Bitmap</a>, <a href="SkImage_Reference#Image">Image</a>, <a href="undocumented#Patch">Patches</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Sprite">Sprites</a>, and <a href="undocumented#Vertices">Vertices</a> are painted as if -<a href="#SkPaint_kFill_Style">kFill Style</a> is set, and ignore the set <a href="#SkPaint_Style">Style</a>. -The <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> specifies additional rules to fill the area outside the path edge, +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kFill_Style'><code>SkPaint::kFill_Style</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Applies to <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Region'>Region</a>, <a href='undocumented#Round_Rect'>Round Rect</a>, <a href='undocumented#Circle'>Circles</a>, <a href='undocumented#Oval'>Ovals</a>, <a href='SkPath_Reference#Path'>Path</a>, and <a href='undocumented#Text'>Text</a>. +<a href='SkBitmap_Reference#Bitmap'>Bitmap</a>, <a href='SkImage_Reference#Image'>Image</a>, <a href='undocumented#Patch'>Patches</a>, <a href='undocumented#Region'>Region</a>, <a href='undocumented#Sprite'>Sprites</a>, and <a href='undocumented#Vertices'>Vertices</a> are painted as if +<a href='#SkPaint_kFill_Style'>kFill Style</a> is set, and ignore the set <a href='#SkPaint_Style'>Style</a>. +The <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> specifies additional rules to fill the area outside the path edge, and to create an unfilled hole inside the shape. -<a href="#SkPaint_Style">Style</a> is set to <a href="#SkPaint_kFill_Style">kFill Style</a> by default. +<a href='#SkPaint_Style'>Style</a> is set to <a href='#SkPaint_kFill_Style'>kFill Style</a> by default. </td> </tr> <tr> - <td><a name="SkPaint_kStroke_Style"> <code><strong>SkPaint::kStroke_Style </strong></code> </a></td><td>1</td><td>Set to stroke geometry. -Applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Arc">Arcs</a>, <a href="undocumented#Circle">Circles</a>, <a href="undocumented#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. -<a href="undocumented#Arc">Arcs</a>, <a href="undocumented#Line">Lines</a>, and points, are always drawn as if <a href="#SkPaint_kStroke_Style">kStroke Style</a> is set, -and ignore the set <a href="#SkPaint_Style">Style</a>. -The stroke construction is unaffected by the <a href="SkPath_Reference#Fill_Type">Path Fill Type</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kStroke_Style'><code>SkPaint::kStroke_Style</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Applies to <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Region'>Region</a>, <a href='undocumented#Round_Rect'>Round Rect</a>, <a href='undocumented#Arc'>Arcs</a>, <a href='undocumented#Circle'>Circles</a>, <a href='undocumented#Oval'>Ovals</a>, <a href='SkPath_Reference#Path'>Path</a>, and <a href='undocumented#Text'>Text</a>. +<a href='undocumented#Arc'>Arcs</a>, <a href='undocumented#Line'>Lines</a>, and points, are always drawn as if <a href='#SkPaint_kStroke_Style'>kStroke Style</a> is set, +and ignore the set <a href='#SkPaint_Style'>Style</a>. +The stroke construction is unaffected by the <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a>. </td> </tr> - <tr> - <td><a name="SkPaint_kStrokeAndFill_Style"> <code><strong>SkPaint::kStrokeAndFill_Style </strong></code> </a></td><td>2</td><td>Set to stroke and fill geometry. -Applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circles</a>, <a href="undocumented#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. -<a href="SkPath_Reference#Path">Path</a> is treated as if it is set to <a href="SkPath_Reference#SkPath_kWinding_FillType">SkPath::kWinding FillType</a>, -and the set <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> is ignored. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kStrokeAndFill_Style'><code>SkPaint::kStrokeAndFill_Style</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Applies to <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Region'>Region</a>, <a href='undocumented#Round_Rect'>Round Rect</a>, <a href='undocumented#Circle'>Circles</a>, <a href='undocumented#Oval'>Ovals</a>, <a href='SkPath_Reference#Path'>Path</a>, and <a href='undocumented#Text'>Text</a>. +<a href='SkPath_Reference#Path'>Path</a> is treated as if it is set to <a href='SkPath_Reference#SkPath_kWinding_FillType'>SkPath::kWinding FillType</a>, +and the set <a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> is ignored. </td> </tr> <tr> - <td><a name="SkPaint_kStyleCount"> <code><strong>SkPaint::kStyleCount </strong></code> </a></td><td>3</td><td>The number of different <a href="#SkPaint_Style">Style</a> values defined. -May be used to verify that <a href="#SkPaint_Style">Style</a> is a legal value. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kStyleCount'><code>SkPaint::kStyleCount</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May be used to verify that <a href='#SkPaint_Style'>Style</a> is a legal value. </td> </tr> +</table> - - -<a name="SkPaint_getStyle"></a> +<a name='SkPaint_getStyle'></a> ## getStyle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Style getStyle() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_Style'>Style</a> <a href='#SkPaint_getStyle'>getStyle</a>() const </pre> Whether the geometry is filled, stroked, or filled and stroked. ### Return Value -one of:<a href="#SkPaint_kFill_Style">kFill Style</a>, <a href="#SkPaint_kStroke_Style">kStroke Style</a>, <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> +one of:<a href='#SkPaint_kFill_Style'>kFill Style</a>, <a href='#SkPaint_kStroke_Style'>kStroke Style</a>, <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a> ### Example @@ -2106,24 +2874,24 @@ SkPaint::kFill_Style == paint.getStyle() ### See Also -<a href="#SkPaint_Style">Style</a> <a href="#SkPaint_setStyle">setStyle</a> +<a href='#SkPaint_Style'>Style</a> <a href='#SkPaint_setStyle'>setStyle</a> --- -<a name="SkPaint_setStyle"></a> +<a name='SkPaint_setStyle'></a> ## setStyle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setStyle(Style style) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setStyle'>setStyle</a>(<a href='#SkPaint_Style'>Style</a> style) </pre> Sets whether the geometry is filled, stroked, or filled and stroked. -Has no effect if <a href="#SkPaint_setStyle_style">style</a> is not a legal <a href="#SkPaint_Style">Style</a> value. +Has no effect if <a href='#SkPaint_setStyle_style'>style</a> is not a legal <a href='#SkPaint_Style'>Style</a> value. ### Parameters -<table> <tr> <td><a name="SkPaint_setStyle_style"> <code><strong>style </strong></code> </a></td> <td> -one of: <a href="#SkPaint_kFill_Style">kFill Style</a>, <a href="#SkPaint_kStroke_Style">kStroke Style</a>, <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a></td> +<table> <tr> <td><a name='SkPaint_setStyle_style'><code><strong>style</strong></code></a></td> + <td>one of: <a href='#SkPaint_kFill_Style'>kFill Style</a>, <a href='#SkPaint_kStroke_Style'>kStroke Style</a>, <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a></td> </tr> </table> @@ -2133,25 +2901,25 @@ one of: <a href="#SkPaint_kFill_Style">kFill Style</a>, <a href="#SkPaint_kStrok ### See Also -<a href="#SkPaint_Style">Style</a> <a href="#SkPaint_getStyle">getStyle</a> +<a href='#SkPaint_Style'>Style</a> <a href='#SkPaint_getStyle'>getStyle</a> --- ### See Also -<a href="SkPath_Reference#Fill_Type">Path Fill Type</a> <a href="undocumented#Path_Effect">Path Effect</a> <a href="#Style_Fill">Style Fill</a> <a href="#Style_Stroke">Style Stroke</a> +<a href='SkPath_Reference#Fill_Type'>Path Fill Type</a> <a href='undocumented#Path_Effect'>Path Effect</a> <a href='#Style_Fill'>Style Fill</a> <a href='#Style_Stroke'>Style Stroke</a> -## <a name="Stroke_Width"></a> Stroke Width +## <a name='Stroke_Width'>Stroke Width</a> -<a href="#Stroke_Width">Stroke Width</a> sets the width for stroking. The width is the thickness +<a href='#Stroke_Width'>Stroke Width</a> sets the width for stroking. The width is the thickness of the stroke perpendicular to the path direction when the paint style is -set to <a href="#SkPaint_kStroke_Style">kStroke Style</a> or <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>. +set to <a href='#SkPaint_kStroke_Style'>kStroke Style</a> or <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a>. When width is greater than zero, the stroke encompasses as many pixels partially or fully as needed. When the width equals zero, the paint enables hairlines; the stroke is always one pixel wide. -The stroke dimensions are scaled by the canvas matrix, but <a href="#Style_Hairline">Hairline</a> stroke +The stroke dimensions are scaled by the canvas matrix, but <a href='#Style_Hairline'>Hairline</a> stroke remains one pixel wide regardless of scaling. The default width for the paint is zero. @@ -2162,19 +2930,19 @@ The default width for the paint is zero. line and the platform implementation. </div></fiddle-embed></div> -<a name="SkPaint_getStrokeWidth"></a> +<a name='SkPaint_getStrokeWidth'></a> ## getStrokeWidth -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getStrokeWidth() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getStrokeWidth'>getStrokeWidth</a>() const </pre> -Returns the thickness of the pen used by <a href="#Paint">Paint</a> to +Returns the thickness of the pen used by <a href='#Paint'>Paint</a> to outline the shape. ### Return Value -zero for <a href="#Style_Hairline">Hairline</a>, greater than zero for pen thickness +zero for <a href='#Style_Hairline'>Hairline</a>, greater than zero for pen thickness ### Example @@ -2190,21 +2958,21 @@ zero for <a href="#Style_Hairline">Hairline</a>, greater than zero for pen thick --- -<a name="SkPaint_setStrokeWidth"></a> +<a name='SkPaint_setStrokeWidth'></a> ## setStrokeWidth -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setStrokeWidth(SkScalar width) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setStrokeWidth'>setStrokeWidth</a>(<a href='undocumented#SkScalar'>SkScalar</a> width) </pre> Sets the thickness of the pen used by the paint to outline the shape. -Has no effect if <a href="#SkPaint_setStrokeWidth_width">width</a> is less than zero. +Has no effect if <a href='#SkPaint_setStrokeWidth_width'>width</a> is less than zero. ### Parameters -<table> <tr> <td><a name="SkPaint_setStrokeWidth_width"> <code><strong>width </strong></code> </a></td> <td> -zero thickness for <a href="#Style_Hairline">Hairline</a>; greater than zero for pen thickness</td> +<table> <tr> <td><a name='SkPaint_setStrokeWidth_width'><code><strong>width</strong></code></a></td> + <td>zero thickness for <a href='#Style_Hairline'>Hairline</a>; greater than zero for pen thickness</td> </tr> </table> @@ -2222,22 +2990,22 @@ zero thickness for <a href="#Style_Hairline">Hairline</a>; greater than zero for --- -## <a name="Miter_Limit"></a> Miter Limit +## <a name='Miter_Limit'>Miter Limit</a> -<a href="#Miter_Limit">Miter Limit</a> specifies the maximum miter length, +<a href='#Miter_Limit'>Miter Limit</a> specifies the maximum miter length, relative to the stroke width. -<a href="#Miter_Limit">Miter Limit</a> is used when the <a href="#Stroke_Join">Stroke Join</a> -is set to <a href="#SkPaint_kMiter_Join">kMiter Join</a>, and the <a href="#SkPaint_Style">Style</a> is either <a href="#SkPaint_kStroke_Style">kStroke Style</a> -or <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>. +<a href='#Miter_Limit'>Miter Limit</a> is used when the <a href='#Stroke_Join'>Stroke Join</a> +is set to <a href='#SkPaint_kMiter_Join'>kMiter Join</a>, and the <a href='#SkPaint_Style'>Style</a> is either <a href='#SkPaint_kStroke_Style'>kStroke Style</a> +or <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a>. -If the miter at a corner exceeds this limit, <a href="#SkPaint_kMiter_Join">kMiter Join</a> -is replaced with <a href="#SkPaint_kBevel_Join">kBevel Join</a>. +If the miter at a corner exceeds this limit, <a href='#SkPaint_kMiter_Join'>kMiter Join</a> +is replaced with <a href='#SkPaint_kBevel_Join'>kBevel Join</a>. -<a href="#Miter_Limit">Miter Limit</a> can be computed from the corner angle: +<a href='#Miter_Limit'>Miter Limit</a> can be computed from the corner angle: -miter limit = 1 / sin ( angle / 2 )<a href="#Miter_Limit">Miter Limit</a> default value is 4. -The default may be changed at compile time by setting <a href="undocumented#SkPaintDefaults_MiterLimit">SkPaintDefaults MiterLimit</a> +miter limit = 1 / sin ( angle / 2 )<a href='#Miter_Limit'>Miter Limit</a> default value is 4. +The default may be changed at compile time by setting <a href='undocumented#SkPaintDefaults_MiterLimit'>SkPaintDefaults MiterLimit</a> in "SkUserConfig.h" or as a define supplied by the build environment. Here are some miter limits and the angles that triggers them. @@ -2262,18 +3030,18 @@ When the miter limit is decreased slightly, the miter join is replaced by a bevel join. </div></fiddle-embed></div> -<a name="SkPaint_getStrokeMiter"></a> +<a name='SkPaint_getStrokeMiter'></a> ## getStrokeMiter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getStrokeMiter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getStrokeMiter'>getStrokeMiter</a>() const </pre> The limit at which a sharp corner is drawn beveled. ### Return Value -zero and greater <a href="#Miter_Limit">Miter Limit</a> +zero and greater <a href='#Miter_Limit'>Miter Limit</a> ### Example @@ -2289,25 +3057,25 @@ default miter limit == 4 ### See Also -<a href="#Miter_Limit">Miter Limit</a> <a href="#SkPaint_setStrokeMiter">setStrokeMiter</a> <a href="#SkPaint_Join">Join</a> +<a href='#Miter_Limit'>Miter Limit</a> <a href='#SkPaint_setStrokeMiter'>setStrokeMiter</a> <a href='#SkPaint_Join'>Join</a> --- -<a name="SkPaint_setStrokeMiter"></a> +<a name='SkPaint_setStrokeMiter'></a> ## setStrokeMiter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setStrokeMiter(SkScalar miter) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setStrokeMiter'>setStrokeMiter</a>(<a href='undocumented#SkScalar'>SkScalar</a> miter) </pre> The limit at which a sharp corner is drawn beveled. Valid values are zero and greater. -Has no effect if <a href="#SkPaint_setStrokeMiter_miter">miter</a> is less than zero. +Has no effect if <a href='#SkPaint_setStrokeMiter_miter'>miter</a> is less than zero. ### Parameters -<table> <tr> <td><a name="SkPaint_setStrokeMiter_miter"> <code><strong>miter </strong></code> </a></td> <td> -zero and greater <a href="#Miter_Limit">Miter Limit</a></td> +<table> <tr> <td><a name='SkPaint_setStrokeMiter_miter'><code><strong>miter</strong></code></a></td> + <td>zero and greater <a href='#Miter_Limit'>Miter Limit</a></td> </tr> </table> @@ -2325,94 +3093,114 @@ default miter limit == 8 ### See Also -<a href="#Miter_Limit">Miter Limit</a> <a href="#SkPaint_getStrokeMiter">getStrokeMiter</a> <a href="#SkPaint_Join">Join</a> +<a href='#Miter_Limit'>Miter Limit</a> <a href='#SkPaint_getStrokeMiter'>getStrokeMiter</a> <a href='#SkPaint_Join'>Join</a> --- -## <a name="Stroke_Cap"></a> Stroke Cap +## <a name='Stroke_Cap'>Stroke Cap</a> -## <a name="SkPaint_Cap"></a> Enum SkPaint::Cap +## <a name='SkPaint_Cap'>Enum SkPaint::Cap</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_Cap">Cap</a> { - <a href="#SkPaint_kButt_Cap">kButt Cap</a>, - <a href="#SkPaint_kRound_Cap">kRound Cap</a>, - <a href="#SkPaint_kSquare_Cap">kSquare Cap</a>, + enum <a href='#SkPaint_Cap'>Cap</a> { + <a href='#SkPaint_kButt_Cap'>kButt Cap</a>, + <a href='#SkPaint_kRound_Cap'>kRound Cap</a>, + <a href='#SkPaint_kSquare_Cap'>kSquare Cap</a>, - <a href="#SkPaint_kLast_Cap">kLast Cap</a> = <a href="#SkPaint_kSquare_Cap">kSquare Cap</a>, - <a href="#SkPaint_kDefault_Cap">kDefault Cap</a> = <a href="#SkPaint_kButt_Cap">kButt Cap</a>, + <a href='#SkPaint_kLast_Cap'>kLast Cap</a> = <a href='#SkPaint_kSquare_Cap'>kSquare Cap</a>, + <a href='#SkPaint_kDefault_Cap'>kDefault Cap</a> = <a href='#SkPaint_kButt_Cap'>kButt Cap</a>, }; - static constexpr int <a href="#SkPaint_kCapCount">kCapCount</a> = <a href="#SkPaint_kLast_Cap">kLast Cap</a> + 1; + static constexpr int <a href='#SkPaint_kCapCount'>kCapCount</a> = <a href='#SkPaint_kLast_Cap'>kLast Cap</a> + 1; </pre> -<a href="#Stroke_Cap">Stroke Cap</a> draws at the beginning and end of an open <a href="SkPath_Reference#Contour">Path Contour</a>. +<a href='#Stroke_Cap'>Stroke Cap</a> draws at the beginning and end of an open <a href='SkPath_Reference#Contour'>Path Contour</a>. ### Constants -<table> - <tr> - <td><a name="SkPaint_kButt_Cap"> <code><strong>SkPaint::kButt_Cap </strong></code> </a></td><td>0</td><td>Does not extend the stroke past the beginning or the end. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kButt_Cap'><code>SkPaint::kButt_Cap</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Does not extend the stroke past the beginning or the end. </td> </tr> <tr> - <td><a name="SkPaint_kRound_Cap"> <code><strong>SkPaint::kRound_Cap </strong></code> </a></td><td>1</td><td>Adds a circle with a diameter equal to <a href="#Stroke_Width">Stroke Width</a> at the beginning + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kRound_Cap'><code>SkPaint::kRound_Cap</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Adds a circle with a diameter equal to <a href='#Stroke_Width'>Stroke Width</a> at the beginning and end. </td> </tr> - <tr> - <td><a name="SkPaint_kSquare_Cap"> <code><strong>SkPaint::kSquare_Cap </strong></code> </a></td><td>2</td><td>Adds a square with sides equal to <a href="#Stroke_Width">Stroke Width</a> at the beginning + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kSquare_Cap'><code>SkPaint::kSquare_Cap</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Adds a square with sides equal to <a href='#Stroke_Width'>Stroke Width</a> at the beginning and end. The square sides are parallel to the initial and final direction of the stroke. </td> </tr> <tr> - <td><a name="SkPaint_kLast_Cap"> <code><strong>SkPaint::kLast_Cap </strong></code> </a></td><td>2</td><td>Equivalent to the largest value for <a href="#Stroke_Cap">Stroke Cap</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kLast_Cap'><code>SkPaint::kLast_Cap</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Equivalent to the largest value for <a href='#Stroke_Cap'>Stroke Cap</a>. </td> </tr> - <tr> - <td><a name="SkPaint_kDefault_Cap"> <code><strong>SkPaint::kDefault_Cap </strong></code> </a></td><td>0</td><td>Equivalent to <a href="#SkPaint_kButt_Cap">kButt Cap</a>. -<a href="#Stroke_Cap">Stroke Cap</a> is set to <a href="#SkPaint_kButt_Cap">kButt Cap</a> by default. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kDefault_Cap'><code>SkPaint::kDefault_Cap</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#Stroke_Cap'>Stroke Cap</a> is set to <a href='#SkPaint_kButt_Cap'>kButt Cap</a> by default. </td> </tr> <tr> - <td><a name="SkPaint_kCapCount"> <code><strong>SkPaint::kCapCount </strong></code> </a></td><td>3</td><td>The number of different <a href="#Stroke_Cap">Stroke Cap</a> values defined. -May be used to verify that <a href="#Stroke_Cap">Stroke Cap</a> is a legal value. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kCapCount'><code>SkPaint::kCapCount</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May be used to verify that <a href='#Stroke_Cap'>Stroke Cap</a> is a legal value. </td> </tr> +</table> -Stroke describes the area covered by a pen of <a href="#Stroke_Width">Stroke Width</a> as it -follows the <a href="SkPath_Reference#Contour">Path Contour</a>, moving parallel to the contour direction. +Stroke describes the area covered by a pen of <a href='#Stroke_Width'>Stroke Width</a> as it +follows the <a href='SkPath_Reference#Contour'>Path Contour</a>, moving parallel to the contour direction. -If the <a href="SkPath_Reference#Contour">Path Contour</a> is not terminated by <a href="SkPath_Reference#SkPath_kClose_Verb">SkPath::kClose Verb</a>, the contour has a +If the <a href='SkPath_Reference#Contour'>Path Contour</a> is not terminated by <a href='SkPath_Reference#SkPath_kClose_Verb'>SkPath::kClose Verb</a>, the contour has a visible beginning and end. -<a href="SkPath_Reference#Contour">Path Contour</a> may start and end at the same point; defining <a href="SkPath_Reference#Contour_Zero_Length">Zero Length Contour</a>. +<a href='SkPath_Reference#Contour'>Path Contour</a> may start and end at the same point; defining <a href='SkPath_Reference#Contour_Zero_Length'>Zero Length Contour</a>. -<a href="#SkPaint_kButt_Cap">kButt Cap</a> and <a href="SkPath_Reference#Contour_Zero_Length">Zero Length Contour</a> is not drawn. -<a href="#SkPaint_kRound_Cap">kRound Cap</a> and <a href="SkPath_Reference#Contour_Zero_Length">Zero Length Contour</a> draws a circle of diameter <a href="#Stroke_Width">Stroke Width</a> +<a href='#SkPaint_kButt_Cap'>kButt Cap</a> and <a href='SkPath_Reference#Contour_Zero_Length'>Zero Length Contour</a> is not drawn. +<a href='#SkPaint_kRound_Cap'>kRound Cap</a> and <a href='SkPath_Reference#Contour_Zero_Length'>Zero Length Contour</a> draws a circle of diameter <a href='#Stroke_Width'>Stroke Width</a> at the contour point. -<a href="#SkPaint_kSquare_Cap">kSquare Cap</a> and <a href="SkPath_Reference#Contour_Zero_Length">Zero Length Contour</a> draws an upright square with a side of -<a href="#Stroke_Width">Stroke Width</a> at the contour point. +<a href='#SkPaint_kSquare_Cap'>kSquare Cap</a> and <a href='SkPath_Reference#Contour_Zero_Length'>Zero Length Contour</a> draws an upright square with a side of +<a href='#Stroke_Width'>Stroke Width</a> at the contour point. -<a href="#Stroke_Cap">Stroke Cap</a> is <a href="#SkPaint_kButt_Cap">kButt Cap</a> by default. +<a href='#Stroke_Cap'>Stroke Cap</a> is <a href='#SkPaint_kButt_Cap'>kButt Cap</a> by default. ### Example <div><fiddle-embed name="2bffb6384cc20077e632e7d01da045ca"></fiddle-embed></div> -<a name="SkPaint_getStrokeCap"></a> +<a name='SkPaint_getStrokeCap'></a> ## getStrokeCap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Cap getStrokeCap() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_Cap'>Cap</a> <a href='#SkPaint_getStrokeCap'>getStrokeCap</a>() const </pre> The geometry drawn at the beginning and end of strokes. ### Return Value -one of: <a href="#SkPaint_kButt_Cap">kButt Cap</a>, <a href="#SkPaint_kRound_Cap">kRound Cap</a>, <a href="#SkPaint_kSquare_Cap">kSquare Cap</a> +one of: <a href='#SkPaint_kButt_Cap'>kButt Cap</a>, <a href='#SkPaint_kRound_Cap'>kRound Cap</a>, <a href='#SkPaint_kSquare_Cap'>kSquare Cap</a> ### Example @@ -2428,24 +3216,24 @@ kButt_Cap == default stroke cap ### See Also -<a href="#Stroke_Cap">Stroke Cap</a> <a href="#SkPaint_setStrokeCap">setStrokeCap</a> +<a href='#Stroke_Cap'>Stroke Cap</a> <a href='#SkPaint_setStrokeCap'>setStrokeCap</a> --- -<a name="SkPaint_setStrokeCap"></a> +<a name='SkPaint_setStrokeCap'></a> ## setStrokeCap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setStrokeCap(Cap cap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setStrokeCap'>setStrokeCap</a>(<a href='#SkPaint_Cap'>Cap</a> cap) </pre> The geometry drawn at the beginning and end of strokes. ### Parameters -<table> <tr> <td><a name="SkPaint_setStrokeCap_cap"> <code><strong>cap </strong></code> </a></td> <td> -one of: <a href="#SkPaint_kButt_Cap">kButt Cap</a>, <a href="#SkPaint_kRound_Cap">kRound Cap</a>, <a href="#SkPaint_kSquare_Cap">kSquare Cap</a>; -has no effect if <a href="#SkPaint_setStrokeCap_cap">cap</a> is not valid</td> +<table> <tr> <td><a name='SkPaint_setStrokeCap_cap'><code><strong>cap</strong></code></a></td> + <td>one of: <a href='#SkPaint_kButt_Cap'>kButt Cap</a>, <a href='#SkPaint_kRound_Cap'>kRound Cap</a>, <a href='#SkPaint_kSquare_Cap'>kSquare Cap</a>; +has no effect if <a href='#SkPaint_setStrokeCap_cap'>cap</a> is not valid</td> </tr> </table> @@ -2463,41 +3251,41 @@ kRound_Cap == paint.getStrokeCap() ### See Also -<a href="#Stroke_Cap">Stroke Cap</a> <a href="#SkPaint_getStrokeCap">getStrokeCap</a> +<a href='#Stroke_Cap'>Stroke Cap</a> <a href='#SkPaint_getStrokeCap'>getStrokeCap</a> --- -## <a name="Stroke_Join"></a> Stroke Join +## <a name='Stroke_Join'>Stroke Join</a> -<a href="#Stroke_Join">Stroke Join</a> draws at the sharp corners of an open or closed <a href="SkPath_Reference#Contour">Path Contour</a>. +<a href='#Stroke_Join'>Stroke Join</a> draws at the sharp corners of an open or closed <a href='SkPath_Reference#Contour'>Path Contour</a>. -Stroke describes the area covered by a pen of <a href="#Stroke_Width">Stroke Width</a> as it -follows the <a href="SkPath_Reference#Contour">Path Contour</a>, moving parallel to the contour direction. +Stroke describes the area covered by a pen of <a href='#Stroke_Width'>Stroke Width</a> as it +follows the <a href='SkPath_Reference#Contour'>Path Contour</a>, moving parallel to the contour direction. If the contour direction changes abruptly, because the tangent direction leading to the end of a curve within the contour does not match the tangent direction of -the following curve, the pair of curves meet at <a href="#Stroke_Join">Stroke Join</a>. +the following curve, the pair of curves meet at <a href='#Stroke_Join'>Stroke Join</a>. ### Example <div><fiddle-embed name="917c44b504d3f9308571fd3835d90a0d"></fiddle-embed></div> -## <a name="SkPaint_Join"></a> Enum SkPaint::Join +## <a name='SkPaint_Join'>Enum SkPaint::Join</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_Join">Join</a> { - <a href="#SkPaint_kMiter_Join">kMiter Join</a>, - <a href="#SkPaint_kRound_Join">kRound Join</a>, - <a href="#SkPaint_kBevel_Join">kBevel Join</a>, + enum <a href='#SkPaint_Join'>Join</a> { + <a href='#SkPaint_kMiter_Join'>kMiter Join</a>, + <a href='#SkPaint_kRound_Join'>kRound Join</a>, + <a href='#SkPaint_kBevel_Join'>kBevel Join</a>, - <a href="#SkPaint_kLast_Join">kLast Join</a> = <a href="#SkPaint_kBevel_Join">kBevel Join</a>, - <a href="#SkPaint_kDefault_Join">kDefault Join</a> = <a href="#SkPaint_kMiter_Join">kMiter Join</a>, + <a href='#SkPaint_kLast_Join'>kLast Join</a> = <a href='#SkPaint_kBevel_Join'>kBevel Join</a>, + <a href='#SkPaint_kDefault_Join'>kDefault Join</a> = <a href='#SkPaint_kMiter_Join'>kMiter Join</a>, }; - static constexpr int <a href="#SkPaint_kJoinCount">kJoinCount</a> = <a href="#SkPaint_kLast_Join">kLast Join</a> + 1; + static constexpr int <a href='#SkPaint_kJoinCount'>kJoinCount</a> = <a href='#SkPaint_kLast_Join'>kLast Join</a> + 1; </pre> -<a href="#SkPaint_Join">Join</a> specifies how corners are drawn when a shape is stroked. <a href="#SkPaint_Join">Join</a> +<a href='#SkPaint_Join'>Join</a> specifies how corners are drawn when a shape is stroked. <a href='#SkPaint_Join'>Join</a> affects the four corners of a stroked rectangle, and the connected segments in a stroked path. @@ -2511,32 +3299,50 @@ not necessarily include circles at each connected segment. ### Constants -<table> - <tr> - <td><a name="SkPaint_kMiter_Join"> <code><strong>SkPaint::kMiter_Join </strong></code> </a></td><td>0</td><td>Extends the outside corner to the extent allowed by <a href="#Miter_Limit">Miter Limit</a>. -If the extension exceeds <a href="#Miter_Limit">Miter Limit</a>, <a href="#SkPaint_kBevel_Join">kBevel Join</a> is used instead. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kMiter_Join'><code>SkPaint::kMiter_Join</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Extends the outside corner to the extent allowed by <a href='#Miter_Limit'>Miter Limit</a>. +If the extension exceeds <a href='#Miter_Limit'>Miter Limit</a>, <a href='#SkPaint_kBevel_Join'>kBevel Join</a> is used instead. </td> </tr> <tr> - <td><a name="SkPaint_kRound_Join"> <code><strong>SkPaint::kRound_Join </strong></code> </a></td><td>1</td><td>Adds a circle with a diameter of <a href="#Stroke_Width">Stroke Width</a> at the sharp corner. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kRound_Join'><code>SkPaint::kRound_Join</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Adds a circle with a diameter of <a href='#Stroke_Width'>Stroke Width</a> at the sharp corner. </td> </tr> - <tr> - <td><a name="SkPaint_kBevel_Join"> <code><strong>SkPaint::kBevel_Join </strong></code> </a></td><td>2</td><td>Connects the outside edges of the sharp corner. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kBevel_Join'><code>SkPaint::kBevel_Join</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Connects the outside edges of the sharp corner. </td> </tr> <tr> - <td><a name="SkPaint_kLast_Join"> <code><strong>SkPaint::kLast_Join </strong></code> </a></td><td>2</td><td>Equivalent to the largest value for <a href="#Stroke_Join">Stroke Join</a>. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kLast_Join'><code>SkPaint::kLast_Join</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +equivalent to the largest value for Stroke_Join</td> </tr> - <tr> - <td><a name="SkPaint_kDefault_Join"> <code><strong>SkPaint::kDefault_Join </strong></code> </a></td><td>1</td><td>Equivalent to <a href="#SkPaint_kMiter_Join">kMiter Join</a>. -<a href="#Stroke_Join">Stroke Join</a> is set to <a href="#SkPaint_kMiter_Join">kMiter Join</a> by default. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kDefault_Join'><code>SkPaint::kDefault_Join</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#Stroke_Join'>Stroke Join</a> is set to <a href='#SkPaint_kMiter_Join'>kMiter Join</a> by default. </td> </tr> <tr> - <td><a name="SkPaint_kJoinCount"> <code><strong>SkPaint::kJoinCount </strong></code> </a></td><td>3</td><td>The number of different <a href="#Stroke_Join">Stroke Join</a> values defined. -May be used to verify that <a href="#Stroke_Join">Stroke Join</a> is a legal value. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kJoinCount'><code>SkPaint::kJoinCount</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May be used to verify that <a href='#Stroke_Join'>Stroke Join</a> is a legal value. </td> </tr> </table> @@ -2547,22 +3353,20 @@ May be used to verify that <a href="#Stroke_Join">Stroke Join</a> is a legal val ### See Also -<a href="#SkPaint_setStrokeJoin">setStrokeJoin</a> <a href="#SkPaint_getStrokeJoin">getStrokeJoin</a> <a href="#SkPaint_setStrokeMiter">setStrokeMiter</a> <a href="#SkPaint_getStrokeMiter">getStrokeMiter</a> - - +<a href='#SkPaint_setStrokeJoin'>setStrokeJoin</a> <a href='#SkPaint_getStrokeJoin'>getStrokeJoin</a> <a href='#SkPaint_setStrokeMiter'>setStrokeMiter</a> <a href='#SkPaint_getStrokeMiter'>getStrokeMiter</a> -<a name="SkPaint_getStrokeJoin"></a> +<a name='SkPaint_getStrokeJoin'></a> ## getStrokeJoin -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Join getStrokeJoin() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_Join'>Join</a> <a href='#SkPaint_getStrokeJoin'>getStrokeJoin</a>() const </pre> The geometry drawn at the corners of strokes. ### Return Value -one of: <a href="#SkPaint_kMiter_Join">kMiter Join</a>, <a href="#SkPaint_kRound_Join">kRound Join</a>, <a href="#SkPaint_kBevel_Join">kBevel Join</a> +one of: <a href='#SkPaint_kMiter_Join'>kMiter Join</a>, <a href='#SkPaint_kRound_Join'>kRound Join</a>, <a href='#SkPaint_kBevel_Join'>kBevel Join</a> ### Example @@ -2578,23 +3382,23 @@ kMiter_Join == default stroke join ### See Also -<a href="#Stroke_Join">Stroke Join</a> <a href="#SkPaint_setStrokeJoin">setStrokeJoin</a> +<a href='#Stroke_Join'>Stroke Join</a> <a href='#SkPaint_setStrokeJoin'>setStrokeJoin</a> --- -<a name="SkPaint_setStrokeJoin"></a> +<a name='SkPaint_setStrokeJoin'></a> ## setStrokeJoin -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setStrokeJoin(Join join) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setStrokeJoin'>setStrokeJoin</a>(<a href='#SkPaint_Join'>Join</a> join) </pre> The geometry drawn at the corners of strokes. ### Parameters -<table> <tr> <td><a name="SkPaint_setStrokeJoin_join"> <code><strong>join </strong></code> </a></td> <td> -one of: <a href="#SkPaint_kMiter_Join">kMiter Join</a>, <a href="#SkPaint_kRound_Join">kRound Join</a>, <a href="#SkPaint_kBevel_Join">kBevel Join</a>; +<table> <tr> <td><a name='SkPaint_setStrokeJoin_join'><code><strong>join</strong></code></a></td> + <td>one of: <a href='#SkPaint_kMiter_Join'>kMiter Join</a>, <a href='#SkPaint_kRound_Join'>kRound Join</a>, <a href='#SkPaint_kBevel_Join'>kBevel Join</a>; otherwise, has no effect</td> </tr> </table> @@ -2613,93 +3417,97 @@ kMiter_Join == paint.getStrokeJoin() ### See Also -<a href="#Stroke_Join">Stroke Join</a> <a href="#SkPaint_getStrokeJoin">getStrokeJoin</a> +<a href='#Stroke_Join'>Stroke Join</a> <a href='#SkPaint_getStrokeJoin'>getStrokeJoin</a> --- ### See Also -<a href="#Miter_Limit">Miter Limit</a> +<a href='#Miter_Limit'>Miter Limit</a> -## <a name="Fill_Path"></a> Fill Path +## <a name='Fill_Path'>Fill Path</a> -<a href="#Fill_Path">Fill Path</a> creates a <a href="SkPath_Reference#Path">Path</a> by applying the <a href="undocumented#Path_Effect">Path Effect</a>, followed by the <a href="#Style_Stroke">Style Stroke</a>. +<a href='#Fill_Path'>Fill Path</a> creates a <a href='SkPath_Reference#Path'>Path</a> by applying the <a href='undocumented#Path_Effect'>Path Effect</a>, followed by the <a href='#Style_Stroke'>Style Stroke</a>. -If <a href="#Paint">Paint</a> contains <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Path_Effect">Path Effect</a> operates on the source <a href="SkPath_Reference#Path">Path</a>; the result -replaces the destination <a href="SkPath_Reference#Path">Path</a>. Otherwise, the source <a href="SkPath_Reference#Path">Path</a> is replaces the -destination <a href="SkPath_Reference#Path">Path</a>. +If <a href='#Paint'>Paint</a> contains <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Path_Effect'>Path Effect</a> operates on the source <a href='SkPath_Reference#Path'>Path</a>; the result +replaces the destination <a href='SkPath_Reference#Path'>Path</a>. Otherwise, the source <a href='SkPath_Reference#Path'>Path</a> is replaces the +destination <a href='SkPath_Reference#Path'>Path</a>. -Fill <a href="SkPath_Reference#Path">Path</a> can request the <a href="undocumented#Path_Effect">Path Effect</a> to restrict to a culling rectangle, but -the <a href="undocumented#Path_Effect">Path Effect</a> is not required to do so. +Fill <a href='SkPath_Reference#Path'>Path</a> can request the <a href='undocumented#Path_Effect'>Path Effect</a> to restrict to a culling rectangle, but +the <a href='undocumented#Path_Effect'>Path Effect</a> is not required to do so. -If <a href="#SkPaint_Style">Style</a> is <a href="#SkPaint_kStroke_Style">kStroke Style</a> or <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>, -and <a href="#Stroke_Width">Stroke Width</a> is greater than zero, the <a href="#Stroke_Width">Stroke Width</a>, <a href="#Stroke_Cap">Stroke Cap</a>, <a href="#Stroke_Join">Stroke Join</a>, -and <a href="#Miter_Limit">Miter Limit</a> operate on the destination <a href="SkPath_Reference#Path">Path</a>, replacing it. +If <a href='#SkPaint_Style'>Style</a> is <a href='#SkPaint_kStroke_Style'>kStroke Style</a> or <a href='#SkPaint_kStrokeAndFill_Style'>kStrokeAndFill Style</a>, +and <a href='#Stroke_Width'>Stroke Width</a> is greater than zero, the <a href='#Stroke_Width'>Stroke Width</a>, <a href='#Stroke_Cap'>Stroke Cap</a>, <a href='#Stroke_Join'>Stroke Join</a>, +and <a href='#Miter_Limit'>Miter Limit</a> operate on the destination <a href='SkPath_Reference#Path'>Path</a>, replacing it. -Fill <a href="SkPath_Reference#Path">Path</a> can specify the precision used by <a href="#Stroke_Width">Stroke Width</a> to approximate the stroke geometry. +Fill <a href='SkPath_Reference#Path'>Path</a> can specify the precision used by <a href='#Stroke_Width'>Stroke Width</a> to approximate the stroke geometry. -If the <a href="#SkPaint_Style">Style</a> is <a href="#SkPaint_kStroke_Style">kStroke Style</a> and the <a href="#Stroke_Width">Stroke Width</a> is zero, <a href="#SkPaint_getFillPath">getFillPath</a> -returns false since <a href="#Style_Hairline">Hairline</a> has no filled equivalent. +If the <a href='#SkPaint_Style'>Style</a> is <a href='#SkPaint_kStroke_Style'>kStroke Style</a> and the <a href='#Stroke_Width'>Stroke Width</a> is zero, <a href='#SkPaint_getFillPath'>getFillPath</a> +returns false since <a href='#Style_Hairline'>Hairline</a> has no filled equivalent. -<a name="SkPaint_getFillPath"></a> +<a name='SkPaint_getFillPath'></a> ## getFillPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect, SkScalar resScale = 1) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_getFillPath'>getFillPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, <a href='SkPath_Reference#SkPath'>SkPath</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>* cullRect, <a href='undocumented#SkScalar'>SkScalar</a> resScale = 1) const </pre> The filled equivalent of the stroked path. ### Parameters -<table> <tr> <td><a name="SkPaint_getFillPath_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> read to create a filled version</td> - </tr> <tr> <td><a name="SkPaint_getFillPath_dst"> <code><strong>dst </strong></code> </a></td> <td> -resulting <a href="SkPath_Reference#Path">Path</a>; may be the same as <a href="#SkPaint_getFillPath_src">src</a>, but may not be nullptr</td> - </tr> <tr> <td><a name="SkPaint_getFillPath_cullRect"> <code><strong>cullRect </strong></code> </a></td> <td> -optional limit passed to <a href="undocumented#Path_Effect">Path Effect</a></td> - </tr> <tr> <td><a name="SkPaint_getFillPath_resScale"> <code><strong>resScale </strong></code> </a></td> <td> -if > 1, increase precision, else if (0 < res < 1) reduce precision +<table> <tr> <td><a name='SkPaint_getFillPath_src'><code><strong>src</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> read to create a filled version</td> + </tr> + <tr> <td><a name='SkPaint_getFillPath_dst'><code><strong>dst</strong></code></a></td> + <td>resulting <a href='SkPath_Reference#Path'>Path</a>; may be the same as <a href='#SkPaint_getFillPath_src'>src</a>, but may not be nullptr</td> + </tr> + <tr> <td><a name='SkPaint_getFillPath_cullRect'><code><strong>cullRect</strong></code></a></td> + <td>optional limit passed to <a href='undocumented#Path_Effect'>Path Effect</a></td> + </tr> + <tr> <td><a name='SkPaint_getFillPath_resScale'><code><strong>resScale</strong></code></a></td> + <td>if > 1, increase precision, else if (0 < res < 1) reduce precision to favor speed and size</td> </tr> </table> ### Return Value -true if the path represents <a href="#Style_Fill">Style Fill</a>, or false if it represents <a href="#Style_Hairline">Hairline</a> +true if the path represents <a href='#Style_Fill'>Style Fill</a>, or false if it represents <a href='#Style_Hairline'>Hairline</a> ### Example -<div><fiddle-embed name="cedd6233848198e1fca4d1e14816baaf"><div>A very small <a href="SkPath_Reference#Quad">Quad</a> stroke is turned into a filled path with increasing levels of precision. -At the lowest precision, the <a href="SkPath_Reference#Quad">Quad</a> stroke is approximated by a rectangle. +<div><fiddle-embed name="cedd6233848198e1fca4d1e14816baaf"><div>A very small <a href='SkPath_Reference#Quad'>Quad</a> stroke is turned into a filled path with increasing levels of precision. +At the lowest precision, the <a href='SkPath_Reference#Quad'>Quad</a> stroke is approximated by a rectangle. At the highest precision, the filled path has high fidelity compared to the original stroke. </div></fiddle-embed></div> --- -<a name="SkPaint_getFillPath_2"></a> +<a name='SkPaint_getFillPath_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getFillPath(const SkPath& src, SkPath* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_getFillPath'>getFillPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, <a href='SkPath_Reference#SkPath'>SkPath</a>* dst) const </pre> The filled equivalent of the stroked path. -Replaces <a href="#SkPaint_getFillPath_2_dst">dst</a> with the <a href="#SkPaint_getFillPath_2_src">src</a> path modified by <a href="undocumented#Path_Effect">Path Effect</a> and <a href="#Style_Stroke">Style Stroke</a>. -<a href="undocumented#Path_Effect">Path Effect</a>, if any, is not culled. <a href="#Stroke_Width">Stroke Width</a> is created with default precision. +Replaces <a href='#SkPaint_getFillPath_2_dst'>dst</a> with the <a href='#SkPaint_getFillPath_2_src'>src</a> path modified by <a href='undocumented#Path_Effect'>Path Effect</a> and <a href='#Style_Stroke'>Style Stroke</a>. +<a href='undocumented#Path_Effect'>Path Effect</a>, if any, is not culled. <a href='#Stroke_Width'>Stroke Width</a> is created with default precision. ### Parameters -<table> <tr> <td><a name="SkPaint_getFillPath_2_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="SkPath_Reference#Path">Path</a> read to create a filled version</td> - </tr> <tr> <td><a name="SkPaint_getFillPath_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -resulting <a href="SkPath_Reference#Path">Path</a> <a href="#SkPaint_getFillPath_2_dst">dst</a> may be the same as <a href="#SkPaint_getFillPath_2_src">src</a>, but may not be nullptr</td> +<table> <tr> <td><a name='SkPaint_getFillPath_2_src'><code><strong>src</strong></code></a></td> + <td><a href='SkPath_Reference#Path'>Path</a> read to create a filled version</td> + </tr> + <tr> <td><a name='SkPaint_getFillPath_2_dst'><code><strong>dst</strong></code></a></td> + <td>resulting <a href='SkPath_Reference#Path'>Path</a> <a href='#SkPaint_getFillPath_2_dst'>dst</a> may be the same as <a href='#SkPaint_getFillPath_2_src'>src</a>, but may not be nullptr</td> </tr> </table> ### Return Value -true if the path represents <a href="#Style_Fill">Style Fill</a>, or false if it represents <a href="#Style_Hairline">Hairline</a> +true if the path represents <a href='#Style_Fill'>Style Fill</a>, or false if it represents <a href='#Style_Hairline'>Hairline</a> ### Example @@ -2709,44 +3517,44 @@ true if the path represents <a href="#Style_Fill">Style Fill</a>, or false if it ### See Also -<a href="#Style_Stroke">Style Stroke</a> <a href="#Stroke_Width">Stroke Width</a> <a href="undocumented#Path_Effect">Path Effect</a> +<a href='#Style_Stroke'>Style Stroke</a> <a href='#Stroke_Width'>Stroke Width</a> <a href='undocumented#Path_Effect'>Path Effect</a> -## <a name="Shader_Methods"></a> Shader Methods +## <a name='Shader_Methods'>Shader Methods</a> -<a href="undocumented#Shader">Shader</a> defines the colors used when drawing a shape. -<a href="undocumented#Shader">Shader</a> may be an image, a gradient, or a computed fill. -If <a href="#Paint">Paint</a> has no <a href="undocumented#Shader">Shader</a>, then <a href="SkColor_Reference#Color">Color</a> fills the shape. +<a href='undocumented#Shader'>Shader</a> defines the colors used when drawing a shape. +<a href='undocumented#Shader'>Shader</a> may be an image, a gradient, or a computed fill. +If <a href='#Paint'>Paint</a> has no <a href='undocumented#Shader'>Shader</a>, then <a href='SkColor_Reference#Color'>Color</a> fills the shape. -<a href="undocumented#Shader">Shader</a> is modulated by <a href="SkColor_Reference#Alpha">Color Alpha</a> component of <a href="SkColor_Reference#Color">Color</a>. -If <a href="undocumented#Shader">Shader</a> object defines only <a href="SkColor_Reference#Alpha">Color Alpha</a>, then <a href="SkColor_Reference#Color">Color</a> modulated by <a href="SkColor_Reference#Alpha">Color Alpha</a> describes +<a href='undocumented#Shader'>Shader</a> is modulated by <a href='SkColor_Reference#Alpha'>Color Alpha</a> component of <a href='SkColor_Reference#Color'>Color</a>. +If <a href='undocumented#Shader'>Shader</a> object defines only <a href='SkColor_Reference#Alpha'>Color Alpha</a>, then <a href='SkColor_Reference#Color'>Color</a> modulated by <a href='SkColor_Reference#Alpha'>Color Alpha</a> describes the fill. -The drawn transparency can be modified without altering <a href="undocumented#Shader">Shader</a>, by changing <a href="SkColor_Reference#Alpha">Color Alpha</a>. +The drawn transparency can be modified without altering <a href='undocumented#Shader'>Shader</a>, by changing <a href='SkColor_Reference#Alpha'>Color Alpha</a>. ### Example <div><fiddle-embed name="c015dc2010c15e1c00b4f7330232b0f7"></fiddle-embed></div> -If <a href="undocumented#Shader">Shader</a> generates only <a href="SkColor_Reference#Alpha">Color Alpha</a> then all components of <a href="SkColor_Reference#Color">Color</a> modulate the output. +If <a href='undocumented#Shader'>Shader</a> generates only <a href='SkColor_Reference#Alpha'>Color Alpha</a> then all components of <a href='SkColor_Reference#Color'>Color</a> modulate the output. ### Example <div><fiddle-embed name="fe80fd80b98a20823db7fb9a077243c7"></fiddle-embed></div> -<a name="SkPaint_getShader"></a> +<a name='SkPaint_getShader'></a> ## getShader -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkShader* getShader() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkShader'>SkShader</a>* <a href='#SkPaint_getShader'>getShader</a>() const </pre> Optional colors used when filling a path, such as a gradient. -Does not alter <a href="undocumented#Shader">Shader</a> <a href="undocumented#Reference_Count">Reference Count</a>. +Does not alter <a href='undocumented#Shader'>Shader</a> <a href='undocumented#Reference_Count'>Reference Count</a>. ### Return Value -<a href="undocumented#Shader">Shader</a> if previously set, nullptr otherwise +<a href='undocumented#Shader'>Shader</a> if previously set, nullptr otherwise ### Example @@ -2763,20 +3571,20 @@ nullptr != shader --- -<a name="SkPaint_refShader"></a> +<a name='SkPaint_refShader'></a> ## refShader -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkShader> refShader() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkShader'>SkShader</a>> <a href='#SkPaint_refShader'>refShader</a>() const </pre> Optional colors used when filling a path, such as a gradient. -Increases <a href="undocumented#Shader">Shader</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increases <a href='undocumented#Shader'>Shader</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Shader">Shader</a> if previously set, nullptr otherwise +<a href='undocumented#Shader'>Shader</a> if previously set, nullptr otherwise ### Example @@ -2793,22 +3601,22 @@ shader unique: false --- -<a name="SkPaint_setShader"></a> +<a name='SkPaint_setShader'></a> ## setShader -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setShader(sk_sp<SkShader> shader) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setShader'>setShader</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkShader'>SkShader</a>> shader) </pre> Optional colors used when filling a path, such as a gradient. -Sets <a href="undocumented#Shader">Shader</a> to <a href="#SkPaint_setShader_shader">shader</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Shader">Shader</a>. -Increments <a href="#SkPaint_setShader_shader">shader</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Sets <a href='undocumented#Shader'>Shader</a> to <a href='#SkPaint_setShader_shader'>shader</a>, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous <a href='undocumented#Shader'>Shader</a>. +Increments <a href='#SkPaint_setShader_shader'>shader</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setShader_shader"> <code><strong>shader </strong></code> </a></td> <td> -how geometry is filled with color; if nullptr, <a href="SkColor_Reference#Color">Color</a> is used instead</td> +<table> <tr> <td><a name='SkPaint_setShader_shader'><code><strong>shader</strong></code></a></td> + <td>how geometry is filled with color; if nullptr, <a href='SkColor_Reference#Color'>Color</a> is used instead</td> </tr> </table> @@ -2818,31 +3626,31 @@ how geometry is filled with color; if nullptr, <a href="SkColor_Reference#Color" --- -## <a name="Color_Filter_Methods"></a> Color Filter Methods +## <a name='Color_Filter_Methods'>Color Filter Methods</a> -<a href="undocumented#Color_Filter">Color Filter</a> alters the color used when drawing a shape. -<a href="undocumented#Color_Filter">Color Filter</a> may apply <a href="undocumented#Blend_Mode">Blend Mode</a>, transform the color through a matrix, or composite multiple filters. -If <a href="#Paint">Paint</a> has no <a href="undocumented#Color_Filter">Color Filter</a>, the color is unaltered. +<a href='undocumented#Color_Filter'>Color Filter</a> alters the color used when drawing a shape. +<a href='undocumented#Color_Filter'>Color Filter</a> may apply <a href='undocumented#Blend_Mode'>Blend Mode</a>, transform the color through a matrix, or composite multiple filters. +If <a href='#Paint'>Paint</a> has no <a href='undocumented#Color_Filter'>Color Filter</a>, the color is unaltered. -The drawn transparency can be modified without altering <a href="undocumented#Color_Filter">Color Filter</a>, by changing <a href="SkColor_Reference#Alpha">Color Alpha</a>. +The drawn transparency can be modified without altering <a href='undocumented#Color_Filter'>Color Filter</a>, by changing <a href='SkColor_Reference#Alpha'>Color Alpha</a>. ### Example <div><fiddle-embed name="5abde56ca2f89a18b8e231abd1b57c56"></fiddle-embed></div> -<a name="SkPaint_getColorFilter"></a> +<a name='SkPaint_getColorFilter'></a> ## getColorFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorFilter* getColorFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkColorFilter'>SkColorFilter</a>* <a href='#SkPaint_getColorFilter'>getColorFilter</a>() const </pre> -Returns <a href="undocumented#Color_Filter">Color Filter</a> if set, or nullptr. -Does not alter <a href="undocumented#Color_Filter">Color Filter</a> <a href="undocumented#Reference_Count">Reference Count</a>. +Returns <a href='undocumented#Color_Filter'>Color Filter</a> if set, or nullptr. +Does not alter <a href='undocumented#Color_Filter'>Color Filter</a> <a href='undocumented#Reference_Count'>Reference Count</a>. ### Return Value -<a href="undocumented#Color_Filter">Color Filter</a> if previously set, nullptr otherwise +<a href='undocumented#Color_Filter'>Color Filter</a> if previously set, nullptr otherwise ### Example @@ -2859,19 +3667,19 @@ nullptr != color filter --- -<a name="SkPaint_refColorFilter"></a> +<a name='SkPaint_refColorFilter'></a> ## refColorFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkColorFilter> refColorFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorFilter'>SkColorFilter</a>> <a href='#SkPaint_refColorFilter'>refColorFilter</a>() const </pre> -Returns <a href="undocumented#Color_Filter">Color Filter</a> if set, or nullptr. -Increases <a href="undocumented#Color_Filter">Color Filter</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Returns <a href='undocumented#Color_Filter'>Color Filter</a> if set, or nullptr. +Increases <a href='undocumented#Color_Filter'>Color Filter</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Color_Filter">Color Filter</a> if set, or nullptr +<a href='undocumented#Color_Filter'>Color Filter</a> if set, or nullptr ### Example @@ -2888,22 +3696,22 @@ color filter unique: false --- -<a name="SkPaint_setColorFilter"></a> +<a name='SkPaint_setColorFilter'></a> ## setColorFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setColorFilter(sk_sp<SkColorFilter> colorFilter) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setColorFilter'>setColorFilter</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorFilter'>SkColorFilter</a>> colorFilter) </pre> -Sets <a href="undocumented#Color_Filter">Color Filter</a> to filter, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous -<a href="undocumented#Color_Filter">Color Filter</a>. Pass nullptr to clear <a href="undocumented#Color_Filter">Color Filter</a>. +Sets <a href='undocumented#Color_Filter'>Color Filter</a> to filter, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous +<a href='undocumented#Color_Filter'>Color Filter</a>. Pass nullptr to clear <a href='undocumented#Color_Filter'>Color Filter</a>. -Increments filter <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increments filter <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setColorFilter_colorFilter"> <code><strong>colorFilter </strong></code> </a></td> <td> -<a href="undocumented#Color_Filter">Color Filter</a> to apply to subsequent draw</td> +<table> <tr> <td><a name='SkPaint_setColorFilter_colorFilter'><code><strong>colorFilter</strong></code></a></td> + <td><a href='undocumented#Color_Filter'>Color Filter</a> to apply to subsequent draw</td> </tr> </table> @@ -2913,10 +3721,10 @@ Increments filter <a href="undocumented#Reference_Count">Reference Count</a> by --- -## <a name="Blend_Mode_Methods"></a> Blend Mode Methods +## <a name='Blend_Mode_Methods'>Blend Mode Methods</a> -<a href="undocumented#Blend_Mode">Blend Mode</a> describes how <a href="SkColor_Reference#Color">Color</a> combines with the destination color. -The default setting, <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a>, draws the source color +<a href='undocumented#Blend_Mode'>Blend Mode</a> describes how <a href='SkColor_Reference#Color'>Color</a> combines with the destination color. +The default setting, <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a>, draws the source color over the destination color. ### Example @@ -2925,17 +3733,17 @@ over the destination color. ### See Also -<a href="undocumented#Blend_Mode">Blend Mode</a> +<a href='undocumented#Blend_Mode'>Blend Mode</a> -<a name="SkPaint_getBlendMode"></a> +<a name='SkPaint_getBlendMode'></a> ## getBlendMode -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkBlendMode getBlendMode() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkBlendMode'>SkBlendMode</a> <a href='#SkPaint_getBlendMode'>getBlendMode</a>() const </pre> -Returns <a href="undocumented#Blend_Mode">Blend Mode</a>. -By default, returns <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a>. +Returns <a href='undocumented#Blend_Mode'>Blend Mode</a>. +By default, returns <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a>. ### Return Value @@ -2956,18 +3764,18 @@ kSrcOver != getBlendMode --- -<a name="SkPaint_isSrcOver"></a> +<a name='SkPaint_isSrcOver'></a> ## isSrcOver -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isSrcOver() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_isSrcOver'>isSrcOver</a>() const </pre> -Returns true if <a href="undocumented#Blend_Mode">Blend Mode</a> is <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a>, the default. +Returns true if <a href='undocumented#Blend_Mode'>Blend Mode</a> is <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a>, the default. ### Return Value -true if <a href="undocumented#Blend_Mode">Blend Mode</a> is <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a> +true if <a href='undocumented#Blend_Mode'>Blend Mode</a> is <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a> ### Example @@ -2984,20 +3792,20 @@ isSrcOver != true --- -<a name="SkPaint_setBlendMode"></a> +<a name='SkPaint_setBlendMode'></a> ## setBlendMode -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setBlendMode(SkBlendMode mode) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setBlendMode'>setBlendMode</a>(<a href='undocumented#SkBlendMode'>SkBlendMode</a> mode) </pre> -Sets <a href="undocumented#Blend_Mode">Blend Mode</a> to <a href="#SkPaint_setBlendMode_mode">mode</a>. +Sets <a href='undocumented#Blend_Mode'>Blend Mode</a> to <a href='#SkPaint_setBlendMode_mode'>mode</a>. Does not check for valid input. ### Parameters -<table> <tr> <td><a name="SkPaint_setBlendMode_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="undocumented#SkBlendMode">SkBlendMode</a> used to combine source color and destination</td> +<table> <tr> <td><a name='SkPaint_setBlendMode_mode'><code><strong>mode</strong></code></a></td> + <td><a href='undocumented#SkBlendMode'>SkBlendMode</a> used to combine source color and destination</td> </tr> </table> @@ -3016,11 +3824,11 @@ isSrcOver != true --- -## <a name="Path_Effect_Methods"></a> Path Effect Methods +## <a name='Path_Effect_Methods'>Path Effect Methods</a> -<a href="undocumented#Path_Effect">Path Effect</a> modifies the path geometry before drawing it. -<a href="undocumented#Path_Effect">Path Effect</a> may implement dashing, custom fill effects and custom stroke effects. -If <a href="#Paint">Paint</a> has no <a href="undocumented#Path_Effect">Path Effect</a>, the path geometry is unaltered when filled or stroked. +<a href='undocumented#Path_Effect'>Path Effect</a> modifies the path geometry before drawing it. +<a href='undocumented#Path_Effect'>Path Effect</a> may implement dashing, custom fill effects and custom stroke effects. +If <a href='#Paint'>Paint</a> has no <a href='undocumented#Path_Effect'>Path Effect</a>, the path geometry is unaltered when filled or stroked. ### Example @@ -3028,21 +3836,21 @@ If <a href="#Paint">Paint</a> has no <a href="undocumented#Path_Effect">Path Eff ### See Also -<a href="undocumented#Path_Effect">Path Effect</a> +<a href='undocumented#Path_Effect'>Path Effect</a> -<a name="SkPaint_getPathEffect"></a> +<a name='SkPaint_getPathEffect'></a> ## getPathEffect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPathEffect* getPathEffect() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkPathEffect'>SkPathEffect</a>* <a href='#SkPaint_getPathEffect'>getPathEffect</a>() const </pre> -Returns <a href="undocumented#Path_Effect">Path Effect</a> if set, or nullptr. -Does not alter <a href="undocumented#Path_Effect">Path Effect</a> <a href="undocumented#Reference_Count">Reference Count</a>. +Returns <a href='undocumented#Path_Effect'>Path Effect</a> if set, or nullptr. +Does not alter <a href='undocumented#Path_Effect'>Path Effect</a> <a href='undocumented#Reference_Count'>Reference Count</a>. ### Return Value -<a href="undocumented#Path_Effect">Path Effect</a> if previously set, nullptr otherwise +<a href='undocumented#Path_Effect'>Path Effect</a> if previously set, nullptr otherwise ### Example @@ -3059,19 +3867,19 @@ nullptr != path effect --- -<a name="SkPaint_refPathEffect"></a> +<a name='SkPaint_refPathEffect'></a> ## refPathEffect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkPathEffect> refPathEffect() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkPathEffect'>SkPathEffect</a>> <a href='#SkPaint_refPathEffect'>refPathEffect</a>() const </pre> -Returns <a href="undocumented#Path_Effect">Path Effect</a> if set, or nullptr. -Increases <a href="undocumented#Path_Effect">Path Effect</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Returns <a href='undocumented#Path_Effect'>Path Effect</a> if set, or nullptr. +Increases <a href='undocumented#Path_Effect'>Path Effect</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Path_Effect">Path Effect</a> if previously set, nullptr otherwise +<a href='undocumented#Path_Effect'>Path Effect</a> if previously set, nullptr otherwise ### Example @@ -3088,22 +3896,22 @@ path effect unique: false --- -<a name="SkPaint_setPathEffect"></a> +<a name='SkPaint_setPathEffect'></a> ## setPathEffect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPathEffect(sk_sp<SkPathEffect> pathEffect) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setPathEffect'>setPathEffect</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkPathEffect'>SkPathEffect</a>> pathEffect) </pre> -Sets <a href="undocumented#Path_Effect">Path Effect</a> to <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous -<a href="undocumented#Path_Effect">Path Effect</a>. Pass nullptr to leave the path geometry unaltered. +Sets <a href='undocumented#Path_Effect'>Path Effect</a> to <a href='#SkPaint_setPathEffect_pathEffect'>pathEffect</a>, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous +<a href='undocumented#Path_Effect'>Path Effect</a>. Pass nullptr to leave the path geometry unaltered. -Increments <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increments <a href='#SkPaint_setPathEffect_pathEffect'>pathEffect</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setPathEffect_pathEffect"> <code><strong>pathEffect </strong></code> </a></td> <td> -replace <a href="SkPath_Reference#Path">Path</a> with a modification when drawn</td> +<table> <tr> <td><a name='SkPaint_setPathEffect_pathEffect'><code><strong>pathEffect</strong></code></a></td> + <td>replace <a href='SkPath_Reference#Path'>Path</a> with a modification when drawn</td> </tr> </table> @@ -3113,32 +3921,32 @@ replace <a href="SkPath_Reference#Path">Path</a> with a modification when drawn< --- -## <a name="Mask_Filter_Methods"></a> Mask Filter Methods +## <a name='Mask_Filter_Methods'>Mask Filter Methods</a> -<a href="undocumented#Mask_Filter">Mask Filter</a> uses coverage of the shape drawn to create <a href="undocumented#Mask_Alpha">Mask Alpha</a>. -<a href="undocumented#Mask_Filter">Mask Filter</a> takes a Mask, and returns a Mask. +<a href='undocumented#Mask_Filter'>Mask Filter</a> uses coverage of the shape drawn to create <a href='undocumented#Mask_Alpha'>Mask Alpha</a>. +<a href='undocumented#Mask_Filter'>Mask Filter</a> takes a Mask, and returns a Mask. -<a href="undocumented#Mask_Filter">Mask Filter</a> may change the geometry and transparency of the shape, such as -creating a blur effect. Set <a href="undocumented#Mask_Filter">Mask Filter</a> to nullptr to prevent <a href="undocumented#Mask_Filter">Mask Filter</a> from +<a href='undocumented#Mask_Filter'>Mask Filter</a> may change the geometry and transparency of the shape, such as +creating a blur effect. Set <a href='undocumented#Mask_Filter'>Mask Filter</a> to nullptr to prevent <a href='undocumented#Mask_Filter'>Mask Filter</a> from modifying the draw. ### Example <div><fiddle-embed name="55d7b9d482ac8e17a6153f555a8adb8d"></fiddle-embed></div> -<a name="SkPaint_getMaskFilter"></a> +<a name='SkPaint_getMaskFilter'></a> ## getMaskFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkMaskFilter* getMaskFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkMaskFilter'>SkMaskFilter</a>* <a href='#SkPaint_getMaskFilter'>getMaskFilter</a>() const </pre> -Returns <a href="undocumented#Mask_Filter">Mask Filter</a> if set, or nullptr. -Does not alter <a href="undocumented#Mask_Filter">Mask Filter</a> <a href="undocumented#Reference_Count">Reference Count</a>. +Returns <a href='undocumented#Mask_Filter'>Mask Filter</a> if set, or nullptr. +Does not alter <a href='undocumented#Mask_Filter'>Mask Filter</a> <a href='undocumented#Reference_Count'>Reference Count</a>. ### Return Value -<a href="undocumented#Mask_Filter">Mask Filter</a> if previously set, nullptr otherwise +<a href='undocumented#Mask_Filter'>Mask Filter</a> if previously set, nullptr otherwise ### Example @@ -3155,20 +3963,20 @@ nullptr != mask filter --- -<a name="SkPaint_refMaskFilter"></a> +<a name='SkPaint_refMaskFilter'></a> ## refMaskFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkMaskFilter> refMaskFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkMaskFilter'>SkMaskFilter</a>> <a href='#SkPaint_refMaskFilter'>refMaskFilter</a>() const </pre> -Returns <a href="undocumented#Mask_Filter">Mask Filter</a> if set, or nullptr. +Returns <a href='undocumented#Mask_Filter'>Mask Filter</a> if set, or nullptr. -Increases <a href="undocumented#Mask_Filter">Mask Filter</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increases <a href='undocumented#Mask_Filter'>Mask Filter</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Mask_Filter">Mask Filter</a> if previously set, nullptr otherwise +<a href='undocumented#Mask_Filter'>Mask Filter</a> if previously set, nullptr otherwise ### Example @@ -3185,23 +3993,23 @@ mask filter unique: false --- -<a name="SkPaint_setMaskFilter"></a> +<a name='SkPaint_setMaskFilter'></a> ## setMaskFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setMaskFilter(sk_sp<SkMaskFilter> maskFilter) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setMaskFilter'>setMaskFilter</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkMaskFilter'>SkMaskFilter</a>> maskFilter) </pre> -Sets <a href="undocumented#Mask_Filter">Mask Filter</a> to <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous -<a href="undocumented#Mask_Filter">Mask Filter</a>. Pass nullptr to clear <a href="undocumented#Mask_Filter">Mask Filter</a> and leave <a href="undocumented#Mask_Filter">Mask Filter</a> effect on -<a href="undocumented#Mask_Alpha">Mask Alpha</a> unaltered. +Sets <a href='undocumented#Mask_Filter'>Mask Filter</a> to <a href='#SkPaint_setMaskFilter_maskFilter'>maskFilter</a>, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous +<a href='undocumented#Mask_Filter'>Mask Filter</a>. Pass nullptr to clear <a href='undocumented#Mask_Filter'>Mask Filter</a> and leave <a href='undocumented#Mask_Filter'>Mask Filter</a> effect on +<a href='undocumented#Mask_Alpha'>Mask Alpha</a> unaltered. -Increments <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increments <a href='#SkPaint_setMaskFilter_maskFilter'>maskFilter</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setMaskFilter_maskFilter"> <code><strong>maskFilter </strong></code> </a></td> <td> -modifies clipping mask generated from drawn geometry</td> +<table> <tr> <td><a name='SkPaint_setMaskFilter_maskFilter'><code><strong>maskFilter</strong></code></a></td> + <td>modifies clipping mask generated from drawn geometry</td> </tr> </table> @@ -3211,30 +4019,30 @@ modifies clipping mask generated from drawn geometry</td> --- -## <a name="Typeface_Methods"></a> Typeface Methods +## <a name='Typeface_Methods'>Typeface Methods</a> -<a href="undocumented#Typeface">Typeface</a> identifies the font used when drawing and measuring text. -<a href="undocumented#Typeface">Typeface</a> may be specified by name, from a file, or from a data stream. -The default <a href="undocumented#Typeface">Typeface</a> defers to the platform-specific default font +<a href='undocumented#Typeface'>Typeface</a> identifies the font used when drawing and measuring text. +<a href='undocumented#Typeface'>Typeface</a> may be specified by name, from a file, or from a data stream. +The default <a href='undocumented#Typeface'>Typeface</a> defers to the platform-specific default font implementation. ### Example <div><fiddle-embed name="1a7a5062725139760962582f599f1b97"></fiddle-embed></div> -<a name="SkPaint_getTypeface"></a> +<a name='SkPaint_getTypeface'></a> ## getTypeface -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkTypeface* getTypeface() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkTypeface'>SkTypeface</a>* <a href='#SkPaint_getTypeface'>getTypeface</a>() const </pre> -Returns <a href="undocumented#Typeface">Typeface</a> if set, or nullptr. -Increments <a href="undocumented#Typeface">Typeface</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Returns <a href='undocumented#Typeface'>Typeface</a> if set, or nullptr. +Increments <a href='undocumented#Typeface'>Typeface</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Typeface">Typeface</a> if previously set, nullptr otherwise +<a href='undocumented#Typeface'>Typeface</a> if previously set, nullptr otherwise ### Example @@ -3251,18 +4059,18 @@ nullptr != typeface --- -<a name="SkPaint_refTypeface"></a> +<a name='SkPaint_refTypeface'></a> ## refTypeface -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkTypeface> refTypeface() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkTypeface'>SkTypeface</a>> <a href='#SkPaint_refTypeface'>refTypeface</a>() const </pre> -Increases <a href="undocumented#Typeface">Typeface</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increases <a href='undocumented#Typeface'>Typeface</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Typeface">Typeface</a> if previously set, nullptr otherwise +<a href='undocumented#Typeface'>Typeface</a> if previously set, nullptr otherwise ### Example @@ -3279,21 +4087,21 @@ typeface1 == typeface2 --- -<a name="SkPaint_setTypeface"></a> +<a name='SkPaint_setTypeface'></a> ## setTypeface -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTypeface(sk_sp<SkTypeface> typeface) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setTypeface'>setTypeface</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkTypeface'>SkTypeface</a>> typeface) </pre> -Sets <a href="undocumented#Typeface">Typeface</a> to <a href="#SkPaint_setTypeface_typeface">typeface</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Typeface">Typeface</a>. -Pass nullptr to clear <a href="undocumented#Typeface">Typeface</a> and use the default <a href="#SkPaint_setTypeface_typeface">typeface</a>. Increments -<a href="#SkPaint_setTypeface_typeface">typeface</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Sets <a href='undocumented#Typeface'>Typeface</a> to <a href='#SkPaint_setTypeface_typeface'>typeface</a>, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous <a href='undocumented#Typeface'>Typeface</a>. +Pass nullptr to clear <a href='undocumented#Typeface'>Typeface</a> and use the default <a href='#SkPaint_setTypeface_typeface'>typeface</a>. Increments +<a href='#SkPaint_setTypeface_typeface'>typeface</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setTypeface_typeface"> <code><strong>typeface </strong></code> </a></td> <td> -font and style used to draw text</td> +<table> <tr> <td><a name='SkPaint_setTypeface_typeface'><code><strong>typeface</strong></code></a></td> + <td>font and style used to draw text</td> </tr> </table> @@ -3303,34 +4111,34 @@ font and style used to draw text</td> --- -## <a name="Image_Filter_Methods"></a> Image Filter Methods +## <a name='Image_Filter_Methods'>Image Filter Methods</a> -<a href="undocumented#Image_Filter">Image Filter</a> operates on the pixel representation of the shape, as modified by <a href="#Paint">Paint</a> -with <a href="undocumented#Blend_Mode">Blend Mode</a> set to <a href="undocumented#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a>. <a href="undocumented#Image_Filter">Image Filter</a> creates a new bitmap, -which is drawn to the device using the set <a href="undocumented#Blend_Mode">Blend Mode</a>. +<a href='undocumented#Image_Filter'>Image Filter</a> operates on the pixel representation of the shape, as modified by <a href='#Paint'>Paint</a> +with <a href='undocumented#Blend_Mode'>Blend Mode</a> set to <a href='undocumented#SkBlendMode_kSrcOver'>SkBlendMode::kSrcOver</a>. <a href='undocumented#Image_Filter'>Image Filter</a> creates a new bitmap, +which is drawn to the device using the set <a href='undocumented#Blend_Mode'>Blend Mode</a>. -<a href="undocumented#Image_Filter">Image Filter</a> is higher level than <a href="undocumented#Mask_Filter">Mask Filter</a>; for instance, an <a href="undocumented#Image_Filter">Image Filter</a> -can operate on all channels of <a href="SkColor_Reference#Color">Color</a>, while <a href="undocumented#Mask_Filter">Mask Filter</a> generates <a href="SkColor_Reference#Alpha">Alpha</a> only. -<a href="undocumented#Image_Filter">Image Filter</a> operates independently of and can be used in combination with -<a href="undocumented#Mask_Filter">Mask Filter</a>. +<a href='undocumented#Image_Filter'>Image Filter</a> is higher level than <a href='undocumented#Mask_Filter'>Mask Filter</a>; for instance, an <a href='undocumented#Image_Filter'>Image Filter</a> +can operate on all channels of <a href='SkColor_Reference#Color'>Color</a>, while <a href='undocumented#Mask_Filter'>Mask Filter</a> generates <a href='SkColor_Reference#Alpha'>Alpha</a> only. +<a href='undocumented#Image_Filter'>Image Filter</a> operates independently of and can be used in combination with +<a href='undocumented#Mask_Filter'>Mask Filter</a>. ### Example <div><fiddle-embed name="250e45c5935d54eac6aca775d1fe3475"></fiddle-embed></div> -<a name="SkPaint_getImageFilter"></a> +<a name='SkPaint_getImageFilter'></a> ## getImageFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkImageFilter* getImageFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkImageFilter'>SkImageFilter</a>* <a href='#SkPaint_getImageFilter'>getImageFilter</a>() const </pre> -Returns <a href="undocumented#Image_Filter">Image Filter</a> if set, or nullptr. -Does not alter <a href="undocumented#Image_Filter">Image Filter</a> <a href="undocumented#Reference_Count">Reference Count</a>. +Returns <a href='undocumented#Image_Filter'>Image Filter</a> if set, or nullptr. +Does not alter <a href='undocumented#Image_Filter'>Image Filter</a> <a href='undocumented#Reference_Count'>Reference Count</a>. ### Return Value -<a href="undocumented#Image_Filter">Image Filter</a> if previously set, nullptr otherwise +<a href='undocumented#Image_Filter'>Image Filter</a> if previously set, nullptr otherwise ### Example @@ -3347,19 +4155,19 @@ nullptr != image filter --- -<a name="SkPaint_refImageFilter"></a> +<a name='SkPaint_refImageFilter'></a> ## refImageFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImageFilter> refImageFilter() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkImageFilter'>SkImageFilter</a>> <a href='#SkPaint_refImageFilter'>refImageFilter</a>() const </pre> -Returns <a href="undocumented#Image_Filter">Image Filter</a> if set, or nullptr. -Increases <a href="undocumented#Image_Filter">Image Filter</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Returns <a href='undocumented#Image_Filter'>Image Filter</a> if set, or nullptr. +Increases <a href='undocumented#Image_Filter'>Image Filter</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Image_Filter">Image Filter</a> if previously set, nullptr otherwise +<a href='undocumented#Image_Filter'>Image Filter</a> if previously set, nullptr otherwise ### Example @@ -3376,23 +4184,23 @@ image filter unique: false --- -<a name="SkPaint_setImageFilter"></a> +<a name='SkPaint_setImageFilter'></a> ## setImageFilter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setImageFilter(sk_sp<SkImageFilter> imageFilter) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setImageFilter'>setImageFilter</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkImageFilter'>SkImageFilter</a>> imageFilter) </pre> -Sets <a href="undocumented#Image_Filter">Image Filter</a> to <a href="#SkPaint_setImageFilter_imageFilter">imageFilter</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous -<a href="undocumented#Image_Filter">Image Filter</a>. Pass nullptr to clear <a href="undocumented#Image_Filter">Image Filter</a>, and remove <a href="undocumented#Image_Filter">Image Filter</a> effect +Sets <a href='undocumented#Image_Filter'>Image Filter</a> to <a href='#SkPaint_setImageFilter_imageFilter'>imageFilter</a>, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous +<a href='undocumented#Image_Filter'>Image Filter</a>. Pass nullptr to clear <a href='undocumented#Image_Filter'>Image Filter</a>, and remove <a href='undocumented#Image_Filter'>Image Filter</a> effect on drawing. -Increments <a href="#SkPaint_setImageFilter_imageFilter">imageFilter</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increments <a href='#SkPaint_setImageFilter_imageFilter'>imageFilter</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setImageFilter_imageFilter"> <code><strong>imageFilter </strong></code> </a></td> <td> -how <a href="SkImage_Reference#Image">Image</a> is sampled when transformed</td> +<table> <tr> <td><a name='SkPaint_setImageFilter_imageFilter'><code><strong>imageFilter</strong></code></a></td> + <td>how <a href='SkImage_Reference#Image'>Image</a> is sampled when transformed</td> </tr> </table> @@ -3402,32 +4210,32 @@ how <a href="SkImage_Reference#Image">Image</a> is sampled when transformed</td> --- -## <a name="Draw_Looper_Methods"></a> Draw Looper Methods +## <a name='Draw_Looper_Methods'>Draw Looper Methods</a> -<a href="undocumented#Draw_Looper">Draw Looper</a> sets a modifier that communicates state from one <a href="undocumented#Draw_Layer">Draw Layer</a> +<a href='undocumented#Draw_Looper'>Draw Looper</a> sets a modifier that communicates state from one <a href='undocumented#Draw_Layer'>Draw Layer</a> to another to construct the draw. -<a href="undocumented#Draw_Looper">Draw Looper</a> draws one or more times, modifying the canvas and paint each time. -<a href="undocumented#Draw_Looper">Draw Looper</a> may be used to draw multiple colors or create a colored shadow. -Set <a href="undocumented#Draw_Looper">Draw Looper</a> to nullptr to prevent <a href="undocumented#Draw_Looper">Draw Looper</a> from modifying the draw. +<a href='undocumented#Draw_Looper'>Draw Looper</a> draws one or more times, modifying the canvas and paint each time. +<a href='undocumented#Draw_Looper'>Draw Looper</a> may be used to draw multiple colors or create a colored shadow. +Set <a href='undocumented#Draw_Looper'>Draw Looper</a> to nullptr to prevent <a href='undocumented#Draw_Looper'>Draw Looper</a> from modifying the draw. ### Example <div><fiddle-embed name="84ec12a36e50df5ac565cc7a75ffbe9f"></fiddle-embed></div> -<a name="SkPaint_getDrawLooper"></a> +<a name='SkPaint_getDrawLooper'></a> ## getDrawLooper -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkDrawLooper* getDrawLooper() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkDrawLooper'>SkDrawLooper</a>* <a href='#SkPaint_getDrawLooper'>getDrawLooper</a>() const </pre> -Returns <a href="undocumented#Draw_Looper">Draw Looper</a> if set, or nullptr. -Does not alter <a href="undocumented#Draw_Looper">Draw Looper</a> <a href="undocumented#Reference_Count">Reference Count</a>. +Returns <a href='undocumented#Draw_Looper'>Draw Looper</a> if set, or nullptr. +Does not alter <a href='undocumented#Draw_Looper'>Draw Looper</a> <a href='undocumented#Reference_Count'>Reference Count</a>. ### Return Value -<a href="undocumented#Draw_Looper">Draw Looper</a> if previously set, nullptr otherwise +<a href='undocumented#Draw_Looper'>Draw Looper</a> if previously set, nullptr otherwise ### Example @@ -3444,19 +4252,19 @@ nullptr != draw looper --- -<a name="SkPaint_refDrawLooper"></a> +<a name='SkPaint_refDrawLooper'></a> ## refDrawLooper -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkDrawLooper> refDrawLooper() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkDrawLooper'>SkDrawLooper</a>> <a href='#SkPaint_refDrawLooper'>refDrawLooper</a>() const </pre> -Returns <a href="undocumented#Draw_Looper">Draw Looper</a> if set, or nullptr. -Increases <a href="undocumented#Draw_Looper">Draw Looper</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Returns <a href='undocumented#Draw_Looper'>Draw Looper</a> if set, or nullptr. +Increases <a href='undocumented#Draw_Looper'>Draw Looper</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Return Value -<a href="undocumented#Draw_Looper">Draw Looper</a> if previously set, nullptr otherwise +<a href='undocumented#Draw_Looper'>Draw Looper</a> if previously set, nullptr otherwise ### Example @@ -3473,32 +4281,34 @@ draw looper unique: false --- -<a name="SkPaint_getLooper"></a> +<a name='SkPaint_getLooper'></a> ## getLooper -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkDrawLooper* getLooper() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkDrawLooper'>SkDrawLooper</a>* <a href='#SkPaint_getLooper'>getLooper</a>() const </pre> +Deprecated. + --- -<a name="SkPaint_setDrawLooper"></a> +<a name='SkPaint_setDrawLooper'></a> ## setDrawLooper -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setDrawLooper(sk_sp<SkDrawLooper> drawLooper) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setDrawLooper'>setDrawLooper</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkDrawLooper'>SkDrawLooper</a>> drawLooper) </pre> -Sets <a href="undocumented#Draw_Looper">Draw Looper</a> to <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous -<a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>. Pass nullptr to clear <a href="undocumented#Draw_Looper">Draw Looper</a> and leave <a href="undocumented#Draw_Looper">Draw Looper</a> effect on +Sets <a href='undocumented#Draw_Looper'>Draw Looper</a> to <a href='#SkPaint_setDrawLooper_drawLooper'>drawLooper</a>, decreasing <a href='undocumented#Reference_Count'>Reference Count</a> of the previous +<a href='#SkPaint_setDrawLooper_drawLooper'>drawLooper</a>. Pass nullptr to clear <a href='undocumented#Draw_Looper'>Draw Looper</a> and leave <a href='undocumented#Draw_Looper'>Draw Looper</a> effect on drawing unaltered. -Increments <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a> <a href="undocumented#Reference_Count">Reference Count</a> by one. +Increments <a href='#SkPaint_setDrawLooper_drawLooper'>drawLooper</a> <a href='undocumented#Reference_Count'>Reference Count</a> by one. ### Parameters -<table> <tr> <td><a name="SkPaint_setDrawLooper_drawLooper"> <code><strong>drawLooper </strong></code> </a></td> <td> -iterates through drawing one or more time, altering <a href="#Paint">Paint</a></td> +<table> <tr> <td><a name='SkPaint_setDrawLooper_drawLooper'><code><strong>drawLooper</strong></code></a></td> + <td>iterates through drawing one or more time, altering <a href='#Paint'>Paint</a></td> </tr> </table> @@ -3508,69 +4318,84 @@ iterates through drawing one or more time, altering <a href="#Paint">Paint</a></ --- -<a name="SkPaint_setLooper"></a> +<a name='SkPaint_setLooper'></a> ## setLooper -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLooper(sk_sp<SkDrawLooper> drawLooper) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setLooper'>setLooper</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkDrawLooper'>SkDrawLooper</a>> drawLooper) </pre> +Deprecated. + --- -## <a name="Text_Align"></a> Text Align +## <a name='Text_Align'>Text Align</a> -## <a name="SkPaint_Align"></a> Enum SkPaint::Align +## <a name='SkPaint_Align'>Enum SkPaint::Align</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_Align">Align</a> { - <a href="#SkPaint_kLeft_Align">kLeft Align</a>, - <a href="#SkPaint_kCenter_Align">kCenter Align</a>, - <a href="#SkPaint_kRight_Align">kRight Align</a>, + enum <a href='#SkPaint_Align'>Align</a> { + <a href='#SkPaint_kLeft_Align'>kLeft Align</a>, + <a href='#SkPaint_kCenter_Align'>kCenter Align</a>, + <a href='#SkPaint_kRight_Align'>kRight Align</a>, }; - static constexpr int <a href="#SkPaint_kAlignCount">kAlignCount</a> = 3; + static constexpr int <a href='#SkPaint_kAlignCount'>kAlignCount</a> = 3; </pre> -<a href="#SkPaint_Align">Align</a> adjusts the text relative to the text position. -<a href="#SkPaint_Align">Align</a> affects <a href="undocumented#Glyph">Glyphs</a> drawn with: <a href="SkCanvas_Reference#SkCanvas_drawText">SkCanvas::drawText</a>, <a href="SkCanvas_Reference#SkCanvas_drawPosText">SkCanvas::drawPosText</a>, -<a href="SkCanvas_Reference#SkCanvas_drawPosTextH">SkCanvas::drawPosTextH</a>, <a href="SkCanvas_Reference#SkCanvas_drawTextOnPath">SkCanvas::drawTextOnPath</a>, -<a href="SkCanvas_Reference#SkCanvas_drawTextOnPathHV">SkCanvas::drawTextOnPathHV</a>, <a href="SkCanvas_Reference#SkCanvas_drawTextRSXform">SkCanvas::drawTextRSXform</a>, <a href="SkCanvas_Reference#SkCanvas_drawTextBlob">SkCanvas::drawTextBlob</a>, -and <a href="SkCanvas_Reference#SkCanvas_drawString">SkCanvas::drawString</a>; -as well as calls that place text <a href="undocumented#Glyph">Glyphs</a> like <a href="#SkPaint_getTextWidths">getTextWidths</a> and <a href="#SkPaint_getTextPath">getTextPath</a>. +<a href='#SkPaint_Align'>Align</a> adjusts the text relative to the text position. +<a href='#SkPaint_Align'>Align</a> affects <a href='undocumented#Glyph'>Glyphs</a> drawn with: <a href='SkCanvas_Reference#SkCanvas_drawText'>SkCanvas::drawText</a>, <a href='SkCanvas_Reference#SkCanvas_drawPosText'>SkCanvas::drawPosText</a>, +<a href='SkCanvas_Reference#SkCanvas_drawPosTextH'>SkCanvas::drawPosTextH</a>, <a href='SkCanvas_Reference#SkCanvas_drawTextOnPath'>SkCanvas::drawTextOnPath</a>, +<a href='SkCanvas_Reference#SkCanvas_drawTextOnPathHV'>SkCanvas::drawTextOnPathHV</a>, <a href='SkCanvas_Reference#SkCanvas_drawTextRSXform'>SkCanvas::drawTextRSXform</a>, <a href='SkCanvas_Reference#SkCanvas_drawTextBlob'>SkCanvas::drawTextBlob</a>, +and <a href='SkCanvas_Reference#SkCanvas_drawString'>SkCanvas::drawString</a>; +as well as calls that place text <a href='undocumented#Glyph'>Glyphs</a> like <a href='#SkPaint_getTextWidths'>getTextWidths</a> and <a href='#SkPaint_getTextPath'>getTextPath</a>. The text position is set by the font for both horizontal and vertical text. Typically, for horizontal text, the position is to the left side of the glyph on the base line; and for vertical text, the position is the horizontal center of the glyph at the caps height. -<a href="#SkPaint_Align">Align</a> adjusts the glyph position to center it or move it to abut the position +<a href='#SkPaint_Align'>Align</a> adjusts the glyph position to center it or move it to abut the position using the metrics returned by the font. -<a href="#SkPaint_Align">Align</a> defaults to <a href="#SkPaint_kLeft_Align">kLeft Align</a>. +<a href='#SkPaint_Align'>Align</a> defaults to <a href='#SkPaint_kLeft_Align'>kLeft Align</a>. ### Constants -<table> - <tr> - <td><a name="SkPaint_kLeft_Align"> <code><strong>SkPaint::kLeft_Align </strong></code> </a></td><td>0</td><td>Leaves the glyph at the position computed by the font offset by the text position. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kLeft_Align'><code>SkPaint::kLeft_Align</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Leaves the glyph at the position computed by the font offset by the text position. </td> </tr> <tr> - <td><a name="SkPaint_kCenter_Align"> <code><strong>SkPaint::kCenter_Align </strong></code> </a></td><td>1</td><td>Moves the glyph half its width if <a href="#SkPaint_Flags">Flags</a> has <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> clear, and -half its height if <a href="#SkPaint_Flags">Flags</a> has <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> set. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kCenter_Align'><code>SkPaint::kCenter_Align</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Moves the glyph half its width if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> clear, and +half its height if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> set. </td> </tr> - <tr> - <td><a name="SkPaint_kRight_Align"> <code><strong>SkPaint::kRight_Align </strong></code> </a></td><td>2</td><td>Moves the glyph by its width if <a href="#SkPaint_Flags">Flags</a> has <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> clear, -and by its height if <a href="#SkPaint_Flags">Flags</a> has <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> set. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kRight_Align'><code>SkPaint::kRight_Align</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Moves the glyph by its width if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> clear, +and by its height if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> set. </td> </tr> <tr> - <td><a name="SkPaint_kAlignCount"> <code><strong>SkPaint::kAlignCount </strong></code> </a></td><td>3</td><td>The number of different <a href="#Text_Align">Text Align</a> values defined. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kAlignCount'><code>SkPaint::kAlignCount</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +number of different Text_Align values defined</td> </tr> - - +</table> ### Example @@ -3579,18 +4404,18 @@ and by its height if <a href="#SkPaint_Flags">Flags</a> has <a href="#SkPaint_kV ### Example -<div><fiddle-embed name="f1cbbbafe6b3c52b81309cccbf96a308"><div><a href="#Vertical_Text">Vertical Text</a> treats <a href="#SkPaint_kLeft_Align">kLeft Align</a> as top align, and <a href="#SkPaint_kRight_Align">kRight Align</a> as bottom align. +<div><fiddle-embed name="f1cbbbafe6b3c52b81309cccbf96a308"><div><a href='#Vertical_Text'>Vertical Text</a> treats <a href='#SkPaint_kLeft_Align'>kLeft Align</a> as top align, and <a href='#SkPaint_kRight_Align'>kRight Align</a> as bottom align. </div></fiddle-embed></div> -<a name="SkPaint_getTextAlign"></a> +<a name='SkPaint_getTextAlign'></a> ## getTextAlign -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Align getTextAlign() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_Align'>Align</a> <a href='#SkPaint_getTextAlign'>getTextAlign</a>() const </pre> -Returns <a href="#Text_Align">Text Align</a>. -Returns <a href="#SkPaint_kLeft_Align">kLeft Align</a> if <a href="#Text_Align">Text Align</a> has not been set. +Returns <a href='#Text_Align'>Text Align</a>. +Returns <a href='#SkPaint_kLeft_Align'>kLeft Align</a> if <a href='#Text_Align'>Text Align</a> has not been set. ### Return Value @@ -3610,50 +4435,50 @@ kLeft_Align == default --- -<a name="SkPaint_setTextAlign"></a> +<a name='SkPaint_setTextAlign'></a> ## setTextAlign -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTextAlign(Align align) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setTextAlign'>setTextAlign</a>(<a href='#SkPaint_Align'>Align</a> align) </pre> -Sets <a href="#Text_Align">Text Align</a> to <a href="#SkPaint_setTextAlign_align">align</a>. -Has no effect if <a href="#SkPaint_setTextAlign_align">align</a> is an invalid value. +Sets <a href='#Text_Align'>Text Align</a> to <a href='#SkPaint_setTextAlign_align'>align</a>. +Has no effect if <a href='#SkPaint_setTextAlign_align'>align</a> is an invalid value. ### Parameters -<table> <tr> <td><a name="SkPaint_setTextAlign_align"> <code><strong>align </strong></code> </a></td> <td> -text placement relative to position</td> +<table> <tr> <td><a name='SkPaint_setTextAlign_align'><code><strong>align</strong></code></a></td> + <td>text placement relative to position</td> </tr> </table> ### Example -<div><fiddle-embed name="d37540afd918506ac2594665ca63979b"><div><a href="undocumented#Text">Text</a> is left-aligned by default, and then set to center. Setting the +<div><fiddle-embed name="d37540afd918506ac2594665ca63979b"><div><a href='undocumented#Text'>Text</a> is left-aligned by default, and then set to center. Setting the alignment out of range has no effect. </div></fiddle-embed></div> --- -## <a name="Text_Size"></a> Text Size +## <a name='Text_Size'>Text Size</a> -<a href="#Text_Size">Text Size</a> adjusts the overall text size in points. -<a href="#Text_Size">Text Size</a> can be set to any positive value or zero. -<a href="#Text_Size">Text Size</a> defaults to 12. -Set <a href="undocumented#SkPaintDefaults_TextSize">SkPaintDefaults TextSize</a> at compile time to change the default setting. +<a href='#Text_Size'>Text Size</a> adjusts the overall text size in points. +<a href='#Text_Size'>Text Size</a> can be set to any positive value or zero. +<a href='#Text_Size'>Text Size</a> defaults to 12. +Set <a href='undocumented#SkPaintDefaults_TextSize'>SkPaintDefaults TextSize</a> at compile time to change the default setting. ### Example <div><fiddle-embed name="91c9a3e498bb9412e4522a95d076ed5f"></fiddle-embed></div> -<a name="SkPaint_getTextSize"></a> +<a name='SkPaint_getTextSize'></a> ## getTextSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getTextSize() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getTextSize'>getTextSize</a>() const </pre> -Returns <a href="#Text_Size">Text Size</a> in points. +Returns <a href='#Text_Size'>Text Size</a> in points. ### Return Value @@ -3665,20 +4490,20 @@ typographic height of text --- -<a name="SkPaint_setTextSize"></a> +<a name='SkPaint_setTextSize'></a> ## setTextSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTextSize(SkScalar textSize) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setTextSize'>setTextSize</a>(<a href='undocumented#SkScalar'>SkScalar</a> textSize) </pre> -Sets <a href="#Text_Size">Text Size</a> in points. -Has no effect if <a href="#SkPaint_setTextSize_textSize">textSize</a> is not greater than or equal to zero. +Sets <a href='#Text_Size'>Text Size</a> in points. +Has no effect if <a href='#SkPaint_setTextSize_textSize'>textSize</a> is not greater than or equal to zero. ### Parameters -<table> <tr> <td><a name="SkPaint_setTextSize_textSize"> <code><strong>textSize </strong></code> </a></td> <td> -typographic height of text</td> +<table> <tr> <td><a name='SkPaint_setTextSize_textSize'><code><strong>textSize</strong></code></a></td> + <td>typographic height of text</td> </tr> </table> @@ -3688,26 +4513,26 @@ typographic height of text</td> --- -## <a name="Text_Scale_X"></a> Text Scale X +## <a name='Text_Scale_X'>Text Scale X</a> -<a href="#Text_Scale_X">Text Scale X</a> adjusts the text horizontal scale. -<a href="undocumented#Text">Text</a> scaling approximates condensed and expanded type faces when the actual face +<a href='#Text_Scale_X'>Text Scale X</a> adjusts the text horizontal scale. +<a href='undocumented#Text'>Text</a> scaling approximates condensed and expanded type faces when the actual face is not available. -<a href="#Text_Scale_X">Text Scale X</a> can be set to any value. -<a href="#Text_Scale_X">Text Scale X</a> defaults to 1. +<a href='#Text_Scale_X'>Text Scale X</a> can be set to any value. +<a href='#Text_Scale_X'>Text Scale X</a> defaults to 1. ### Example <div><fiddle-embed name="d13d787c1e36f515319fc998411c1d91"></fiddle-embed></div> -<a name="SkPaint_getTextScaleX"></a> +<a name='SkPaint_getTextScaleX'></a> ## getTextScaleX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getTextScaleX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getTextScaleX'>getTextScaleX</a>() const </pre> -Returns <a href="#Text_Scale_X">Text Scale X</a>. +Returns <a href='#Text_Scale_X'>Text Scale X</a>. Default value is 1. ### Return Value @@ -3720,20 +4545,20 @@ text horizontal scale --- -<a name="SkPaint_setTextScaleX"></a> +<a name='SkPaint_setTextScaleX'></a> ## setTextScaleX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTextScaleX(SkScalar scaleX) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setTextScaleX'>setTextScaleX</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX) </pre> -Sets <a href="#Text_Scale_X">Text Scale X</a>. +Sets <a href='#Text_Scale_X'>Text Scale X</a>. Default value is 1. ### Parameters -<table> <tr> <td><a name="SkPaint_setTextScaleX_scaleX"> <code><strong>scaleX </strong></code> </a></td> <td> -text horizontal scale</td> +<table> <tr> <td><a name='SkPaint_setTextScaleX_scaleX'><code><strong>scaleX</strong></code></a></td> + <td>text horizontal scale</td> </tr> </table> @@ -3743,26 +4568,26 @@ text horizontal scale</td> --- -## <a name="Text_Skew_X"></a> Text Skew X +## <a name='Text_Skew_X'>Text Skew X</a> -<a href="#Text_Skew_X">Text Skew X</a> adjusts the text horizontal slant. -<a href="undocumented#Text">Text</a> skewing approximates italic and oblique type faces when the actual face +<a href='#Text_Skew_X'>Text Skew X</a> adjusts the text horizontal slant. +<a href='undocumented#Text'>Text</a> skewing approximates italic and oblique type faces when the actual face is not available. -<a href="#Text_Skew_X">Text Skew X</a> can be set to any value. -<a href="#Text_Skew_X">Text Skew X</a> defaults to 0. +<a href='#Text_Skew_X'>Text Skew X</a> can be set to any value. +<a href='#Text_Skew_X'>Text Skew X</a> defaults to 0. ### Example <div><fiddle-embed name="aff208b0aab265f273045b27e683c17c"></fiddle-embed></div> -<a name="SkPaint_getTextSkewX"></a> +<a name='SkPaint_getTextSkewX'></a> ## getTextSkewX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getTextSkewX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getTextSkewX'>getTextSkewX</a>() const </pre> -Returns <a href="#Text_Skew_X">Text Skew X</a>. +Returns <a href='#Text_Skew_X'>Text Skew X</a>. Default value is zero. ### Return Value @@ -3775,20 +4600,20 @@ additional shear in x-axis relative to y-axis --- -<a name="SkPaint_setTextSkewX"></a> +<a name='SkPaint_setTextSkewX'></a> ## setTextSkewX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTextSkewX(SkScalar skewX) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setTextSkewX'>setTextSkewX</a>(<a href='undocumented#SkScalar'>SkScalar</a> skewX) </pre> -Sets <a href="#Text_Skew_X">Text Skew X</a>. +Sets <a href='#Text_Skew_X'>Text Skew X</a>. Default value is zero. ### Parameters -<table> <tr> <td><a name="SkPaint_setTextSkewX_skewX"> <code><strong>skewX </strong></code> </a></td> <td> -additional shear in x-axis relative to y-axis</td> +<table> <tr> <td><a name='SkPaint_setTextSkewX_skewX'><code><strong>skewX</strong></code></a></td> + <td>additional shear in x-axis relative to y-axis</td> </tr> </table> @@ -3798,81 +4623,91 @@ additional shear in x-axis relative to y-axis</td> --- -## <a name="Text_Encoding"></a> Text Encoding +## <a name='Text_Encoding'>Text Encoding</a> -## <a name="SkPaint_TextEncoding"></a> Enum SkPaint::TextEncoding +## <a name='SkPaint_TextEncoding'>Enum SkPaint::TextEncoding</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_TextEncoding">TextEncoding</a> { - <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>, - <a href="#SkPaint_kUTF16_TextEncoding">kUTF16 TextEncoding</a>, - <a href="#SkPaint_kUTF32_TextEncoding">kUTF32 TextEncoding</a>, - <a href="#SkPaint_kGlyphID_TextEncoding">kGlyphID TextEncoding</a>, + enum <a href='#SkPaint_TextEncoding'>TextEncoding</a> { + <a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a>, + <a href='#SkPaint_kUTF16_TextEncoding'>kUTF16 TextEncoding</a>, + <a href='#SkPaint_kUTF32_TextEncoding'>kUTF32 TextEncoding</a>, + <a href='#SkPaint_kGlyphID_TextEncoding'>kGlyphID TextEncoding</a>, }; </pre> -<a href="#SkPaint_TextEncoding">TextEncoding</a> determines whether text specifies character codes and their encoded -size, or glyph indices. Characters are encoded as specified by the <a href="http://unicode.org/standard/standard.html">Unicode standard</a> . +<a href='#SkPaint_TextEncoding'>TextEncoding</a> determines whether text specifies character codes and their encoded +size, or glyph indices. Characters are encoded as specified by the <a href='https://unicode.org/standard/standard.html'>Unicode standard</a></a> . Character codes encoded size are specified by UTF-8, UTF-16, or UTF-32. All character code formats are able to represent all of Unicode, differing only in the total storage required. -<a href="https://tools.ietf.org/html/rfc3629">UTF-8 (RFC 3629)</a> encodes each character as one or more 8-bit bytes. +<a href='https://tools.ietf.org/html/rfc3629'>UTF-8 (RFC 3629)</a></a> encodes each character as one or more 8-bit bytes. -<a href="https://tools.ietf.org/html/rfc2781">UTF-16 (RFC 2781)</a> encodes each character as one or two 16-bit words. +<a href='https://tools.ietf.org/html/rfc2781'>UTF-16 (RFC 2781)</a></a> encodes each character as one or two 16-bit words. -<a href="http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf">UTF-32</a> encodes each character as one 32-bit word. +<a href='https://www.unicode.org/versions/Unicode5.0.0/ch03.pdf'>UTF-32</a></a> encodes each character as one 32-bit word. -<a href="undocumented#Font_Manager">Font Manager</a> uses font data to convert character code points into glyph indices. +<a href='undocumented#Font_Manager'>Font Manager</a> uses font data to convert character code points into glyph indices. A glyph index is a 16-bit word. -<a href="#SkPaint_TextEncoding">TextEncoding</a> is set to <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a> by default. +<a href='#SkPaint_TextEncoding'>TextEncoding</a> is set to <a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a> by default. ### Constants -<table> - <tr> - <td><a name="SkPaint_kUTF8_TextEncoding"> <code><strong>SkPaint::kUTF8_TextEncoding </strong></code> </a></td><td>0</td><td>Uses bytes to represent UTF-8 or ASCII. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kUTF8_TextEncoding'><code>SkPaint::kUTF8_TextEncoding</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +uses bytes to represent UTF-8 or ASCII</td> </tr> <tr> - <td><a name="SkPaint_kUTF16_TextEncoding"> <code><strong>SkPaint::kUTF16_TextEncoding </strong></code> </a></td><td>1</td><td>Uses two byte words to represent most of Unicode. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kUTF16_TextEncoding'><code>SkPaint::kUTF16_TextEncoding</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +uses two byte words to represent most of Unicode</td> </tr> - <tr> - <td><a name="SkPaint_kUTF32_TextEncoding"> <code><strong>SkPaint::kUTF32_TextEncoding </strong></code> </a></td><td>2</td><td>Uses four byte words to represent all of Unicode. -</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kUTF32_TextEncoding'><code>SkPaint::kUTF32_TextEncoding</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +uses four byte words to represent all of Unicode</td> </tr> <tr> - <td><a name="SkPaint_kGlyphID_TextEncoding"> <code><strong>SkPaint::kGlyphID_TextEncoding </strong></code> </a></td><td>3</td><td>Uses two byte words to represent glyph indices. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kGlyphID_TextEncoding'><code>SkPaint::kGlyphID_TextEncoding</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +uses two byte words to represent glyph indices</td> </tr> - - +</table> ### Example <div><fiddle-embed name="b29294e7f29d160a1b46abf2dcec9d2a"><div>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. </div></fiddle-embed></div> -<a name="SkPaint_getTextEncoding"></a> +<a name='SkPaint_getTextEncoding'></a> ## getTextEncoding -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -TextEncoding getTextEncoding() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPaint_TextEncoding'>TextEncoding</a> <a href='#SkPaint_getTextEncoding'>getTextEncoding</a>() const </pre> -Returns <a href="#Text_Encoding">Text Encoding</a>. -<a href="#Text_Encoding">Text Encoding</a> determines how character code points are mapped to font glyph indices. +Returns <a href='#Text_Encoding'>Text Encoding</a>. +<a href='#Text_Encoding'>Text Encoding</a> determines how character code points are mapped to font glyph indices. ### Return Value -one of: <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>, <a href="#SkPaint_kUTF16_TextEncoding">kUTF16 TextEncoding</a>, <a href="#SkPaint_kUTF32_TextEncoding">kUTF32 TextEncoding</a>, or -<a href="#SkPaint_kGlyphID_TextEncoding">kGlyphID TextEncoding</a> +one of: <a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a>, <a href='#SkPaint_kUTF16_TextEncoding'>kUTF16 TextEncoding</a>, <a href='#SkPaint_kUTF32_TextEncoding'>kUTF32 TextEncoding</a>, or +<a href='#SkPaint_kGlyphID_TextEncoding'>kGlyphID TextEncoding</a> ### Example @@ -3889,22 +4724,22 @@ kGlyphID_TextEncoding == text encoding --- -<a name="SkPaint_setTextEncoding"></a> +<a name='SkPaint_setTextEncoding'></a> ## setTextEncoding -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setTextEncoding(TextEncoding encoding) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_setTextEncoding'>setTextEncoding</a>(<a href='#SkPaint_TextEncoding'>TextEncoding</a> encoding) </pre> -Sets <a href="#Text_Encoding">Text Encoding</a> to <a href="#SkPaint_setTextEncoding_encoding">encoding</a>. -<a href="#Text_Encoding">Text Encoding</a> determines how character code points are mapped to font glyph indices. -Invalid values for <a href="#SkPaint_setTextEncoding_encoding">encoding</a> are ignored. +Sets <a href='#Text_Encoding'>Text Encoding</a> to <a href='#SkPaint_setTextEncoding_encoding'>encoding</a>. +<a href='#Text_Encoding'>Text Encoding</a> determines how character code points are mapped to font glyph indices. +Invalid values for <a href='#SkPaint_setTextEncoding_encoding'>encoding</a> are ignored. ### Parameters -<table> <tr> <td><a name="SkPaint_setTextEncoding_encoding"> <code><strong>encoding </strong></code> </a></td> <td> -one of: <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>, <a href="#SkPaint_kUTF16_TextEncoding">kUTF16 TextEncoding</a>, <a href="#SkPaint_kUTF32_TextEncoding">kUTF32 TextEncoding</a>, or -<a href="#SkPaint_kGlyphID_TextEncoding">kGlyphID TextEncoding</a></td> +<table> <tr> <td><a name='SkPaint_setTextEncoding_encoding'><code><strong>encoding</strong></code></a></td> + <td>one of: <a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a>, <a href='#SkPaint_kUTF16_TextEncoding'>kUTF16 TextEncoding</a>, <a href='#SkPaint_kUTF32_TextEncoding'>kUTF32 TextEncoding</a>, or +<a href='#SkPaint_kGlyphID_TextEncoding'>kGlyphID TextEncoding</a></td> </tr> # @@ -3924,13 +4759,13 @@ one of: <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>, <a href="# --- -## <a name="Font_Metrics"></a> Font Metrics +## <a name='Font_Metrics'>Font Metrics</a> -<a href="#Font_Metrics">Font Metrics</a> describe dimensions common to the <a href="undocumented#Glyph">Glyphs</a> in <a href="undocumented#Typeface">Typeface</a>. -The dimensions are computed by <a href="undocumented#Font_Manager">Font Manager</a> from font data and do not take -<a href="#Paint">Paint</a> settings other than <a href="#Text_Size">Text Size</a> into account. +<a href='#Font_Metrics'>Font Metrics</a> describe dimensions common to the <a href='undocumented#Glyph'>Glyphs</a> in <a href='undocumented#Typeface'>Typeface</a>. +The dimensions are computed by <a href='undocumented#Font_Manager'>Font Manager</a> from font data and do not take +<a href='#Paint'>Paint</a> settings other than <a href='#Text_Size'>Text Size</a> into account. -<a href="undocumented#Font">Font</a> dimensions specify the anchor to the left of the glyph at baseline as the origin. +<a href='undocumented#Font'>Font</a> dimensions specify the anchor to the left of the glyph at baseline as the origin. X-axis values to the left of the glyph are negative, and to the right of the left glyph edge are positive. Y-axis values above the baseline are negative, and below the baseline are positive. @@ -3939,195 +4774,383 @@ Y-axis values above the baseline are negative, and below the baseline are positi <div><fiddle-embed name="2bfa3783719fcd769af177a1b244e171"></fiddle-embed></div> -# <a name="SkPaint_FontMetrics"></a> Struct SkPaint::FontMetrics +# <a name='SkPaint_FontMetrics'>Struct SkPaint::FontMetrics</a> + +## <a name='Font_Metrics_Constant'>Constant</a> + + +SkPaint related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_FontMetricsFlags'>FontMetricsFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>valid <a href='#Font_Metrics'>Font Metrics</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag'>kStrikeoutPositionIsValid Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>set if <a href='#SkPaint_FontMetrics_fStrikeoutPosition'>fStrikeoutPosition</a> is valid</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag'>kStrikeoutThicknessIsValid Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>set if <a href='#SkPaint_FontMetrics_fStrikeoutThickness'>fStrikeoutThickness</a> is valid</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag'>kUnderlinePositionIsValid Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>set if <a href='#SkPaint_FontMetrics_fUnderlinePosition'>fUnderlinePosition</a> is valid</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag'>kUnderlineThicknessIsValid Flag</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>set if <a href='#SkPaint_FontMetrics_fUnderlineThickness'>fUnderlineThickness</a> is valid</td> + </tr> +</table> + + +## <a name='Font_Metrics_Member_Function'>Member_Function</a> + + +SkPaint member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_hasStrikeoutPosition'>hasStrikeoutPosition</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns strikeout position if set</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_hasStrikeoutThickness'>hasStrikeoutThickness</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns strikeout thickness if set</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_hasUnderlinePosition'>hasUnderlinePosition</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns underline position if set</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_hasUnderlineThickness'>hasUnderlineThickness</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns underline thickness if set</td> + </tr> +</table> + + +## <a name='Font_Metrics_Member'>Member</a> + + +SkPaint members may be read and written directly without using a member function. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fAscent'>fAscent</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>distance to reserve above baseline</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fAvgCharWidth'>fAvgCharWidth</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>average character width</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fBottom'>fBottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>extent below baseline</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fCapHeight'>fCapHeight</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>height of an upper-case letter</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fDescent'>fDescent</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>distance to reserve below baseline</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fFlags'>fFlags</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>is set to <a href='#SkPaint_FontMetrics_FontMetricsFlags'>FontMetricsFlags</a> when metrics are valid</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fLeading'>fLeading</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>distance to add between lines</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fMaxCharWidth'>fMaxCharWidth</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maximum character width</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fStrikeoutPosition'>fStrikeoutPosition</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>strikeout position relative to baseline</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fStrikeoutThickness'>fStrikeoutThickness</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>strikeout thickness</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fTop'>fTop</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>extent above baseline</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fUnderlinePosition'>fUnderlinePosition</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>underline position relative to baseline</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fUnderlineThickness'>fUnderlineThickness</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>underline thickness</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fXHeight'>fXHeight</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>height of lower-case 'x'</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fXMax'>fXMax</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>maximum x</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_FontMetrics_fXMin'>fXMin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>minimum x</td> + </tr> +</table> + <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - struct <a href="#SkPaint_FontMetrics">FontMetrics</a> { - enum <a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> { - <a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0, - <a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1, - <a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2, - <a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3, + struct <a href='#SkPaint_FontMetrics'>FontMetrics</a> { + enum <a href='#SkPaint_FontMetrics_FontMetricsFlags'>FontMetricsFlags</a> { + <a href='#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag'>kUnderlineThicknessIsValid Flag</a> = 1 << 0, + <a href='#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag'>kUnderlinePositionIsValid Flag</a> = 1 << 1, + <a href='#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag'>kStrikeoutThicknessIsValid Flag</a> = 1 << 2, + <a href='#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag'>kStrikeoutPositionIsValid Flag</a> = 1 << 3, }; - uint32_t <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fTop">fTop</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fAscent">fAscent</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fDescent">fDescent</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fBottom">fBottom</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fLeading">fLeading</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fAvgCharWidth">fAvgCharWidth</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fMaxCharWidth">fMaxCharWidth</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXMin">fXMin</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXMax">fXMax</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXHeight">fXHeight</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fCapHeight">fCapHeight</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a>; - - bool <a href="#SkPaint_FontMetrics_hasUnderlineThickness">hasUnderlineThickness(SkScalar* thickness)</a> const; - bool <a href="#SkPaint_FontMetrics_hasUnderlinePosition">hasUnderlinePosition(SkScalar* position)</a> const; - bool <a href="#SkPaint_FontMetrics_hasStrikeoutThickness">hasStrikeoutThickness(SkScalar* thickness)</a> const; - bool <a href="#SkPaint_FontMetrics_hasStrikeoutPosition">hasStrikeoutPosition(SkScalar* position)</a> const; + uint32_t <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fTop'>fTop</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fAscent'>fAscent</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fDescent'>fDescent</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fBottom'>fBottom</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fLeading'>fLeading</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fAvgCharWidth'>fAvgCharWidth</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fMaxCharWidth'>fMaxCharWidth</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fXMin'>fXMin</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fXMax'>fXMax</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fXHeight'>fXHeight</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fCapHeight'>fCapHeight</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fUnderlineThickness'>fUnderlineThickness</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fUnderlinePosition'>fUnderlinePosition</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fStrikeoutThickness'>fStrikeoutThickness</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_FontMetrics_fStrikeoutPosition'>fStrikeoutPosition</a>; + + bool <a href='#SkPaint_FontMetrics_hasUnderlineThickness'>hasUnderlineThickness(SkScalar* thickness)</a> const; + bool <a href='#SkPaint_FontMetrics_hasUnderlinePosition'>hasUnderlinePosition(SkScalar* position)</a> const; + bool <a href='#SkPaint_FontMetrics_hasStrikeoutThickness'>hasStrikeoutThickness(SkScalar* thickness)</a> const; + bool <a href='#SkPaint_FontMetrics_hasStrikeoutPosition'>hasStrikeoutPosition(SkScalar* position)</a> const; }; </pre> -<a href="#SkPaint_FontMetrics">FontMetrics</a> is filled out by <a href="#SkPaint_getFontMetrics">getFontMetrics</a>. <a href="#SkPaint_FontMetrics">FontMetrics</a> contents reflect the values -computed by <a href="undocumented#Font_Manager">Font Manager</a> using <a href="undocumented#Typeface">Typeface</a>. Values are set to zero if they are +<a href='#SkPaint_FontMetrics'>FontMetrics</a> is filled out by <a href='#SkPaint_getFontMetrics'>getFontMetrics</a>. <a href='#SkPaint_FontMetrics'>FontMetrics</a> contents reflect the values +computed by <a href='undocumented#Font_Manager'>Font Manager</a> using <a href='undocumented#Typeface'>Typeface</a>. Values are set to zero if they are not available. All vertical values relative to the baseline are given y-down. As such, zero is on the baseline, negative values are above the baseline, and positive values are below the baseline. -<a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a> and <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a> have a bit set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a> if their values +<a href='#SkPaint_FontMetrics_fUnderlineThickness'>fUnderlineThickness</a> and <a href='#SkPaint_FontMetrics_fUnderlinePosition'>fUnderlinePosition</a> have a bit set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a> if their values are valid, since their value may be zero. -<a href="#SkPaint_FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a> and <a href="#SkPaint_FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a> have a bit set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a> if their values +<a href='#SkPaint_FontMetrics_fStrikeoutThickness'>fStrikeoutThickness</a> and <a href='#SkPaint_FontMetrics_fStrikeoutPosition'>fStrikeoutPosition</a> have a bit set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a> if their values are valid, since their value may be zero. -## <a name="SkPaint_FontMetrics_FontMetricsFlags"></a> Enum SkPaint::FontMetrics::FontMetricsFlags +## <a name='SkPaint_FontMetrics_FontMetricsFlags'>Enum SkPaint::FontMetrics::FontMetricsFlags</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> { - <a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0, - <a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1, - <a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2, - <a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3, + enum <a href='#SkPaint_FontMetrics_FontMetricsFlags'>FontMetricsFlags</a> { + <a href='#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag'>kUnderlineThicknessIsValid Flag</a> = 1 << 0, + <a href='#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag'>kUnderlinePositionIsValid Flag</a> = 1 << 1, + <a href='#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag'>kStrikeoutThicknessIsValid Flag</a> = 1 << 2, + <a href='#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag'>kStrikeoutPositionIsValid Flag</a> = 1 << 3, }; </pre> -<a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> are set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a> when underline and strikeout metrics are valid; +<a href='#SkPaint_FontMetrics_FontMetricsFlags'>FontMetricsFlags</a> are set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a> when underline and strikeout metrics are valid; the underline or strikeout metric may be valid and zero. Fonts with embedded bitmaps may not have valid underline or strikeout metrics. ### Constants -<table> - <tr> - <td><a name="SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag"> <code><strong>SkPaint::FontMetrics::kUnderlineThicknessIsValid_Flag </strong></code> </a></td><td>0x0001</td><td>Set if <a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a> is valid. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag'><code>SkPaint::FontMetrics::kUnderlineThicknessIsValid_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0001</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if fUnderlineThickness is valid</td> </tr> <tr> - <td><a name="SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag"> <code><strong>SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag </strong></code> </a></td><td>0x0002</td><td>Set if <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a> is valid. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag'><code>SkPaint::FontMetrics::kUnderlinePositionIsValid_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0002</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if fUnderlinePosition is valid</td> </tr> - <tr> - <td><a name="SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag"> <code><strong>SkPaint::FontMetrics::kStrikeoutThicknessIsValid_Flag </strong></code> </a></td><td>0x0004</td><td>Set if <a href="#SkPaint_FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a> is valid. -</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag'><code>SkPaint::FontMetrics::kStrikeoutThicknessIsValid_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0004</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if fStrikeoutThickness is valid</td> </tr> <tr> - <td><a name="SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag"> <code><strong>SkPaint::FontMetrics::kStrikeoutPositionIsValid_Flag </strong></code> </a></td><td>0x0008</td><td>Set if <a href="#SkPaint_FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a> is valid. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag'><code>SkPaint::FontMetrics::kStrikeoutPositionIsValid_Flag</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x0008</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +set if fStrikeoutPosition is valid</td> </tr> +</table> - - -<a name="SkPaint_FontMetrics_fFlags"> <code><strong>uint32_t fFlags</strong></code> </a> - -<a href="#SkPaint_FontMetrics_fFlags">fFlags</a> is set when underline metrics are valid. - -<a name="SkPaint_FontMetrics_fTop"> <code><strong>SkScalar fTop</strong></code> </a> - +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>uint32_t</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fFlags'><code>fFlags</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +is set to FontMetricsFlags when metrics are valid</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fTop'><code>fTop</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Greatest extent above the baseline for any glyph. Typically less than zero. - -<a name="SkPaint_FontMetrics_fAscent"> <code><strong>SkScalar fAscent</strong></code> </a> - +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fAscent'><code>fAscent</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Recommended distance above the baseline to reserve for a line of text. Typically less than zero. - -<a name="SkPaint_FontMetrics_fDescent"> <code><strong>SkScalar fDescent</strong></code> </a> - +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fDescent'><code>fDescent</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Recommended distance below the baseline to reserve for a line of text. Typically greater than zero. - -<a name="SkPaint_FontMetrics_fBottom"> <code><strong>SkScalar fBottom</strong></code> </a> - +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fBottom'><code>fBottom</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Greatest extent below the baseline for any glyph. Typically greater than zero. - -<a name="SkPaint_FontMetrics_fLeading"> <code><strong>SkScalar fLeading</strong></code> </a> - +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fLeading'><code>fLeading</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Recommended distance to add between lines of text. Typically greater than or equal to zero. - -<a name="SkPaint_FontMetrics_fAvgCharWidth"> <code><strong>SkScalar fAvgCharWidth</strong></code> </a> - +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fAvgCharWidth'><code>fAvgCharWidth</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Average character width, if it is available. Zero if no average width is stored in the font. - -<a name="SkPaint_FontMetrics_fMaxCharWidth"> <code><strong>SkScalar fMaxCharWidth</strong></code> </a> - -Maximum character width. - -<a name="SkPaint_FontMetrics_fXMin"> <code><strong>SkScalar fXMin</strong></code> </a> - -Minimum bounding box x value for all <a href="undocumented#Glyph">Glyphs</a>. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fMaxCharWidth'><code>fMaxCharWidth</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +maximum character width</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fXMin'><code>fXMin</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Minimum bounding box x-value for all <a href='undocumented#Glyph'>Glyphs</a>. Typically less than zero. - -<a name="SkPaint_FontMetrics_fXMax"> <code><strong>SkScalar fXMax</strong></code> </a> - -Maximum bounding box x value for all <a href="undocumented#Glyph">Glyphs</a>. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fXMax'><code>fXMax</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Maximum bounding box x value for all <a href='undocumented#Glyph'>Glyphs</a>. Typically greater than zero. - -<a name="SkPaint_FontMetrics_fXHeight"> <code><strong>SkScalar fXHeight</strong></code> </a> - -Height of a lower-case 'x'. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fXHeight'><code>fXHeight</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> May be zero if no lower-case height is stored in the font. - -<a name="SkPaint_FontMetrics_fCapHeight"> <code><strong>SkScalar fCapHeight</strong></code> </a> - -Height of an upper-case letter. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fCapHeight'><code>fCapHeight</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> May be zero if no upper-case height is stored in the font. - -<a name="SkPaint_FontMetrics_fUnderlineThickness"> <code><strong>SkScalar fUnderlineThickness</strong></code> </a> - -Underline thickness. - -If the metric is valid, the <a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> is set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>. -If <a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> is clear, <a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a> is zero. - -<a name="SkPaint_FontMetrics_fUnderlinePosition"> <code><strong>SkScalar fUnderlinePosition</strong></code> </a> - +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fUnderlineThickness'><code>fUnderlineThickness</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +If the metric is valid, the <a href='#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag'>kUnderlineThicknessIsValid Flag</a> is set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a>. +If <a href='#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag'>kUnderlineThicknessIsValid Flag</a> is clear, <a href='#SkPaint_FontMetrics_fUnderlineThickness'>fUnderlineThickness</a> is zero. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fUnderlinePosition'><code>fUnderlinePosition</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Position of the top of the underline stroke relative to the baseline. Typically positive when valid. -If the metric is valid, the <a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> is set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>. -If <a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> is clear, <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a> is zero. - -<a name="SkPaint_FontMetrics_fStrikeoutThickness"> <code><strong>SkScalar fStrikeoutThickness</strong></code> </a> - -Strikeout thickness. - -If the metric is valid, the <a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> is set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>. -If <a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> is clear, <a href="#SkPaint_FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a> is zero. - -<a name="SkPaint_FontMetrics_fStrikeoutPosition"> <code><strong>SkScalar fStrikeoutPosition</strong></code> </a> - +If the metric is valid, the <a href='#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag'>kUnderlinePositionIsValid Flag</a> is set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a>. +If <a href='#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag'>kUnderlinePositionIsValid Flag</a> is clear, <a href='#SkPaint_FontMetrics_fUnderlinePosition'>fUnderlinePosition</a> is zero. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fStrikeoutThickness'><code>fStrikeoutThickness</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +If the metric is valid, the <a href='#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag'>kStrikeoutThicknessIsValid Flag</a> is set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a>. +If <a href='#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag'>kStrikeoutThicknessIsValid Flag</a> is clear, <a href='#SkPaint_FontMetrics_fStrikeoutThickness'>fStrikeoutThickness</a> is zero. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_FontMetrics_fStrikeoutPosition'><code>fStrikeoutPosition</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> Position of the bottom of the strikeout stroke relative to the baseline. Typically negative when valid. -If the metric is valid, the <a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> is set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>. -If <a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> is clear, <a href="#SkPaint_FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a> is zero. +If the metric is valid, the <a href='#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag'>kStrikeoutPositionIsValid Flag</a> is set in <a href='#SkPaint_FontMetrics_fFlags'>fFlags</a>. +If <a href='#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag'>kStrikeoutPositionIsValid Flag</a> is clear, <a href='#SkPaint_FontMetrics_fStrikeoutPosition'>fStrikeoutPosition</a> is zero. +</td> + </tr> +</table> -<a name="SkPaint_FontMetrics_hasUnderlineThickness"></a> +<a name='SkPaint_FontMetrics_hasUnderlineThickness'></a> ## hasUnderlineThickness -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool hasUnderlineThickness(SkScalar* thickness) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_FontMetrics_hasUnderlineThickness'>hasUnderlineThickness</a>(<a href='undocumented#SkScalar'>SkScalar</a>* thickness) const </pre> -If <a href="#Font_Metrics">Font Metrics</a> has a valid underline <a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a> is not valid, -return false, and ignore <a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a>. +If <a href='#Font_Metrics'>Font Metrics</a> has a valid underline <a href='#SkPaint_FontMetrics_hasUnderlineThickness_thickness'>thickness</a>, return true, and set +<a href='#SkPaint_FontMetrics_hasUnderlineThickness_thickness'>thickness</a> to that value. If the underline <a href='#SkPaint_FontMetrics_hasUnderlineThickness_thickness'>thickness</a> is not valid, +return false, and ignore <a href='#SkPaint_FontMetrics_hasUnderlineThickness_thickness'>thickness</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_FontMetrics_hasUnderlineThickness_thickness"> <code><strong>thickness </strong></code> </a></td> <td> -storage for underline width</td> +<table> <tr> <td><a name='SkPaint_FontMetrics_hasUnderlineThickness_thickness'><code><strong>thickness</strong></code></a></td> + <td>storage for underline width</td> </tr> </table> @@ -4137,45 +5160,45 @@ true if font specifies underline width --- -<a name="SkPaint_FontMetrics_hasUnderlinePosition"></a> +<a name='SkPaint_FontMetrics_hasUnderlinePosition'></a> ## hasUnderlinePosition -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool hasUnderlinePosition(SkScalar* position) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_FontMetrics_hasUnderlinePosition'>hasUnderlinePosition</a>(<a href='undocumented#SkScalar'>SkScalar</a>* position) const </pre> -If <a href="#Font_Metrics">Font Metrics</a> has a valid underline <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a> is not valid, -return false, and ignore <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a>. +If <a href='#Font_Metrics'>Font Metrics</a> has a valid underline <a href='#SkPaint_FontMetrics_hasUnderlinePosition_position'>position</a>, return true, and set +<a href='#SkPaint_FontMetrics_hasUnderlinePosition_position'>position</a> to that value. If the underline <a href='#SkPaint_FontMetrics_hasUnderlinePosition_position'>position</a> is not valid, +return false, and ignore <a href='#SkPaint_FontMetrics_hasUnderlinePosition_position'>position</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_FontMetrics_hasUnderlinePosition_position"> <code><strong>position </strong></code> </a></td> <td> -storage for underline <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a></td> +<table> <tr> <td><a name='SkPaint_FontMetrics_hasUnderlinePosition_position'><code><strong>position</strong></code></a></td> + <td>storage for underline <a href='#SkPaint_FontMetrics_hasUnderlinePosition_position'>position</a></td> </tr> </table> ### Return Value -true if font specifies underline <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a> +true if font specifies underline <a href='#SkPaint_FontMetrics_hasUnderlinePosition_position'>position</a> --- -<a name="SkPaint_FontMetrics_hasStrikeoutThickness"></a> +<a name='SkPaint_FontMetrics_hasStrikeoutThickness'></a> ## hasStrikeoutThickness -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool hasStrikeoutThickness(SkScalar* thickness) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_FontMetrics_hasStrikeoutThickness'>hasStrikeoutThickness</a>(<a href='undocumented#SkScalar'>SkScalar</a>* thickness) const </pre> -If <a href="#Font_Metrics">Font Metrics</a> has a valid strikeout <a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a> is not valid, -return false, and ignore <a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a>. +If <a href='#Font_Metrics'>Font Metrics</a> has a valid strikeout <a href='#SkPaint_FontMetrics_hasStrikeoutThickness_thickness'>thickness</a>, return true, and set +<a href='#SkPaint_FontMetrics_hasStrikeoutThickness_thickness'>thickness</a> to that value. If the underline <a href='#SkPaint_FontMetrics_hasStrikeoutThickness_thickness'>thickness</a> is not valid, +return false, and ignore <a href='#SkPaint_FontMetrics_hasStrikeoutThickness_thickness'>thickness</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_FontMetrics_hasStrikeoutThickness_thickness"> <code><strong>thickness </strong></code> </a></td> <td> -storage for strikeout width</td> +<table> <tr> <td><a name='SkPaint_FontMetrics_hasStrikeoutThickness_thickness'><code><strong>thickness</strong></code></a></td> + <td>storage for strikeout width</td> </tr> </table> @@ -4185,53 +5208,54 @@ true if font specifies strikeout width --- -<a name="SkPaint_FontMetrics_hasStrikeoutPosition"></a> +<a name='SkPaint_FontMetrics_hasStrikeoutPosition'></a> ## hasStrikeoutPosition -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool hasStrikeoutPosition(SkScalar* position) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_FontMetrics_hasStrikeoutPosition'>hasStrikeoutPosition</a>(<a href='undocumented#SkScalar'>SkScalar</a>* position) const </pre> -If <a href="#Font_Metrics">Font Metrics</a> has a valid strikeout <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a> is not valid, -return false, and ignore <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a>. +If <a href='#Font_Metrics'>Font Metrics</a> has a valid strikeout <a href='#SkPaint_FontMetrics_hasStrikeoutPosition_position'>position</a>, return true, and set +<a href='#SkPaint_FontMetrics_hasStrikeoutPosition_position'>position</a> to that value. If the underline <a href='#SkPaint_FontMetrics_hasStrikeoutPosition_position'>position</a> is not valid, +return false, and ignore <a href='#SkPaint_FontMetrics_hasStrikeoutPosition_position'>position</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_FontMetrics_hasStrikeoutPosition_position"> <code><strong>position </strong></code> </a></td> <td> -storage for strikeout <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a></td> +<table> <tr> <td><a name='SkPaint_FontMetrics_hasStrikeoutPosition_position'><code><strong>position</strong></code></a></td> + <td>storage for strikeout <a href='#SkPaint_FontMetrics_hasStrikeoutPosition_position'>position</a></td> </tr> </table> ### Return Value -true if font specifies strikeout <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a> +true if font specifies strikeout <a href='#SkPaint_FontMetrics_hasStrikeoutPosition_position'>position</a> --- -<a name="SkPaint_getFontMetrics"></a> +<a name='SkPaint_getFontMetrics'></a> ## getFontMetrics -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getFontMetrics(FontMetrics* metrics, SkScalar scale = 0) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getFontMetrics'>getFontMetrics</a>(<a href='#SkPaint_FontMetrics'>FontMetrics</a>* metrics, <a href='undocumented#SkScalar'>SkScalar</a> scale = 0) const </pre> -Returns <a href="#Font_Metrics">Font Metrics</a> associated with <a href="undocumented#Typeface">Typeface</a>. -The return value is the recommended spacing between lines: the sum of <a href="#SkPaint_getFontMetrics_metrics">metrics</a> +Returns <a href='#Font_Metrics'>Font Metrics</a> associated with <a href='undocumented#Typeface'>Typeface</a>. +The return value is the recommended spacing between lines: the sum of <a href='#SkPaint_getFontMetrics_metrics'>metrics</a> descent, ascent, and leading. -If <a href="#SkPaint_getFontMetrics_metrics">metrics</a> is not nullptr, <a href="#Font_Metrics">Font Metrics</a> is copied to <a href="#SkPaint_getFontMetrics_metrics">metrics</a>. -Results are scaled by <a href="#Text_Size">Text Size</a> but does not take into account -dimensions required by <a href="#Text_Scale_X">Text Scale X</a>, <a href="#Text_Skew_X">Text Skew X</a>, <a href="#Fake_Bold">Fake Bold</a>, -<a href="#Style_Stroke">Style Stroke</a>, and <a href="undocumented#Path_Effect">Path Effect</a>. -Results can be additionally scaled by <a href="#SkPaint_getFontMetrics_scale">scale</a>; a <a href="#SkPaint_getFontMetrics_scale">scale</a> of zero +If <a href='#SkPaint_getFontMetrics_metrics'>metrics</a> is not nullptr, <a href='#Font_Metrics'>Font Metrics</a> is copied to <a href='#SkPaint_getFontMetrics_metrics'>metrics</a>. +Results are scaled by <a href='#Text_Size'>Text Size</a> but does not take into account +dimensions required by <a href='#Text_Scale_X'>Text Scale X</a>, <a href='#Text_Skew_X'>Text Skew X</a>, <a href='#Fake_Bold'>Fake Bold</a>, +<a href='#Style_Stroke'>Style Stroke</a>, and <a href='undocumented#Path_Effect'>Path Effect</a>. +Results can be additionally scaled by <a href='#SkPaint_getFontMetrics_scale'>scale</a>; a <a href='#SkPaint_getFontMetrics_scale'>scale</a> of zero is ignored. ### Parameters -<table> <tr> <td><a name="SkPaint_getFontMetrics_metrics"> <code><strong>metrics </strong></code> </a></td> <td> -storage for <a href="#Font_Metrics">Font Metrics</a> from <a href="undocumented#Typeface">Typeface</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkPaint_getFontMetrics_scale"> <code><strong>scale </strong></code> </a></td> <td> -additional multiplier for returned values</td> +<table> <tr> <td><a name='SkPaint_getFontMetrics_metrics'><code><strong>metrics</strong></code></a></td> + <td>storage for <a href='#Font_Metrics'>Font Metrics</a> from <a href='undocumented#Typeface'>Typeface</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkPaint_getFontMetrics_scale'><code><strong>scale</strong></code></a></td> + <td>additional multiplier for returned values</td> </tr> </table> @@ -4245,22 +5269,22 @@ recommended spacing between lines ### See Also -<a href="#Text_Size">Text Size</a> <a href="undocumented#Typeface">Typeface</a> <a href="#Typeface_Methods">Typeface Methods</a> +<a href='#Text_Size'>Text Size</a> <a href='undocumented#Typeface'>Typeface</a> <a href='#Typeface_Methods'>Typeface Methods</a> --- -<a name="SkPaint_getFontSpacing"></a> +<a name='SkPaint_getFontSpacing'></a> ## getFontSpacing -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar getFontSpacing() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_getFontSpacing'>getFontSpacing</a>() const </pre> Returns the recommended spacing between lines: the sum of metrics descent, ascent, and leading. -Result is scaled by <a href="#Text_Size">Text Size</a> but does not take into account -dimensions required by stroking and <a href="undocumented#Path_Effect">Path Effect</a>. -Returns the same result as <a href="#SkPaint_getFontMetrics">getFontMetrics</a>. +Result is scaled by <a href='#Text_Size'>Text Size</a> but does not take into account +dimensions required by stroking and <a href='undocumented#Path_Effect'>Path Effect</a>. +Returns the same result as <a href='#SkPaint_getFontMetrics'>getFontMetrics</a>. ### Return Value @@ -4283,25 +5307,25 @@ textSize: 32 fontSpacing: 37.25 --- -<a name="SkPaint_getFontBounds"></a> +<a name='SkPaint_getFontBounds'></a> ## getFontBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect getFontBounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPaint_getFontBounds'>getFontBounds</a>() const </pre> -Returns the union of bounds of all <a href="undocumented#Glyph">Glyphs</a>. -Returned dimensions are computed by <a href="undocumented#Font_Manager">Font Manager</a> from font data, -ignoring <a href="#SkPaint_Hinting">Hinting</a>. Includes <a href="#Text_Size">Text Size</a>, <a href="#Text_Scale_X">Text Scale X</a>, -and <a href="#Text_Skew_X">Text Skew X</a>, but not <a href="#Fake_Bold">Fake Bold</a> or <a href="undocumented#Path_Effect">Path Effect</a>. +Returns the union of bounds of all <a href='undocumented#Glyph'>Glyphs</a>. +Returned dimensions are computed by <a href='undocumented#Font_Manager'>Font Manager</a> from font data, +ignoring <a href='#SkPaint_Hinting'>Hinting</a>. Includes <a href='#Text_Size'>Text Size</a>, <a href='#Text_Scale_X'>Text Scale X</a>, +and <a href='#Text_Skew_X'>Text Skew X</a>, but not <a href='#Fake_Bold'>Fake Bold</a> or <a href='undocumented#Path_Effect'>Path Effect</a>. -If <a href="#Text_Size">Text Size</a> is large, <a href="#Text_Scale_X">Text Scale X</a> is one, and <a href="#Text_Skew_X">Text Skew X</a> is zero, -returns the same bounds as <a href="#Font_Metrics">Font Metrics</a> { <a href="#SkPaint_FontMetrics_fXMin">FontMetrics::fXMin</a>, -<a href="#SkPaint_FontMetrics_fTop">FontMetrics::fTop</a>, <a href="#SkPaint_FontMetrics_fXMax">FontMetrics::fXMax</a>, <a href="#SkPaint_FontMetrics_fBottom">FontMetrics::fBottom</a> }. +If <a href='#Text_Size'>Text Size</a> is large, <a href='#Text_Scale_X'>Text Scale X</a> is one, and <a href='#Text_Skew_X'>Text Skew X</a> is zero, +returns the same bounds as <a href='#Font_Metrics'>Font Metrics</a> { <a href='#SkPaint_FontMetrics_fXMin'>FontMetrics::fXMin</a>, +<a href='#SkPaint_FontMetrics_fTop'>FontMetrics::fTop</a>, <a href='#SkPaint_FontMetrics_fXMax'>FontMetrics::fXMax</a>, <a href='#SkPaint_FontMetrics_fBottom'>FontMetrics::fBottom</a> }. ### Return Value -union of bounds of all <a href="undocumented#Glyph">Glyphs</a> +union of bounds of all <a href='undocumented#Glyph'>Glyphs</a> ### Example @@ -4318,40 +5342,42 @@ font bounds = { -12.2461, -14.7891, 21.5215, 5.55469 } --- -<a name="SkPaint_textToGlyphs"></a> +<a name='SkPaint_textToGlyphs'></a> ## textToGlyphs -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int textToGlyphs(const void* text, size_t byteLength, SkGlyphID glyphs[]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_textToGlyphs'>textToGlyphs</a>(const void* text, size_t byteLength, <a href='undocumented#SkGlyphID'>SkGlyphID</a> glyphs[]) const </pre> -Converts <a href="#SkPaint_textToGlyphs_text">text</a> into glyph indices. -Returns the number of glyph indices represented by <a href="#SkPaint_textToGlyphs_text">text</a>. -<a href="#Text_Encoding">Text Encoding</a> specifies how <a href="#SkPaint_textToGlyphs_text">text</a> represents characters or <a href="#SkPaint_textToGlyphs_glyphs">glyphs</a>. -<a href="#SkPaint_textToGlyphs_glyphs">glyphs</a> may be nullptr, to compute the glyph count. +Converts <a href='#SkPaint_textToGlyphs_text'>text</a> into glyph indices. +Returns the number of glyph indices represented by <a href='#SkPaint_textToGlyphs_text'>text</a>. +<a href='#Text_Encoding'>Text Encoding</a> specifies how <a href='#SkPaint_textToGlyphs_text'>text</a> represents characters or <a href='#SkPaint_textToGlyphs_glyphs'>glyphs</a>. +<a href='#SkPaint_textToGlyphs_glyphs'>glyphs</a> may be nullptr, to compute the glyph count. -Does not check <a href="#SkPaint_textToGlyphs_text">text</a> for valid character codes or valid glyph indices. +Does not check <a href='#SkPaint_textToGlyphs_text'>text</a> for valid character codes or valid glyph indices. -If <a href="#SkPaint_textToGlyphs_byteLength">byteLength</a> equals zero, returns zero. -If <a href="#SkPaint_textToGlyphs_byteLength">byteLength</a> includes a partial character, the partial character is ignored. +If <a href='#SkPaint_textToGlyphs_byteLength'>byteLength</a> equals zero, returns zero. +If <a href='#SkPaint_textToGlyphs_byteLength'>byteLength</a> includes a partial character, the partial character is ignored. -If <a href="#Text_Encoding">Text Encoding</a> is <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a> and -<a href="#SkPaint_textToGlyphs_text">text</a> contains an invalid UTF-8 sequence, zero is returned. +If <a href='#Text_Encoding'>Text Encoding</a> is <a href='#SkPaint_kUTF8_TextEncoding'>kUTF8 TextEncoding</a> and +<a href='#SkPaint_textToGlyphs_text'>text</a> contains an invalid UTF-8 sequence, zero is returned. ### Parameters -<table> <tr> <td><a name="SkPaint_textToGlyphs_text"> <code><strong>text </strong></code> </a></td> <td> -character storage encoded with <a href="#Text_Encoding">Text Encoding</a></td> - </tr> <tr> <td><a name="SkPaint_textToGlyphs_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -length of character storage in bytes</td> - </tr> <tr> <td><a name="SkPaint_textToGlyphs_glyphs"> <code><strong>glyphs </strong></code> </a></td> <td> -storage for glyph indices; may be nullptr</td> +<table> <tr> <td><a name='SkPaint_textToGlyphs_text'><code><strong>text</strong></code></a></td> + <td>character storage encoded with <a href='#Text_Encoding'>Text Encoding</a></td> + </tr> + <tr> <td><a name='SkPaint_textToGlyphs_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>length of character storage in bytes</td> + </tr> + <tr> <td><a name='SkPaint_textToGlyphs_glyphs'><code><strong>glyphs</strong></code></a></td> + <td>storage for glyph indices; may be nullptr</td> </tr> </table> ### Return Value -number of <a href="#SkPaint_textToGlyphs_glyphs">glyphs</a> represented by <a href="#SkPaint_textToGlyphs_text">text</a> of length <a href="#SkPaint_textToGlyphs_byteLength">byteLength</a> +number of <a href='#SkPaint_textToGlyphs_glyphs'>glyphs</a> represented by <a href='#SkPaint_textToGlyphs_text'>text</a> of length <a href='#SkPaint_textToGlyphs_byteLength'>byteLength</a> ### Example @@ -4359,29 +5385,30 @@ number of <a href="#SkPaint_textToGlyphs_glyphs">glyphs</a> represented by <a hr --- -<a name="SkPaint_countText"></a> +<a name='SkPaint_countText'></a> ## countText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int countText(const void* text, size_t byteLength) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_countText'>countText</a>(const void* text, size_t byteLength) const </pre> -Returns the number of <a href="undocumented#Glyph">Glyphs</a> in <a href="#SkPaint_countText_text">text</a>. -Uses <a href="#Text_Encoding">Text Encoding</a> to count the <a href="undocumented#Glyph">Glyphs</a>. -Returns the same result as <a href="#SkPaint_textToGlyphs">textToGlyphs</a>. +Returns the number of <a href='undocumented#Glyph'>Glyphs</a> in <a href='#SkPaint_countText_text'>text</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to count the <a href='undocumented#Glyph'>Glyphs</a>. +Returns the same result as <a href='#SkPaint_textToGlyphs'>textToGlyphs</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_countText_text"> <code><strong>text </strong></code> </a></td> <td> -character storage encoded with <a href="#Text_Encoding">Text Encoding</a></td> - </tr> <tr> <td><a name="SkPaint_countText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -length of character storage in bytes</td> +<table> <tr> <td><a name='SkPaint_countText_text'><code><strong>text</strong></code></a></td> + <td>character storage encoded with <a href='#Text_Encoding'>Text Encoding</a></td> + </tr> + <tr> <td><a name='SkPaint_countText_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>length of character storage in bytes</td> </tr> </table> ### Return Value -number of <a href="undocumented#Glyph">Glyphs</a> represented by <a href="#SkPaint_countText_text">text</a> of length <a href="#SkPaint_countText_byteLength">byteLength</a> +number of <a href='undocumented#Glyph'>Glyphs</a> represented by <a href='#SkPaint_countText_text'>text</a> of length <a href='#SkPaint_countText_byteLength'>byteLength</a> ### Example @@ -4397,39 +5424,40 @@ count = 5 --- -<a name="SkPaint_containsText"></a> +<a name='SkPaint_containsText'></a> ## containsText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool containsText(const void* text, size_t byteLength) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_containsText'>containsText</a>(const void* text, size_t byteLength) const </pre> -Returns true if all <a href="#SkPaint_containsText_text">text</a> corresponds to a non-zero glyph index. -Returns false if any characters in <a href="#SkPaint_containsText_text">text</a> are not supported in -<a href="undocumented#Typeface">Typeface</a>. +Returns true if all <a href='#SkPaint_containsText_text'>text</a> corresponds to a non-zero glyph index. +Returns false if any characters in <a href='#SkPaint_containsText_text'>text</a> are not supported in +<a href='undocumented#Typeface'>Typeface</a>. -If <a href="#Text_Encoding">Text Encoding</a> is <a href="#SkPaint_kGlyphID_TextEncoding">kGlyphID TextEncoding</a>, -returns true if all glyph indices in <a href="#SkPaint_containsText_text">text</a> are non-zero; -does not check to see if <a href="#SkPaint_containsText_text">text</a> contains valid glyph indices for <a href="undocumented#Typeface">Typeface</a>. +If <a href='#Text_Encoding'>Text Encoding</a> is <a href='#SkPaint_kGlyphID_TextEncoding'>kGlyphID TextEncoding</a>, +returns true if all glyph indices in <a href='#SkPaint_containsText_text'>text</a> are non-zero; +does not check to see if <a href='#SkPaint_containsText_text'>text</a> contains valid glyph indices for <a href='undocumented#Typeface'>Typeface</a>. -Returns true if <a href="#SkPaint_containsText_byteLength">byteLength</a> is zero. +Returns true if <a href='#SkPaint_containsText_byteLength'>byteLength</a> is zero. ### Parameters -<table> <tr> <td><a name="SkPaint_containsText_text"> <code><strong>text </strong></code> </a></td> <td> -array of characters or <a href="undocumented#Glyph">Glyphs</a></td> - </tr> <tr> <td><a name="SkPaint_containsText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -number of bytes in <a href="#SkPaint_containsText_text">text</a> array</td> +<table> <tr> <td><a name='SkPaint_containsText_text'><code><strong>text</strong></code></a></td> + <td>array of characters or <a href='undocumented#Glyph'>Glyphs</a></td> + </tr> + <tr> <td><a name='SkPaint_containsText_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>number of bytes in <a href='#SkPaint_containsText_text'>text</a> array</td> </tr> </table> ### Return Value -true if all <a href="#SkPaint_containsText_text">text</a> corresponds to a non-zero glyph index +true if all <a href='#SkPaint_containsText_text'>text</a> corresponds to a non-zero glyph index ### Example -<div><fiddle-embed name="71b417d6651cbcecae1a05067c94ab3e"><div><a href="#SkPaint_containsText">containsText</a> succeeds for degree symbol, but cannot find a glyph index +<div><fiddle-embed name="71b417d6651cbcecae1a05067c94ab3e"><div><a href='#SkPaint_containsText'>containsText</a> succeeds for degree symbol, but cannot find a glyph index corresponding to the Unicode surrogate code point. </div> @@ -4444,8 +5472,8 @@ corresponding to the Unicode surrogate code point. ### Example -<div><fiddle-embed name="083557b6f653d6fc00a34e01f87b74ff"><div><a href="#SkPaint_containsText">containsText</a> returns true that glyph index is greater than zero, not -that it corresponds to an entry in <a href="undocumented#Typeface">Typeface</a>. +<div><fiddle-embed name="083557b6f653d6fc00a34e01f87b74ff"><div><a href='#SkPaint_containsText'>containsText</a> returns true that glyph index is greater than zero, not +that it corresponds to an entry in <a href='undocumented#Typeface'>Typeface</a>. </div> #### Example Output @@ -4460,68 +5488,72 @@ that it corresponds to an entry in <a href="undocumented#Typeface">Typeface</a>. ### See Also -<a href="#SkPaint_setTextEncoding">setTextEncoding</a> <a href="undocumented#Typeface">Typeface</a> +<a href='#SkPaint_setTextEncoding'>setTextEncoding</a> <a href='undocumented#Typeface'>Typeface</a> --- -<a name="SkPaint_glyphsToUnichars"></a> +<a name='SkPaint_glyphsToUnichars'></a> ## glyphsToUnichars -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_glyphsToUnichars'>glyphsToUnichars</a>(const <a href='undocumented#SkGlyphID'>SkGlyphID</a> glyphs[], int count, <a href='undocumented#SkUnichar'>SkUnichar</a> text[]) const </pre> -Converts <a href="#SkPaint_glyphsToUnichars_glyphs">glyphs</a> into <a href="#SkPaint_glyphsToUnichars_text">text</a> if possible. -<a href="undocumented#Glyph">Glyph</a> values without direct Unicode equivalents are mapped to zero. -Uses the <a href="undocumented#Typeface">Typeface</a>, but is unaffected -by <a href="#Text_Encoding">Text Encoding</a>; the <a href="#SkPaint_glyphsToUnichars_text">text</a> values returned are equivalent to <a href="#SkPaint_kUTF32_TextEncoding">kUTF32 TextEncoding</a>. +Converts <a href='#SkPaint_glyphsToUnichars_glyphs'>glyphs</a> into <a href='#SkPaint_glyphsToUnichars_text'>text</a> if possible. +<a href='undocumented#Glyph'>Glyph</a> values without direct Unicode equivalents are mapped to zero. +Uses the <a href='undocumented#Typeface'>Typeface</a>, but is unaffected +by <a href='#Text_Encoding'>Text Encoding</a>; the <a href='#SkPaint_glyphsToUnichars_text'>text</a> values returned are equivalent to <a href='#SkPaint_kUTF32_TextEncoding'>kUTF32 TextEncoding</a>. -Only supported on platforms that use FreeType as the <a href="undocumented#Engine">Font Engine</a>. +Only supported on platforms that use FreeType as the <a href='undocumented#Engine'>Font Engine</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_glyphsToUnichars_glyphs"> <code><strong>glyphs </strong></code> </a></td> <td> -array of indices into font</td> - </tr> <tr> <td><a name="SkPaint_glyphsToUnichars_count"> <code><strong>count </strong></code> </a></td> <td> -length of glyph array</td> - </tr> <tr> <td><a name="SkPaint_glyphsToUnichars_text"> <code><strong>text </strong></code> </a></td> <td> -storage for character codes, one per glyph</td> +<table> <tr> <td><a name='SkPaint_glyphsToUnichars_glyphs'><code><strong>glyphs</strong></code></a></td> + <td>array of indices into font</td> + </tr> + <tr> <td><a name='SkPaint_glyphsToUnichars_count'><code><strong>count</strong></code></a></td> + <td>length of glyph array</td> + </tr> + <tr> <td><a name='SkPaint_glyphsToUnichars_text'><code><strong>text</strong></code></a></td> + <td>storage for character codes, one per glyph</td> </tr> </table> ### Example -<div><fiddle-embed name="c12686b0b3e0a87d0a248bbfc57e9492"><div>Convert UTF-8 <a href="#SkPaint_glyphsToUnichars_text">text</a> to <a href="#SkPaint_glyphsToUnichars_glyphs">glyphs</a>; then convert <a href="#SkPaint_glyphsToUnichars_glyphs">glyphs</a> to Unichar code points. +<div><fiddle-embed name="c12686b0b3e0a87d0a248bbfc57e9492"><div>Convert UTF-8 <a href='#SkPaint_glyphsToUnichars_text'>text</a> to <a href='#SkPaint_glyphsToUnichars_glyphs'>glyphs</a>; then convert <a href='#SkPaint_glyphsToUnichars_glyphs'>glyphs</a> to Unichar code points. </div></fiddle-embed></div> --- -## <a name="Measure_Text"></a> Measure Text +## <a name='Measure_Text'>Measure Text</a> -<a name="SkPaint_measureText"></a> +<a name='SkPaint_measureText'></a> ## measureText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar measureText(const void* text, size_t length, SkRect* bounds) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_measureText'>measureText</a>(const void* text, size_t length, <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds) const </pre> -Returns the advance width of <a href="#SkPaint_measureText_text">text</a> if <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is clear, -and the height of <a href="#SkPaint_measureText_text">text</a> if <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is set. -The advance is the normal distance to move before drawing additional <a href="#SkPaint_measureText_text">text</a>. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_measureText_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the font metrics, -and <a href="#Text_Size">Text Size</a>, <a href="#Text_Scale_X">Text Scale X</a>, <a href="#Text_Skew_X">Text Skew X</a>, <a href="#Stroke_Width">Stroke Width</a>, and -<a href="undocumented#Path_Effect">Path Effect</a> to scale the metrics and <a href="#SkPaint_measureText_bounds">bounds</a>. -Returns the bounding box of <a href="#SkPaint_measureText_text">text</a> if <a href="#SkPaint_measureText_bounds">bounds</a> is not nullptr. -The bounding box is computed as if the <a href="#SkPaint_measureText_text">text</a> was drawn at the origin. +Returns the advance width of <a href='#SkPaint_measureText_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear, +and the height of <a href='#SkPaint_measureText_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set. +The advance is the normal distance to move before drawing additional <a href='#SkPaint_measureText_text'>text</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_measureText_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics, +and <a href='#Text_Size'>Text Size</a>, <a href='#Text_Scale_X'>Text Scale X</a>, <a href='#Text_Skew_X'>Text Skew X</a>, <a href='#Stroke_Width'>Stroke Width</a>, and +<a href='undocumented#Path_Effect'>Path Effect</a> to scale the metrics and <a href='#SkPaint_measureText_bounds'>bounds</a>. +Returns the bounding box of <a href='#SkPaint_measureText_text'>text</a> if <a href='#SkPaint_measureText_bounds'>bounds</a> is not nullptr. +The bounding box is computed as if the <a href='#SkPaint_measureText_text'>text</a> was drawn at the origin. ### Parameters -<table> <tr> <td><a name="SkPaint_measureText_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices to be measured</td> - </tr> <tr> <td><a name="SkPaint_measureText_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_measureText_text">text</a> to measure</td> - </tr> <tr> <td><a name="SkPaint_measureText_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -returns bounding box relative to (0, 0) if not nullptr</td> +<table> <tr> <td><a name='SkPaint_measureText_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices to be measured</td> + </tr> + <tr> <td><a name='SkPaint_measureText_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_measureText_text'>text</a> to measure</td> + </tr> + <tr> <td><a name='SkPaint_measureText_bounds'><code><strong>bounds</strong></code></a></td> + <td>returns bounding box relative to (0, 0) if not nullptr</td> </tr> </table> @@ -4535,25 +5567,26 @@ advance width or height --- -<a name="SkPaint_measureText_2"></a> +<a name='SkPaint_measureText_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar measureText(const void* text, size_t length) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_measureText'>measureText</a>(const void* text, size_t length) const </pre> -Returns the advance width of <a href="#SkPaint_measureText_2_text">text</a> if <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is clear, -and the height of <a href="#SkPaint_measureText_2_text">text</a> if <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is set. -The advance is the normal distance to move before drawing additional <a href="#SkPaint_measureText_2_text">text</a>. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_measureText_2_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the font metrics, -and <a href="#Text_Size">Text Size</a> to scale the metrics. -Does not scale the advance or bounds by <a href="#Fake_Bold">Fake Bold</a> or <a href="undocumented#Path_Effect">Path Effect</a>. +Returns the advance width of <a href='#SkPaint_measureText_2_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear, +and the height of <a href='#SkPaint_measureText_2_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set. +The advance is the normal distance to move before drawing additional <a href='#SkPaint_measureText_2_text'>text</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_measureText_2_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics, +and <a href='#Text_Size'>Text Size</a> to scale the metrics. +Does not scale the advance or bounds by <a href='#Fake_Bold'>Fake Bold</a> or <a href='undocumented#Path_Effect'>Path Effect</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_measureText_2_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices to be measured</td> - </tr> <tr> <td><a name="SkPaint_measureText_2_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_measureText_2_text">text</a> to measure</td> +<table> <tr> <td><a name='SkPaint_measureText_2_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices to be measured</td> + </tr> + <tr> <td><a name='SkPaint_measureText_2_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_measureText_2_text'>text</a> to measure</td> </tr> </table> @@ -4576,208 +5609,226 @@ double width = 10 --- -<a name="SkPaint_breakText"></a> +<a name='SkPaint_breakText'></a> ## breakText -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t breakText(const void* text, size_t length, SkScalar maxWidth, - SkScalar* measuredWidth = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkPaint_breakText'>breakText</a>(const void* text, size_t length, <a href='undocumented#SkScalar'>SkScalar</a> maxWidth, + <a href='undocumented#SkScalar'>SkScalar</a>* measuredWidth = nullptr) const </pre> -Returns the bytes of <a href="#SkPaint_breakText_text">text</a> that fit within <a href="#SkPaint_breakText_maxWidth">maxWidth</a>. -If <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is clear, the <a href="#SkPaint_breakText_text">text</a> fragment fits if its advance width is less than or -equal to <a href="#SkPaint_breakText_maxWidth">maxWidth</a>. -If <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is set, the <a href="#SkPaint_breakText_text">text</a> fragment fits if its advance height is less than or -equal to <a href="#SkPaint_breakText_maxWidth">maxWidth</a>. -Measures only while the advance is less than or equal to <a href="#SkPaint_breakText_maxWidth">maxWidth</a>. -Returns the advance or the <a href="#SkPaint_breakText_text">text</a> fragment in <a href="#SkPaint_breakText_measuredWidth">measuredWidth</a> if it not nullptr. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_breakText_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the font metrics, -and <a href="#Text_Size">Text Size</a> to scale the metrics. -Does not scale the advance or bounds by <a href="#Fake_Bold">Fake Bold</a> or <a href="undocumented#Path_Effect">Path Effect</a>. +Returns the bytes of <a href='#SkPaint_breakText_text'>text</a> that fit within <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>. +If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear, the <a href='#SkPaint_breakText_text'>text</a> fragment fits if its advance width is less than or +equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>. +If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set, the <a href='#SkPaint_breakText_text'>text</a> fragment fits if its advance height is less than or +equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>. +Measures only while the advance is less than or equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>. +Returns the advance or the <a href='#SkPaint_breakText_text'>text</a> fragment in <a href='#SkPaint_breakText_measuredWidth'>measuredWidth</a> if it not nullptr. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_breakText_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics, +and <a href='#Text_Size'>Text Size</a> to scale the metrics. +Does not scale the advance or bounds by <a href='#Fake_Bold'>Fake Bold</a> or <a href='undocumented#Path_Effect'>Path Effect</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_breakText_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices to be measured</td> - </tr> <tr> <td><a name="SkPaint_breakText_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_breakText_text">text</a> to measure</td> - </tr> <tr> <td><a name="SkPaint_breakText_maxWidth"> <code><strong>maxWidth </strong></code> </a></td> <td> -advance limit; <a href="#SkPaint_breakText_text">text</a> is measured while advance is less than <a href="#SkPaint_breakText_maxWidth">maxWidth</a></td> - </tr> <tr> <td><a name="SkPaint_breakText_measuredWidth"> <code><strong>measuredWidth </strong></code> </a></td> <td> -returns the width of the <a href="#SkPaint_breakText_text">text</a> less than or equal to <a href="#SkPaint_breakText_maxWidth">maxWidth</a></td> +<table> <tr> <td><a name='SkPaint_breakText_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices to be measured</td> + </tr> + <tr> <td><a name='SkPaint_breakText_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_breakText_text'>text</a> to measure</td> + </tr> + <tr> <td><a name='SkPaint_breakText_maxWidth'><code><strong>maxWidth</strong></code></a></td> + <td>advance limit; <a href='#SkPaint_breakText_text'>text</a> is measured while advance is less than <a href='#SkPaint_breakText_maxWidth'>maxWidth</a></td> + </tr> + <tr> <td><a name='SkPaint_breakText_measuredWidth'><code><strong>measuredWidth</strong></code></a></td> + <td>returns the width of the <a href='#SkPaint_breakText_text'>text</a> less than or equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a></td> </tr> </table> ### Return Value -bytes of <a href="#SkPaint_breakText_text">text</a> that fit, always less than or equal to <a href="#SkPaint_breakText_length">length</a> +bytes of <a href='#SkPaint_breakText_text'>text</a> that fit, always less than or equal to <a href='#SkPaint_breakText_length'>length</a> ### Example -<div><fiddle-embed name="fd0033470ccbd5c7059670fdbf96cffc"><div><a href="undocumented#Line">Line</a> under "" shows desired width, shorter than available characters. -<a href="undocumented#Line">Line</a> under "" shows measured width after breaking <a href="#SkPaint_breakText_text">text</a>. +<div><fiddle-embed name="fd0033470ccbd5c7059670fdbf96cffc"><div><a href='undocumented#Line'>Line</a> under "" shows desired width, shorter than available characters. +<a href='undocumented#Line'>Line</a> under "" shows measured width after breaking <a href='#SkPaint_breakText_text'>text</a>. </div></fiddle-embed></div> --- -<a name="SkPaint_getTextWidths"></a> +<a name='SkPaint_getTextWidths'></a> ## getTextWidths -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getTextWidths(const void* text, size_t byteLength, SkScalar widths[], SkRect bounds[] = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_getTextWidths'>getTextWidths</a>(const void* text, size_t byteLength, <a href='undocumented#SkScalar'>SkScalar</a> widths[], <a href='SkRect_Reference#SkRect'>SkRect</a> bounds[] = nullptr) const </pre> -Retrieves the advance and <a href="#SkPaint_getTextWidths_bounds">bounds</a> for each glyph in <a href="#SkPaint_getTextWidths_text">text</a>, and returns -the glyph count in <a href="#SkPaint_getTextWidths_text">text</a>. -Both <a href="#SkPaint_getTextWidths_widths">widths</a> and <a href="#SkPaint_getTextWidths_bounds">bounds</a> may be nullptr. -If <a href="#SkPaint_getTextWidths_widths">widths</a> is not nullptr, <a href="#SkPaint_getTextWidths_widths">widths</a> must be an array of glyph count entries. -if <a href="#SkPaint_getTextWidths_bounds">bounds</a> is not nullptr, <a href="#SkPaint_getTextWidths_bounds">bounds</a> must be an array of glyph count entries. -If <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is clear, <a href="#SkPaint_getTextWidths_widths">widths</a> returns the horizontal advance. -If <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> is set, <a href="#SkPaint_getTextWidths_widths">widths</a> returns the vertical advance. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getTextWidths_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the font metrics, -and <a href="#Text_Size">Text Size</a> to scale the <a href="#SkPaint_getTextWidths_widths">widths</a> and <a href="#SkPaint_getTextWidths_bounds">bounds</a>. -Does not scale the advance by <a href="#Fake_Bold">Fake Bold</a> or <a href="undocumented#Path_Effect">Path Effect</a>. -Does include <a href="#Fake_Bold">Fake Bold</a> and <a href="undocumented#Path_Effect">Path Effect</a> in the <a href="#SkPaint_getTextWidths_bounds">bounds</a>. +Retrieves the advance and <a href='#SkPaint_getTextWidths_bounds'>bounds</a> for each glyph in <a href='#SkPaint_getTextWidths_text'>text</a>, and returns +the glyph count in <a href='#SkPaint_getTextWidths_text'>text</a>. +Both <a href='#SkPaint_getTextWidths_widths'>widths</a> and <a href='#SkPaint_getTextWidths_bounds'>bounds</a> may be nullptr. +If <a href='#SkPaint_getTextWidths_widths'>widths</a> is not nullptr, <a href='#SkPaint_getTextWidths_widths'>widths</a> must be an array of glyph count entries. +if <a href='#SkPaint_getTextWidths_bounds'>bounds</a> is not nullptr, <a href='#SkPaint_getTextWidths_bounds'>bounds</a> must be an array of glyph count entries. +If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear, <a href='#SkPaint_getTextWidths_widths'>widths</a> returns the horizontal advance. +If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set, <a href='#SkPaint_getTextWidths_widths'>widths</a> returns the vertical advance. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getTextWidths_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics, +and <a href='#Text_Size'>Text Size</a> to scale the <a href='#SkPaint_getTextWidths_widths'>widths</a> and <a href='#SkPaint_getTextWidths_bounds'>bounds</a>. +Does not scale the advance by <a href='#Fake_Bold'>Fake Bold</a> or <a href='undocumented#Path_Effect'>Path Effect</a>. +Does include <a href='#Fake_Bold'>Fake Bold</a> and <a href='undocumented#Path_Effect'>Path Effect</a> in the <a href='#SkPaint_getTextWidths_bounds'>bounds</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_getTextWidths_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices to be measured</td> - </tr> <tr> <td><a name="SkPaint_getTextWidths_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_getTextWidths_text">text</a> to measure</td> - </tr> <tr> <td><a name="SkPaint_getTextWidths_widths"> <code><strong>widths </strong></code> </a></td> <td> -returns <a href="#SkPaint_getTextWidths_text">text</a> advances for each glyph; may be nullptr</td> - </tr> <tr> <td><a name="SkPaint_getTextWidths_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -returns <a href="#SkPaint_getTextWidths_bounds">bounds</a> for each glyph relative to (0, 0); may be nullptr</td> +<table> <tr> <td><a name='SkPaint_getTextWidths_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices to be measured</td> + </tr> + <tr> <td><a name='SkPaint_getTextWidths_byteLength'><code><strong>byteLength</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_getTextWidths_text'>text</a> to measure</td> + </tr> + <tr> <td><a name='SkPaint_getTextWidths_widths'><code><strong>widths</strong></code></a></td> + <td>returns <a href='#SkPaint_getTextWidths_text'>text</a> advances for each glyph; may be nullptr</td> + </tr> + <tr> <td><a name='SkPaint_getTextWidths_bounds'><code><strong>bounds</strong></code></a></td> + <td>returns <a href='#SkPaint_getTextWidths_bounds'>bounds</a> for each glyph relative to (0, 0); may be nullptr</td> </tr> </table> ### Return Value -glyph count in <a href="#SkPaint_getTextWidths_text">text</a> +glyph count in <a href='#SkPaint_getTextWidths_text'>text</a> ### Example -<div><fiddle-embed name="6b9e101f49e9c2c28755c5bdcef64dfb"><div>Bounds of <a href="undocumented#Glyph">Glyphs</a> increase for stroked <a href="#SkPaint_getTextWidths_text">text</a>, but <a href="#SkPaint_getTextWidths_text">text</a> advance remains the same. -The underlines show the <a href="#SkPaint_getTextWidths_text">text</a> advance, spaced to keep them distinct. +<div><fiddle-embed name="6b9e101f49e9c2c28755c5bdcef64dfb"><div>Bounds of <a href='undocumented#Glyph'>Glyphs</a> increase for stroked <a href='#SkPaint_getTextWidths_text'>text</a>, but <a href='#SkPaint_getTextWidths_text'>text</a> advance remains the same. +The underlines show the <a href='#SkPaint_getTextWidths_text'>text</a> advance, spaced to keep them distinct. </div></fiddle-embed></div> --- -## <a name="Text_Path"></a> Text Path +## <a name='Text_Path'>Text Path</a> -<a href="#Text_Path">Text Path</a> describes the geometry of <a href="undocumented#Glyph">Glyphs</a> used to draw text. +<a href='#Text_Path'>Text Path</a> describes the geometry of <a href='undocumented#Glyph'>Glyphs</a> used to draw text. -<a name="SkPaint_getTextPath"></a> +<a name='SkPaint_getTextPath'></a> ## getTextPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y, SkPath* path) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_getTextPath'>getTextPath</a>(const void* text, size_t length, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='SkPath_Reference#SkPath'>SkPath</a>* path) const </pre> -Returns the geometry as <a href="SkPath_Reference#Path">Path</a> equivalent to the drawn <a href="#SkPaint_getTextPath_text">text</a>. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getTextPath_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, -and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -All of the glyph paths are stored in <a href="#SkPaint_getTextPath_path">path</a>. -Uses <a href="#SkPaint_getTextPath_x">x</a>, <a href="#SkPaint_getTextPath_y">y</a>, and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getTextPath_path">path</a>. +Returns the geometry as <a href='SkPath_Reference#Path'>Path</a> equivalent to the drawn <a href='#SkPaint_getTextPath_text'>text</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getTextPath_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the glyph paths, +and <a href='#Text_Size'>Text Size</a>, <a href='#Fake_Bold'>Fake Bold</a>, and <a href='undocumented#Path_Effect'>Path Effect</a> to scale and modify the glyph paths. +All of the glyph paths are stored in <a href='#SkPaint_getTextPath_path'>path</a>. +Uses <a href='#SkPaint_getTextPath_x'>x</a>, <a href='#SkPaint_getTextPath_y'>y</a>, and <a href='#Text_Align'>Text Align</a> to position <a href='#SkPaint_getTextPath_path'>path</a>. ### Parameters -<table> <tr> <td><a name="SkPaint_getTextPath_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices</td> - </tr> <tr> <td><a name="SkPaint_getTextPath_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_getTextPath_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getTextPath_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="#SkPaint_getTextPath_x">x</a>-coordinate of the origin of the <a href="#SkPaint_getTextPath_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getTextPath_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="#SkPaint_getTextPath_y">y</a>-coordinate of the origin of the <a href="#SkPaint_getTextPath_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getTextPath_path"> <code><strong>path </strong></code> </a></td> <td> -geometry of the <a href="undocumented#Glyph">Glyphs</a></td> +<table> <tr> <td><a name='SkPaint_getTextPath_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices</td> + </tr> + <tr> <td><a name='SkPaint_getTextPath_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_getTextPath_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getTextPath_x'><code><strong>x</strong></code></a></td> + <td><a href='#SkPaint_getTextPath_x'>x</a>-coordinate of the origin of the <a href='#SkPaint_getTextPath_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getTextPath_y'><code><strong>y</strong></code></a></td> + <td><a href='#SkPaint_getTextPath_y'>y</a>-coordinate of the origin of the <a href='#SkPaint_getTextPath_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getTextPath_path'><code><strong>path</strong></code></a></td> + <td>geometry of the <a href='undocumented#Glyph'>Glyphs</a></td> </tr> </table> ### Example -<div><fiddle-embed name="7c9e6a399f898d68026c1f0865e6f73e"><div><a href="undocumented#Text">Text</a> is added to <a href="SkPath_Reference#Path">Path</a>, offset, and subtracted from <a href="SkPath_Reference#Path">Path</a>, then added at +<div><fiddle-embed name="7c9e6a399f898d68026c1f0865e6f73e"><div><a href='undocumented#Text'>Text</a> is added to <a href='SkPath_Reference#Path'>Path</a>, offset, and subtracted from <a href='SkPath_Reference#Path'>Path</a>, then added at the offset location. The result is rendered with one draw call. </div></fiddle-embed></div> --- -<a name="SkPaint_getPosTextPath"></a> +<a name='SkPaint_getPosTextPath'></a> ## getPosTextPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void getPosTextPath(const void* text, size_t length, const SkPoint pos[], SkPath* path) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_getPosTextPath'>getPosTextPath</a>(const void* text, size_t length, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pos[], <a href='SkPath_Reference#SkPath'>SkPath</a>* path) const </pre> -Returns the geometry as <a href="SkPath_Reference#Path">Path</a> equivalent to the drawn <a href="#SkPaint_getPosTextPath_text">text</a>. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getPosTextPath_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, -and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -All of the glyph paths are stored in <a href="#SkPaint_getPosTextPath_path">path</a>. -Uses <a href="#SkPaint_getPosTextPath_pos">pos</a> array and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getPosTextPath_path">path</a>. -<a href="#SkPaint_getPosTextPath_pos">pos</a> contains a position for each glyph. +Returns the geometry as <a href='SkPath_Reference#Path'>Path</a> equivalent to the drawn <a href='#SkPaint_getPosTextPath_text'>text</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getPosTextPath_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the glyph paths, +and <a href='#Text_Size'>Text Size</a>, <a href='#Fake_Bold'>Fake Bold</a>, and <a href='undocumented#Path_Effect'>Path Effect</a> to scale and modify the glyph paths. +All of the glyph paths are stored in <a href='#SkPaint_getPosTextPath_path'>path</a>. +Uses <a href='#SkPaint_getPosTextPath_pos'>pos</a> array and <a href='#Text_Align'>Text Align</a> to position <a href='#SkPaint_getPosTextPath_path'>path</a>. +<a href='#SkPaint_getPosTextPath_pos'>pos</a> contains a position for each glyph. ### Parameters -<table> <tr> <td><a name="SkPaint_getPosTextPath_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices</td> - </tr> <tr> <td><a name="SkPaint_getPosTextPath_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_getPosTextPath_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getPosTextPath_pos"> <code><strong>pos </strong></code> </a></td> <td> -positions of each glyph</td> - </tr> <tr> <td><a name="SkPaint_getPosTextPath_path"> <code><strong>path </strong></code> </a></td> <td> -geometry of the <a href="undocumented#Glyph">Glyphs</a></td> +<table> <tr> <td><a name='SkPaint_getPosTextPath_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextPath_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_getPosTextPath_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getPosTextPath_pos'><code><strong>pos</strong></code></a></td> + <td>positions of each glyph</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextPath_path'><code><strong>path</strong></code></a></td> + <td>geometry of the <a href='undocumented#Glyph'>Glyphs</a></td> </tr> </table> ### Example -<div><fiddle-embed name="7f27c93472aa99a7542fb3493076f072"><div>Simplifies three <a href="undocumented#Glyph">Glyphs</a> to eliminate overlaps, and strokes the result. +<div><fiddle-embed name="7f27c93472aa99a7542fb3493076f072"><div>Simplifies three <a href='undocumented#Glyph'>Glyphs</a> to eliminate overlaps, and strokes the result. </div></fiddle-embed></div> --- -## <a name="Text_Intercepts"></a> Text Intercepts +## <a name='Text_Intercepts'>Text Intercepts</a> -<a href="#Text_Intercepts">Text Intercepts</a> describe the intersection of drawn text <a href="undocumented#Glyph">Glyphs</a> with a pair -of lines parallel to the text advance. <a href="#Text_Intercepts">Text Intercepts</a> permits creating a +<a href='#Text_Intercepts'>Text Intercepts</a> describe the intersection of drawn text <a href='undocumented#Glyph'>Glyphs</a> with a pair +of lines parallel to the text advance. <a href='#Text_Intercepts'>Text Intercepts</a> permits creating a underline that skips Descenders. -<a name="SkPaint_getTextIntercepts"></a> +<a name='SkPaint_getTextIntercepts'></a> ## getTextIntercepts -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar y, - const SkScalar bounds[2], SkScalar* intervals) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_getTextIntercepts'>getTextIntercepts</a>(const void* text, size_t length, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, + const <a href='undocumented#SkScalar'>SkScalar</a> bounds[2], <a href='undocumented#SkScalar'>SkScalar</a>* intervals) const </pre> -Returns the number of <a href="#SkPaint_getTextIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getTextIntercepts_bounds">bounds</a>. -<a href="#SkPaint_getTextIntercepts_bounds">bounds</a> describes a pair of lines parallel to the <a href="#SkPaint_getTextIntercepts_text">text</a> advance. -The return count is zero or a multiple of two, and is at most twice the number of <a href="undocumented#Glyph">Glyphs</a> in +Returns the number of <a href='#SkPaint_getTextIntercepts_intervals'>intervals</a> that intersect <a href='#SkPaint_getTextIntercepts_bounds'>bounds</a>. +<a href='#SkPaint_getTextIntercepts_bounds'>bounds</a> describes a pair of lines parallel to the <a href='#SkPaint_getTextIntercepts_text'>text</a> advance. +The return count is zero or a multiple of two, and is at most twice the number of <a href='undocumented#Glyph'>Glyphs</a> in the string. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getTextIntercepts_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, -and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -Uses <a href="#SkPaint_getTextIntercepts_x">x</a>, <a href="#SkPaint_getTextIntercepts_y">y</a>, and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getTextIntercepts_intervals">intervals</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getTextIntercepts_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the glyph paths, +and <a href='#Text_Size'>Text Size</a>, <a href='#Fake_Bold'>Fake Bold</a>, and <a href='undocumented#Path_Effect'>Path Effect</a> to scale and modify the glyph paths. +Uses <a href='#SkPaint_getTextIntercepts_x'>x</a>, <a href='#SkPaint_getTextIntercepts_y'>y</a>, and <a href='#Text_Align'>Text Align</a> to position <a href='#SkPaint_getTextIntercepts_intervals'>intervals</a>. -Pass nullptr for <a href="#SkPaint_getTextIntercepts_intervals">intervals</a> to determine the size of the interval array. +Pass nullptr for <a href='#SkPaint_getTextIntercepts_intervals'>intervals</a> to determine the size of the interval array. -<a href="#SkPaint_getTextIntercepts_intervals">intervals</a> are cached to improve performance for multiple calls. +<a href='#SkPaint_getTextIntercepts_intervals'>intervals</a> are cached to improve performance for multiple calls. ### Parameters -<table> <tr> <td><a name="SkPaint_getTextIntercepts_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices</td> - </tr> <tr> <td><a name="SkPaint_getTextIntercepts_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_getTextIntercepts_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getTextIntercepts_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="#SkPaint_getTextIntercepts_x">x</a>-coordinate of the origin of the <a href="#SkPaint_getTextIntercepts_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getTextIntercepts_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="#SkPaint_getTextIntercepts_y">y</a>-coordinate of the origin of the <a href="#SkPaint_getTextIntercepts_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getTextIntercepts_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -lower and upper line parallel to the advance</td> - </tr> <tr> <td><a name="SkPaint_getTextIntercepts_intervals"> <code><strong>intervals </strong></code> </a></td> <td> -returned intersections; may be nullptr</td> +<table> <tr> <td><a name='SkPaint_getTextIntercepts_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices</td> + </tr> + <tr> <td><a name='SkPaint_getTextIntercepts_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_getTextIntercepts_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getTextIntercepts_x'><code><strong>x</strong></code></a></td> + <td><a href='#SkPaint_getTextIntercepts_x'>x</a>-coordinate of the origin of the <a href='#SkPaint_getTextIntercepts_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getTextIntercepts_y'><code><strong>y</strong></code></a></td> + <td><a href='#SkPaint_getTextIntercepts_y'>y</a>-coordinate of the origin of the <a href='#SkPaint_getTextIntercepts_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getTextIntercepts_bounds'><code><strong>bounds</strong></code></a></td> + <td>lower and upper line parallel to the advance</td> + </tr> + <tr> <td><a name='SkPaint_getTextIntercepts_intervals'><code><strong>intervals</strong></code></a></td> + <td>returned intersections; may be nullptr</td> </tr> </table> @@ -4792,38 +5843,42 @@ number of intersections; may be zero --- -<a name="SkPaint_getPosTextIntercepts"></a> +<a name='SkPaint_getPosTextIntercepts'></a> ## getPosTextIntercepts -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[], - const SkScalar bounds[2], SkScalar* intervals) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_getPosTextIntercepts'>getPosTextIntercepts</a>(const void* text, size_t length, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pos[], + const <a href='undocumented#SkScalar'>SkScalar</a> bounds[2], <a href='undocumented#SkScalar'>SkScalar</a>* intervals) const </pre> -Returns the number of <a href="#SkPaint_getPosTextIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getPosTextIntercepts_bounds">bounds</a>. -<a href="#SkPaint_getPosTextIntercepts_bounds">bounds</a> describes a pair of lines parallel to the <a href="#SkPaint_getPosTextIntercepts_text">text</a> advance. -The return count is zero or a multiple of two, and is at most twice the number of <a href="undocumented#Glyph">Glyphs</a> in +Returns the number of <a href='#SkPaint_getPosTextIntercepts_intervals'>intervals</a> that intersect <a href='#SkPaint_getPosTextIntercepts_bounds'>bounds</a>. +<a href='#SkPaint_getPosTextIntercepts_bounds'>bounds</a> describes a pair of lines parallel to the <a href='#SkPaint_getPosTextIntercepts_text'>text</a> advance. +The return count is zero or a multiple of two, and is at most twice the number of <a href='undocumented#Glyph'>Glyphs</a> in the string. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getPosTextIntercepts_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, -and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -Uses <a href="#SkPaint_getPosTextIntercepts_pos">pos</a> array and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getPosTextIntercepts_intervals">intervals</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getPosTextIntercepts_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the glyph paths, +and <a href='#Text_Size'>Text Size</a>, <a href='#Fake_Bold'>Fake Bold</a>, and <a href='undocumented#Path_Effect'>Path Effect</a> to scale and modify the glyph paths. +Uses <a href='#SkPaint_getPosTextIntercepts_pos'>pos</a> array and <a href='#Text_Align'>Text Align</a> to position <a href='#SkPaint_getPosTextIntercepts_intervals'>intervals</a>. -Pass nullptr for <a href="#SkPaint_getPosTextIntercepts_intervals">intervals</a> to determine the size of the interval array. +Pass nullptr for <a href='#SkPaint_getPosTextIntercepts_intervals'>intervals</a> to determine the size of the interval array. -<a href="#SkPaint_getPosTextIntercepts_intervals">intervals</a> are cached to improve performance for multiple calls. +<a href='#SkPaint_getPosTextIntercepts_intervals'>intervals</a> are cached to improve performance for multiple calls. ### Parameters -<table> <tr> <td><a name="SkPaint_getPosTextIntercepts_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices</td> - </tr> <tr> <td><a name="SkPaint_getPosTextIntercepts_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_getPosTextIntercepts_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getPosTextIntercepts_pos"> <code><strong>pos </strong></code> </a></td> <td> -positions of each glyph</td> - </tr> <tr> <td><a name="SkPaint_getPosTextIntercepts_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -lower and upper line parallel to the advance</td> - </tr> <tr> <td><a name="SkPaint_getPosTextIntercepts_intervals"> <code><strong>intervals </strong></code> </a></td> <td> -returned intersections; may be nullptr</td> +<table> <tr> <td><a name='SkPaint_getPosTextIntercepts_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextIntercepts_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_getPosTextIntercepts_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getPosTextIntercepts_pos'><code><strong>pos</strong></code></a></td> + <td>positions of each glyph</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextIntercepts_bounds'><code><strong>bounds</strong></code></a></td> + <td>lower and upper line parallel to the advance</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextIntercepts_intervals'><code><strong>intervals</strong></code></a></td> + <td>returned intersections; may be nullptr</td> </tr> </table> @@ -4833,45 +5888,50 @@ number of intersections; may be zero ### Example -<div><fiddle-embed name="98b2dfc552d0540a7c041fe7a2839bd7"><div><a href="undocumented#Text">Text</a> intercepts draw on either side of, but not inside, <a href="undocumented#Glyph">Glyphs</a> in a run. +<div><fiddle-embed name="98b2dfc552d0540a7c041fe7a2839bd7"><div><a href='undocumented#Text'>Text</a> intercepts draw on either side of, but not inside, <a href='undocumented#Glyph'>Glyphs</a> in a run. </div></fiddle-embed></div> --- -<a name="SkPaint_getPosTextHIntercepts"></a> +<a name='SkPaint_getPosTextHIntercepts'></a> ## getPosTextHIntercepts -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getPosTextHIntercepts(const void* text, size_t length, const SkScalar xpos[], SkScalar constY, - const SkScalar bounds[2], SkScalar* intervals) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_getPosTextHIntercepts'>getPosTextHIntercepts</a>(const void* text, size_t length, const <a href='undocumented#SkScalar'>SkScalar</a> xpos[], <a href='undocumented#SkScalar'>SkScalar</a> constY, + const <a href='undocumented#SkScalar'>SkScalar</a> bounds[2], <a href='undocumented#SkScalar'>SkScalar</a>* intervals) const </pre> -Returns the number of <a href="#SkPaint_getPosTextHIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getPosTextHIntercepts_bounds">bounds</a>. -<a href="#SkPaint_getPosTextHIntercepts_bounds">bounds</a> describes a pair of lines parallel to the <a href="#SkPaint_getPosTextHIntercepts_text">text</a> advance. -The return count is zero or a multiple of two, and is at most twice the number of <a href="undocumented#Glyph">Glyphs</a> in +Returns the number of <a href='#SkPaint_getPosTextHIntercepts_intervals'>intervals</a> that intersect <a href='#SkPaint_getPosTextHIntercepts_bounds'>bounds</a>. +<a href='#SkPaint_getPosTextHIntercepts_bounds'>bounds</a> describes a pair of lines parallel to the <a href='#SkPaint_getPosTextHIntercepts_text'>text</a> advance. +The return count is zero or a multiple of two, and is at most twice the number of <a href='undocumented#Glyph'>Glyphs</a> in the string. -Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getPosTextHIntercepts_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, -and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -Uses <a href="#SkPaint_getPosTextHIntercepts_xpos">xpos</a> array, <a href="#SkPaint_getPosTextHIntercepts_constY">constY</a>, and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getPosTextHIntercepts_intervals">intervals</a>. +Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getPosTextHIntercepts_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the glyph paths, +and <a href='#Text_Size'>Text Size</a>, <a href='#Fake_Bold'>Fake Bold</a>, and <a href='undocumented#Path_Effect'>Path Effect</a> to scale and modify the glyph paths. +Uses <a href='#SkPaint_getPosTextHIntercepts_xpos'>xpos</a> array, <a href='#SkPaint_getPosTextHIntercepts_constY'>constY</a>, and <a href='#Text_Align'>Text Align</a> to position <a href='#SkPaint_getPosTextHIntercepts_intervals'>intervals</a>. -Pass nullptr for <a href="#SkPaint_getPosTextHIntercepts_intervals">intervals</a> to determine the size of the interval array. +Pass nullptr for <a href='#SkPaint_getPosTextHIntercepts_intervals'>intervals</a> to determine the size of the interval array. -<a href="#SkPaint_getPosTextHIntercepts_intervals">intervals</a> are cached to improve performance for multiple calls. +<a href='#SkPaint_getPosTextHIntercepts_intervals'>intervals</a> are cached to improve performance for multiple calls. ### Parameters -<table> <tr> <td><a name="SkPaint_getPosTextHIntercepts_text"> <code><strong>text </strong></code> </a></td> <td> -character codes or glyph indices</td> - </tr> <tr> <td><a name="SkPaint_getPosTextHIntercepts_length"> <code><strong>length </strong></code> </a></td> <td> -number of bytes of <a href="#SkPaint_getPosTextHIntercepts_text">text</a></td> - </tr> <tr> <td><a name="SkPaint_getPosTextHIntercepts_xpos"> <code><strong>xpos </strong></code> </a></td> <td> -positions of each glyph in x</td> - </tr> <tr> <td><a name="SkPaint_getPosTextHIntercepts_constY"> <code><strong>constY </strong></code> </a></td> <td> -position of each glyph in y</td> - </tr> <tr> <td><a name="SkPaint_getPosTextHIntercepts_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -lower and upper line parallel to the advance</td> - </tr> <tr> <td><a name="SkPaint_getPosTextHIntercepts_intervals"> <code><strong>intervals </strong></code> </a></td> <td> -returned intersections; may be nullptr</td> +<table> <tr> <td><a name='SkPaint_getPosTextHIntercepts_text'><code><strong>text</strong></code></a></td> + <td>character codes or glyph indices</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextHIntercepts_length'><code><strong>length</strong></code></a></td> + <td>number of bytes of <a href='#SkPaint_getPosTextHIntercepts_text'>text</a></td> + </tr> + <tr> <td><a name='SkPaint_getPosTextHIntercepts_xpos'><code><strong>xpos</strong></code></a></td> + <td>positions of each glyph in x</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextHIntercepts_constY'><code><strong>constY</strong></code></a></td> + <td>position of each glyph in y</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextHIntercepts_bounds'><code><strong>bounds</strong></code></a></td> + <td>lower and upper line parallel to the advance</td> + </tr> + <tr> <td><a name='SkPaint_getPosTextHIntercepts_intervals'><code><strong>intervals</strong></code></a></td> + <td>returned intersections; may be nullptr</td> </tr> </table> @@ -4881,40 +5941,42 @@ number of intersections; may be zero ### Example -<div><fiddle-embed name="dc9851c43acc3716aca8c9a4d40d452d"><div><a href="undocumented#Text">Text</a> intercepts do not take stroke thickness into consideration. +<div><fiddle-embed name="dc9851c43acc3716aca8c9a4d40d452d"><div><a href='undocumented#Text'>Text</a> intercepts do not take stroke thickness into consideration. </div></fiddle-embed></div> --- -<a name="SkPaint_getTextBlobIntercepts"></a> +<a name='SkPaint_getTextBlobIntercepts'></a> ## getTextBlobIntercepts -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getTextBlobIntercepts(const SkTextBlob* blob, const SkScalar bounds[2], SkScalar* intervals) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPaint_getTextBlobIntercepts'>getTextBlobIntercepts</a>(const <a href='undocumented#SkTextBlob'>SkTextBlob</a>* blob, const <a href='undocumented#SkScalar'>SkScalar</a> bounds[2], <a href='undocumented#SkScalar'>SkScalar</a>* intervals) const </pre> -Returns the number of <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getTextBlobIntercepts_bounds">bounds</a>. -<a href="#SkPaint_getTextBlobIntercepts_bounds">bounds</a> describes a pair of lines parallel to the text advance. -The return count is zero or a multiple of two, and is at most twice the number of <a href="undocumented#Glyph">Glyphs</a> in +Returns the number of <a href='#SkPaint_getTextBlobIntercepts_intervals'>intervals</a> that intersect <a href='#SkPaint_getTextBlobIntercepts_bounds'>bounds</a>. +<a href='#SkPaint_getTextBlobIntercepts_bounds'>bounds</a> describes a pair of lines parallel to the text advance. +The return count is zero or a multiple of two, and is at most twice the number of <a href='undocumented#Glyph'>Glyphs</a> in the string. -Uses <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, -and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -Uses run array and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a>. +Uses <a href='undocumented#Typeface'>Typeface</a> to get the glyph paths, +and <a href='#Text_Size'>Text Size</a>, <a href='#Fake_Bold'>Fake Bold</a>, and <a href='undocumented#Path_Effect'>Path Effect</a> to scale and modify the glyph paths. +Uses run array and <a href='#Text_Align'>Text Align</a> to position <a href='#SkPaint_getTextBlobIntercepts_intervals'>intervals</a>. -<a href="#Text_Encoding">Text Encoding</a> must be set to <a href="#SkPaint_kGlyphID_TextEncoding">SkPaint::kGlyphID TextEncoding</a>. +<a href='#Text_Encoding'>Text Encoding</a> must be set to <a href='#SkPaint_kGlyphID_TextEncoding'>SkPaint::kGlyphID TextEncoding</a>. -Pass nullptr for <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a> to determine the size of the interval array. +Pass nullptr for <a href='#SkPaint_getTextBlobIntercepts_intervals'>intervals</a> to determine the size of the interval array. -<a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a> are cached to improve performance for multiple calls. +<a href='#SkPaint_getTextBlobIntercepts_intervals'>intervals</a> are cached to improve performance for multiple calls. ### Parameters -<table> <tr> <td><a name="SkPaint_getTextBlobIntercepts_blob"> <code><strong>blob </strong></code> </a></td> <td> -<a href="undocumented#Glyph">Glyphs</a>, positions, and text paint attributes</td> - </tr> <tr> <td><a name="SkPaint_getTextBlobIntercepts_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -lower and upper line parallel to the advance</td> - </tr> <tr> <td><a name="SkPaint_getTextBlobIntercepts_intervals"> <code><strong>intervals </strong></code> </a></td> <td> -returned intersections; may be nullptr</td> +<table> <tr> <td><a name='SkPaint_getTextBlobIntercepts_blob'><code><strong>blob</strong></code></a></td> + <td><a href='undocumented#Glyph'>Glyphs</a>, positions, and text paint attributes</td> + </tr> + <tr> <td><a name='SkPaint_getTextBlobIntercepts_bounds'><code><strong>bounds</strong></code></a></td> + <td>lower and upper line parallel to the advance</td> + </tr> + <tr> <td><a name='SkPaint_getTextBlobIntercepts_intervals'><code><strong>intervals</strong></code></a></td> + <td>returned intersections; may be nullptr</td> </tr> </table> @@ -4928,22 +5990,22 @@ number of intersections; may be zero --- -<a name="SkPaint_nothingToDraw"></a> +<a name='SkPaint_nothingToDraw'></a> ## nothingToDraw -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool nothingToDraw() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_nothingToDraw'>nothingToDraw</a>() const </pre> -Returns true if <a href="#Paint">Paint</a> prevents all drawing; -otherwise, the <a href="#Paint">Paint</a> may or may not allow drawing. +Returns true if <a href='#Paint'>Paint</a> prevents all drawing; +otherwise, the <a href='#Paint'>Paint</a> may or may not allow drawing. -Returns true if, for example, <a href="undocumented#Blend_Mode">Blend Mode</a> combined with <a href="SkColor_Reference#Alpha">Color Alpha</a> computes a -new <a href="SkColor_Reference#Alpha">Alpha</a> of zero. +Returns true if, for example, <a href='undocumented#Blend_Mode'>Blend Mode</a> combined with <a href='SkColor_Reference#Alpha'>Color Alpha</a> computes a +new <a href='SkColor_Reference#Alpha'>Alpha</a> of zero. ### Return Value -true if <a href="#Paint">Paint</a> prevents all drawing +true if <a href='#Paint'>Paint</a> prevents all drawing ### Example @@ -4962,52 +6024,65 @@ alpha 0 nothing to draw: true --- -## <a name="Fast_Bounds"></a> Fast Bounds +## <a name='Fast_Bounds'>Fast Bounds</a> -<a href="#Fast_Bounds">Fast Bounds</a> methods conservatively outset a drawing bounds by additional area -<a href="#Paint">Paint</a> may draw to. +To be made private. +<a href='#Fast_Bounds'>Fast Bounds</a> functions conservatively outset a drawing bounds by additional area +<a href='#Paint'>Paint</a> may draw to. -<a name="SkPaint_canComputeFastBounds"></a> +<a name='SkPaint_canComputeFastBounds'></a> ## canComputeFastBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool canComputeFastBounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPaint_canComputeFastBounds'>canComputeFastBounds</a>() const </pre> -Returns true if <a href="#Paint">Paint</a> does not include elements requiring extensive computation -to compute <a href="undocumented#Device">Device</a> bounds of drawn geometry. For instance, <a href="#Paint">Paint</a> with <a href="undocumented#Path_Effect">Path Effect</a> +( to be made private) +Returns true if <a href='#Paint'>Paint</a> does not include elements requiring extensive computation +to compute <a href='undocumented#Device'>Device</a> bounds of drawn geometry. For instance, <a href='#Paint'>Paint</a> with <a href='undocumented#Path_Effect'>Path Effect</a> always returns false. ### Return Value -true if <a href="#Paint">Paint</a> allows for fast computation of bounds +true if <a href='#Paint'>Paint</a> allows for fast computation of bounds --- -<a name="SkPaint_computeFastBounds"></a> +<a name='SkPaint_computeFastBounds'></a> ## computeFastBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkPaint_computeFastBounds'>computeFastBounds</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& orig, <a href='SkRect_Reference#SkRect'>SkRect</a>* storage) const </pre> -Only call this if <a href="#SkPaint_canComputeFastBounds">canComputeFastBounds</a> returned true. This takes a +( to be made private) +Only call this if <a href='#SkPaint_canComputeFastBounds'>canComputeFastBounds</a> returned true. This takes a raw rectangle (the raw bounds of a shape), and adjusts it for stylistic -effects in the paint (e.g. stroking). If needed, it uses the <a href="#SkPaint_computeFastBounds_storage">storage</a> +effects in the paint (e.g. stroking). If needed, it uses the <a href='#SkPaint_computeFastBounds_storage'>storage</a> parameter. It returns the adjusted bounds that can then be used -for <a href="SkCanvas_Reference#SkCanvas_quickReject">SkCanvas::quickReject</a> tests. - -The returned <a href="SkRect_Reference#Rect">Rect</a> will either be <a href="#SkPaint_computeFastBounds_orig">orig</a> or <a href="#SkPaint_computeFastBounds_storage">storage</a>, thus the caller -should not rely on <a href="#SkPaint_computeFastBounds_storage">storage</a> being set to the result, but should always -use the returned value. It is legal for <a href="#SkPaint_computeFastBounds_orig">orig</a> and <a href="#SkPaint_computeFastBounds_storage">storage</a> to be the same -<a href="SkRect_Reference#Rect">Rect</a>. +for <a href='SkCanvas_Reference#SkCanvas_quickReject'>SkCanvas::quickReject</a> tests. + +The returned <a href='SkRect_Reference#Rect'>Rect</a> will either be <a href='#SkPaint_computeFastBounds_orig'>orig</a> or <a href='#SkPaint_computeFastBounds_storage'>storage</a>, thus the caller +should not rely on <a href='#SkPaint_computeFastBounds_storage'>storage</a> being set to the result, but should always +use the returned value. It is legal for <a href='#SkPaint_computeFastBounds_orig'>orig</a> and <a href='#SkPaint_computeFastBounds_storage'>storage</a> to be the same +<a href='SkRect_Reference#Rect'>Rect</a>. + +For example: +if (!path.isInverseFillType() && paint.<a href='#SkPaint_canComputeFastBounds'>canComputeFastBounds</a>) { +<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPaint_computeFastBounds_storage'>storage</a>; +if (canvas->quickReject(paint.computeFastBounds(path.getBounds(), &<a href='#SkPaint_computeFastBounds_storage'>storage</a>))) { +return; // don't draw the path +} +} +// draw the path ### Parameters -<table> <tr> <td><a name="SkPaint_computeFastBounds_orig"> <code><strong>orig </strong></code> </a></td> <td> -geometry modified by <a href="#Paint">Paint</a> when drawn</td> - </tr> <tr> <td><a name="SkPaint_computeFastBounds_storage"> <code><strong>storage </strong></code> </a></td> <td> -computed bounds of geometry; may not be nullptr</td> +<table> <tr> <td><a name='SkPaint_computeFastBounds_orig'><code><strong>orig</strong></code></a></td> + <td>geometry modified by <a href='#Paint'>Paint</a> when drawn</td> + </tr> + <tr> <td><a name='SkPaint_computeFastBounds_storage'><code><strong>storage</strong></code></a></td> + <td>computed bounds of geometry; may not be nullptr</td> </tr> </table> @@ -5017,19 +6092,22 @@ fast computed bounds --- -<a name="SkPaint_computeFastStrokeBounds"></a> +<a name='SkPaint_computeFastStrokeBounds'></a> ## computeFastStrokeBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkRect& computeFastStrokeBounds(const SkRect& orig, SkRect* storage) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkPaint_computeFastStrokeBounds'>computeFastStrokeBounds</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& orig, <a href='SkRect_Reference#SkRect'>SkRect</a>* storage) const </pre> +( to be made private) + ### Parameters -<table> <tr> <td><a name="SkPaint_computeFastStrokeBounds_orig"> <code><strong>orig </strong></code> </a></td> <td> -geometry modified by <a href="#Paint">Paint</a> when drawn</td> - </tr> <tr> <td><a name="SkPaint_computeFastStrokeBounds_storage"> <code><strong>storage </strong></code> </a></td> <td> -computed bounds of geometry</td> +<table> <tr> <td><a name='SkPaint_computeFastStrokeBounds_orig'><code><strong>orig</strong></code></a></td> + <td>geometry modified by <a href='#Paint'>Paint</a> when drawn</td> + </tr> + <tr> <td><a name='SkPaint_computeFastStrokeBounds_storage'><code><strong>storage</strong></code></a></td> + <td>computed bounds of geometry</td> </tr> </table> @@ -5039,25 +6117,28 @@ fast computed bounds --- -<a name="SkPaint_doComputeFastBounds"></a> +<a name='SkPaint_doComputeFastBounds'></a> ## doComputeFastBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style style) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkPaint_doComputeFastBounds'>doComputeFastBounds</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& orig, <a href='SkRect_Reference#SkRect'>SkRect</a>* storage, <a href='#SkPaint_Style'>Style</a> style) const </pre> -Computes the bounds, overriding the <a href="#Paint">Paint</a> <a href="#SkPaint_Style">Style</a>. This can be used to -account for additional width required by stroking <a href="#SkPaint_doComputeFastBounds_orig">orig</a>, without -altering <a href="#SkPaint_Style">Style</a> set to fill. +( to be made private) +Computes the bounds, overriding the <a href='#Paint'>Paint</a> <a href='#SkPaint_Style'>Style</a>. This can be used to +account for additional width required by stroking <a href='#SkPaint_doComputeFastBounds_orig'>orig</a>, without +altering <a href='#SkPaint_Style'>Style</a> set to fill. ### Parameters -<table> <tr> <td><a name="SkPaint_doComputeFastBounds_orig"> <code><strong>orig </strong></code> </a></td> <td> -geometry modified by <a href="#Paint">Paint</a> when drawn</td> - </tr> <tr> <td><a name="SkPaint_doComputeFastBounds_storage"> <code><strong>storage </strong></code> </a></td> <td> -computed bounds of geometry</td> - </tr> <tr> <td><a name="SkPaint_doComputeFastBounds_style"> <code><strong>style </strong></code> </a></td> <td> -overrides <a href="#SkPaint_Style">Style</a></td> +<table> <tr> <td><a name='SkPaint_doComputeFastBounds_orig'><code><strong>orig</strong></code></a></td> + <td>geometry modified by <a href='#Paint'>Paint</a> when drawn</td> + </tr> + <tr> <td><a name='SkPaint_doComputeFastBounds_storage'><code><strong>storage</strong></code></a></td> + <td>computed bounds of geometry</td> + </tr> + <tr> <td><a name='SkPaint_doComputeFastBounds_style'><code><strong>style</strong></code></a></td> + <td>overrides <a href='#SkPaint_Style'>Style</a></td> </tr> </table> @@ -5067,31 +6148,53 @@ fast computed bounds --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> -| name | description | -| --- | --- | -| <a href="#SkPaint_containsText">containsText</a> | returns if all text corresponds to <a href="undocumented#Glyph">Glyphs</a> | -| <a href="#SkPaint_countText">countText</a> | returns number of <a href="undocumented#Glyph">Glyphs</a> in text | -| <a href="#SkPaint_glyphsToUnichars">glyphsToUnichars</a> | converts <a href="undocumented#Glyph">Glyphs</a> into text | -| <a href="#SkPaint_nothingToDraw">nothingToDraw</a> | returns true if <a href="#Paint">Paint</a> prevents all drawing | -| <a href="#SkPaint_textToGlyphs">textToGlyphs</a> | converts text into glyph indices | -| <a href="#SkPaint_toString">toString</a> | converts <a href="#Paint">Paint</a> to machine readable form | - -<a name="SkPaint_toString"></a> + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_containsText'>containsText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if all text corresponds to <a href='undocumented#Glyph'>Glyphs</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_countText'>countText</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns number of <a href='undocumented#Glyph'>Glyphs</a> in text</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_glyphsToUnichars'>glyphsToUnichars</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='undocumented#Glyph'>Glyphs</a> into text</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_nothingToDraw'>nothingToDraw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Paint'>Paint</a> prevents all drawing</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_textToGlyphs'>textToGlyphs</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts text into glyph indices</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPaint_toString'>toString</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>converts <a href='#Paint'>Paint</a> to machine readable form</td> + </tr> +</table> + + +<a name='SkPaint_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPaint_toString'>toString</a>(<a href='undocumented#SkString'>SkString</a>* str) const </pre> -Creates string representation of <a href="#Paint">Paint</a>. The representation is read by +Creates string representation of <a href='#Paint'>Paint</a>. The representation is read by internal debugging tools. ### Parameters -<table> <tr> <td><a name="SkPaint_toString_str"> <code><strong>str </strong></code> </a></td> <td> -storage for string representation of <a href="#Paint">Paint</a></td> +<table> <tr> <td><a name='SkPaint_toString_str'><code><strong>str</strong></code></a></td> + <td>storage for string representation of <a href='#Paint'>Paint</a></td> </tr> </table> @@ -5109,7 +6212,7 @@ text size = 12 ### See Also -<a href="undocumented#SkPathEffect_toString">SkPathEffect::toString</a> <a href="undocumented#SkMaskFilter_toString">SkMaskFilter::toString</a> <a href="undocumented#SkColorFilter_toString">SkColorFilter::toString</a> <a href="undocumented#SkImageFilter_toString">SkImageFilter::toString</a> +<a href='undocumented#SkPathEffect_toString'>SkPathEffect::toString</a> <a href='undocumented#SkMaskFilter_toString'>SkMaskFilter::toString</a> <a href='undocumented#SkColorFilter_toString'>SkColorFilter::toString</a> <a href='undocumented#SkImageFilter_toString'>SkImageFilter::toString</a> --- diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md index 8bfd765e8a..5d376fa0de 100644 --- a/site/user/api/SkPath_Reference.md +++ b/site/user/api/SkPath_Reference.md @@ -1,327 +1,845 @@ SkPath Reference === -# <a name="Path"></a> Path - -## <a name="Overview"></a> Overview - -## <a name="Overview_Subtopic"></a> Overview Subtopic - -| name | description | -| --- | --- | -| <a href="#Class_or_Struct">Class or Struct</a> | embedded struct and class members | -| <a href="#Constant">Constant</a> | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkPath">SkPath</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -<a href="#Path">Path</a> contains <a href="undocumented#Line">Lines</a> and <a href="undocumented#Curve">Curves</a> which can be stroked or filled. <a href="#Contour">Contour</a> is -composed of a series of connected <a href="undocumented#Line">Lines</a> and <a href="undocumented#Curve">Curves</a>. <a href="#Path">Path</a> may contain zero, -one, or more <a href="#Contour">Contours</a>. -Each <a href="undocumented#Line">Line</a> and <a href="undocumented#Curve">Curve</a> are described by <a href="#Verb">Verb</a>, <a href="SkPoint_Reference#Point">Points</a>, and optional <a href="#Conic_Weight">Conic Weight</a>. - -Each pair of connected <a href="undocumented#Line">Lines</a> and <a href="undocumented#Curve">Curves</a> share common <a href="SkPoint_Reference#Point">Point</a>; for instance, <a href="#Path">Path</a> -containing two connected <a href="undocumented#Line">Lines</a> are described the <a href="#Verb">Verb</a> sequence: -<a href="#SkPath_kMove_Verb">SkPath::kMove Verb</a>, <a href="#SkPath_kLine_Verb">SkPath::kLine Verb</a>, <a href="#SkPath_kLine_Verb">SkPath::kLine Verb</a>; and a <a href="SkPoint_Reference#Point">Point</a> sequence +# <a name='Path'>Path</a> +<a href='#Path'>Path</a> contains <a href='undocumented#Line'>Lines</a> and <a href='undocumented#Curve'>Curves</a> which can be stroked or filled. <a href='#Contour'>Contour</a> is +composed of a series of connected <a href='undocumented#Line'>Lines</a> and <a href='undocumented#Curve'>Curves</a>. <a href='#Path'>Path</a> may contain zero, +one, or more <a href='#Contour'>Contours</a>. +Each <a href='undocumented#Line'>Line</a> and <a href='undocumented#Curve'>Curve</a> are described by <a href='#SkPath_Verb'>Verb</a>, <a href='SkPoint_Reference#Point'>Points</a>, and optional <a href='#Conic_Weight'>Conic Weight</a>. + +Each pair of connected <a href='undocumented#Line'>Lines</a> and <a href='undocumented#Curve'>Curves</a> share common <a href='SkPoint_Reference#Point'>Point</a>; for instance, <a href='#Path'>Path</a> +containing two connected <a href='undocumented#Line'>Lines</a> are described the <a href='#SkPath_Verb'>Verb</a> sequence: +<a href='#SkPath_kMove_Verb'>SkPath::kMove Verb</a>, <a href='#SkPath_kLine_Verb'>SkPath::kLine Verb</a>, <a href='#SkPath_kLine_Verb'>SkPath::kLine Verb</a>; and a <a href='SkPoint_Reference#Point'>Point</a> sequence with three entries, sharing -the middle entry as the end of the first <a href="undocumented#Line">Line</a> and the start of the second <a href="undocumented#Line">Line</a>. +the middle entry as the end of the first <a href='undocumented#Line'>Line</a> and the start of the second <a href='undocumented#Line'>Line</a>. -<a href="#Path">Path</a> components <a href="#Arc">Arc</a>, <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> are composed of -<a href="undocumented#Line">Lines</a> and <a href="undocumented#Curve">Curves</a> with as many <a href="#Verb">Verbs</a> and <a href="SkPoint_Reference#Point">Points</a> required -for an exact description. Once added to <a href="#Path">Path</a>, these components may lose their -identity; although <a href="#Path">Path</a> can be inspected to determine if it describes a single -<a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, <a href="undocumented#Round_Rect">Round Rect</a>, and so on. +<a href='#Path'>Path</a> components <a href='#Arc'>Arc</a>, <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Round_Rect'>Round Rect</a>, <a href='undocumented#Circle'>Circle</a>, and <a href='undocumented#Oval'>Oval</a> are composed of +<a href='undocumented#Line'>Lines</a> and <a href='undocumented#Curve'>Curves</a> with as many <a href='#Verb'>Verbs</a> and <a href='SkPoint_Reference#Point'>Points</a> required +for an exact description. Once added to <a href='#Path'>Path</a>, these components may lose their +identity; although <a href='#Path'>Path</a> can be inspected to determine if it describes a single +<a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, <a href='undocumented#Round_Rect'>Round Rect</a>, and so on. ### Example -<div><fiddle-embed name="93887af0c1dac49521972698cf04069c"><div><a href="#Path">Path</a> contains three <a href="#Contour">Contours</a>: <a href="undocumented#Line">Line</a>, <a href="undocumented#Circle">Circle</a>, and <a href="#Quad">Quad</a>. <a href="undocumented#Line">Line</a> is stroked but -not filled. <a href="undocumented#Circle">Circle</a> is stroked and filled; <a href="undocumented#Circle">Circle</a> stroke forms a loop. <a href="#Quad">Quad</a> -is stroked and filled, but since it is not closed, <a href="#Quad">Quad</a> does not stroke a loop. +<div><fiddle-embed name="93887af0c1dac49521972698cf04069c"><div><a href='#Path'>Path</a> contains three <a href='#Contour'>Contours</a>: <a href='undocumented#Line'>Line</a>, <a href='undocumented#Circle'>Circle</a>, and <a href='#Quad'>Quad</a>. <a href='undocumented#Line'>Line</a> is stroked but +not filled. <a href='undocumented#Circle'>Circle</a> is stroked and filled; <a href='undocumented#Circle'>Circle</a> stroke forms a loop. <a href='#Quad'>Quad</a> +is stroked and filled, but since it is not closed, <a href='#Quad'>Quad</a> does not stroke a loop. </div></fiddle-embed></div> -<a href="#Path">Path</a> contains a <a href="#Fill_Type">Fill Type</a> which determines whether overlapping <a href="#Contour">Contours</a> -form fills or holes. <a href="#Fill_Type">Fill Type</a> also determines whether area inside or outside -<a href="undocumented#Line">Lines</a> and <a href="undocumented#Curve">Curves</a> is filled. +<a href='#Path'>Path</a> contains a <a href='#Fill_Type'>Fill Type</a> which determines whether overlapping <a href='#Contour'>Contours</a> +form fills or holes. <a href='#Fill_Type'>Fill Type</a> also determines whether area inside or outside +<a href='undocumented#Line'>Lines</a> and <a href='undocumented#Curve'>Curves</a> is filled. ### Example -<div><fiddle-embed name="36a995442c081ee779ecab2962d36e69"><div><a href="#Path">Path</a> is drawn filled, then stroked, then stroked and filled. +<div><fiddle-embed name="36a995442c081ee779ecab2962d36e69"><div><a href='#Path'>Path</a> is drawn filled, then stroked, then stroked and filled. </div></fiddle-embed></div> -<a href="#Path">Path</a> contents are never shared. Copying <a href="#Path">Path</a> by value effectively creates -a new <a href="#Path">Path</a> independent of the original. Internally, the copy does not duplicate +<a href='#Path'>Path</a> contents are never shared. Copying <a href='#Path'>Path</a> by value effectively creates +a new <a href='#Path'>Path</a> independent of the original. Internally, the copy does not duplicate its contents until it is edited, to reduce memory use and improve performance. -## <a name="Contour"></a> Contour +## <a name='Contour'>Contour</a> -<a href="#Contour">Contour</a> contains one or more <a href="#Verb">Verbs</a>, and as many <a href="SkPoint_Reference#Point">Points</a> as -are required to satisfy <a href="#Verb_Array">Verb Array</a>. First <a href="#Verb">Verb</a> in <a href="#Path">Path</a> is always -<a href="#SkPath_kMove_Verb">SkPath::kMove Verb</a>; each <a href="#SkPath_kMove_Verb">SkPath::kMove Verb</a> that follows starts a new <a href="#Contour">Contour</a>. +<a href='#Contour'>Contour</a> contains one or more <a href='#Verb'>Verbs</a>, and as many <a href='SkPoint_Reference#Point'>Points</a> as +are required to satisfy <a href='#Verb_Array'>Verb Array</a>. First <a href='#SkPath_Verb'>Verb</a> in <a href='#Path'>Path</a> is always +<a href='#SkPath_kMove_Verb'>SkPath::kMove Verb</a>; each <a href='#SkPath_kMove_Verb'>SkPath::kMove Verb</a> that follows starts a new <a href='#Contour'>Contour</a>. ### Example -<div><fiddle-embed name="0374f2dcd7effeb1dd435205a6c2de6f"><div>Each <a href="#SkPath_moveTo">SkPath::moveTo</a> starts a new <a href="#Contour">Contour</a>, and content after <a href="#SkPath_close">SkPath::close()</a> -also starts a new <a href="#Contour">Contour</a>. Since <a href="#SkPath_conicTo">SkPath::conicTo</a> is not preceded by -<a href="#SkPath_moveTo">SkPath::moveTo</a>, the first <a href="SkPoint_Reference#Point">Point</a> of the third <a href="#Contour">Contour</a> starts at the last <a href="SkPoint_Reference#Point">Point</a> -of the second <a href="#Contour">Contour</a>. +<div><fiddle-embed name="0374f2dcd7effeb1dd435205a6c2de6f"><div>Each <a href='#SkPath_moveTo'>SkPath::moveTo</a> starts a new <a href='#Contour'>Contour</a>, and content after <a href='#SkPath_close'>SkPath::close()</a> +also starts a new <a href='#Contour'>Contour</a>. Since <a href='#SkPath_conicTo'>SkPath::conicTo</a> is not preceded by +<a href='#SkPath_moveTo'>SkPath::moveTo</a>, the first <a href='SkPoint_Reference#Point'>Point</a> of the third <a href='#Contour'>Contour</a> starts at the last <a href='SkPoint_Reference#Point'>Point</a> +of the second <a href='#Contour'>Contour</a>. </div></fiddle-embed></div> -If final <a href="#Verb">Verb</a> in <a href="#Contour">Contour</a> is <a href="#SkPath_kClose_Verb">SkPath::kClose Verb</a>, <a href="undocumented#Line">Line</a> connects <a href="#Last_Point">Last Point</a> in -<a href="#Contour">Contour</a> with first <a href="SkPoint_Reference#Point">Point</a>. A closed <a href="#Contour">Contour</a>, stroked, draws -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> at <a href="#Last_Point">Last Point</a> and first <a href="SkPoint_Reference#Point">Point</a>. Without <a href="#SkPath_kClose_Verb">SkPath::kClose Verb</a> -as final <a href="#Verb">Verb</a>, <a href="#Last_Point">Last Point</a> and first <a href="SkPoint_Reference#Point">Point</a> are not connected; <a href="#Contour">Contour</a> -remains open. An open <a href="#Contour">Contour</a>, stroked, draws <a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> at -<a href="#Last_Point">Last Point</a> and first <a href="SkPoint_Reference#Point">Point</a>. +If final <a href='#SkPath_Verb'>Verb</a> in <a href='#Contour'>Contour</a> is <a href='#SkPath_kClose_Verb'>SkPath::kClose Verb</a>, <a href='undocumented#Line'>Line</a> connects <a href='#Last_Point'>Last Point</a> in +<a href='#Contour'>Contour</a> with first <a href='SkPoint_Reference#Point'>Point</a>. A closed <a href='#Contour'>Contour</a>, stroked, draws +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> at <a href='#Last_Point'>Last Point</a> and first <a href='SkPoint_Reference#Point'>Point</a>. Without <a href='#SkPath_kClose_Verb'>SkPath::kClose Verb</a> +as final <a href='#SkPath_Verb'>Verb</a>, <a href='#Last_Point'>Last Point</a> and first <a href='SkPoint_Reference#Point'>Point</a> are not connected; <a href='#Contour'>Contour</a> +remains open. An open <a href='#Contour'>Contour</a>, stroked, draws <a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> at +<a href='#Last_Point'>Last Point</a> and first <a href='SkPoint_Reference#Point'>Point</a>. ### Example -<div><fiddle-embed name="7a1f39b12d2cd8b7f5b1190879259cb2"><div><a href="#Path">Path</a> is drawn stroked, with an open <a href="#Contour">Contour</a> and a closed <a href="#Contour">Contour</a>. +<div><fiddle-embed name="7a1f39b12d2cd8b7f5b1190879259cb2"><div><a href='#Path'>Path</a> is drawn stroked, with an open <a href='#Contour'>Contour</a> and a closed <a href='#Contour'>Contour</a>. </div></fiddle-embed></div> -## <a name="Contour_Zero_Length"></a> Contour Zero Length +## <a name='Contour_Zero_Length'>Contour Zero Length</a> -<a href="#Contour">Contour</a> length is distance traveled from first <a href="SkPoint_Reference#Point">Point</a> to <a href="#Last_Point">Last Point</a>, -plus, if <a href="#Contour">Contour</a> is closed, distance from <a href="#Last_Point">Last Point</a> to first <a href="SkPoint_Reference#Point">Point</a>. -Even if <a href="#Contour">Contour</a> length is zero, stroked <a href="undocumented#Line">Lines</a> are drawn if <a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> +<a href='#Contour'>Contour</a> length is distance traveled from first <a href='SkPoint_Reference#Point'>Point</a> to <a href='#Last_Point'>Last Point</a>, +plus, if <a href='#Contour'>Contour</a> is closed, distance from <a href='#Last_Point'>Last Point</a> to first <a href='SkPoint_Reference#Point'>Point</a>. +Even if <a href='#Contour'>Contour</a> length is zero, stroked <a href='undocumented#Line'>Lines</a> are drawn if <a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> makes them visible. ### Example <div><fiddle-embed name="62848df605af6258653d9e16b27d8f7f"></fiddle-embed></div> -# <a name="SkPath"></a> Class SkPath -<a href="#Path">Paths</a> contain geometry. <a href="#Path">Paths</a> may be empty, or contain one or more <a href="#Verb">Verbs</a> that -outline a figure. <a href="#Path">Path</a> always starts with a move verb to a Cartesian_Coordinate, +# <a name='SkPath'>Class SkPath</a> +<a href='#Path'>Paths</a> contain geometry. <a href='#Path'>Paths</a> may be empty, or contain one or more <a href='#Verb'>Verbs</a> that +outline a figure. <a href='#Path'>Path</a> always starts with a move verb to a Cartesian_Coordinate, and may be followed by additional verbs that add lines or curves. Adding a close verb makes the geometry into a continuous loop, a closed contour. -<a href="#Path">Paths</a> may contain any number of contours, each beginning with a move verb. +<a href='#Path'>Paths</a> may contain any number of contours, each beginning with a move verb. -<a href="#Path">Path</a> contours may contain only a move verb, or may also contain lines, -<a href="#Quad">Quadratic Beziers</a>, <a href="#Conic">Conics</a>, and <a href="#Cubic">Cubic Beziers</a>. <a href="#Path">Path</a> contours may be open or +<a href='#Path'>Path</a> contours may contain only a move verb, or may also contain lines, +<a href='#Quad'>Quadratic Beziers</a>, <a href='#Conic'>Conics</a>, and <a href='#Cubic'>Cubic Beziers</a>. <a href='#Path'>Path</a> contours may be open or closed. -When used to draw a filled area, <a href="#Path">Path</a> describes whether the fill is inside or -outside the geometry. <a href="#Path">Path</a> also describes the winding rule used to fill +When used to draw a filled area, <a href='#Path'>Path</a> describes whether the fill is inside or +outside the geometry. <a href='#Path'>Path</a> also describes the winding rule used to fill overlapping contours. -Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and convexity. Call -<a href="#SkPath_updateBoundsCache">SkPath::updateBoundsCache</a> to make <a href="#Path">Path</a> thread safe. - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Arc">Arc</a> | part of <a href="undocumented#Oval">Oval</a> or <a href="undocumented#Circle">Circle</a> | -| <a href="#Build">Build</a> | adds points and verbs to path | -| <a href="#Conic">Conic</a> | conic section defined by three points and a weight | -| <a href="#Conic_Weight">Conic Weight</a> | strength of <a href="#Conic">Conic</a> control <a href="SkPoint_Reference#Point">Point</a> | -| <a href="#SkPath_Convexity">Convexity</a> | if <a href="#Path">Path</a> is concave or convex | -| <a href="#Cubic">Cubic</a> | Bezier_Curve described by third-order polynomial | -| <a href="#SkPath_Direction">Direction</a> | <a href="#Path">Path</a> contour orientation | -| <a href="#Fill_Type">Fill Type</a> | <a href="#Path">Path</a> fill rule, normal and inverted | -| <a href="#Generation_ID">Generation ID</a> | value reflecting contents change | -| <a href="#Interpolate">Interpolate</a> | weighted average of <a href="#Path">Path</a> pair | -| <a href="#Last_Point">Last Point</a> | final <a href="SkPoint_Reference#Point">Point</a> in <a href="#Contour">Contour</a> | -| <a href="#Point_Array">Point Array</a> | end points and control points for lines and curves | -| <a href="#Property">Property</a> | metrics and attributes | -| <a href="#Quad">Quad</a> | Bezier_Curve described by second-order polynomial | -| <a href="#Transform">Transform</a> | modify all points | -| <a href="#Utility">Utility</a> | rarely called management functions | -| <a href="#SkPath_Verb">Verb</a> | line and curve type | -| <a href="#Verb_Array">Verb Array</a> | line and curve type for points | -| <a href="#Volatile">Volatile</a> | caching attribute | - -## <a name="Constant"></a> Constant - -| name | description | -| --- | --- | -| <a href="#SkPath_AddPathMode">AddPathMode</a> | sets <a href="#SkPath_addPath">addPath</a> options | -| <a href="#SkPath_ArcSize">ArcSize</a> | used by <a href="#SkPath_arcTo">arcTo</a> variation | -| <a href="#SkPath_Convexity">Convexity</a> | returns if <a href="#Path">Path</a> is convex or concave | -| <a href="#SkPath_Direction">Direction</a> | sets <a href="#Contour">Contour</a> clockwise or counterclockwise | -| <a href="#SkPath_FillType">FillType</a> | sets winding rule and inverse fill | -| <a href="#SkPath_SegmentMask">SegmentMask</a> | returns <a href="#SkPath_Verb">Verb</a> types in <a href="#Path">Path</a> | -| <a href="#SkPath_Verb">Verb</a> | controls how <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Points</a> are interpreted | - -## <a name="Class_or_Struct"></a> Class or Struct - -| name | description | -| --- | --- | -| <a href="#SkPath_Iter">Iter</a> | <a href="#Path">Path</a> data iterator | -| <a href="#SkPath_RawIter">RawIter</a> | <a href="#Path">Path</a> raw data iterator | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkPath_empty_constructor">SkPath()</a> | constructs with default values | -| <a href="#SkPath_copy_const_SkPath">SkPath(const SkPath& path)</a> | makes a shallow copy | -| <a href="#SkPath_reset">reset</a> | removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a>; frees memory | -| <a href="#SkPath_rewind">rewind</a> | removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a>, keeping memory | -| <a href="#SkPath_destructor">~SkPath()</a> | decreases <a href="undocumented#Reference_Count">Reference Count</a> of owned objects | - -## <a name="Operator"></a> Operator - -| name | description | -| --- | --- | -| <a href="#SkPath_notequal_operator">operator!=(const SkPath& a, const SkPath& b)</a> | compares paths for inequality | -| <a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> | makes a shallow copy | -| <a href="#SkPath_equal_operator">operator==(const SkPath& a, const SkPath& b)</a> | compares paths for equality | -| <a href="#SkPath_swap">swap</a> | exchanges <a href="#Path">Path</a> pair | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkPath_ConvertConicToQuads">ConvertConicToQuads</a> | approximates <a href="#Conic">Conic</a> with <a href="#Quad">Quad</a> array | -| <a href="#SkPath_ConvertToNonInverseFillType">ConvertToNonInverseFillType</a> | returns <a href="#Fill_Type">Fill Type</a> representing inside geometry | -| <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> | returns if <a href="#Cubic">Cubic</a> is very small | -| <a href="#SkPath_IsInverseFillType">IsInverseFillType</a> | returns if <a href="#Fill_Type">Fill Type</a> represents outside geometry | -| <a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> | returns if <a href="undocumented#Line">Line</a> is very small | -| <a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> | returns if <a href="#Quad">Quad</a> is very small | -| <a href="#SkPath_addArc">addArc</a> | adds one <a href="#Contour">Contour</a> containing <a href="#Arc">Arc</a> | -| <a href="#SkPath_addCircle">addCircle</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Circle">Circle</a> | -| <a href="#SkPath_addOval">addOval</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Oval">Oval</a> | -| <a href="#SkPath_addPath">addPath</a> | adds contents of <a href="#Path">Path</a> | -| <a href="#SkPath_addPoly">addPoly</a> | adds one <a href="#Contour">Contour</a> containing connected lines | -| <a href="#SkPath_addRRect">addRRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> | -| <a href="#SkPath_addRect">addRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkPath_addRoundRect">addRoundRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> with common corner radii | -| <a href="#SkPath_arcTo">arcTo</a> | appends <a href="#Arc">Arc</a> | -| <a href="#SkPath_close">close</a> | makes last <a href="#Contour">Contour</a> a loop | -| <a href="#SkPath_computeTightBounds">computeTightBounds</a> | returns extent of geometry | -| <a href="#SkPath_conicTo">conicTo</a> | appends <a href="#Conic">Conic</a> | -| <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> | returns true if <a href="SkRect_Reference#Rect">Rect</a> may be inside | -| <a href="#SkPath_contains">contains</a> | returns if <a href="SkPoint_Reference#Point">Point</a> is in fill area | -| <a href="#SkPath_countPoints">countPoints</a> | returns <a href="#Point_Array">Point Array</a> length | -| <a href="#SkPath_countVerbs">countVerbs</a> | returns <a href="#Verb_Array">Verb Array</a> length | -| <a href="#SkPath_cubicTo">cubicTo</a> | appends <a href="#Cubic">Cubic</a> | -| <a href="#SkPath_dump_2">dump</a> | sends text representation using floats to standard output | -| <a href="#SkPath_dumpHex">dumpHex</a> | sends text representation using hexadecimal to standard output | -| <a href="#SkPath_getBounds">getBounds</a> | returns maximum and minimum of <a href="#Point_Array">Point Array</a> | -| <a href="#SkPath_getConvexity">getConvexity</a> | returns geometry convexity, computing if necessary | -| <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> | returns geometry convexity if known | -| <a href="#SkPath_getFillType">getFillType</a> | returns <a href="#Fill_Type">Fill Type</a>: winding, even-odd, inverse | -| <a href="#SkPath_getGenerationID">getGenerationID</a> | returns unique ID | -| <a href="#SkPath_getLastPt">getLastPt</a> | returns <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_getPoint">getPoint</a> | returns entry from <a href="#Point_Array">Point Array</a> | -| <a href="#SkPath_getPoints">getPoints</a> | returns <a href="#Point_Array">Point Array</a> | -| <a href="#SkPath_getSegmentMasks">getSegmentMasks</a> | returns types in <a href="#Verb_Array">Verb Array</a> | -| <a href="#SkPath_getVerbs">getVerbs</a> | returns <a href="#Verb_Array">Verb Array</a> | -| <a href="#SkPath_incReserve">incReserve</a> | reserves space for additional data | -| <a href="#SkPath_interpolate">interpolate</a> | interpolates between <a href="#Path">Path</a> pair | -| <a href="#SkPath_isConvex">isConvex</a> | returns if geometry is convex | -| <a href="#SkPath_isEmpty">isEmpty</a> | returns if verb count is zero | -| <a href="#SkPath_isFinite">isFinite</a> | returns if all <a href="SkPoint_Reference#Point">Point</a> values are finite | -| <a href="#SkPath_isInterpolatable">isInterpolatable</a> | returns if pair contains equal counts of <a href="#Verb_Array">Verb Array</a> and <a href="#Conic_Weight">Weights</a> | -| <a href="#SkPath_isInverseFillType">isInverseFillType</a> | returns if <a href="#Fill_Type">Fill Type</a> fills outside geometry | -| <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> | returns if final <a href="#Contour">Contour</a> forms a loop | -| <a href="#SkPath_isLine">isLine</a> | returns if describes <a href="undocumented#Line">Line</a> | -| <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> | returns if describes <a href="SkRect_Reference#Rect">Rect</a> pair, one inside the other | -| <a href="#SkPath_isOval">isOval</a> | returns if describes <a href="undocumented#Oval">Oval</a> | -| <a href="#SkPath_isRRect">isRRect</a> | returns if describes <a href="undocumented#Round_Rect">Round Rect</a> | -| <a href="#SkPath_isRect">isRect</a> | returns if describes <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkPath_isValid">isValid</a> | returns if data is internally consistent | -| <a href="#SkPath_isVolatile">isVolatile</a> | returns if <a href="undocumented#Device">Device</a> should not cache | -| <a href="#SkPath_lineTo">lineTo</a> | appends <a href="undocumented#Line">Line</a> | -| <a href="#SkPath_moveTo">moveTo</a> | starts <a href="#Contour">Contour</a> | -| <a href="#SkPath_offset">offset</a> | translates <a href="#Point_Array">Point Array</a> | -| <a href="#SkPath_quadTo">quadTo</a> | appends <a href="#Quad">Quad</a> | -| <a href="#SkPath_rArcTo">rArcTo</a> | appends <a href="#Arc">Arc</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rConicTo">rConicTo</a> | appends <a href="#Conic">Conic</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rCubicTo">rCubicTo</a> | appends <a href="#Cubic">Cubic</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rLineTo">rLineTo</a> | appends <a href="undocumented#Line">Line</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rMoveTo">rMoveTo</a> | starts <a href="#Contour">Contour</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rQuadTo">rQuadTo</a> | appends <a href="#Quad">Quad</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_readFromMemory">readFromMemory</a> | Initializes from buffer | -| <a href="#SkPath_reset">reset</a> | removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a>; frees memory | -| <a href="#SkPath_reverseAddPath">reverseAddPath</a> | adds contents of <a href="#Path">Path</a> back to front | -| <a href="#SkPath_rewind">rewind</a> | removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a>, keeping memory | -| <a href="#SkPath_serialize">serialize</a> | copies data to buffer | -| <a href="#SkPath_setConvexity">setConvexity</a> | sets if geometry is convex to avoid future computation | -| <a href="#SkPath_setFillType">setFillType</a> | sets <a href="#Fill_Type">Fill Type</a>: winding, even-odd, inverse | -| <a href="#SkPath_setIsVolatile">setIsVolatile</a> | sets if <a href="undocumented#Device">Device</a> should not cache | -| <a href="#SkPath_setLastPt">setLastPt</a> | replaces <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_swap">swap</a> | exchanges <a href="#Path">Path</a> pair | -| <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> | toggles <a href="#Fill_Type">Fill Type</a> between inside and outside geometry | -| <a href="#SkPath_transform">transform</a> | applies <a href="SkMatrix_Reference#Matrix">Matrix</a> to <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Weights</a> | -| <a href="#SkPath_updateBoundsCache">updateBoundsCache</a> | refreshes result of <a href="#SkPath_getBounds">getBounds</a> | -| <a href="#SkPath_writeToMemory">writeToMemory</a> | copies data to buffer | - -## <a name="Verb"></a> Verb - -## <a name="SkPath_Verb"></a> Enum SkPath::Verb +Internally, <a href='#Path'>Path</a> lazily computes metrics likes bounds and convexity. Call +<a href='#SkPath_updateBoundsCache'>SkPath::updateBoundsCache</a> to make <a href='#Path'>Path</a> thread safe. + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Class'>Class Declarations</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>embedded class members</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkPath'>SkPath</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkPath global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Arc'>Arc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>part of <a href='undocumented#Oval'>Oval</a> or <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Build'>Build</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds points and verbs to path</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Conic'>Conic</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>conic section defined by three points and a weight</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Conic_Weight'>Conic Weight</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>strength of <a href='#Conic'>Conic</a> control <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Contour'>Contour</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>loop of lines and curves</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Contour_Zero_Length'>Contour Zero Length</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>consideration when contour has no length</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Convexity'>Convexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>if <a href='#Path'>Path</a> is concave or convex</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Cubic'>Cubic</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>curve described by third-order polynomial</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Direction'>Direction</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contour orientation, clockwise or counterclockwise</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Fill_Type'>Fill Type</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>fill rule, normal and inverted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Generation_ID'>Generation ID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>value reflecting contents change</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Interpolate'>Interpolate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>weighted average of <a href='#Path'>Path</a> pair</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Last_Point'>Last Point</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>final <a href='SkPoint_Reference#Point'>Point</a> in <a href='#Contour'>Contour</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Point_Array'>Point Array</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>end points and control points for lines and curves</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>metrics and attributes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Quad'>Quad</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>curve described by second-order polynomial</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Transform'>Transform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>modify all points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Verb'>Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>line and curve type</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Verb_Array'>Verb Array</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>line and curve type for points</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Volatile'>Volatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>caching attribute</td> + </tr> +</table> + + +## <a name='Constant'>Constant</a> + + +SkPath related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_AddPathMode'>AddPathMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#SkPath_addPath'>addPath</a> options</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_ArcSize'>ArcSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>used by <a href='#SkPath_arcTo'>arcTo</a> variation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Convexity'>Convexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Path'>Path</a> is convex or concave</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Direction'>Direction</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Contour'>Contour</a> clockwise or counterclockwise</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_FillType'>FillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets winding rule and inverse fill</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_SegmentMask'>SegmentMask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPath_Verb'>Verb</a> types in <a href='#Path'>Path</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Verb'>Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>controls how <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Points</a> are interpreted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appended to destination unaltered</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kCCW_Direction'>kCCW Direction</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contour travels counterclockwise</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kCW_Direction'>kCW Direction</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contour travels clockwise</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kClose_Verb'>kClose Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>closes <a href='#Contour'>Contour</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kConcave_Convexity'>kConcave Convexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>more than one <a href='#Contour'>Contour</a>, or a geometry with indentations</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kConic_SegmentMask'>kConic SegmentMask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contains one or more <a href='#Conic'>Conics</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kConic_Verb'>kConic Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#Conic'>Conic</a> from <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>one <a href='#Contour'>Contour</a> made of a simple geometry without indentations</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kCubic_SegmentMask'>kCubic SegmentMask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contains one or more <a href='#Cubic'>Cubics</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kCubic_Verb'>kCubic Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#Cubic'>Cubic</a> from <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kDone_Verb'>kDone Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>terminates <a href='#Path'>Path</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>is enclosed by an odd number of <a href='#Contour'>Contours</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>add line if prior <a href='#Contour'>Contour</a> is not closed</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>is enclosed by an even number of <a href='#Contour'>Contours</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>is enclosed by a zero sum of <a href='#Contour'>Contour</a> <a href='#Direction'>Directions</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kLarge_ArcSize'>kLarge ArcSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger of <a href='#Arc'>Arc</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kLine_SegmentMask'>kLine SegmentMask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contains one or more <a href='undocumented#Line'>Lines</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kLine_Verb'>kLine Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='undocumented#Line'>Line</a> from <a href='#Last_Point'>Last Point</a> to next <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kMove_Verb'>kMove Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>starts new <a href='#Contour'>Contour</a> at next <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kQuad_SegmentMask'>kQuad SegmentMask</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>contains one or more <a href='#Quad'>Quads</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kQuad_Verb'>kQuad Verb</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#Quad'>Quad</a> from <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kSmall_ArcSize'>kSmall ArcSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller of <a href='#Arc'>Arc</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>indicates <a href='#SkPath_Convexity'>Convexity</a> has not been determined</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_kWinding_FillType'>kWinding FillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>is enclosed by a non-zero sum of <a href='#Contour'>Contour</a> <a href='#Direction'>Directions</a></td> + </tr> +</table> + + +## <a name='Class'>Class</a> + + +SkPath uses C++ classes to declare the public data structures and interfaces. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_Iter'>Iter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>data iterator</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_RawIter'>RawIter</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>raw data iterator</td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkPath can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_empty_constructor'>SkPath()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_copy_const_SkPath'>SkPath(const SkPath& path)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>removes <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a>; frees memory</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rewind'>rewind</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>removes <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a>, keeping memory</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_destructor'>~SkPath()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>decreases <a href='undocumented#Reference_Count'>Reference Count</a> of owned objects</td> + </tr> +</table> + + +## <a name='Operator'>Operator</a> + + +SkPath operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_notequal_operator'>operator!=(const SkPath& a, const SkPath& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares paths for inequality</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_copy_operator'>operator=(const SkPath& path)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes a shallow copy</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_equal_operator'>operator==(const SkPath& a, const SkPath& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>compares paths for equality</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_swap'>swap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Path'>Path</a> pair</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkPath member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_ConvertConicToQuads'>ConvertConicToQuads</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>approximates <a href='#Conic'>Conic</a> with <a href='#Quad'>Quad</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Fill_Type'>Fill Type</a> representing inside geometry</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Cubic'>Cubic</a> is very small</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsInverseFillType'>IsInverseFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Fill_Type'>Fill Type</a> represents outside geometry</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Line'>Line</a> is very small</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Quad'>Quad</a> is very small</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addArc'>addArc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='#Arc'>Arc</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addCircle'>addCircle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addOval'>addOval</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Oval'>Oval</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPath'>addPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds contents of <a href='#Path'>Path</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPoly'>addPoly</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing connected lines</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRRect'>addRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRect'>addRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRoundRect'>addRoundRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Round_Rect'>Round Rect</a> with common corner radii</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_arcTo'>arcTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Arc'>Arc</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_close'>close</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes last <a href='#Contour'>Contour</a> a loop</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_computeTightBounds'>computeTightBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns extent of geometry</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_conicTo'>conicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Conic'>Conic</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkRect_Reference#Rect'>Rect</a> may be inside</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_contains'>contains</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='SkPoint_Reference#Point'>Point</a> is in fill area</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_countPoints'>countPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Point_Array'>Point Array</a> length</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_countVerbs'>countVerbs</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Verb_Array'>Verb Array</a> length</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_cubicTo'>cubicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Cubic'>Cubic</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dumpHex'>dumpHex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using hexadecimal to standard output</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getBounds'>getBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns maximum and minimum of <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getConvexity'>getConvexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns geometry convexity, computing if necessary</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns geometry convexity if known</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getFillType'>getFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Fill_Type'>Fill Type</a>: winding, even-odd, inverse</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getGenerationID'>getGenerationID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getLastPt'>getLastPt</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getPoint'>getPoint</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns entry from <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getPoints'>getPoints</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getSegmentMasks'>getSegmentMasks</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns types in <a href='#Verb_Array'>Verb Array</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getVerbs'>getVerbs</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Verb_Array'>Verb Array</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_incReserve'>incReserve</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reserves space for additional data</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_interpolate'>interpolate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>interpolates between <a href='#Path'>Path</a> pair</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isConvex'>isConvex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if geometry is convex</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if verb count is zero</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if all <a href='SkPoint_Reference#Point'>Point</a> values are finite</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isInterpolatable'>isInterpolatable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if pair contains equal counts of <a href='#Verb_Array'>Verb Array</a> and <a href='#Conic_Weight'>Weights</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isInverseFillType'>isInverseFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Fill_Type'>Fill Type</a> fills outside geometry</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isLastContourClosed'>isLastContourClosed</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if final <a href='#Contour'>Contour</a> forms a loop</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isLine'>isLine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='undocumented#Line'>Line</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isNestedFillRects'>isNestedFillRects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='SkRect_Reference#Rect'>Rect</a> pair, one inside the other</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isOval'>isOval</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='undocumented#Oval'>Oval</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isRRect'>isRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isRect'>isRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isValid'>isValid</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if data is internally consistent</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isVolatile'>isVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Device'>Device</a> should not cache</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_lineTo'>lineTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='undocumented#Line'>Line</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_moveTo'>moveTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>starts <a href='#Contour'>Contour</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_quadTo'>quadTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Quad'>Quad</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rArcTo'>rArcTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Arc'>Arc</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rConicTo'>rConicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Conic'>Conic</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rCubicTo'>rCubicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Cubic'>Cubic</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rLineTo'>rLineTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='undocumented#Line'>Line</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rMoveTo'>rMoveTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>starts <a href='#Contour'>Contour</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rQuadTo'>rQuadTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Quad'>Quad</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_readFromMemory'>readFromMemory</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>initializes from buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>removes <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a>; frees memory</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_reverseAddPath'>reverseAddPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds contents of <a href='#Path'>Path</a> back to front</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rewind'>rewind</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>removes <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a>, keeping memory</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_serialize'>serialize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies data to buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setConvexity'>setConvexity</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets if geometry is convex to avoid future computation</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setFillType'>setFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='#Fill_Type'>Fill Type</a>: winding, even-odd, inverse</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setIsVolatile'>setIsVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets if <a href='undocumented#Device'>Device</a> should not cache</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setLastPt'>setLastPt</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_swap'>swap</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Path'>Path</a> pair</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>toggles <a href='#Fill_Type'>Fill Type</a> between inside and outside geometry</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_transform'>transform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>applies <a href='SkMatrix_Reference#Matrix'>Matrix</a> to <a href='#Point_Array'>Point Array</a> and <a href='#Conic_Weight'>Weights</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_updateBoundsCache'>updateBoundsCache</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>refreshes result of <a href='#SkPath_getBounds'>getBounds</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_writeToMemory'>writeToMemory</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies data to buffer</td> + </tr> +</table> + + +## <a name='Verb'>Verb</a> + +## <a name='SkPath_Verb'>Enum SkPath::Verb</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#Verb">Verb</a> { - <a href="#SkPath_kMove_Verb">kMove Verb</a>, - <a href="#SkPath_kLine_Verb">kLine Verb</a>, - <a href="#SkPath_kQuad_Verb">kQuad Verb</a>, - <a href="#SkPath_kConic_Verb">kConic Verb</a>, - <a href="#SkPath_kCubic_Verb">kCubic Verb</a>, - <a href="#SkPath_kClose_Verb">kClose Verb</a>, - <a href="#SkPath_kDone_Verb">kDone Verb</a>, + enum <a href='#SkPath_Verb'>Verb</a> { + <a href='#SkPath_kMove_Verb'>kMove Verb</a>, + <a href='#SkPath_kLine_Verb'>kLine Verb</a>, + <a href='#SkPath_kQuad_Verb'>kQuad Verb</a>, + <a href='#SkPath_kConic_Verb'>kConic Verb</a>, + <a href='#SkPath_kCubic_Verb'>kCubic Verb</a>, + <a href='#SkPath_kClose_Verb'>kClose Verb</a>, + <a href='#SkPath_kDone_Verb'>kDone Verb</a>, }; </pre> -<a href="#Verb">Verb</a> instructs <a href="#Path">Path</a> how to interpret one or more <a href="SkPoint_Reference#Point">Point</a> and optional <a href="#Conic_Weight">Conic Weight</a>; -manage <a href="#Contour">Contour</a>, and terminate <a href="#Path">Path</a>. +<a href='#SkPath_Verb'>Verb</a> instructs <a href='#Path'>Path</a> how to interpret one or more <a href='SkPoint_Reference#Point'>Point</a> and optional <a href='#Conic_Weight'>Conic Weight</a>; +manage <a href='#Contour'>Contour</a>, and terminate <a href='#Path'>Path</a>. ### Constants -<table> - <tr> - <td><a name="SkPath_kMove_Verb"> <code><strong>SkPath::kMove_Verb </strong></code> </a></td><td>0</td><td>Starts new <a href="#Contour">Contour</a> at next <a href="SkPoint_Reference#Point">Point</a>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kMove_Verb'><code>SkPath::kMove_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Consecutive <a href='#SkPath_kMove_Verb'>kMove Verb</a> are preserved but all but the last <a href='#SkPath_kMove_Verb'>kMove Verb</a> is +ignored. <a href='#SkPath_kMove_Verb'>kMove Verb</a> after other <a href='#Verb'>Verbs</a> implicitly closes the previous <a href='#Contour'>Contour</a> +if <a href='SkPaint_Reference#SkPaint_kFill_Style'>SkPaint::kFill Style</a> is set when drawn; otherwise, stroke is drawn open. +<a href='#SkPath_kMove_Verb'>kMove Verb</a> as the last <a href='#SkPath_Verb'>Verb</a> is preserved but ignored. </td> </tr> <tr> - <td><a name="SkPath_kLine_Verb"> <code><strong>SkPath::kLine_Verb </strong></code> </a></td><td>1</td><td>Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to next <a href="SkPoint_Reference#Point">Point</a>. -<a href="undocumented#Line">Line</a> is a straight segment from <a href="SkPoint_Reference#Point">Point</a> to <a href="SkPoint_Reference#Point">Point</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kLine_Verb'><code>SkPath::kLine_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='undocumented#Line'>Line</a> is a straight segment from <a href='SkPoint_Reference#Point'>Point</a> to <a href='SkPoint_Reference#Point'>Point</a>. Consecutive <a href='#SkPath_kLine_Verb'>kLine Verb</a> +extend <a href='#Contour'>Contour</a>. <a href='#SkPath_kLine_Verb'>kLine Verb</a> at same position as prior <a href='#SkPath_kMove_Verb'>kMove Verb</a> is +preserved, and draws <a href='SkPoint_Reference#Point'>Point</a> if <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a> is set, and +<a href='SkPaint_Reference#SkPaint_Cap'>SkPaint::Cap</a> is <a href='SkPaint_Reference#SkPaint_kSquare_Cap'>SkPaint::kSquare Cap</a> or <a href='SkPaint_Reference#SkPaint_kRound_Cap'>SkPaint::kRound Cap</a>. <a href='#SkPath_kLine_Verb'>kLine Verb</a> +at same position as prior line or curve <a href='#SkPath_Verb'>Verb</a> is preserved but is ignored. </td> </tr> - <tr> - <td><a name="SkPath_kQuad_Verb"> <code><strong>SkPath::kQuad_Verb </strong></code> </a></td><td>2</td><td>Adds <a href="#Quad">Quad</a> from <a href="#Last_Point">Last Point</a>, using control <a href="SkPoint_Reference#Point">Point</a>, and end <a href="SkPoint_Reference#Point">Point</a>. -<a href="#Quad">Quad</a> is a parabolic section within tangents from <a href="#Last_Point">Last Point</a> to control <a href="SkPoint_Reference#Point">Point</a>, -and control <a href="SkPoint_Reference#Point">Point</a> to end <a href="SkPoint_Reference#Point">Point</a>. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kQuad_Verb'><code>SkPath::kQuad_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Adds <a href='#Quad'>Quad</a> from <a href='#Last_Point'>Last Point</a>, using control <a href='SkPoint_Reference#Point'>Point</a>, and end <a href='SkPoint_Reference#Point'>Point</a>. +<a href='#Quad'>Quad</a> is a parabolic section within tangents from <a href='#Last_Point'>Last Point</a> to control <a href='SkPoint_Reference#Point'>Point</a>, +and control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>. </td> </tr> <tr> - <td><a name="SkPath_kConic_Verb"> <code><strong>SkPath::kConic_Verb </strong></code> </a></td><td>3</td><td>Adds <a href="#Conic">Conic</a> from <a href="#Last_Point">Last Point</a>, using control <a href="SkPoint_Reference#Point">Point</a>, end <a href="SkPoint_Reference#Point">Point</a>, and <a href="#Conic_Weight">Conic Weight</a>. -<a href="#Conic">Conic</a> is a elliptical, parabolic, or hyperbolic section within tangents -from <a href="#Last_Point">Last Point</a> to control <a href="SkPoint_Reference#Point">Point</a>, and control <a href="SkPoint_Reference#Point">Point</a> to end <a href="SkPoint_Reference#Point">Point</a>, constrained -by <a href="#Conic_Weight">Conic Weight</a>. <a href="#Conic_Weight">Conic Weight</a> less than one is elliptical; equal to one is -parabolic (and identical to <a href="#Quad">Quad</a>); greater than one hyperbolic. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConic_Verb'><code>SkPath::kConic_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Adds <a href='#Conic'>Conic</a> from <a href='#Last_Point'>Last Point</a>, using control <a href='SkPoint_Reference#Point'>Point</a>, end <a href='SkPoint_Reference#Point'>Point</a>, and <a href='#Conic_Weight'>Conic Weight</a>. +<a href='#Conic'>Conic</a> is a elliptical, parabolic, or hyperbolic section within tangents +from <a href='#Last_Point'>Last Point</a> to control <a href='SkPoint_Reference#Point'>Point</a>, and control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>, constrained +by <a href='#Conic_Weight'>Conic Weight</a>. <a href='#Conic_Weight'>Conic Weight</a> less than one is elliptical; equal to one is +parabolic (and identical to <a href='#Quad'>Quad</a>); greater than one hyperbolic. </td> </tr> - <tr> - <td><a name="SkPath_kCubic_Verb"> <code><strong>SkPath::kCubic_Verb </strong></code> </a></td><td>4</td><td>Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a>, using two control <a href="SkPoint_Reference#Point">Points</a>, and end <a href="SkPoint_Reference#Point">Point</a>. -<a href="#Cubic">Cubic</a> is a third-order Bezier_Curve section within tangents from <a href="#Last_Point">Last Point</a> -to first control <a href="SkPoint_Reference#Point">Point</a>, and from second control <a href="SkPoint_Reference#Point">Point</a> to end <a href="SkPoint_Reference#Point">Point</a>. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCubic_Verb'><code>SkPath::kCubic_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Adds <a href='#Cubic'>Cubic</a> from <a href='#Last_Point'>Last Point</a>, using two control <a href='SkPoint_Reference#Point'>Points</a>, and end <a href='SkPoint_Reference#Point'>Point</a>. +<a href='#Cubic'>Cubic</a> is a third-order Bezier_Curve section within tangents from <a href='#Last_Point'>Last Point</a> +to first control <a href='SkPoint_Reference#Point'>Point</a>, and from second control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>. </td> </tr> <tr> - <td><a name="SkPath_kClose_Verb"> <code><strong>SkPath::kClose_Verb </strong></code> </a></td><td>5</td><td>Closes <a href="#Contour">Contour</a>, connecting <a href="#Last_Point">Last Point</a> to <a href="#SkPath_kMove_Verb">kMove Verb</a> <a href="SkPoint_Reference#Point">Point</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kClose_Verb'><code>SkPath::kClose_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Closes <a href='#Contour'>Contour</a>, connecting <a href='#Last_Point'>Last Point</a> to <a href='#SkPath_kMove_Verb'>kMove Verb</a> <a href='SkPoint_Reference#Point'>Point</a>. Consecutive +<a href='#SkPath_kClose_Verb'>kClose Verb</a> are preserved but only first has an effect. <a href='#SkPath_kClose_Verb'>kClose Verb</a> after +<a href='#SkPath_kMove_Verb'>kMove Verb</a> has no effect. </td> </tr> - <tr> - <td><a name="SkPath_kDone_Verb"> <code><strong>SkPath::kDone_Verb </strong></code> </a></td><td>6</td><td>Terminates <a href="#Path">Path</a>. Not in <a href="#Verb_Array">Verb Array</a>, but returned by <a href="#Path">Path</a> iterator. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kDone_Verb'><code>SkPath::kDone_Verb</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>6</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Not in <a href='#Verb_Array'>Verb Array</a>, but returned by <a href='#Path'>Path</a> iterator. </td> </tr> -Each <a href="#Verb">Verb</a> has zero or more <a href="SkPoint_Reference#Point">Points</a> stored in <a href="#Path">Path</a>. -<a href="#Path">Path</a> iterator returns complete curve descriptions, duplicating shared <a href="SkPoint_Reference#Point">Points</a> +Each <a href='#SkPath_Verb'>Verb</a> has zero or more <a href='SkPoint_Reference#Point'>Points</a> stored in <a href='#Path'>Path</a>. +<a href='#Path'>Path</a> iterator returns complete curve descriptions, duplicating shared <a href='SkPoint_Reference#Point'>Points</a> for consecutive entries. </table> -| <a href="#Verb">Verb</a> | Allocated <a href="SkPoint_Reference#Point">Points</a> | Iterated <a href="SkPoint_Reference#Point">Points</a> | <a href="#Conic_Weight">Weights</a> | +| <a href='#SkPath_Verb'>Verb</a> | Allocated <a href='SkPoint_Reference#Point'>Points</a> | Iterated <a href='SkPoint_Reference#Point'>Points</a> | <a href='#Conic_Weight'>Weights</a> | | --- | --- | --- | --- | -| <a href="#SkPath_kMove_Verb">kMove Verb</a> | 1 | 1 | 0 | -| <a href="#SkPath_kLine_Verb">kLine Verb</a> | 1 | 2 | 0 | -| <a href="#SkPath_kQuad_Verb">kQuad Verb</a> | 2 | 3 | 0 | -| <a href="#SkPath_kConic_Verb">kConic Verb</a> | 2 | 3 | 1 | -| <a href="#SkPath_kCubic_Verb">kCubic Verb</a> | 3 | 4 | 0 | -| <a href="#SkPath_kClose_Verb">kClose Verb</a> | 0 | 1 | 0 | -| <a href="#SkPath_kDone_Verb">kDone Verb</a> | -- | 0 | 0 | +| <a href='#SkPath_kMove_Verb'>kMove Verb</a> | 1 | 1 | 0 | +| <a href='#SkPath_kLine_Verb'>kLine Verb</a> | 1 | 2 | 0 | +| <a href='#SkPath_kQuad_Verb'>kQuad Verb</a> | 2 | 3 | 0 | +| <a href='#SkPath_kConic_Verb'>kConic Verb</a> | 2 | 3 | 1 | +| <a href='#SkPath_kCubic_Verb'>kCubic Verb</a> | 3 | 4 | 0 | +| <a href='#SkPath_kClose_Verb'>kClose Verb</a> | 0 | 1 | 0 | +| <a href='#SkPath_kDone_Verb'>kDone Verb</a> | -- | 0 | 0 | ### Example @@ -336,39 +854,46 @@ verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConi </fiddle-embed></div> +## <a name='Direction'>Direction</a> - -## <a name="Direction"></a> Direction - -## <a name="SkPath_Direction"></a> Enum SkPath::Direction +## <a name='SkPath_Direction'>Enum SkPath::Direction</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#Direction">Direction</a> { - <a href="#SkPath_kCW_Direction">kCW Direction</a>, - <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, + enum <a href='#SkPath_Direction'>Direction</a> { + <a href='#SkPath_kCW_Direction'>kCW Direction</a>, + <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>, }; </pre> -<a href="#Direction">Direction</a> describes whether <a href="#Contour">Contour</a> is clockwise or counterclockwise. -When <a href="#Path">Path</a> contains multiple overlapping <a href="#Contour">Contours</a>, <a href="#Direction">Direction</a> together with -<a href="#Fill_Type">Fill Type</a> determines whether overlaps are filled or form holes. +<a href='#SkPath_Direction'>Direction</a> describes whether <a href='#Contour'>Contour</a> is clockwise or counterclockwise. +When <a href='#Path'>Path</a> contains multiple overlapping <a href='#Contour'>Contours</a>, <a href='#SkPath_Direction'>Direction</a> together with +<a href='#Fill_Type'>Fill Type</a> determines whether overlaps are filled or form holes. -<a href="#Direction">Direction</a> also determines how <a href="#Contour">Contour</a> is measured. For instance, dashing -measures along <a href="#Path">Path</a> to determine where to start and stop stroke; <a href="#Direction">Direction</a> +<a href='#SkPath_Direction'>Direction</a> also determines how <a href='#Contour'>Contour</a> is measured. For instance, dashing +measures along <a href='#Path'>Path</a> to determine where to start and stop stroke; <a href='#SkPath_Direction'>Direction</a> will change dashed results as it steps clockwise or counterclockwise. -Closed <a href="#Contour">Contours</a> like <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> added with -<a href="#SkPath_kCW_Direction">kCW Direction</a> travel clockwise; the same added with <a href="#SkPath_kCCW_Direction">kCCW Direction</a> +Closed <a href='#Contour'>Contours</a> like <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Round_Rect'>Round Rect</a>, <a href='undocumented#Circle'>Circle</a>, and <a href='undocumented#Oval'>Oval</a> added with +<a href='#SkPath_kCW_Direction'>kCW Direction</a> travel clockwise; the same added with <a href='#SkPath_kCCW_Direction'>kCCW Direction</a> travel counterclockwise. ### Constants -<table> - <tr> - <td><a name="SkPath_kCW_Direction"> <code><strong>SkPath::kCW_Direction </strong></code> </a></td><td>0</td><td><a href="#Contour">Contour</a> travels in a clockwise direction</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCW_Direction'><code>SkPath::kCW_Direction</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +contour travels clockwise</td> </tr> <tr> - <td><a name="SkPath_kCCW_Direction"> <code><strong>SkPath::kCCW_Direction </strong></code> </a></td><td>1</td><td><a href="#Contour">Contour</a> travels in a counterclockwise direction</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCCW_Direction'><code>SkPath::kCCW_Direction</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +contour travels counterclockwise</td> </tr> </table> @@ -378,23 +903,21 @@ travel counterclockwise. ### See Also -<a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_rArcTo">rArcTo</a> <a href="#SkPath_isRect">isRect</a> <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> <a href="#SkPath_addOval">addOval</a><sup><a href="#SkPath_addOval_2">[2]</a></sup> - +<a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkPath_rArcTo'>rArcTo</a> <a href='#SkPath_isRect'>isRect</a> <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a> <a href='#SkPath_addRect'>addRect</a><sup><a href='#SkPath_addRect_2'>[2]</a></sup><sup><a href='#SkPath_addRect_3'>[3]</a></sup> <a href='#SkPath_addOval'>addOval</a><sup><a href='#SkPath_addOval_2'>[2]</a></sup> - -<a name="SkPath_empty_constructor"></a> +<a name='SkPath_empty_constructor'></a> ## SkPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPath() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath'>SkPath</a>() </pre> -By default, <a href="#Path">Path</a> has no <a href="#Verb">Verbs</a>, no <a href="SkPoint_Reference#Point">Points</a>, and no <a href="#Conic_Weight">Weights</a>. -<a href="#Fill_Type">Fill Type</a> is set to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. +By default, <a href='#Path'>Path</a> has no <a href='#Verb'>Verbs</a>, no <a href='SkPoint_Reference#Point'>Points</a>, and no <a href='#Conic_Weight'>Weights</a>. +<a href='#Fill_Type'>Fill Type</a> is set to <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>. ### Return Value -empty <a href="#Path">Path</a> +empty <a href='#Path'>Path</a> ### Example @@ -410,39 +933,39 @@ path is empty ### See Also -<a href="#SkPath_reset">reset</a> <a href="#SkPath_rewind">rewind</a> +<a href='#SkPath_reset'>reset</a> <a href='#SkPath_rewind'>rewind</a> --- -<a name="SkPath_copy_const_SkPath"></a> +<a name='SkPath_copy_const_SkPath'></a> ## SkPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPath(const SkPath& path) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath'>SkPath</a>(const <a href='#SkPath'>SkPath</a>& path) </pre> -Copy constructor makes two paths identical by value. Internally, <a href="#SkPath_copy_const_SkPath_path">path</a> and -the returned result share pointer values. The underlying <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a> -and <a href="#Conic_Weight">Weights</a> are copied when modified. +Copy constructor makes two paths identical by value. Internally, <a href='#SkPath_copy_const_SkPath_path'>path</a> and +the returned result share pointer values. The underlying <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a> +and <a href='#Conic_Weight'>Weights</a> are copied when modified. -Creating a <a href="#Path">Path</a> copy is very efficient and never allocates memory. -<a href="#Path">Paths</a> are always copied by value from the interface; the underlying shared +Creating a <a href='#Path'>Path</a> copy is very efficient and never allocates memory. +<a href='#Path'>Paths</a> are always copied by value from the interface; the underlying shared pointers are not exposed. ### Parameters -<table> <tr> <td><a name="SkPath_copy_const_SkPath_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Path">Path</a> to copy by value</td> +<table> <tr> <td><a name='SkPath_copy_const_SkPath_path'><code><strong>path</strong></code></a></td> + <td><a href='#Path'>Path</a> to copy by value</td> </tr> </table> ### Return Value -copy of <a href="#Path">Path</a> +copy of <a href='#Path'>Path</a> ### Example -<div><fiddle-embed name="647312aacd946c8a6eabaca797140432"><div>Modifying one <a href="#SkPath_copy_const_SkPath_path">path</a> does not effect another, even if they started as copies +<div><fiddle-embed name="647312aacd946c8a6eabaca797140432"><div>Modifying one <a href='#SkPath_copy_const_SkPath_path'>path</a> does not effect another, even if they started as copies of each other. </div> @@ -460,55 +983,55 @@ path2 verbs: 3 ### See Also -<a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> +<a href='#SkPath_copy_operator'>operator=(const SkPath& path)</a> --- -<a name="SkPath_destructor"></a> +<a name='SkPath_destructor'></a> ## ~SkPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -~SkPath() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_destructor'>~SkPath</a>() </pre> -Releases ownership of any shared data and deletes data if <a href="#Path">Path</a> is sole owner. +Releases ownership of any shared data and deletes data if <a href='#Path'>Path</a> is sole owner. ### Example -<div><fiddle-embed name="01ad6be9b7d15a2217daea273eb3d466"><div>delete calls <a href="#Path">Path</a> Destructor, but copy of original in path2 is unaffected. +<div><fiddle-embed name="01ad6be9b7d15a2217daea273eb3d466"><div>delete calls <a href='#Path'>Path</a> Destructor, but copy of original in path2 is unaffected. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_empty_constructor">SkPath()</a> <a href="#SkPath_copy_const_SkPath">SkPath(const SkPath& path)</a> <a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> +<a href='#SkPath_empty_constructor'>SkPath()</a> <a href='#SkPath_copy_const_SkPath'>SkPath(const SkPath& path)</a> <a href='#SkPath_copy_operator'>operator=(const SkPath& path)</a> --- -<a name="SkPath_copy_operator"></a> +<a name='SkPath_copy_operator'></a> ## operator= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPath& operator=(const SkPath& path) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath'>SkPath</a>& <a href='#SkPath_copy_operator'>operator=(const SkPath& path)</a> </pre> -<a href="#Path">Path</a> assignment makes two paths identical by value. Internally, assignment -shares pointer values. The underlying <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Weights</a> +<a href='#Path'>Path</a> assignment makes two paths identical by value. Internally, assignment +shares pointer values. The underlying <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a> and <a href='#Conic_Weight'>Weights</a> are copied when modified. -Copying <a href="#Path">Paths</a> by assignment is very efficient and never allocates memory. -<a href="#Path">Paths</a> are always copied by value from the interface; the underlying shared +Copying <a href='#Path'>Paths</a> by assignment is very efficient and never allocates memory. +<a href='#Path'>Paths</a> are always copied by value from the interface; the underlying shared pointers are not exposed. ### Parameters -<table> <tr> <td><a name="SkPath_copy_operator_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Weights</a>, and <a href="#Fill_Type">Fill Type</a> to copy</td> +<table> <tr> <td><a name='SkPath_copy_operator_path'><code><strong>path</strong></code></a></td> + <td><a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, <a href='#Conic_Weight'>Weights</a>, and <a href='#Fill_Type'>Fill Type</a> to copy</td> </tr> </table> ### Return Value -<a href="#Path">Path</a> copied by value +<a href='#Path'>Path</a> copied by value ### Example @@ -525,37 +1048,38 @@ path2 bounds = 10, 20, 30, 40 ### See Also -<a href="#SkPath_swap">swap</a> <a href="#SkPath_copy_const_SkPath">SkPath(const SkPath& path)</a> +<a href='#SkPath_swap'>swap</a> <a href='#SkPath_copy_const_SkPath'>SkPath(const SkPath& path)</a> --- -<a name="SkPath_equal_operator"></a> +<a name='SkPath_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkPath& a, const SkPath& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_equal_operator'>operator==(const SkPath& a, const SkPath& b)</a> </pre> -Compares <a href="#SkPath_equal_operator_a">a</a> and <a href="#SkPath_equal_operator_b">b</a>; returns true if <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a> +Compares <a href='#SkPath_equal_operator_a'>a</a> and <a href='#SkPath_equal_operator_b'>b</a>; returns true if <a href='#Fill_Type'>Fill Type</a>, <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a> are equivalent. ### Parameters -<table> <tr> <td><a name="SkPath_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Path">Path</a> to compare</td> - </tr> <tr> <td><a name="SkPath_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Path">Path</a> to compare</td> +<table> <tr> <td><a name='SkPath_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Path'>Path</a> to compare</td> + </tr> + <tr> <td><a name='SkPath_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Path'>Path</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> pair are equivalent +true if <a href='#Path'>Path</a> pair are equivalent ### Example -<div><fiddle-embed name="31883f51bb357f2ac5990d88f8b82e02"><div>Rewind removes <a href="#Verb_Array">Verb Array</a> but leaves storage; since storage is not compared, -<a href="#Path">Path</a> pair are equivalent. +<div><fiddle-embed name="31883f51bb357f2ac5990d88f8b82e02"><div>Rewind removes <a href='#Verb_Array'>Verb Array</a> but leaves storage; since storage is not compared, +<a href='#Path'>Path</a> pair are equivalent. </div> #### Example Output @@ -571,32 +1095,33 @@ reset one == two --- -<a name="SkPath_notequal_operator"></a> +<a name='SkPath_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkPath& a, const SkPath& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_notequal_operator'>operator!=(const SkPath& a, const SkPath& b)</a> </pre> -Compares <a href="#SkPath_notequal_operator_a">a</a> and <a href="#SkPath_notequal_operator_b">b</a>; returns true if <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a> +Compares <a href='#SkPath_notequal_operator_a'>a</a> and <a href='#SkPath_notequal_operator_b'>b</a>; returns true if <a href='#Fill_Type'>Fill Type</a>, <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a> are not equivalent. ### Parameters -<table> <tr> <td><a name="SkPath_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Path">Path</a> to compare</td> - </tr> <tr> <td><a name="SkPath_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Path">Path</a> to compare</td> +<table> <tr> <td><a name='SkPath_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Path'>Path</a> to compare</td> + </tr> + <tr> <td><a name='SkPath_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Path'>Path</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> pair are not equivalent +true if <a href='#Path'>Path</a> pair are not equivalent ### Example -<div><fiddle-embed name="0c6870ba1cea85ce6da5abd489c23d83"><div><a href="#Path">Path</a> pair are equal though their convexity is not equal. +<div><fiddle-embed name="0c6870ba1cea85ce6da5abd489c23d83"><div><a href='#Path'>Path</a> pair are equal though their convexity is not equal. </div> #### Example Output @@ -612,55 +1137,119 @@ convexity != --- -## <a name="Property"></a> Property - -| name | description | -| --- | --- | -| <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> | returns if <a href="#Cubic">Cubic</a> is very small | -| <a href="#SkPath_IsInverseFillType">IsInverseFillType</a> | returns if <a href="#Fill_Type">Fill Type</a> represents outside geometry | -| <a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> | returns if <a href="undocumented#Line">Line</a> is very small | -| <a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> | returns if <a href="#Quad">Quad</a> is very small | -| <a href="#SkPath_computeTightBounds">computeTightBounds</a> | returns extent of geometry | -| <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> | returns true if <a href="SkRect_Reference#Rect">Rect</a> may be inside | -| <a href="#SkPath_contains">contains</a> | returns if <a href="SkPoint_Reference#Point">Point</a> is in fill area | -| <a href="#SkPath_getBounds">getBounds</a> | returns maximum and minimum of <a href="#Point_Array">Point Array</a> | -| <a href="#SkPath_getLastPt">getLastPt</a> | returns <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_isEmpty">isEmpty</a> | returns if verb count is zero | -| <a href="#SkPath_isFinite">isFinite</a> | returns if all <a href="SkPoint_Reference#Point">Point</a> values are finite | -| <a href="#SkPath_isInterpolatable">isInterpolatable</a> | returns if pair contains equal counts of <a href="#Verb_Array">Verb Array</a> and <a href="#Conic_Weight">Weights</a> | -| <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> | returns if final <a href="#Contour">Contour</a> forms a loop | -| <a href="#SkPath_isLine">isLine</a> | returns if describes <a href="undocumented#Line">Line</a> | -| <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> | returns if describes <a href="SkRect_Reference#Rect">Rect</a> pair, one inside the other | -| <a href="#SkPath_isOval">isOval</a> | returns if describes <a href="undocumented#Oval">Oval</a> | -| <a href="#SkPath_isRRect">isRRect</a> | returns if describes <a href="undocumented#Round_Rect">Round Rect</a> | -| <a href="#SkPath_isRect">isRect</a> | returns if describes <a href="SkRect_Reference#Rect">Rect</a> | -| <a href="#SkPath_isValid">isValid</a> | returns if data is internally consistent | -| <a href="#SkPath_isVolatile">isVolatile</a> | returns if <a href="undocumented#Device">Device</a> should not cache | - -<a name="SkPath_isInterpolatable"></a> +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Cubic'>Cubic</a> is very small</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsInverseFillType'>IsInverseFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Fill_Type'>Fill Type</a> represents outside geometry</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Line'>Line</a> is very small</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='#Quad'>Quad</a> is very small</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_computeTightBounds'>computeTightBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns extent of geometry</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkRect_Reference#Rect'>Rect</a> may be inside</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_contains'>contains</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='SkPoint_Reference#Point'>Point</a> is in fill area</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getBounds'>getBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns maximum and minimum of <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getLastPt'>getLastPt</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if verb count is zero</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if all <a href='SkPoint_Reference#Point'>Point</a> values are finite</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isInterpolatable'>isInterpolatable</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if pair contains equal counts of <a href='#Verb_Array'>Verb Array</a> and <a href='#Conic_Weight'>Weights</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isLastContourClosed'>isLastContourClosed</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if final <a href='#Contour'>Contour</a> forms a loop</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isLine'>isLine</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='undocumented#Line'>Line</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isNestedFillRects'>isNestedFillRects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='SkRect_Reference#Rect'>Rect</a> pair, one inside the other</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isOval'>isOval</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='undocumented#Oval'>Oval</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isRRect'>isRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isRect'>isRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if describes <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isValid'>isValid</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if data is internally consistent</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_isVolatile'>isVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns if <a href='undocumented#Device'>Device</a> should not cache</td> + </tr> +</table> + + +<a name='SkPath_isInterpolatable'></a> ## isInterpolatable -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isInterpolatable(const SkPath& compare) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isInterpolatable'>isInterpolatable</a>(const <a href='#SkPath'>SkPath</a>& compare) const </pre> -Return true if <a href="#Path">Paths</a> contain equal <a href="#Verb">Verbs</a> and equal <a href="#Conic_Weight">Weights</a>. -If <a href="#Path">Paths</a> contain one or more <a href="#Conic">Conics</a>, the <a href="#Conic_Weight">Weights</a> must match. +Return true if <a href='#Path'>Paths</a> contain equal <a href='#Verb'>Verbs</a> and equal <a href='#Conic_Weight'>Weights</a>. +If <a href='#Path'>Paths</a> contain one or more <a href='#Conic'>Conics</a>, the <a href='#Conic_Weight'>Weights</a> must match. -<a href="#SkPath_conicTo">conicTo</a> may add different <a href="#Verb">Verbs</a> depending on <a href="#Conic_Weight">Conic Weight</a>, so it is not -trivial to interpolate a pair of <a href="#Path">Paths</a> containing <a href="#Conic">Conics</a> with different -<a href="#Conic_Weight">Conic Weight</a> values. +<a href='#SkPath_conicTo'>conicTo</a> may add different <a href='#Verb'>Verbs</a> depending on <a href='#Conic_Weight'>Conic Weight</a>, so it is not +trivial to interpolate a pair of <a href='#Path'>Paths</a> containing <a href='#Conic'>Conics</a> with different +<a href='#Conic_Weight'>Conic Weight</a> values. ### Parameters -<table> <tr> <td><a name="SkPath_isInterpolatable_compare"> <code><strong>compare </strong></code> </a></td> <td> -<a href="#Path">Path</a> to <a href="#SkPath_isInterpolatable_compare">compare</a></td> +<table> <tr> <td><a name='SkPath_isInterpolatable_compare'><code><strong>compare</strong></code></a></td> + <td><a href='#Path'>Path</a> to <a href='#SkPath_isInterpolatable_compare'>compare</a></td> </tr> </table> ### Return Value -true if <a href="#Path">Paths</a> <a href="#Verb_Array">Verb Array</a> and <a href="#Conic_Weight">Weights</a> are equivalent +true if <a href='#Path'>Paths</a> <a href='#Verb_Array'>Verb Array</a> and <a href='#Conic_Weight'>Weights</a> are equivalent ### Example @@ -676,52 +1265,61 @@ paths are interpolatable ### See Also -<a href="#SkPath_isInterpolatable">isInterpolatable</a> +<a href='#SkPath_isInterpolatable'>isInterpolatable</a> --- -## <a name="Interpolate"></a> Interpolate +## <a name='Interpolate'>Interpolate</a> -| name | description | -| --- | --- | -| <a href="#SkPath_interpolate">interpolate</a> | interpolates between <a href="#Path">Path</a> pair | -<a name="SkPath_interpolate"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_interpolate'>interpolate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>interpolates between <a href='#Path'>Path</a> pair</td> + </tr> +</table> + + +<a name='SkPath_interpolate'></a> ## interpolate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_interpolate'>interpolate</a>(const <a href='#SkPath'>SkPath</a>& ending, <a href='undocumented#SkScalar'>SkScalar</a> weight, <a href='#SkPath'>SkPath</a>* out) const </pre> -<a href="#Interpolate">Interpolate</a> between <a href="#Path">Paths</a> with <a href="#Point_Array">Point Array</a> of equal size. -Copy <a href="#Verb_Array">Verb Array</a> and <a href="#Conic_Weight">Weights</a> to <a href="#SkPath_interpolate_out">out</a>, and set <a href="#SkPath_interpolate_out">out</a> <a href="#Point_Array">Point Array</a> to a weighted -average of this <a href="#Point_Array">Point Array</a> and <a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a>, using the formula: -(<a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> * <a href="#SkPath_interpolate_weight">weight</a>) + <a href="#SkPath_interpolate_ending">ending</a> <a href="SkPoint_Reference#Point">Point</a> * (1 - <a href="#SkPath_interpolate_weight">weight</a>) +<a href='#Interpolate'>Interpolate</a> between <a href='#Path'>Paths</a> with <a href='#Point_Array'>Point Array</a> of equal size. +Copy <a href='#Verb_Array'>Verb Array</a> and <a href='#Conic_Weight'>Weights</a> to <a href='#SkPath_interpolate_out'>out</a>, and set <a href='#SkPath_interpolate_out'>out</a> <a href='#Point_Array'>Point Array</a> to a weighted +average of this <a href='#Point_Array'>Point Array</a> and <a href='#SkPath_interpolate_ending'>ending</a> <a href='#Point_Array'>Point Array</a>, using the formula: +(<a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> * <a href='#SkPath_interpolate_weight'>weight</a>) + <a href='#SkPath_interpolate_ending'>ending</a> <a href='SkPoint_Reference#Point'>Point</a> * (1 - <a href='#SkPath_interpolate_weight'>weight</a>) . -<a href="#SkPath_interpolate_weight">weight</a> is most useful when between zero (<a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a>) and -one (this <a href="#Point_Array">Point Array</a>); will work with values outside of this +<a href='#SkPath_interpolate_weight'>weight</a> is most useful when between zero (<a href='#SkPath_interpolate_ending'>ending</a> <a href='#Point_Array'>Point Array</a>) and +one (this <a href='#Point_Array'>Point Array</a>); will work with values outside of this range. -<a href="#SkPath_interpolate">interpolate</a> returns false and leaves <a href="#SkPath_interpolate_out">out</a> unchanged if <a href="#Point_Array">Point Array</a> is not -the same size as <a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a>. Call <a href="#SkPath_isInterpolatable">isInterpolatable</a> to check <a href="#Path">Path</a> -compatibility prior to calling <a href="#SkPath_interpolate">interpolate</a>. +<a href='#SkPath_interpolate'>interpolate</a> returns false and leaves <a href='#SkPath_interpolate_out'>out</a> unchanged if <a href='#Point_Array'>Point Array</a> is not +the same size as <a href='#SkPath_interpolate_ending'>ending</a> <a href='#Point_Array'>Point Array</a>. Call <a href='#SkPath_isInterpolatable'>isInterpolatable</a> to check <a href='#Path'>Path</a> +compatibility prior to calling <a href='#SkPath_interpolate'>interpolate</a>. ### Parameters -<table> <tr> <td><a name="SkPath_interpolate_ending"> <code><strong>ending </strong></code> </a></td> <td> -<a href="#Point_Array">Point Array</a> averaged with this <a href="#Point_Array">Point Array</a></td> - </tr> <tr> <td><a name="SkPath_interpolate_weight"> <code><strong>weight </strong></code> </a></td> <td> -contribution of this <a href="#Point_Array">Point Array</a>, and -one minus contribution of <a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a></td> - </tr> <tr> <td><a name="SkPath_interpolate_out"> <code><strong>out </strong></code> </a></td> <td> -<a href="#Path">Path</a> replaced by interpolated averages</td> +<table> <tr> <td><a name='SkPath_interpolate_ending'><code><strong>ending</strong></code></a></td> + <td><a href='#Point_Array'>Point Array</a> averaged with this <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr> <td><a name='SkPath_interpolate_weight'><code><strong>weight</strong></code></a></td> + <td>contribution of this <a href='#Point_Array'>Point Array</a>, and +one minus contribution of <a href='#SkPath_interpolate_ending'>ending</a> <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr> <td><a name='SkPath_interpolate_out'><code><strong>out</strong></code></a></td> + <td><a href='#Path'>Path</a> replaced by interpolated averages</td> </tr> </table> ### Return Value -true if <a href="#Path">Paths</a> contain same number of <a href="SkPoint_Reference#Point">Points</a> +true if <a href='#Path'>Paths</a> contain same number of <a href='SkPoint_Reference#Point'>Points</a> ### Example @@ -729,45 +1327,47 @@ true if <a href="#Path">Paths</a> contain same number of <a href="SkPoint_Refere ### See Also -<a href="#SkPath_isInterpolatable">isInterpolatable</a> +<a href='#SkPath_isInterpolatable'>isInterpolatable</a> --- -<a name="SkPath_unique"></a> +<a name='SkPath_unique'></a> ## unique -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool unique() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_unique'>unique</a>() const </pre> +Deprecated. + soonOnly valid for Android framework. --- -## <a name="Fill_Type"></a> Fill Type +## <a name='Fill_Type'>Fill Type</a> -## <a name="SkPath_FillType"></a> Enum SkPath::FillType +## <a name='SkPath_FillType'>Enum SkPath::FillType</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPath_FillType">FillType</a> { - <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, - <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, - <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, - <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a>, + enum <a href='#SkPath_FillType'>FillType</a> { + <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>, + <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a>, + <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a>, + <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a>, }; </pre> -<a href="#Fill_Type">Fill Type</a> selects the rule used to fill <a href="#Path">Path</a>. <a href="#Path">Path</a> set to <a href="#SkPath_kWinding_FillType">kWinding FillType</a> -fills if the sum of <a href="#Contour">Contour</a> edges is not zero, where clockwise edges add one, and -counterclockwise edges subtract one. <a href="#Path">Path</a> set to <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> fills if the -number of <a href="#Contour">Contour</a> edges is odd. Each <a href="#Fill_Type">Fill Type</a> has an inverse variant that +<a href='#Fill_Type'>Fill Type</a> selects the rule used to fill <a href='#Path'>Path</a>. <a href='#Path'>Path</a> set to <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> +fills if the sum of <a href='#Contour'>Contour</a> edges is not zero, where clockwise edges add one, and +counterclockwise edges subtract one. <a href='#Path'>Path</a> set to <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> fills if the +number of <a href='#Contour'>Contour</a> edges is odd. Each <a href='#Fill_Type'>Fill Type</a> has an inverse variant that reverses the rule: -<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> fills where the sum of <a href="#Contour">Contour</a> edges is zero; -<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> fills where the number of <a href="#Contour">Contour</a> edges is even. +<a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> fills where the sum of <a href='#Contour'>Contour</a> edges is zero; +<a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> fills where the number of <a href='#Contour'>Contour</a> edges is even. ### Example -<div><fiddle-embed name="525ed591c31960de23068dba8ea11a75"><div>The top row has two clockwise rectangles. The second row has one clockwise and +<div><fiddle-embed name="71fc6c069c377d808799f2453edabaf5"><div>The top row has two clockwise rectangles. The second row has one clockwise and one counterclockwise rectangle. The even-odd variants draw the same. The winding variants draw the top rectangle overlap, which has a winding of 2, the same as the outer parts of the top rectangles, which have a winding of 1. @@ -775,53 +1375,62 @@ same as the outer parts of the top rectangles, which have a winding of 1. ### Constants -<table> - <tr> - <td><a name="SkPath_kWinding_FillType"> <code><strong>SkPath::kWinding_FillType </strong></code> </a></td><td>0</td><td>Specifies fill as area is enclosed by a non-zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kWinding_FillType'><code>SkPath::kWinding_FillType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +is enclosed by a non-zero sum of Contour Directions</td> </tr> <tr> - <td><a name="SkPath_kEvenOdd_FillType"> <code><strong>SkPath::kEvenOdd_FillType </strong></code> </a></td><td>1</td><td>Specifies fill as area enclosed by an odd number of <a href="#Contour">Contours</a>. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kEvenOdd_FillType'><code>SkPath::kEvenOdd_FillType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +is enclosed by an odd number of Contours</td> </tr> - <tr> - <td><a name="SkPath_kInverseWinding_FillType"> <code><strong>SkPath::kInverseWinding_FillType </strong></code> </a></td><td>2</td><td>Specifies fill as area is enclosed by a zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>. -</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kInverseWinding_FillType'><code>SkPath::kInverseWinding_FillType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +is enclosed by a zero sum of Contour Directions</td> </tr> <tr> - <td><a name="SkPath_kInverseEvenOdd_FillType"> <code><strong>SkPath::kInverseEvenOdd_FillType </strong></code> </a></td><td>3</td><td>Specifies fill as area enclosed by an even number of <a href="#Contour">Contours</a>. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kInverseEvenOdd_FillType'><code>SkPath::kInverseEvenOdd_FillType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +is enclosed by an even number of Contours</td> </tr> </table> ### Example -<div><fiddle-embed name="0ebf978b234a00e2c2573cfa7b04e776"></fiddle-embed></div> +<div><fiddle-embed name="d84cd32b0bfd9ad2714f753120ed0ee1"></fiddle-embed></div> ### See Also -<a href="SkPaint_Reference#SkPaint_Style">SkPaint::Style</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> - - +<a href='SkPaint_Reference#SkPaint_Style'>SkPaint::Style</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> -<a name="SkPath_getFillType"></a> +<a name='SkPath_getFillType'></a> ## getFillType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -FillType getFillType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a>() const </pre> -Returns <a href="#SkPath_FillType">FillType</a>, the rule used to fill <a href="#Path">Path</a>. <a href="#SkPath_FillType">FillType</a> of a new <a href="#Path">Path</a> is -<a href="#SkPath_kWinding_FillType">kWinding FillType</a>. +Returns <a href='#SkPath_FillType'>FillType</a>, the rule used to fill <a href='#Path'>Path</a>. <a href='#SkPath_FillType'>FillType</a> of a new <a href='#Path'>Path</a> is +<a href='#SkPath_kWinding_FillType'>kWinding FillType</a>. ### Return Value -one of: <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, -<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> +one of: <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a>, <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a>, +<a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> ### Example -<div><fiddle-embed name="2eb8f985d1e263e70b5c0aa4a8b68d8e"> +<div><fiddle-embed name="019af90e778914e8a109d6305ede4fc4"> #### Example Output @@ -833,52 +1442,52 @@ default path fill type is kWinding_FillType ### See Also -<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_isInverseFillType">isInverseFillType</a> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_isInverseFillType'>isInverseFillType</a> --- -<a name="SkPath_setFillType"></a> +<a name='SkPath_setFillType'></a> ## setFillType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setFillType(FillType ft) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_setFillType'>setFillType</a>(<a href='#SkPath_FillType'>FillType</a> ft) </pre> -Sets <a href="#SkPath_FillType">FillType</a>, the rule used to fill <a href="#Path">Path</a>. While there is no check -that <a href="#SkPath_setFillType_ft">ft</a> is legal, values outside of <a href="#SkPath_FillType">FillType</a> are not supported. +Sets <a href='#SkPath_FillType'>FillType</a>, the rule used to fill <a href='#Path'>Path</a>. While there is no check +that <a href='#SkPath_setFillType_ft'>ft</a> is legal, values outside of <a href='#SkPath_FillType'>FillType</a> are not supported. ### Parameters -<table> <tr> <td><a name="SkPath_setFillType_ft"> <code><strong>ft </strong></code> </a></td> <td> -one of: <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, -<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a></td> +<table> <tr> <td><a name='SkPath_setFillType_ft'><code><strong>ft</strong></code></a></td> + <td>one of: <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a>, <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a>, +<a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a></td> </tr> </table> ### Example -<div><fiddle-embed name="b4a91cd7f50b2a0a0d1bec6d0ac823d2"><div>If empty <a href="#Path">Path</a> is set to inverse <a href="#SkPath_FillType">FillType</a>, it fills all pixels. +<div><fiddle-embed name="b4a91cd7f50b2a0a0d1bec6d0ac823d2"><div>If empty <a href='#Path'>Path</a> is set to inverse <a href='#SkPath_FillType'>FillType</a>, it fills all pixels. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a> --- -<a name="SkPath_isInverseFillType"></a> +<a name='SkPath_isInverseFillType'></a> ## isInverseFillType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isInverseFillType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isInverseFillType'>isInverseFillType</a>() const </pre> -Returns if <a href="#SkPath_FillType">FillType</a> describes area outside <a href="#Path">Path</a> geometry. The inverse fill area +Returns if <a href='#SkPath_FillType'>FillType</a> describes area outside <a href='#Path'>Path</a> geometry. The inverse fill area extends indefinitely. ### Return Value -true if <a href="#SkPath_FillType">FillType</a> is <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> or <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> +true if <a href='#SkPath_FillType'>FillType</a> is <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> or <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> ### Example @@ -894,224 +1503,231 @@ default path fill type is inverse: false ### See Also -<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a> --- -<a name="SkPath_toggleInverseFillType"></a> +<a name='SkPath_toggleInverseFillType'></a> ## toggleInverseFillType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toggleInverseFillType() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a>() </pre> -Replace <a href="#SkPath_FillType">FillType</a> with its inverse. The inverse of <a href="#SkPath_FillType">FillType</a> describes the area -unmodified by the original <a href="#SkPath_FillType">FillType</a>. +Replace <a href='#SkPath_FillType'>FillType</a> with its inverse. The inverse of <a href='#SkPath_FillType'>FillType</a> describes the area +unmodified by the original <a href='#SkPath_FillType'>FillType</a>. -| <a href="#SkPath_FillType">FillType</a> | toggled <a href="#SkPath_FillType">FillType</a> | +| <a href='#SkPath_FillType'>FillType</a> | toggled <a href='#SkPath_FillType'>FillType</a> | | --- | --- | -| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | -| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | -| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | -| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | +| <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> | +| <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> | +| <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> | <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | +| <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | ### Example -<div><fiddle-embed name="400facce23d417bc5043c5f58404afbd"><div><a href="#Path">Path</a> drawn normally and through its inverse touches every pixel once. +<div><fiddle-embed name="400facce23d417bc5043c5f58404afbd"><div><a href='#Path'>Path</a> drawn normally and through its inverse touches every pixel once. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_isInverseFillType">isInverseFillType</a> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_isInverseFillType'>isInverseFillType</a> --- -## <a name="Convexity"></a> Convexity +## <a name='Convexity'>Convexity</a> -## <a name="SkPath_Convexity"></a> Enum SkPath::Convexity +## <a name='SkPath_Convexity'>Enum SkPath::Convexity</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#Convexity">Convexity</a> : uint8_t { - <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>, - <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>, - <a href="#SkPath_kConcave_Convexity">kConcave Convexity</a>, + enum <a href='#SkPath_Convexity'>Convexity</a> : uint8_t { + <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a>, + <a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a>, + <a href='#SkPath_kConcave_Convexity'>kConcave Convexity</a>, }; </pre> -<a href="#Path">Path</a> is convex if it contains one <a href="#Contour">Contour</a> and <a href="#Contour">Contour</a> loops no more than -360 degrees, and <a href="#Contour">Contour</a> angles all have same <a href="#SkPath_Direction">Direction</a>. Convex <a href="#Path">Path</a> -may have better performance and require fewer resources on <a href="undocumented#GPU_Surface">GPU Surface</a>. +<a href='#Path'>Path</a> is convex if it contains one <a href='#Contour'>Contour</a> and <a href='#Contour'>Contour</a> loops no more than +360 degrees, and <a href='#Contour'>Contour</a> angles all have same <a href='#SkPath_Direction'>Direction</a>. Convex <a href='#Path'>Path</a> +may have better performance and require fewer resources on <a href='undocumented#GPU_Surface'>GPU Surface</a>. -<a href="#Path">Path</a> is concave when either at least one <a href="#SkPath_Direction">Direction</a> change is clockwise and -another is counterclockwise, or the sum of the changes in <a href="#SkPath_Direction">Direction</a> is not 360 +<a href='#Path'>Path</a> is concave when either at least one <a href='#SkPath_Direction'>Direction</a> change is clockwise and +another is counterclockwise, or the sum of the changes in <a href='#SkPath_Direction'>Direction</a> is not 360 degrees. -Initially <a href="#Path">Path</a> <a href="#Convexity">Convexity</a> is <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>. <a href="#Path">Path</a> <a href="#Convexity">Convexity</a> is computed -if needed by destination <a href="SkSurface_Reference#Surface">Surface</a>. +Initially <a href='#Path'>Path</a> <a href='#SkPath_Convexity'>Convexity</a> is <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a>. <a href='#Path'>Path</a> <a href='#SkPath_Convexity'>Convexity</a> is computed +if needed by destination <a href='SkSurface_Reference#Surface'>Surface</a>. ### Constants -<table> - <tr> - <td><a name="SkPath_kUnknown_Convexity"> <code><strong>SkPath::kUnknown_Convexity </strong></code> </a></td><td>0</td><td>Indicates <a href="#Convexity">Convexity</a> has not been determined. -</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kUnknown_Convexity'><code>SkPath::kUnknown_Convexity</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +indicates Convexity has not been determined</td> </tr> <tr> - <td><a name="SkPath_kConvex_Convexity"> <code><strong>SkPath::kConvex_Convexity </strong></code> </a></td><td>1</td><td><a href="#Path">Path</a> has one <a href="#Contour">Contour</a> made of a simple geometry without indentations. -</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConvex_Convexity'><code>SkPath::kConvex_Convexity</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +one Contour made of a simple geometry without indentations</td> </tr> - <tr> - <td><a name="SkPath_kConcave_Convexity"> <code><strong>SkPath::kConcave_Convexity </strong></code> </a></td><td>2</td><td><a href="#Path">Path</a> has more than one <a href="#Contour">Contour</a>, or a geometry with indentations. -</td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConcave_Convexity'><code>SkPath::kConcave_Convexity</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +more than one Contour, or a geometry with indentations</td> </tr> </table> ### Example -<div><fiddle-embed name="b7d0c0732411db76fa37b05fc18712b3"></fiddle-embed></div> +<div><fiddle-embed name="ac49e8b810bd6ed5d84b4f5a3b40a0ec"></fiddle-embed></div> ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getConvexity">getConvexity</a> <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> <a href="#SkPath_setConvexity">setConvexity</a> <a href="#SkPath_isConvex">isConvex</a> - - +<a href='#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_setConvexity'>setConvexity</a> <a href='#SkPath_isConvex'>isConvex</a> -<a name="SkPath_getConvexity"></a> +<a name='SkPath_getConvexity'></a> ## getConvexity -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Convexity getConvexity() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Convexity'>Convexity</a> <a href='#SkPath_getConvexity'>getConvexity</a>() const </pre> -Computes <a href="#Convexity">Convexity</a> if required, and returns stored value. -<a href="#Convexity">Convexity</a> is computed if stored value is <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>, -or if <a href="#Path">Path</a> has been altered since <a href="#Convexity">Convexity</a> was computed or set. +Computes <a href='#SkPath_Convexity'>Convexity</a> if required, and returns stored value. +<a href='#SkPath_Convexity'>Convexity</a> is computed if stored value is <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a>, +or if <a href='#Path'>Path</a> has been altered since <a href='#SkPath_Convexity'>Convexity</a> was computed or set. ### Return Value -computed or stored <a href="#Convexity">Convexity</a> +computed or stored <a href='#SkPath_Convexity'>Convexity</a> ### Example -<div><fiddle-embed name="c8f5ac4040cb5026d234bf99e3f01e8e"></fiddle-embed></div> +<div><fiddle-embed name="a8f36f2fa90003e3691fd0da0bb0c243"></fiddle-embed></div> ### See Also -<a href="#Convexity">Convexity</a> <a href="#Contour">Contour</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> <a href="#SkPath_setConvexity">setConvexity</a> <a href="#SkPath_isConvex">isConvex</a> +<a href='#SkPath_Convexity'>Convexity</a> <a href='#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_setConvexity'>setConvexity</a> <a href='#SkPath_isConvex'>isConvex</a> --- -<a name="SkPath_getConvexityOrUnknown"></a> +<a name='SkPath_getConvexityOrUnknown'></a> ## getConvexityOrUnknown -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Convexity getConvexityOrUnknown() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Convexity'>Convexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>() const </pre> -Returns last computed <a href="#Convexity">Convexity</a>, or <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a> if -<a href="#Path">Path</a> has been altered since <a href="#Convexity">Convexity</a> was computed or set. +Returns last computed <a href='#SkPath_Convexity'>Convexity</a>, or <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a> if +<a href='#Path'>Path</a> has been altered since <a href='#SkPath_Convexity'>Convexity</a> was computed or set. ### Return Value -stored <a href="#Convexity">Convexity</a> +stored <a href='#SkPath_Convexity'>Convexity</a> ### Example -<div><fiddle-embed name="bc19da9de880e3f339707247686efc0a"><div><a href="#Convexity">Convexity</a> is unknown unless <a href="#SkPath_getConvexity">getConvexity</a> is called without a subsequent call +<div><fiddle-embed name="111c59e9afadb940ab8f41bdc25378a4"><div><a href='#SkPath_Convexity'>Convexity</a> is unknown unless <a href='#SkPath_getConvexity'>getConvexity</a> is called without a subsequent call that alters the path. </div></fiddle-embed></div> ### See Also -<a href="#Convexity">Convexity</a> <a href="#Contour">Contour</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getConvexity">getConvexity</a> <a href="#SkPath_setConvexity">setConvexity</a> <a href="#SkPath_isConvex">isConvex</a> +<a href='#SkPath_Convexity'>Convexity</a> <a href='#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_setConvexity'>setConvexity</a> <a href='#SkPath_isConvex'>isConvex</a> --- -<a name="SkPath_setConvexity"></a> +<a name='SkPath_setConvexity'></a> ## setConvexity -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setConvexity(Convexity convexity) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_setConvexity'>setConvexity</a>(<a href='#SkPath_Convexity'>Convexity</a> convexity) </pre> -Stores <a href="#SkPath_setConvexity_convexity">convexity</a> so that it is later returned by <a href="#SkPath_getConvexity">getConvexity</a> or <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a>. -<a href="#SkPath_setConvexity_convexity">convexity</a> may differ from <a href="#SkPath_getConvexity">getConvexity</a>, although setting an incorrect value may +Stores <a href='#SkPath_setConvexity_convexity'>convexity</a> so that it is later returned by <a href='#SkPath_getConvexity'>getConvexity</a> or <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>. +<a href='#SkPath_setConvexity_convexity'>convexity</a> may differ from <a href='#SkPath_getConvexity'>getConvexity</a>, although setting an incorrect value may cause incorrect or inefficient drawing. -If <a href="#SkPath_setConvexity_convexity">convexity</a> is <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>: <a href="#SkPath_getConvexity">getConvexity</a> will -compute <a href="#Convexity">Convexity</a>, and <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> will return <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>. +If <a href='#SkPath_setConvexity_convexity'>convexity</a> is <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a>: <a href='#SkPath_getConvexity'>getConvexity</a> will +compute <a href='#SkPath_Convexity'>Convexity</a>, and <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> will return <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a>. -If <a href="#SkPath_setConvexity_convexity">convexity</a> is <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a> or <a href="#SkPath_kConcave_Convexity">kConcave Convexity</a>, <a href="#SkPath_getConvexity">getConvexity</a> -and <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> will return <a href="#SkPath_setConvexity_convexity">convexity</a> until the path is +If <a href='#SkPath_setConvexity_convexity'>convexity</a> is <a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a> or <a href='#SkPath_kConcave_Convexity'>kConcave Convexity</a>, <a href='#SkPath_getConvexity'>getConvexity</a> +and <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> will return <a href='#SkPath_setConvexity_convexity'>convexity</a> until the path is altered. ### Parameters -<table> <tr> <td><a name="SkPath_setConvexity_convexity"> <code><strong>convexity </strong></code> </a></td> <td> -one of: <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>, <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>, or <a href="#SkPath_kConcave_Convexity">kConcave Convexity</a></td> +<table> <tr> <td><a name='SkPath_setConvexity_convexity'><code><strong>convexity</strong></code></a></td> + <td>one of: <a href='#SkPath_kUnknown_Convexity'>kUnknown Convexity</a>, <a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a>, or <a href='#SkPath_kConcave_Convexity'>kConcave Convexity</a></td> </tr> </table> ### Example -<div><fiddle-embed name="6fe0d520507eeafe118b80f7f1d9b588"></fiddle-embed></div> +<div><fiddle-embed name="875e32b4b1cb48d739325705fc0fa42c"></fiddle-embed></div> ### See Also -<a href="#Convexity">Convexity</a> <a href="#Contour">Contour</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getConvexity">getConvexity</a> <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> <a href="#SkPath_isConvex">isConvex</a> +<a href='#SkPath_Convexity'>Convexity</a> <a href='#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_isConvex'>isConvex</a> --- -<a name="SkPath_isConvex"></a> +<a name='SkPath_isConvex'></a> ## isConvex -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isConvex() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isConvex'>isConvex</a>() const </pre> -Computes <a href="#Convexity">Convexity</a> if required, and returns true if value is <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>. -If <a href="#SkPath_setConvexity">setConvexity</a> was called with <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a> or <a href="#SkPath_kConcave_Convexity">kConcave Convexity</a>, and -the path has not been altered, <a href="#Convexity">Convexity</a> is not recomputed. +Computes <a href='#SkPath_Convexity'>Convexity</a> if required, and returns true if value is <a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a>. +If <a href='#SkPath_setConvexity'>setConvexity</a> was called with <a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a> or <a href='#SkPath_kConcave_Convexity'>kConcave Convexity</a>, and +the path has not been altered, <a href='#SkPath_Convexity'>Convexity</a> is not recomputed. ### Return Value -true if <a href="#Convexity">Convexity</a> stored or computed is <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a> +true if <a href='#SkPath_Convexity'>Convexity</a> stored or computed is <a href='#SkPath_kConvex_Convexity'>kConvex Convexity</a> ### Example -<div><fiddle-embed name="dfd2c40e1c2a7b539a94aec8d040d349"><div>Concave shape is erroneously considered convex after a forced call to -<a href="#SkPath_setConvexity">setConvexity</a>. +<div><fiddle-embed name="d8be8b6e59de244e4cbf58ec9554557b"><div>Concave shape is erroneously considered convex after a forced call to +<a href='#SkPath_setConvexity'>setConvexity</a>. </div></fiddle-embed></div> ### See Also -<a href="#Convexity">Convexity</a> <a href="#Contour">Contour</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getConvexity">getConvexity</a> <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> <a href="#SkPath_setConvexity">setConvexity</a> +<a href='#SkPath_Convexity'>Convexity</a> <a href='#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_setConvexity'>setConvexity</a> --- -<a name="SkPath_isOval"></a> +<a name='SkPath_isOval'></a> ## isOval -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isOval(SkRect* bounds) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isOval'>isOval</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* bounds) const </pre> Returns true if this path is recognized as an oval or circle. -<a href="#SkPath_isOval_bounds">bounds</a> receives <a href="#SkPath_isOval_bounds">bounds</a> of <a href="undocumented#Oval">Oval</a>. +<a href='#SkPath_isOval_bounds'>bounds</a> receives <a href='#SkPath_isOval_bounds'>bounds</a> of <a href='undocumented#Oval'>Oval</a>. -<a href="#SkPath_isOval_bounds">bounds</a> is unmodified if <a href="undocumented#Oval">Oval</a> is not found. +<a href='#SkPath_isOval_bounds'>bounds</a> is unmodified if <a href='undocumented#Oval'>Oval</a> is not found. ### Parameters -<table> <tr> <td><a name="SkPath_isOval_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -storage for bounding <a href="SkRect_Reference#Rect">Rect</a> of <a href="undocumented#Oval">Oval</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_isOval_bounds'><code><strong>bounds</strong></code></a></td> + <td>storage for bounding <a href='SkRect_Reference#Rect'>Rect</a> of <a href='undocumented#Oval'>Oval</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> is recognized as an oval or circle +true if <a href='#Path'>Path</a> is recognized as an oval or circle ### Example @@ -1119,33 +1735,33 @@ true if <a href="#Path">Path</a> is recognized as an oval or circle ### See Also -<a href="undocumented#Oval">Oval</a> <a href="#SkPath_addCircle">addCircle</a> <a href="#SkPath_addOval">addOval</a><sup><a href="#SkPath_addOval_2">[2]</a></sup> +<a href='undocumented#Oval'>Oval</a> <a href='#SkPath_addCircle'>addCircle</a> <a href='#SkPath_addOval'>addOval</a><sup><a href='#SkPath_addOval_2'>[2]</a></sup> --- -<a name="SkPath_isRRect"></a> +<a name='SkPath_isRRect'></a> ## isRRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isRRect(SkRRect* rrect) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isRRect'>isRRect</a>(<a href='undocumented#SkRRect'>SkRRect</a>* rrect) const </pre> -Returns true if this path is recognized as a <a href="undocumented#SkRRect">SkRRect</a> (but not an oval/circle or rect). +Returns true if this path is recognized as a <a href='undocumented#SkRRect'>SkRRect</a> (but not an oval/circle or rect). -<a href="#SkPath_isRRect_rrect">rrect</a> receives bounds of <a href="undocumented#Round_Rect">Round Rect</a>. +<a href='#SkPath_isRRect_rrect'>rrect</a> receives bounds of <a href='undocumented#Round_Rect'>Round Rect</a>. -<a href="#SkPath_isRRect_rrect">rrect</a> is unmodified if <a href="undocumented#Round_Rect">Round Rect</a> is not found. +<a href='#SkPath_isRRect_rrect'>rrect</a> is unmodified if <a href='undocumented#Round_Rect'>Round Rect</a> is not found. ### Parameters -<table> <tr> <td><a name="SkPath_isRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -storage for bounding <a href="SkRect_Reference#Rect">Rect</a> of <a href="undocumented#Round_Rect">Round Rect</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_isRRect_rrect'><code><strong>rrect</strong></code></a></td> + <td>storage for bounding <a href='SkRect_Reference#Rect'>Rect</a> of <a href='undocumented#Round_Rect'>Round Rect</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> contains only <a href="undocumented#Round_Rect">Round Rect</a> +true if <a href='#Path'>Path</a> contains only <a href='undocumented#Round_Rect'>Round Rect</a> ### Example @@ -1154,20 +1770,20 @@ true if <a href="#Path">Path</a> contains only <a href="undocumented#Round_Rect" ### See Also -<a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkPath_addRoundRect">addRoundRect</a><sup><a href="#SkPath_addRoundRect_2">[2]</a></sup> <a href="#SkPath_addRRect">addRRect</a><sup><a href="#SkPath_addRRect_2">[2]</a></sup> +<a href='undocumented#Round_Rect'>Round Rect</a> <a href='#SkPath_addRoundRect'>addRoundRect</a><sup><a href='#SkPath_addRoundRect_2'>[2]</a></sup> <a href='#SkPath_addRRect'>addRRect</a><sup><a href='#SkPath_addRRect_2'>[2]</a></sup> --- -<a name="SkPath_reset"></a> +<a name='SkPath_reset'></a> ## reset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_reset'>reset</a>() </pre> -Sets <a href="#Path">Path</a> to its initial state. -Removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a>, and sets <a href="#SkPath_FillType">FillType</a> to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. -Internal storage associated with <a href="#Path">Path</a> is released. +Sets <a href='#Path'>Path</a> to its initial state. +Removes <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a>, and sets <a href='#SkPath_FillType'>FillType</a> to <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>. +Internal storage associated with <a href='#Path'>Path</a> is released. ### Example @@ -1175,22 +1791,22 @@ Internal storage associated with <a href="#Path">Path</a> is released. ### See Also -<a href="#SkPath_rewind">rewind</a> +<a href='#SkPath_rewind'>rewind</a> --- -<a name="SkPath_rewind"></a> +<a name='SkPath_rewind'></a> ## rewind -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rewind() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rewind'>rewind</a>() </pre> -Sets <a href="#Path">Path</a> to its initial state, preserving internal storage. -Removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Weights</a>, and sets <a href="#SkPath_FillType">FillType</a> to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. -Internal storage associated with <a href="#Path">Path</a> is retained. +Sets <a href='#Path'>Path</a> to its initial state, preserving internal storage. +Removes <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Weights</a>, and sets <a href='#SkPath_FillType'>FillType</a> to <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>. +Internal storage associated with <a href='#Path'>Path</a> is retained. -Use <a href="#SkPath_rewind">rewind</a> instead of <a href="#SkPath_reset">reset</a> if <a href="#Path">Path</a> storage will be reused and performance +Use <a href='#SkPath_rewind'>rewind</a> instead of <a href='#SkPath_reset'>reset</a> if <a href='#Path'>Path</a> storage will be reused and performance is critical. ### Example @@ -1201,23 +1817,23 @@ a newly initialized path. ### See Also -<a href="#SkPath_reset">reset</a> +<a href='#SkPath_reset'>reset</a> --- -<a name="SkPath_isEmpty"></a> +<a name='SkPath_isEmpty'></a> ## isEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isEmpty() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isEmpty'>isEmpty</a>() const </pre> -Empty <a href="#Path">Path</a> may have <a href="#SkPath_FillType">FillType</a> but has no <a href="SkPoint_Reference#SkPoint">SkPoint</a>, <a href="#SkPath_Verb">Verb</a>, or <a href="#Conic_Weight">Conic Weight</a>. -<a href="#SkPath_empty_constructor">SkPath()</a> constructs empty <a href="#Path">Path</a>; <a href="#SkPath_reset">reset</a> and (rewind) make <a href="#Path">Path</a> empty. +Empty <a href='#Path'>Path</a> may have <a href='#SkPath_FillType'>FillType</a> but has no <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, <a href='#SkPath_Verb'>Verb</a>, or <a href='#Conic_Weight'>Conic Weight</a>. +<a href='#SkPath_empty_constructor'>SkPath()</a> constructs empty <a href='#Path'>Path</a>; <a href='#SkPath_reset'>reset</a> and (rewind) make <a href='#Path'>Path</a> empty. ### Return Value -true if the path contains no <a href="#SkPath_Verb">Verb</a> array +true if the path contains no <a href='#SkPath_Verb'>Verb</a> array ### Example @@ -1237,28 +1853,28 @@ after reset path is empty ### See Also -<a href="#SkPath_empty_constructor">SkPath()</a> <a href="#SkPath_reset">reset</a> <a href="#SkPath_rewind">rewind</a> +<a href='#SkPath_empty_constructor'>SkPath()</a> <a href='#SkPath_reset'>reset</a> <a href='#SkPath_rewind'>rewind</a> --- -<a name="SkPath_isLastContourClosed"></a> +<a name='SkPath_isLastContourClosed'></a> ## isLastContourClosed -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isLastContourClosed() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a>() const </pre> -<a href="#Contour">Contour</a> is closed if <a href="#Path">Path</a> <a href="#SkPath_Verb">Verb</a> array was last modified by <a href="#SkPath_close">close</a>. When stroked, -closed <a href="#Contour">Contour</a> draws <a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> instead of <a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> at first and last <a href="SkPoint_Reference#Point">Point</a>. +<a href='#Contour'>Contour</a> is closed if <a href='#Path'>Path</a> <a href='#SkPath_Verb'>Verb</a> array was last modified by <a href='#SkPath_close'>close</a>. When stroked, +closed <a href='#Contour'>Contour</a> draws <a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> instead of <a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> at first and last <a href='SkPoint_Reference#Point'>Point</a>. ### Return Value -true if the last <a href="#Contour">Contour</a> ends with a <a href="#SkPath_kClose_Verb">kClose Verb</a> +true if the last <a href='#Contour'>Contour</a> ends with a <a href='#SkPath_kClose_Verb'>kClose Verb</a> ### Example -<div><fiddle-embed name="03b740ab94b9017800a52e30b5e7fee7"><div><a href="#SkPath_close">close</a> has no effect if <a href="#Path">Path</a> is empty; <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> returns -false until <a href="#Path">Path</a> has geometry followed by <a href="#SkPath_close">close</a>. +<div><fiddle-embed name="03b740ab94b9017800a52e30b5e7fee7"><div><a href='#SkPath_close'>close</a> has no effect if <a href='#Path'>Path</a> is empty; <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a> returns +false until <a href='#Path'>Path</a> has geometry followed by <a href='#SkPath_close'>close</a>. </div> #### Example Output @@ -1274,24 +1890,24 @@ after close last contour is closed ### See Also -<a href="#SkPath_close">close</a> +<a href='#SkPath_close'>close</a> --- -<a name="SkPath_isFinite"></a> +<a name='SkPath_isFinite'></a> ## isFinite -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isFinite() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isFinite'>isFinite</a>() const </pre> -Returns true for finite <a href="SkPoint_Reference#Point">Point</a> array values between negative <a href="undocumented#SK_ScalarMax">SK ScalarMax</a> and -positive <a href="undocumented#SK_ScalarMax">SK ScalarMax</a>. Returns false for any <a href="SkPoint_Reference#Point">Point</a> array value of -<a href="undocumented#SK_ScalarInfinity">SK ScalarInfinity</a>, <a href="undocumented#SK_ScalarNegativeInfinity">SK ScalarNegativeInfinity</a>, or <a href="undocumented#SK_ScalarNaN">SK ScalarNaN</a>. +Returns true for finite <a href='SkPoint_Reference#Point'>Point</a> array values between negative <a href='undocumented#SK_ScalarMax'>SK ScalarMax</a> and +positive <a href='undocumented#SK_ScalarMax'>SK ScalarMax</a>. Returns false for any <a href='SkPoint_Reference#Point'>Point</a> array value of +<a href='undocumented#SK_ScalarInfinity'>SK ScalarInfinity</a>, <a href='undocumented#SK_ScalarNegativeInfinity'>SK ScalarNegativeInfinity</a>, or <a href='undocumented#SK_ScalarNaN'>SK ScalarNaN</a>. ### Return Value -true if all <a href="SkPoint_Reference#Point">Point</a> values are finite +true if all <a href='SkPoint_Reference#Point'>Point</a> values are finite ### Example @@ -1309,25 +1925,25 @@ after scale path is not finite ### See Also -<a href="undocumented#SkScalar">SkScalar</a> +<a href='undocumented#SkScalar'>SkScalar</a> --- -<a name="SkPath_isVolatile"></a> +<a name='SkPath_isVolatile'></a> ## isVolatile -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isVolatile() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isVolatile'>isVolatile</a>() const </pre> Returns true if the path is volatile; it will not be altered or discarded -by the caller after it is drawn. <a href="#Path">Paths</a> by default have volatile set false, allowing -<a href="SkSurface_Reference#Surface">Surface</a> to attach a cache of data which speeds repeated drawing. If true, <a href="SkSurface_Reference#Surface">Surface</a> +by the caller after it is drawn. <a href='#Path'>Paths</a> by default have volatile set false, allowing +<a href='SkSurface_Reference#Surface'>Surface</a> to attach a cache of data which speeds repeated drawing. If true, <a href='SkSurface_Reference#Surface'>Surface</a> may not speed repeated drawing. ### Return Value -true if caller will alter <a href="#Path">Path</a> after drawing +true if caller will alter <a href='#Path'>Path</a> after drawing ### Example @@ -1343,40 +1959,47 @@ volatile by default is false ### See Also -<a href="#SkPath_setIsVolatile">setIsVolatile</a> +<a href='#SkPath_setIsVolatile'>setIsVolatile</a> --- -## <a name="Volatile"></a> Volatile +## <a name='Volatile'>Volatile</a> + -| name | description | -| --- | --- | -| <a href="#SkPath_setIsVolatile">setIsVolatile</a> | sets if <a href="undocumented#Device">Device</a> should not cache | +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setIsVolatile'>setIsVolatile</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets if <a href='undocumented#Device'>Device</a> should not cache</td> + </tr> +</table> -<a name="SkPath_setIsVolatile"></a> + +<a name='SkPath_setIsVolatile'></a> ## setIsVolatile -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setIsVolatile(bool isVolatile) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_setIsVolatile'>setIsVolatile</a>(bool <a href='#SkPath_isVolatile'>isVolatile</a>) </pre> -Specify whether <a href="#Path">Path</a> is volatile; whether it will be altered or discarded -by the caller after it is drawn. <a href="#Path">Paths</a> by default have volatile set false, allowing -<a href="undocumented#Device">Device</a> to attach a cache of data which speeds repeated drawing. +Specify whether <a href='#Path'>Path</a> is volatile; whether it will be altered or discarded +by the caller after it is drawn. <a href='#Path'>Paths</a> by default have volatile set false, allowing +<a href='undocumented#Device'>Device</a> to attach a cache of data which speeds repeated drawing. Mark temporary paths, discarded or modified after use, as volatile -to inform <a href="undocumented#Device">Device</a> that the path need not be cached. +to inform <a href='undocumented#Device'>Device</a> that the path need not be cached. -Mark animating <a href="#Path">Path</a> volatile to improve performance. -Mark unchanging <a href="#Path">Path</a> non-volatile to improve repeated rendering. +Mark animating <a href='#Path'>Path</a> volatile to improve performance. +Mark unchanging <a href='#Path'>Path</a> non-volatile to improve repeated rendering. -<a href="undocumented#Raster_Surface">Raster Surface</a> <a href="#Path">Path</a> draws are affected by volatile for some shadows. -<a href="undocumented#GPU_Surface">GPU Surface</a> <a href="#Path">Path</a> draws are affected by volatile for some shadows and concave geometries. +<a href='undocumented#Raster_Surface'>Raster Surface</a> <a href='#Path'>Path</a> draws are affected by volatile for some shadows. +<a href='undocumented#GPU_Surface'>GPU Surface</a> <a href='#Path'>Path</a> draws are affected by volatile for some shadows and concave geometries. ### Parameters -<table> <tr> <td><a name="SkPath_setIsVolatile_isVolatile"> <code><strong>isVolatile </strong></code> </a></td> <td> -true if caller will alter <a href="#Path">Path</a> after drawing</td> +<table> <tr> <td><a name='SkPath_setIsVolatile_isVolatile'><code><strong>isVolatile</strong></code></a></td> + <td>true if caller will alter <a href='#Path'>Path</a> after drawing</td> </tr> </table> @@ -1386,38 +2009,40 @@ true if caller will alter <a href="#Path">Path</a> after drawing</td> ### See Also -<a href="#SkPath_isVolatile">isVolatile</a> +<a href='#SkPath_isVolatile'>isVolatile</a> --- -<a name="SkPath_IsLineDegenerate"></a> +<a name='SkPath_IsLineDegenerate'></a> ## IsLineDegenerate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, bool exact) </pre> -Test if <a href="undocumented#Line">Line</a> between <a href="SkPoint_Reference#Point">Point</a> pair is degenerate. -<a href="undocumented#Line">Line</a> with no length or that moves a very short distance is degenerate; it is +Test if <a href='undocumented#Line'>Line</a> between <a href='SkPoint_Reference#Point'>Point</a> pair is degenerate. +<a href='undocumented#Line'>Line</a> with no length or that moves a very short distance is degenerate; it is treated as a point. -<a href="#SkPath_IsLineDegenerate_exact">exact</a> changes the equality test. If true, returns true only if <a href="#SkPath_IsLineDegenerate_p1">p1</a> equals <a href="#SkPath_IsLineDegenerate_p2">p2</a>. -If false, returns true if <a href="#SkPath_IsLineDegenerate_p1">p1</a> equals or nearly equals <a href="#SkPath_IsLineDegenerate_p2">p2</a>. +<a href='#SkPath_IsLineDegenerate_exact'>exact</a> changes the equality test. If true, returns true only if <a href='#SkPath_IsLineDegenerate_p1'>p1</a> equals <a href='#SkPath_IsLineDegenerate_p2'>p2</a>. +If false, returns true if <a href='#SkPath_IsLineDegenerate_p1'>p1</a> equals or nearly equals <a href='#SkPath_IsLineDegenerate_p2'>p2</a>. ### Parameters -<table> <tr> <td><a name="SkPath_IsLineDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> -line start point</td> - </tr> <tr> <td><a name="SkPath_IsLineDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> -line end point</td> - </tr> <tr> <td><a name="SkPath_IsLineDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> -if false, allow nearly equals</td> +<table> <tr> <td><a name='SkPath_IsLineDegenerate_p1'><code><strong>p1</strong></code></a></td> + <td>line start point</td> + </tr> + <tr> <td><a name='SkPath_IsLineDegenerate_p2'><code><strong>p2</strong></code></a></td> + <td>line end point</td> + </tr> + <tr> <td><a name='SkPath_IsLineDegenerate_exact'><code><strong>exact</strong></code></a></td> + <td>if false, allow nearly equals</td> </tr> </table> ### Return Value -true if <a href="undocumented#Line">Line</a> is degenerate; its length is effectively zero +true if <a href='undocumented#Line'>Line</a> is degenerate; its length is effectively zero ### Example @@ -1439,42 +2064,45 @@ line from (100,100) to (100.0001,100.0001) is not degenerate, exactly ### See Also -<a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> +<a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a> <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a> --- -<a name="SkPath_IsQuadDegenerate"></a> +<a name='SkPath_IsQuadDegenerate'></a> ## IsQuadDegenerate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3, bool exact) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3, bool exact) </pre> -Test if <a href="#Quad">Quad</a> is degenerate. -<a href="#Quad">Quad</a> with no length or that moves a very short distance is degenerate; it is +Test if <a href='#Quad'>Quad</a> is degenerate. +<a href='#Quad'>Quad</a> with no length or that moves a very short distance is degenerate; it is treated as a point. ### Parameters -<table> <tr> <td><a name="SkPath_IsQuadDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> -<a href="#Quad">Quad</a> start point</td> - </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> -<a href="#Quad">Quad</a> control point</td> - </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_p3"> <code><strong>p3 </strong></code> </a></td> <td> -<a href="#Quad">Quad</a> end point</td> - </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> -if true, returns true only if <a href="#SkPath_IsQuadDegenerate_p1">p1</a>, <a href="#SkPath_IsQuadDegenerate_p2">p2</a>, and <a href="#SkPath_IsQuadDegenerate_p3">p3</a> are equal; -if false, returns true if <a href="#SkPath_IsQuadDegenerate_p1">p1</a>, <a href="#SkPath_IsQuadDegenerate_p2">p2</a>, and <a href="#SkPath_IsQuadDegenerate_p3">p3</a> are equal or nearly equal</td> +<table> <tr> <td><a name='SkPath_IsQuadDegenerate_p1'><code><strong>p1</strong></code></a></td> + <td><a href='#Quad'>Quad</a> start point</td> + </tr> + <tr> <td><a name='SkPath_IsQuadDegenerate_p2'><code><strong>p2</strong></code></a></td> + <td><a href='#Quad'>Quad</a> control point</td> + </tr> + <tr> <td><a name='SkPath_IsQuadDegenerate_p3'><code><strong>p3</strong></code></a></td> + <td><a href='#Quad'>Quad</a> end point</td> + </tr> + <tr> <td><a name='SkPath_IsQuadDegenerate_exact'><code><strong>exact</strong></code></a></td> + <td>if true, returns true only if <a href='#SkPath_IsQuadDegenerate_p1'>p1</a>, <a href='#SkPath_IsQuadDegenerate_p2'>p2</a>, and <a href='#SkPath_IsQuadDegenerate_p3'>p3</a> are equal; +if false, returns true if <a href='#SkPath_IsQuadDegenerate_p1'>p1</a>, <a href='#SkPath_IsQuadDegenerate_p2'>p2</a>, and <a href='#SkPath_IsQuadDegenerate_p3'>p3</a> are equal or nearly equal</td> </tr> </table> ### Return Value -true if <a href="#Quad">Quad</a> is degenerate; its length is effectively zero +true if <a href='#Quad'>Quad</a> is degenerate; its length is effectively zero ### Example -<div><fiddle-embed name="1d50896c528cd4581966646b7d96acff"><div>As single precision floats: 100, 100.00001, and 100.00002 have different bit representations +<div><fiddle-embed name="a2b255a7dac1926cc3a247d318d63c62"><div>As single precision floats: 100, 100.00001, and 100.00002 have different bit representations but nearly the same value. Translating all three by 1000 gives them the same bit representation; the fractional portion of the number can not be represented by the float and is lost. </div> @@ -1492,41 +2120,45 @@ quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly ### See Also -<a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> +<a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a> <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a> --- -<a name="SkPath_IsCubicDegenerate"></a> +<a name='SkPath_IsCubicDegenerate'></a> ## IsCubicDegenerate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3, - const SkPoint& p4, bool exact) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3, + const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p4, bool exact) </pre> -Test if <a href="#Cubic">Cubic</a> is degenerate. -<a href="#Cubic">Cubic</a> with no length or that moves a very short distance is degenerate; it is +Test if <a href='#Cubic'>Cubic</a> is degenerate. +<a href='#Cubic'>Cubic</a> with no length or that moves a very short distance is degenerate; it is treated as a point. ### Parameters -<table> <tr> <td><a name="SkPath_IsCubicDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> -<a href="#Cubic">Cubic</a> start point</td> - </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> -<a href="#Cubic">Cubic</a> control point 1</td> - </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p3"> <code><strong>p3 </strong></code> </a></td> <td> -<a href="#Cubic">Cubic</a> control point 2</td> - </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p4"> <code><strong>p4 </strong></code> </a></td> <td> -<a href="#Cubic">Cubic</a> end point</td> - </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> -if true, returns true only if <a href="#SkPath_IsCubicDegenerate_p1">p1</a>, <a href="#SkPath_IsCubicDegenerate_p2">p2</a>, <a href="#SkPath_IsCubicDegenerate_p3">p3</a>, and <a href="#SkPath_IsCubicDegenerate_p4">p4</a> are equal; -if false, returns true if <a href="#SkPath_IsCubicDegenerate_p1">p1</a>, <a href="#SkPath_IsCubicDegenerate_p2">p2</a>, <a href="#SkPath_IsCubicDegenerate_p3">p3</a>, and <a href="#SkPath_IsCubicDegenerate_p4">p4</a> are equal or nearly equal</td> +<table> <tr> <td><a name='SkPath_IsCubicDegenerate_p1'><code><strong>p1</strong></code></a></td> + <td><a href='#Cubic'>Cubic</a> start point</td> + </tr> + <tr> <td><a name='SkPath_IsCubicDegenerate_p2'><code><strong>p2</strong></code></a></td> + <td><a href='#Cubic'>Cubic</a> control point 1</td> + </tr> + <tr> <td><a name='SkPath_IsCubicDegenerate_p3'><code><strong>p3</strong></code></a></td> + <td><a href='#Cubic'>Cubic</a> control point 2</td> + </tr> + <tr> <td><a name='SkPath_IsCubicDegenerate_p4'><code><strong>p4</strong></code></a></td> + <td><a href='#Cubic'>Cubic</a> end point</td> + </tr> + <tr> <td><a name='SkPath_IsCubicDegenerate_exact'><code><strong>exact</strong></code></a></td> + <td>if true, returns true only if <a href='#SkPath_IsCubicDegenerate_p1'>p1</a>, <a href='#SkPath_IsCubicDegenerate_p2'>p2</a>, <a href='#SkPath_IsCubicDegenerate_p3'>p3</a>, and <a href='#SkPath_IsCubicDegenerate_p4'>p4</a> are equal; +if false, returns true if <a href='#SkPath_IsCubicDegenerate_p1'>p1</a>, <a href='#SkPath_IsCubicDegenerate_p2'>p2</a>, <a href='#SkPath_IsCubicDegenerate_p3'>p3</a>, and <a href='#SkPath_IsCubicDegenerate_p4'>p4</a> are equal or nearly equal</td> </tr> </table> ### Return Value -true if <a href="#Cubic">Cubic</a> is degenerate; its length is effectively zero +true if <a href='#Cubic'>Cubic</a> is degenerate; its length is effectively zero ### Example @@ -1543,29 +2175,29 @@ true if <a href="#Cubic">Cubic</a> is degenerate; its length is effectively zero --- -<a name="SkPath_isLine"></a> +<a name='SkPath_isLine'></a> ## isLine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isLine(SkPoint line[2]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isLine'>isLine</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> line[2]) const </pre> -Returns true if <a href="#Path">Path</a> contains only one <a href="undocumented#Line">Line</a>; -<a href="#Verb">Path Verb</a> array has two entries: <a href="#SkPath_kMove_Verb">kMove Verb</a>, <a href="#SkPath_kLine_Verb">kLine Verb</a>. -If <a href="#Path">Path</a> contains one <a href="undocumented#Line">Line</a> and <a href="#SkPath_isLine_line">line</a> is not nullptr, <a href="#SkPath_isLine_line">line</a> is set to -<a href="undocumented#Line">Line</a> start point and <a href="undocumented#Line">Line</a> end point. -Returns false if <a href="#Path">Path</a> is not one <a href="undocumented#Line">Line</a>; <a href="#SkPath_isLine_line">line</a> is unaltered. +Returns true if <a href='#Path'>Path</a> contains only one <a href='undocumented#Line'>Line</a>; +<a href='#Verb'>Path Verb</a> array has two entries: <a href='#SkPath_kMove_Verb'>kMove Verb</a>, <a href='#SkPath_kLine_Verb'>kLine Verb</a>. +If <a href='#Path'>Path</a> contains one <a href='undocumented#Line'>Line</a> and <a href='#SkPath_isLine_line'>line</a> is not nullptr, <a href='#SkPath_isLine_line'>line</a> is set to +<a href='undocumented#Line'>Line</a> start point and <a href='undocumented#Line'>Line</a> end point. +Returns false if <a href='#Path'>Path</a> is not one <a href='undocumented#Line'>Line</a>; <a href='#SkPath_isLine_line'>line</a> is unaltered. ### Parameters -<table> <tr> <td><a name="SkPath_isLine_line"> <code><strong>line </strong></code> </a></td> <td> -storage for <a href="undocumented#Line">Line</a>. May be nullptr</td> +<table> <tr> <td><a name='SkPath_isLine_line'><code><strong>line</strong></code></a></td> + <td>storage for <a href='undocumented#Line'>Line</a>. May be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> contains exactly one <a href="undocumented#Line">Line</a> +true if <a href='#Path'>Path</a> contains exactly one <a href='undocumented#Line'>Line</a> ### Example @@ -1584,39 +2216,40 @@ second move is not line --- -## <a name="Point_Array"></a> Point Array +## <a name='Point_Array'>Point Array</a> -<a href="#Point_Array">Point Array</a> contains <a href="SkPoint_Reference#Point">Points</a> satisfying the allocated <a href="SkPoint_Reference#Point">Points</a> for -each <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>. For instance, <a href="#Path">Path</a> containing one <a href="#Contour">Contour</a> with <a href="undocumented#Line">Line</a> -and <a href="#Quad">Quad</a> is described by <a href="#Verb_Array">Verb Array</a>: Verb::kMoveTo, Verb::kLineTo, Verb::kQuadTo; and -one <a href="SkPoint_Reference#Point">Point</a> for move, one <a href="SkPoint_Reference#Point">Point</a> for <a href="undocumented#Line">Line</a>, two <a href="SkPoint_Reference#Point">Points</a> for <a href="#Quad">Quad</a>; totaling four <a href="SkPoint_Reference#Point">Points</a>. +<a href='#Point_Array'>Point Array</a> contains <a href='SkPoint_Reference#Point'>Points</a> satisfying the allocated <a href='SkPoint_Reference#Point'>Points</a> for +each <a href='#SkPath_Verb'>Verb</a> in <a href='#Verb_Array'>Verb Array</a>. For instance, <a href='#Path'>Path</a> containing one <a href='#Contour'>Contour</a> with <a href='undocumented#Line'>Line</a> +and <a href='#Quad'>Quad</a> is described by <a href='#Verb_Array'>Verb Array</a>: Verb::kMoveTo, Verb::kLineTo, Verb::kQuadTo; and +one <a href='SkPoint_Reference#Point'>Point</a> for move, one <a href='SkPoint_Reference#Point'>Point</a> for <a href='undocumented#Line'>Line</a>, two <a href='SkPoint_Reference#Point'>Points</a> for <a href='#Quad'>Quad</a>; totaling four <a href='SkPoint_Reference#Point'>Points</a>. -<a href="#Point_Array">Point Array</a> may be read directly from <a href="#Path">Path</a> with <a href="#SkPath_getPoints">getPoints</a>, or inspected with -<a href="#SkPath_getPoint">getPoint</a>, with <a href="#SkPath_Iter">Iter</a>, or with <a href="#SkPath_RawIter">RawIter</a>. +<a href='#Point_Array'>Point Array</a> may be read directly from <a href='#Path'>Path</a> with <a href='#SkPath_getPoints'>getPoints</a>, or inspected with +<a href='#SkPath_getPoint'>getPoint</a>, with <a href='#SkPath_Iter'>Iter</a>, or with <a href='#SkPath_RawIter'>RawIter</a>. -<a name="SkPath_getPoints"></a> +<a name='SkPath_getPoints'></a> ## getPoints -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getPoints(SkPoint points[], int max) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPath_getPoints'>getPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> points[], int max) const </pre> -Returns number of <a href="#SkPath_getPoints_points">points</a> in <a href="#Path">Path</a>. Up to <a href="#SkPath_getPoints_max">max</a> <a href="#SkPath_getPoints_points">points</a> are copied. -<a href="#SkPath_getPoints_points">points</a> may be nullptr; then, <a href="#SkPath_getPoints_max">max</a> must be zero. -If <a href="#SkPath_getPoints_max">max</a> is greater than number of <a href="#SkPath_getPoints_points">points</a>, excess <a href="#SkPath_getPoints_points">points</a> storage is unaltered. +Returns number of <a href='#SkPath_getPoints_points'>points</a> in <a href='#Path'>Path</a>. Up to <a href='#SkPath_getPoints_max'>max</a> <a href='#SkPath_getPoints_points'>points</a> are copied. +<a href='#SkPath_getPoints_points'>points</a> may be nullptr; then, <a href='#SkPath_getPoints_max'>max</a> must be zero. +If <a href='#SkPath_getPoints_max'>max</a> is greater than number of <a href='#SkPath_getPoints_points'>points</a>, excess <a href='#SkPath_getPoints_points'>points</a> storage is unaltered. ### Parameters -<table> <tr> <td><a name="SkPath_getPoints_points"> <code><strong>points </strong></code> </a></td> <td> -storage for <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> array. May be nullptr</td> - </tr> <tr> <td><a name="SkPath_getPoints_max"> <code><strong>max </strong></code> </a></td> <td> -maximum to copy; must be greater than or equal to zero</td> +<table> <tr> <td><a name='SkPath_getPoints_points'><code><strong>points</strong></code></a></td> + <td>storage for <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> array. May be nullptr</td> + </tr> + <tr> <td><a name='SkPath_getPoints_max'><code><strong>max</strong></code></a></td> + <td>maximum to copy; must be greater than or equal to zero</td> </tr> </table> ### Return Value -<a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> array length +<a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> array length ### Example @@ -1635,23 +2268,23 @@ just right point count: 3 (0,0) (20,20) (-10,-10) ### See Also -<a href="#SkPath_countPoints">countPoints</a> <a href="#SkPath_getPoint">getPoint</a> +<a href='#SkPath_countPoints'>countPoints</a> <a href='#SkPath_getPoint'>getPoint</a> --- -<a name="SkPath_countPoints"></a> +<a name='SkPath_countPoints'></a> ## countPoints -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int countPoints() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPath_countPoints'>countPoints</a>() const </pre> -Returns the number of points in <a href="#Path">Path</a>. -<a href="SkPoint_Reference#Point">Point</a> count is initially zero. +Returns the number of points in <a href='#Path'>Path</a>. +<a href='SkPoint_Reference#Point'>Point</a> count is initially zero. ### Return Value -<a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> array length +<a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> array length ### Example @@ -1670,35 +2303,35 @@ second move point count: 3 ### See Also -<a href="#SkPath_getPoints">getPoints</a> +<a href='#SkPath_getPoints'>getPoints</a> --- -<a name="SkPath_getPoint"></a> +<a name='SkPath_getPoint'></a> ## getPoint -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPoint getPoint(int index) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_getPoint'>getPoint</a>(int index) const </pre> -Returns <a href="SkPoint_Reference#Point">Point</a> at <a href="#SkPath_getPoint_index">index</a> in <a href="#Point_Array">Point Array</a>. Valid range for <a href="#SkPath_getPoint_index">index</a> is -0 to <a href="#SkPath_countPoints">countPoints</a> - 1. -Returns (0, 0) if <a href="#SkPath_getPoint_index">index</a> is out of range. +Returns <a href='SkPoint_Reference#Point'>Point</a> at <a href='#SkPath_getPoint_index'>index</a> in <a href='#Point_Array'>Point Array</a>. Valid range for <a href='#SkPath_getPoint_index'>index</a> is +0 to <a href='#SkPath_countPoints'>countPoints</a> - 1. +Returns (0, 0) if <a href='#SkPath_getPoint_index'>index</a> is out of range. ### Parameters -<table> <tr> <td><a name="SkPath_getPoint_index"> <code><strong>index </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> array element selector</td> +<table> <tr> <td><a name='SkPath_getPoint_index'><code><strong>index</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> array element selector</td> </tr> </table> ### Return Value -<a href="SkPoint_Reference#Point">Point</a> array value or (0, 0) +<a href='SkPoint_Reference#Point'>Point</a> array value or (0, 0) ### Example -<div><fiddle-embed name="abd6796f0e15bc7b4fe6f52f6cd2d1a5"> +<div><fiddle-embed name="42885f1df13de109adccc5d531f62111"> #### Example Output @@ -1711,34 +2344,34 @@ point 1: (10,10) ### See Also -<a href="#SkPath_countPoints">countPoints</a> <a href="#SkPath_getPoints">getPoints</a> +<a href='#SkPath_countPoints'>countPoints</a> <a href='#SkPath_getPoints'>getPoints</a> --- -## <a name="Verb_Array"></a> Verb Array +## <a name='Verb_Array'>Verb Array</a> -<a href="#Verb_Array">Verb Array</a> always starts with <a href="#SkPath_kMove_Verb">kMove Verb</a>. -If <a href="#SkPath_kClose_Verb">kClose Verb</a> is not the last entry, it is always followed by <a href="#SkPath_kMove_Verb">kMove Verb</a>; -the quantity of <a href="#SkPath_kMove_Verb">kMove Verb</a> equals the <a href="#Contour">Contour</a> count. -<a href="#Verb_Array">Verb Array</a> does not include or count <a href="#SkPath_kDone_Verb">kDone Verb</a>; it is a convenience -returned when iterating through <a href="#Verb_Array">Verb Array</a>. +<a href='#Verb_Array'>Verb Array</a> always starts with <a href='#SkPath_kMove_Verb'>kMove Verb</a>. +If <a href='#SkPath_kClose_Verb'>kClose Verb</a> is not the last entry, it is always followed by <a href='#SkPath_kMove_Verb'>kMove Verb</a>; +the quantity of <a href='#SkPath_kMove_Verb'>kMove Verb</a> equals the <a href='#Contour'>Contour</a> count. +<a href='#Verb_Array'>Verb Array</a> does not include or count <a href='#SkPath_kDone_Verb'>kDone Verb</a>; it is a convenience +returned when iterating through <a href='#Verb_Array'>Verb Array</a>. -<a href="#Verb_Array">Verb Array</a> may be read directly from <a href="#Path">Path</a> with <a href="#SkPath_getVerbs">getVerbs</a>, or inspected with <a href="#SkPath_Iter">Iter</a>, -or with <a href="#SkPath_RawIter">RawIter</a>. +<a href='#Verb_Array'>Verb Array</a> may be read directly from <a href='#Path'>Path</a> with <a href='#SkPath_getVerbs'>getVerbs</a>, or inspected with <a href='#SkPath_Iter'>Iter</a>, +or with <a href='#SkPath_RawIter'>RawIter</a>. -<a name="SkPath_countVerbs"></a> +<a name='SkPath_countVerbs'></a> ## countVerbs -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int countVerbs() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPath_countVerbs'>countVerbs</a>() const </pre> -Returns the number of <a href="#Verb">Verbs</a>: <a href="#SkPath_kMove_Verb">kMove Verb</a>, <a href="#SkPath_kLine_Verb">kLine Verb</a>, <a href="#SkPath_kQuad_Verb">kQuad Verb</a>, <a href="#SkPath_kConic_Verb">kConic Verb</a>, -<a href="#SkPath_kCubic_Verb">kCubic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>; added to <a href="#Path">Path</a>. +Returns the number of <a href='#Verb'>Verbs</a>: <a href='#SkPath_kMove_Verb'>kMove Verb</a>, <a href='#SkPath_kLine_Verb'>kLine Verb</a>, <a href='#SkPath_kQuad_Verb'>kQuad Verb</a>, <a href='#SkPath_kConic_Verb'>kConic Verb</a>, +<a href='#SkPath_kCubic_Verb'>kCubic Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>; added to <a href='#Path'>Path</a>. ### Return Value -length of <a href="#Verb_Array">Verb Array</a> +length of <a href='#Verb_Array'>Verb Array</a> ### Example @@ -1755,32 +2388,33 @@ round rect verb count: 10 ### See Also -<a href="#SkPath_getVerbs">getVerbs</a> <a href="#SkPath_Iter">Iter</a> <a href="#SkPath_RawIter">RawIter</a> +<a href='#SkPath_getVerbs'>getVerbs</a> <a href='#SkPath_Iter'>Iter</a> <a href='#SkPath_RawIter'>RawIter</a> --- -<a name="SkPath_getVerbs"></a> +<a name='SkPath_getVerbs'></a> ## getVerbs -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int getVerbs(uint8_t verbs[], int max) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPath_getVerbs'>getVerbs</a>(uint8_t verbs[], int max) const </pre> -Returns the number of <a href="#SkPath_getVerbs_verbs">verbs</a> in the path. Up to <a href="#SkPath_getVerbs_max">max</a> <a href="#SkPath_getVerbs_verbs">verbs</a> are copied. The -<a href="#SkPath_getVerbs_verbs">verbs</a> are copied as one byte per verb. +Returns the number of <a href='#SkPath_getVerbs_verbs'>verbs</a> in the path. Up to <a href='#SkPath_getVerbs_max'>max</a> <a href='#SkPath_getVerbs_verbs'>verbs</a> are copied. The +<a href='#SkPath_getVerbs_verbs'>verbs</a> are copied as one byte per verb. ### Parameters -<table> <tr> <td><a name="SkPath_getVerbs_verbs"> <code><strong>verbs </strong></code> </a></td> <td> -storage for <a href="#SkPath_getVerbs_verbs">verbs</a>, may be nullptr</td> - </tr> <tr> <td><a name="SkPath_getVerbs_max"> <code><strong>max </strong></code> </a></td> <td> -maximum number to copy into <a href="#SkPath_getVerbs_verbs">verbs</a></td> +<table> <tr> <td><a name='SkPath_getVerbs_verbs'><code><strong>verbs</strong></code></a></td> + <td>storage for <a href='#SkPath_getVerbs_verbs'>verbs</a>, may be nullptr</td> + </tr> + <tr> <td><a name='SkPath_getVerbs_max'><code><strong>max</strong></code></a></td> + <td>maximum number to copy into <a href='#SkPath_getVerbs_verbs'>verbs</a></td> </tr> </table> ### Return Value -the actual number of <a href="#SkPath_getVerbs_verbs">verbs</a> in the path +the actual number of <a href='#SkPath_getVerbs_verbs'>verbs</a> in the path ### Example @@ -1799,29 +2433,29 @@ just right verb count: 3 move line line ### See Also -<a href="#SkPath_countVerbs">countVerbs</a> <a href="#SkPath_getPoints">getPoints</a> <a href="#SkPath_Iter">Iter</a> <a href="#SkPath_RawIter">RawIter</a> +<a href='#SkPath_countVerbs'>countVerbs</a> <a href='#SkPath_getPoints'>getPoints</a> <a href='#SkPath_Iter'>Iter</a> <a href='#SkPath_RawIter'>RawIter</a> --- -<a name="SkPath_swap"></a> +<a name='SkPath_swap'></a> ## swap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void swap(SkPath& other) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_swap'>swap</a>(<a href='#SkPath'>SkPath</a>& other) </pre> -Exchanges the <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Weights</a>, and <a href="#Fill_Type">Fill Type</a> with <a href="#SkPath_swap_other">other</a>. -Cached state is also exchanged. <a href="#SkPath_swap">swap</a> internally exchanges pointers, so +Exchanges the <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, <a href='#Conic_Weight'>Weights</a>, and <a href='#Fill_Type'>Fill Type</a> with <a href='#SkPath_swap_other'>other</a>. +Cached state is also exchanged. <a href='#SkPath_swap'>swap</a> internally exchanges pointers, so it is lightweight and does not allocate memory. -<a href="#SkPath_swap">swap</a> usage has largely been replaced by <a href="#SkPath_copy_operator">operator=(const SkPath& path)</a>. -<a href="#Path">Paths</a> do not copy their content on assignment until they are written to, -making assignment as efficient as <a href="#SkPath_swap">swap</a>. +<a href='#SkPath_swap'>swap</a> usage has largely been replaced by <a href='#SkPath_copy_operator'>operator=(const SkPath& path)</a>. +<a href='#Path'>Paths</a> do not copy their content on assignment until they are written to, +making assignment as efficient as <a href='#SkPath_swap'>swap</a>. ### Parameters -<table> <tr> <td><a name="SkPath_swap_other"> <code><strong>other </strong></code> </a></td> <td> -<a href="#Path">Path</a> exchanged by value</td> +<table> <tr> <td><a name='SkPath_swap_other'><code><strong>other</strong></code></a></td> + <td><a href='#Path'>Path</a> exchanged by value</td> </tr> </table> @@ -1840,32 +2474,32 @@ path2 bounds = 10, 20, 30, 40 ### See Also -<a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> +<a href='#SkPath_copy_operator'>operator=(const SkPath& path)</a> --- -<a name="SkPath_getBounds"></a> +<a name='SkPath_getBounds'></a> ## getBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkRect& getBounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkPath_getBounds'>getBounds</a>() const </pre> -Returns minimum and maximum x and y values of <a href="#Point_Array">Point Array</a>. -Returns (0, 0, 0, 0) if <a href="#Path">Path</a> contains no points. Returned bounds width and height may -be larger or smaller than area affected when <a href="#Path">Path</a> is drawn. +Returns minimum and maximum x and y values of <a href='#Point_Array'>Point Array</a>. +Returns (0, 0, 0, 0) if <a href='#Path'>Path</a> contains no points. Returned bounds width and height may +be larger or smaller than area affected when <a href='#Path'>Path</a> is drawn. -<a href="SkRect_Reference#Rect">Rect</a> returned includes all <a href="SkPoint_Reference#Point">Points</a> added to <a href="#Path">Path</a>, including <a href="SkPoint_Reference#Point">Points</a> associated with -<a href="#SkPath_kMove_Verb">kMove Verb</a> that define empty <a href="#Contour">Contours</a>. +<a href='SkRect_Reference#Rect'>Rect</a> returned includes all <a href='SkPoint_Reference#Point'>Points</a> added to <a href='#Path'>Path</a>, including <a href='SkPoint_Reference#Point'>Points</a> associated with +<a href='#SkPath_kMove_Verb'>kMove Verb</a> that define empty <a href='#Contour'>Contours</a>. ### Return Value -bounds of all <a href="SkPoint_Reference#Point">Points</a> in <a href="#Point_Array">Point Array</a> +bounds of all <a href='SkPoint_Reference#Point'>Points</a> in <a href='#Point_Array'>Point Array</a> ### Example -<div><fiddle-embed name="9160aa6d1476bd87d927cfc8a4bf25e7"><div>Bounds of upright <a href="undocumented#Circle">Circle</a> can be predicted from center and radius. -Bounds of rotated <a href="undocumented#Circle">Circle</a> includes control <a href="SkPoint_Reference#Point">Points</a> outside of filled area. +<div><fiddle-embed name="45c0fc3acb74fab99d544b80eadd10ad"><div>Bounds of upright <a href='undocumented#Circle'>Circle</a> can be predicted from center and radius. +Bounds of rotated <a href='undocumented#Circle'>Circle</a> includes control <a href='SkPoint_Reference#Point'>Points</a> outside of filled area. </div> #### Example Output @@ -1880,42 +2514,88 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553 ### See Also -<a href="#SkPath_computeTightBounds">computeTightBounds</a> <a href="#SkPath_updateBoundsCache">updateBoundsCache</a> +<a href='#SkPath_computeTightBounds'>computeTightBounds</a> <a href='#SkPath_updateBoundsCache'>updateBoundsCache</a> --- -## <a name="Utility"></a> Utility - -| name | description | -| --- | --- | -| <a href="#SkPath_ConvertConicToQuads">ConvertConicToQuads</a> | approximates <a href="#Conic">Conic</a> with <a href="#Quad">Quad</a> array | -| <a href="#SkPath_ConvertToNonInverseFillType">ConvertToNonInverseFillType</a> | returns <a href="#Fill_Type">Fill Type</a> representing inside geometry | -| <a href="#SkPath_dump_2">dump</a> | sends text representation using floats to standard output | -| | <a href="#SkPath_dump">dump(SkWStream* stream, bool forceClose, bool dumpAsHex)</a> const | -| | <a href="#SkPath_dump_2">dump</a> const | -| <a href="#SkPath_dumpHex">dumpHex</a> | sends text representation using hexadecimal to standard output | -| <a href="#SkPath_getSegmentMasks">getSegmentMasks</a> | returns types in <a href="#Verb_Array">Verb Array</a> | -| <a href="#SkPath_incReserve">incReserve</a> | reserves space for additional data | -| <a href="#SkPath_readFromMemory">readFromMemory</a> | Initializes from buffer | -| <a href="#SkPath_serialize">serialize</a> | copies data to buffer | -| <a href="#SkPath_setLastPt">setLastPt</a> | replaces <a href="#Last_Point">Last Point</a> | -| | <a href="#SkPath_setLastPt">setLastPt(SkScalar x, SkScalar y)</a> | -| <a href="#SkPath_updateBoundsCache">updateBoundsCache</a> | refreshes result of <a href="#SkPath_getBounds">getBounds</a> | -| <a href="#SkPath_writeToMemory">writeToMemory</a> | copies data to buffer | - -<a name="SkPath_updateBoundsCache"></a> +## <a name='Utility'>Utility</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_ConvertConicToQuads'>ConvertConicToQuads</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>approximates <a href='#Conic'>Conic</a> with <a href='#Quad'>Quad</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Fill_Type'>Fill Type</a> representing inside geometry</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump'>dump(SkWStream* stream, bool forceClose, bool dumpAsHex)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dumpHex'>dumpHex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using hexadecimal to standard output</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_getSegmentMasks'>getSegmentMasks</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns types in <a href='#Verb_Array'>Verb Array</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_incReserve'>incReserve</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reserves space for additional data</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_readFromMemory'>readFromMemory</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>initializes from buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_serialize'>serialize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies data to buffer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setLastPt'>setLastPt</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_setLastPt'>setLastPt(SkScalar x, SkScalar y)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_updateBoundsCache'>updateBoundsCache</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>refreshes result of <a href='#SkPath_getBounds'>getBounds</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_writeToMemory'>writeToMemory</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies data to buffer</td> + </tr> +</table> + + +<a name='SkPath_updateBoundsCache'></a> ## updateBoundsCache -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void updateBoundsCache() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_updateBoundsCache'>updateBoundsCache</a>() const </pre> -Update internal bounds so that subsequent calls to <a href="#SkPath_getBounds">getBounds</a> are instantaneous. -Unaltered copies of <a href="#Path">Path</a> may also access cached bounds through <a href="#SkPath_getBounds">getBounds</a>. +Update internal bounds so that subsequent calls to <a href='#SkPath_getBounds'>getBounds</a> are instantaneous. +Unaltered copies of <a href='#Path'>Path</a> may also access cached bounds through <a href='#SkPath_getBounds'>getBounds</a>. -For now, identical to calling <a href="#SkPath_getBounds">getBounds</a> and ignoring the returned value. +For now, identical to calling <a href='#SkPath_getBounds'>getBounds</a> and ignoring the returned value. -Call to prepare <a href="#Path">Path</a> subsequently drawn from multiple threads, +Call to prepare <a href='#Path'>Path</a> subsequently drawn from multiple threads, to avoid a race condition where each draw separately computes the bounds. ### Example @@ -1934,37 +2614,37 @@ cached avg: 0.182784 ms ### See Also -<a href="#SkPath_getBounds">getBounds</a> +<a href='#SkPath_getBounds'>getBounds</a> --- -<a name="SkPath_computeTightBounds"></a> +<a name='SkPath_computeTightBounds'></a> ## computeTightBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect computeTightBounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPath_computeTightBounds'>computeTightBounds</a>() const </pre> -Returns minimum and maximum x and y values of the lines and curves in <a href="#Path">Path</a>. -Returns (0, 0, 0, 0) if <a href="#Path">Path</a> contains no points. +Returns minimum and maximum x and y values of the lines and curves in <a href='#Path'>Path</a>. +Returns (0, 0, 0, 0) if <a href='#Path'>Path</a> contains no points. Returned bounds width and height may be larger or smaller than area affected -when <a href="#Path">Path</a> is drawn. +when <a href='#Path'>Path</a> is drawn. -Includes <a href="SkPoint_Reference#Point">Points</a> associated with <a href="#SkPath_kMove_Verb">kMove Verb</a> that define empty -<a href="#Contour">Contours</a>. +Includes <a href='SkPoint_Reference#Point'>Points</a> associated with <a href='#SkPath_kMove_Verb'>kMove Verb</a> that define empty +<a href='#Contour'>Contours</a>. -Behaves identically to <a href="#SkPath_getBounds">getBounds</a> when <a href="#Path">Path</a> contains -only lines. If <a href="#Path">Path</a> contains curves, computed bounds includes -the maximum extent of the <a href="#Quad">Quad</a>, <a href="#Conic">Conic</a>, or <a href="#Cubic">Cubic</a>; is slower than <a href="#SkPath_getBounds">getBounds</a>; -and unlike <a href="#SkPath_getBounds">getBounds</a>, does not cache the result. +Behaves identically to <a href='#SkPath_getBounds'>getBounds</a> when <a href='#Path'>Path</a> contains +only lines. If <a href='#Path'>Path</a> contains curves, computed bounds includes +the maximum extent of the <a href='#Quad'>Quad</a>, <a href='#Conic'>Conic</a>, or <a href='#Cubic'>Cubic</a>; is slower than <a href='#SkPath_getBounds'>getBounds</a>; +and unlike <a href='#SkPath_getBounds'>getBounds</a>, does not cache the result. ### Return Value -tight bounds of curves in <a href="#Path">Path</a> +tight bounds of curves in <a href='#Path'>Path</a> ### Example -<div><fiddle-embed name="da34f02e69ec98d5681300aea9a2d0bf"> +<div><fiddle-embed name="9a39c56e95b19a657133b7ad1fe0cf03"> #### Example Output @@ -1978,62 +2658,62 @@ rotated circle bounds = 25, 20, 75, 70 ### See Also -<a href="#SkPath_getBounds">getBounds</a> +<a href='#SkPath_getBounds'>getBounds</a> --- -<a name="SkPath_conservativelyContainsRect"></a> +<a name='SkPath_conservativelyContainsRect'></a> ## conservativelyContainsRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool conservativelyContainsRect(const SkRect& rect) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect) const </pre> -Returns true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained by <a href="#Path">Path</a>. -May return false when <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained by <a href="#Path">Path</a>. +Returns true if <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained by <a href='#Path'>Path</a>. +May return false when <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained by <a href='#Path'>Path</a>. -For now, only returns true if <a href="#Path">Path</a> has one <a href="#Contour">Contour</a> and is convex. -<a href="#SkPath_conservativelyContainsRect_rect">rect</a> may share points and edges with <a href="#Path">Path</a> and be contained. -Returns true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is empty, that is, it has zero width or height; and -the <a href="SkPoint_Reference#Point">Point</a> or <a href="undocumented#Line">Line</a> described by <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained by <a href="#Path">Path</a>. +For now, only returns true if <a href='#Path'>Path</a> has one <a href='#Contour'>Contour</a> and is convex. +<a href='#SkPath_conservativelyContainsRect_rect'>rect</a> may share points and edges with <a href='#Path'>Path</a> and be contained. +Returns true if <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is empty, that is, it has zero width or height; and +the <a href='SkPoint_Reference#Point'>Point</a> or <a href='undocumented#Line'>Line</a> described by <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained by <a href='#Path'>Path</a>. ### Parameters -<table> <tr> <td><a name="SkPath_conservativelyContainsRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Line">Line</a>, or <a href="SkPoint_Reference#Point">Point</a> checked for containment</td> +<table> <tr> <td><a name='SkPath_conservativelyContainsRect_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Line'>Line</a>, or <a href='SkPoint_Reference#Point'>Point</a> checked for containment</td> </tr> </table> ### Return Value -true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained +true if <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained ### Example -<div><fiddle-embed name="41638d13e40fa449ece354dde5fb1941"><div><a href="SkRect_Reference#Rect">Rect</a> is drawn in blue if it is contained by red <a href="#Path">Path</a>. +<div><fiddle-embed name="41638d13e40fa449ece354dde5fb1941"><div><a href='SkRect_Reference#Rect'>Rect</a> is drawn in blue if it is contained by red <a href='#Path'>Path</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_contains">contains</a> <a href="undocumented#Op">Op</a> <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_Convexity">Convexity</a> +<a href='#SkPath_contains'>contains</a> <a href='undocumented#Op'>Op</a> <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_Convexity'>Convexity</a> --- -<a name="SkPath_incReserve"></a> +<a name='SkPath_incReserve'></a> ## incReserve -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void incReserve(unsigned extraPtCount) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_incReserve'>incReserve</a>(unsigned extraPtCount) </pre> -grows <a href="#Path">Path</a> <a href="#Verb_Array">Verb Array</a> and <a href="#Point_Array">Point Array</a> to contain <a href="#SkPath_incReserve_extraPtCount">extraPtCount</a> additional <a href="SkPoint_Reference#Point">Points</a>. +grows <a href='#Path'>Path</a> <a href='#Verb_Array'>Verb Array</a> and <a href='#Point_Array'>Point Array</a> to contain <a href='#SkPath_incReserve_extraPtCount'>extraPtCount</a> additional <a href='SkPoint_Reference#Point'>Points</a>. May improve performance and use less memory by -reducing the number and size of allocations when creating <a href="#Path">Path</a>. +reducing the number and size of allocations when creating <a href='#Path'>Path</a>. ### Parameters -<table> <tr> <td><a name="SkPath_incReserve_extraPtCount"> <code><strong>extraPtCount </strong></code> </a></td> <td> -number of additional <a href="SkPoint_Reference#Point">Points</a> to allocate</td> +<table> <tr> <td><a name='SkPath_incReserve_extraPtCount'><code><strong>extraPtCount</strong></code></a></td> + <td>number of additional <a href='SkPoint_Reference#Point'>Points</a> to allocate</td> </tr> </table> @@ -2043,68 +2723,187 @@ number of additional <a href="SkPoint_Reference#Point">Points</a> to allocate</t ### See Also -<a href="#Point_Array">Point Array</a> +<a href='#Point_Array'>Point Array</a> --- -## <a name="Build"></a> Build - -| name | description | -| --- | --- | -| <a href="#SkPath_addArc">addArc</a> | adds one <a href="#Contour">Contour</a> containing <a href="#Arc">Arc</a> | -| <a href="#SkPath_addCircle">addCircle</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Circle">Circle</a> | -| <a href="#SkPath_addOval">addOval</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Oval">Oval</a> | -| | <a href="#SkPath_addOval">addOval(const SkRect& oval, Direction dir = kCW Direction)</a> | -| | <a href="#SkPath_addOval_2">addOval(const SkRect& oval, Direction dir, unsigned start)</a> | -| <a href="#SkPath_addPath">addPath</a> | adds contents of <a href="#Path">Path</a> | -| | <a href="#SkPath_addPath">addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend AddPathMode)</a> | -| | <a href="#SkPath_addPath_2">addPath(const SkPath& src, AddPathMode mode = kAppend AddPathMode)</a> | -| | <a href="#SkPath_addPath_3">addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend AddPathMode)</a> | -| <a href="#SkPath_addPoly">addPoly</a> | adds one <a href="#Contour">Contour</a> containing connected lines | -| <a href="#SkPath_addRRect">addRRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> | -| | <a href="#SkPath_addRRect">addRRect(const SkRRect& rrect, Direction dir = kCW Direction)</a> | -| | <a href="#SkPath_addRRect_2">addRRect(const SkRRect& rrect, Direction dir, unsigned start)</a> | -| <a href="#SkPath_addRect">addRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="SkRect_Reference#Rect">Rect</a> | -| | <a href="#SkPath_addRect">addRect(const SkRect& rect, Direction dir = kCW Direction)</a> | -| | <a href="#SkPath_addRect_2">addRect(const SkRect& rect, Direction dir, unsigned start)</a> | -| | <a href="#SkPath_addRect_3">addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, Direction dir = kCW Direction)</a> | -| <a href="#SkPath_addRoundRect">addRoundRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> with common corner radii | -| | <a href="#SkPath_addRoundRect">addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW Direction)</a> | -| | <a href="#SkPath_addRoundRect_2">addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW Direction)</a> | -| <a href="#SkPath_arcTo">arcTo</a> | appends <a href="#Arc">Arc</a> | -| | <a href="#SkPath_arcTo">arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a> | -| <a href="#SkPath_close">close</a> | makes last <a href="#Contour">Contour</a> a loop | -| <a href="#SkPath_cubicTo">cubicTo</a> | appends <a href="#Cubic">Cubic</a> | -| | <a href="#SkPath_cubicTo">cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)</a> | -| <a href="#SkPath_lineTo">lineTo</a> | appends <a href="undocumented#Line">Line</a> | -| | <a href="#SkPath_lineTo">lineTo(SkScalar x, SkScalar y)</a> | -| | <a href="#SkPath_lineTo_2">lineTo(const SkPoint& p)</a> | -| <a href="#SkPath_moveTo">moveTo</a> | starts <a href="#Contour">Contour</a> | -| | <a href="#SkPath_moveTo">moveTo(SkScalar x, SkScalar y)</a> | -| | <a href="#SkPath_moveTo_2">moveTo(const SkPoint& p)</a> | -| <a href="#SkPath_rArcTo">rArcTo</a> | appends <a href="#Arc">Arc</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rConicTo">rConicTo</a> | appends <a href="#Conic">Conic</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rCubicTo">rCubicTo</a> | appends <a href="#Cubic">Cubic</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rLineTo">rLineTo</a> | appends <a href="undocumented#Line">Line</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rMoveTo">rMoveTo</a> | starts <a href="#Contour">Contour</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_rQuadTo">rQuadTo</a> | appends <a href="#Quad">Quad</a> relative to <a href="#Last_Point">Last Point</a> | -| <a href="#SkPath_reverseAddPath">reverseAddPath</a> | adds contents of <a href="#Path">Path</a> back to front | - -<a name="SkPath_moveTo"></a> +## <a name='Build'>Build</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addArc'>addArc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='#Arc'>Arc</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addCircle'>addCircle</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addOval'>addOval</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Oval'>Oval</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addOval'>addOval(const SkRect& oval, Direction dir = kCW Direction)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addOval_2'>addOval(const SkRect& oval, Direction dir, unsigned start)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPath'>addPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds contents of <a href='#Path'>Path</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPath'>addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend AddPathMode)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPath_2'>addPath(const SkPath& src, AddPathMode mode = kAppend AddPathMode)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPath_3'>addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend AddPathMode)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addPoly'>addPoly</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing connected lines</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRRect'>addRRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRRect'>addRRect(const SkRRect& rrect, Direction dir = kCW Direction)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRRect_2'>addRRect(const SkRRect& rrect, Direction dir, unsigned start)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRect'>addRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRect'>addRect(const SkRect& rect, Direction dir = kCW Direction)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRect_2'>addRect(const SkRect& rect, Direction dir, unsigned start)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRect_3'>addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, Direction dir = kCW Direction)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRoundRect'>addRoundRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds one <a href='#Contour'>Contour</a> containing <a href='undocumented#Round_Rect'>Round Rect</a> with common corner radii</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRoundRect'>addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW Direction)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_addRoundRect_2'>addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW Direction)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_arcTo'>arcTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Arc'>Arc</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_arcTo'>arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_close'>close</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>makes last <a href='#Contour'>Contour</a> a loop</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_cubicTo'>cubicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Cubic'>Cubic</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_cubicTo'>cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_lineTo'>lineTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='undocumented#Line'>Line</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_lineTo'>lineTo(SkScalar x, SkScalar y)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_lineTo_2'>lineTo(const SkPoint& p)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_moveTo'>moveTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>starts <a href='#Contour'>Contour</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_moveTo'>moveTo(SkScalar x, SkScalar y)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_moveTo_2'>moveTo(const SkPoint& p)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rArcTo'>rArcTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Arc'>Arc</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rConicTo'>rConicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Conic'>Conic</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rCubicTo'>rCubicTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Cubic'>Cubic</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rLineTo'>rLineTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='undocumented#Line'>Line</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rMoveTo'>rMoveTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>starts <a href='#Contour'>Contour</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_rQuadTo'>rQuadTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>appends <a href='#Quad'>Quad</a> relative to <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_reverseAddPath'>reverseAddPath</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds contents of <a href='#Path'>Path</a> back to front</td> + </tr> +</table> + + +<a name='SkPath_moveTo'></a> ## moveTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void moveTo(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_moveTo'>moveTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Adds beginning of <a href="#Contour">Contour</a> at <a href="SkPoint_Reference#Point">Point</a> (<a href="#SkPath_moveTo_x">x</a>, <a href="#SkPath_moveTo_y">y</a>). +Adds beginning of <a href='#Contour'>Contour</a> at <a href='SkPoint_Reference#Point'>Point</a> (<a href='#SkPath_moveTo_x'>x</a>, <a href='#SkPath_moveTo_y'>y</a>). ### Parameters -<table> <tr> <td><a name="SkPath_moveTo_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="#SkPath_moveTo_x">x</a>-coordinate of <a href="#Contour">Contour</a> start</td> - </tr> <tr> <td><a name="SkPath_moveTo_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="#SkPath_moveTo_y">y</a>-coordinate of <a href="#Contour">Contour</a> start</td> +<table> <tr> <td><a name='SkPath_moveTo_x'><code><strong>x</strong></code></a></td> + <td><a href='#SkPath_moveTo_x'>x</a>-coordinate of <a href='#Contour'>Contour</a> start</td> + </tr> + <tr> <td><a name='SkPath_moveTo_y'><code><strong>y</strong></code></a></td> + <td><a href='#SkPath_moveTo_y'>y</a>-coordinate of <a href='#Contour'>Contour</a> start</td> </tr> </table> @@ -2114,53 +2913,54 @@ Adds beginning of <a href="#Contour">Contour</a> at <a href="SkPoint_Reference#P ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_rMoveTo">rMoveTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_close">close</a> +<a href='#Contour'>Contour</a> <a href='#SkPath_lineTo'>lineTo</a><sup><a href='#SkPath_lineTo_2'>[2]</a></sup> <a href='#SkPath_rMoveTo'>rMoveTo</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_cubicTo'>cubicTo</a><sup><a href='#SkPath_cubicTo_2'>[2]</a></sup> <a href='#SkPath_close'>close</a> --- -<a name="SkPath_moveTo_2"></a> +<a name='SkPath_moveTo_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void moveTo(const SkPoint& p) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_moveTo'>moveTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p) </pre> -Adds beginning of <a href="#Contour">Contour</a> at <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_moveTo_2_p">p</a>. +Adds beginning of <a href='#Contour'>Contour</a> at <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_moveTo_2_p'>p</a>. ### Parameters -<table> <tr> <td><a name="SkPath_moveTo_2_p"> <code><strong>p </strong></code> </a></td> <td> -contour start</td> +<table> <tr> <td><a name='SkPath_moveTo_2_p'><code><strong>p</strong></code></a></td> + <td>contour start</td> </tr> </table> ### Example -<div><fiddle-embed name="53b351d3fac667a4803418238e44a593"></fiddle-embed></div> +<div><fiddle-embed name="cb8d37990f6e7df3bcc85e7240c81274"></fiddle-embed></div> ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_rMoveTo">rMoveTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_close">close</a> +<a href='#Contour'>Contour</a> <a href='#SkPath_lineTo'>lineTo</a><sup><a href='#SkPath_lineTo_2'>[2]</a></sup> <a href='#SkPath_rMoveTo'>rMoveTo</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_cubicTo'>cubicTo</a><sup><a href='#SkPath_cubicTo_2'>[2]</a></sup> <a href='#SkPath_close'>close</a> --- -<a name="SkPath_rMoveTo"></a> +<a name='SkPath_rMoveTo'></a> ## rMoveTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rMoveTo(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rMoveTo'>rMoveTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Adds beginning of <a href="#Contour">Contour</a> relative to <a href="#Last_Point">Last Point</a>. -If <a href="#Path">Path</a> is empty, starts <a href="#Contour">Contour</a> at (<a href="#SkPath_rMoveTo_dx">dx</a>, <a href="#SkPath_rMoveTo_dy">dy</a>). -Otherwise, start <a href="#Contour">Contour</a> at <a href="#Last_Point">Last Point</a> offset by (<a href="#SkPath_rMoveTo_dx">dx</a>, <a href="#SkPath_rMoveTo_dy">dy</a>). +Adds beginning of <a href='#Contour'>Contour</a> relative to <a href='#Last_Point'>Last Point</a>. +If <a href='#Path'>Path</a> is empty, starts <a href='#Contour'>Contour</a> at (<a href='#SkPath_rMoveTo_dx'>dx</a>, <a href='#SkPath_rMoveTo_dy'>dy</a>). +Otherwise, start <a href='#Contour'>Contour</a> at <a href='#Last_Point'>Last Point</a> offset by (<a href='#SkPath_rMoveTo_dx'>dx</a>, <a href='#SkPath_rMoveTo_dy'>dy</a>). Function name stands for "relative move to". ### Parameters -<table> <tr> <td><a name="SkPath_rMoveTo_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Contour">Contour</a> start x</td> - </tr> <tr> <td><a name="SkPath_rMoveTo_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> y to <a href="#Contour">Contour</a> start y</td> +<table> <tr> <td><a name='SkPath_rMoveTo_dx'><code><strong>dx</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Contour'>Contour</a> start x</td> + </tr> + <tr> <td><a name='SkPath_rMoveTo_dy'><code><strong>dy</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> y to <a href='#Contour'>Contour</a> start y</td> </tr> </table> @@ -2170,29 +2970,30 @@ offset from <a href="#Last_Point">Last Point</a> y to <a href="#Contour">Contour ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_close">close</a> +<a href='#Contour'>Contour</a> <a href='#SkPath_lineTo'>lineTo</a><sup><a href='#SkPath_lineTo_2'>[2]</a></sup> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_cubicTo'>cubicTo</a><sup><a href='#SkPath_cubicTo_2'>[2]</a></sup> <a href='#SkPath_close'>close</a> --- -<a name="SkPath_lineTo"></a> +<a name='SkPath_lineTo'></a> ## lineTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void lineTo(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_lineTo'>lineTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to (<a href="#SkPath_lineTo_x">x</a>, <a href="#SkPath_lineTo_y">y</a>). If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is -<a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="undocumented#Line">Line</a>. +Adds <a href='undocumented#Line'>Line</a> from <a href='#Last_Point'>Last Point</a> to (<a href='#SkPath_lineTo_x'>x</a>, <a href='#SkPath_lineTo_y'>y</a>). If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is +<a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) before adding <a href='undocumented#Line'>Line</a>. -<a href="#SkPath_lineTo">lineTo</a> appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed. -<a href="#SkPath_lineTo">lineTo</a> then appends <a href="#SkPath_kLine_Verb">kLine Verb</a> to <a href="#Verb_Array">Verb Array</a> and (<a href="#SkPath_lineTo_x">x</a>, <a href="#SkPath_lineTo_y">y</a>) to <a href="#Point_Array">Point Array</a>. +<a href='#SkPath_lineTo'>lineTo</a> appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed. +<a href='#SkPath_lineTo'>lineTo</a> then appends <a href='#SkPath_kLine_Verb'>kLine Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (<a href='#SkPath_lineTo_x'>x</a>, <a href='#SkPath_lineTo_y'>y</a>) to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_lineTo_x"> <code><strong>x </strong></code> </a></td> <td> -end of added <a href="undocumented#Line">Line</a> in <a href="#SkPath_lineTo_x">x</a></td> - </tr> <tr> <td><a name="SkPath_lineTo_y"> <code><strong>y </strong></code> </a></td> <td> -end of added <a href="undocumented#Line">Line</a> in <a href="#SkPath_lineTo_y">y</a></td> +<table> <tr> <td><a name='SkPath_lineTo_x'><code><strong>x</strong></code></a></td> + <td>end of added <a href='undocumented#Line'>Line</a> in <a href='#SkPath_lineTo_x'>x</a></td> + </tr> + <tr> <td><a name='SkPath_lineTo_y'><code><strong>y</strong></code></a></td> + <td>end of added <a href='undocumented#Line'>Line</a> in <a href='#SkPath_lineTo_y'>y</a></td> </tr> </table> @@ -2202,26 +3003,26 @@ end of added <a href="undocumented#Line">Line</a> in <a href="#SkPath_lineTo_y"> ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rLineTo">rLineTo</a> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_rLineTo'>rLineTo</a> <a href='#SkPath_addRect'>addRect</a><sup><a href='#SkPath_addRect_2'>[2]</a></sup><sup><a href='#SkPath_addRect_3'>[3]</a></sup> --- -<a name="SkPath_lineTo_2"></a> +<a name='SkPath_lineTo_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void lineTo(const SkPoint& p) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_lineTo'>lineTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p) </pre> -Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_lineTo_2_p">p</a>. If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is -<a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="undocumented#Line">Line</a>. +Adds <a href='undocumented#Line'>Line</a> from <a href='#Last_Point'>Last Point</a> to <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_lineTo_2_p'>p</a>. If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is +<a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) before adding <a href='undocumented#Line'>Line</a>. -<a href="#SkPath_lineTo">lineTo</a> first appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed. -<a href="#SkPath_lineTo">lineTo</a> then appends <a href="#SkPath_kLine_Verb">kLine Verb</a> to <a href="#Verb_Array">Verb Array</a> and <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_lineTo_2_p">p</a> to <a href="#Point_Array">Point Array</a>. +<a href='#SkPath_lineTo'>lineTo</a> first appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed. +<a href='#SkPath_lineTo'>lineTo</a> then appends <a href='#SkPath_kLine_Verb'>kLine Verb</a> to <a href='#Verb_Array'>Verb Array</a> and <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_lineTo_2_p'>p</a> to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_lineTo_2_p"> <code><strong>p </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of added <a href="undocumented#Line">Line</a></td> +<table> <tr> <td><a name='SkPath_lineTo_2_p'><code><strong>p</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of added <a href='undocumented#Line'>Line</a></td> </tr> </table> @@ -2231,31 +3032,32 @@ end <a href="SkPoint_Reference#Point">Point</a> of added <a href="undocumented#L ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rLineTo">rLineTo</a> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_rLineTo'>rLineTo</a> <a href='#SkPath_addRect'>addRect</a><sup><a href='#SkPath_addRect_2'>[2]</a></sup><sup><a href='#SkPath_addRect_3'>[3]</a></sup> --- -<a name="SkPath_rLineTo"></a> +<a name='SkPath_rLineTo'></a> ## rLineTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rLineTo(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rLineTo'>rLineTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rLineTo_dx">dx</a>, <a href="#SkPath_rLineTo_dy">dy</a>). If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is -<a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="undocumented#Line">Line</a>. +Adds <a href='undocumented#Line'>Line</a> from <a href='#Last_Point'>Last Point</a> to <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rLineTo_dx'>dx</a>, <a href='#SkPath_rLineTo_dy'>dy</a>). If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is +<a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) before adding <a href='undocumented#Line'>Line</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; -then appends <a href="#SkPath_kLine_Verb">kLine Verb</a> to <a href="#Verb_Array">Verb Array</a> and <a href="undocumented#Line">Line</a> end to <a href="#Point_Array">Point Array</a>. -<a href="undocumented#Line">Line</a> end is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rLineTo_dx">dx</a>, <a href="#SkPath_rLineTo_dy">dy</a>). +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed; +then appends <a href='#SkPath_kLine_Verb'>kLine Verb</a> to <a href='#Verb_Array'>Verb Array</a> and <a href='undocumented#Line'>Line</a> end to <a href='#Point_Array'>Point Array</a>. +<a href='undocumented#Line'>Line</a> end is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rLineTo_dx'>dx</a>, <a href='#SkPath_rLineTo_dy'>dy</a>). Function name stands for "relative line to". ### Parameters -<table> <tr> <td><a name="SkPath_rLineTo_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="undocumented#Line">Line</a> end x</td> - </tr> <tr> <td><a name="SkPath_rLineTo_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> y to <a href="undocumented#Line">Line</a> end y</td> +<table> <tr> <td><a name='SkPath_rLineTo_dx'><code><strong>dx</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='undocumented#Line'>Line</a> end x</td> + </tr> + <tr> <td><a name='SkPath_rLineTo_dy'><code><strong>dy</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> y to <a href='undocumented#Line'>Line</a> end y</td> </tr> </table> @@ -2265,55 +3067,58 @@ offset from <a href="#Last_Point">Last Point</a> y to <a href="undocumented#Line ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_lineTo'>lineTo</a><sup><a href='#SkPath_lineTo_2'>[2]</a></sup> <a href='#SkPath_addRect'>addRect</a><sup><a href='#SkPath_addRect_2'>[2]</a></sup><sup><a href='#SkPath_addRect_3'>[3]</a></sup> --- -## <a name="Quad"></a> Quad +## <a name='Quad'>Quad</a> -<a href="#Quad">Quad</a> describes a quadratic Bezier, a second-order curve identical to a section -of a parabola. <a href="#Quad">Quad</a> begins at a start <a href="SkPoint_Reference#Point">Point</a>, curves towards a control <a href="SkPoint_Reference#Point">Point</a>, -and then curves to an end <a href="SkPoint_Reference#Point">Point</a>. +<a href='#Quad'>Quad</a> describes a quadratic Bezier, a second-order curve identical to a section +of a parabola. <a href='#Quad'>Quad</a> begins at a start <a href='SkPoint_Reference#Point'>Point</a>, curves towards a control <a href='SkPoint_Reference#Point'>Point</a>, +and then curves to an end <a href='SkPoint_Reference#Point'>Point</a>. ### Example <div><fiddle-embed name="78ad51fa1cd33eb84a6f99061e56e067"></fiddle-embed></div> -<a href="#Quad">Quad</a> is a special case of <a href="#Conic">Conic</a> where <a href="#Conic_Weight">Conic Weight</a> is set to one. +<a href='#Quad'>Quad</a> is a special case of <a href='#Conic'>Conic</a> where <a href='#Conic_Weight'>Conic Weight</a> is set to one. -<a href="#Quad">Quad</a> is always contained by the triangle connecting its three <a href="SkPoint_Reference#Point">Points</a>. <a href="#Quad">Quad</a> -begins tangent to the line between start <a href="SkPoint_Reference#Point">Point</a> and control <a href="SkPoint_Reference#Point">Point</a>, and ends -tangent to the line between control <a href="SkPoint_Reference#Point">Point</a> and end <a href="SkPoint_Reference#Point">Point</a>. +<a href='#Quad'>Quad</a> is always contained by the triangle connecting its three <a href='SkPoint_Reference#Point'>Points</a>. <a href='#Quad'>Quad</a> +begins tangent to the line between start <a href='SkPoint_Reference#Point'>Point</a> and control <a href='SkPoint_Reference#Point'>Point</a>, and ends +tangent to the line between control <a href='SkPoint_Reference#Point'>Point</a> and end <a href='SkPoint_Reference#Point'>Point</a>. ### Example <div><fiddle-embed name="4082f66a42df11bb20462b232b156bb6"></fiddle-embed></div> -<a name="SkPath_quadTo"></a> +<a name='SkPath_quadTo'></a> ## quadTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_quadTo'>quadTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2) </pre> -Adds <a href="#Quad">Quad</a> from <a href="#Last_Point">Last Point</a> towards (<a href="#SkPath_quadTo_x1">x1</a>, <a href="#SkPath_quadTo_y1">y1</a>), to (<a href="#SkPath_quadTo_x2">x2</a>, <a href="#SkPath_quadTo_y2">y2</a>). -If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) -before adding <a href="#Quad">Quad</a>. +Adds <a href='#Quad'>Quad</a> from <a href='#Last_Point'>Last Point</a> towards (<a href='#SkPath_quadTo_x1'>x1</a>, <a href='#SkPath_quadTo_y1'>y1</a>), to (<a href='#SkPath_quadTo_x2'>x2</a>, <a href='#SkPath_quadTo_y2'>y2</a>). +If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) +before adding <a href='#Quad'>Quad</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; -then appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>; and (<a href="#SkPath_quadTo_x1">x1</a>, <a href="#SkPath_quadTo_y1">y1</a>), (<a href="#SkPath_quadTo_x2">x2</a>, <a href="#SkPath_quadTo_y2">y2</a>) -to <a href="#Point_Array">Point Array</a>. +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed; +then appends <a href='#SkPath_kQuad_Verb'>kQuad Verb</a> to <a href='#Verb_Array'>Verb Array</a>; and (<a href='#SkPath_quadTo_x1'>x1</a>, <a href='#SkPath_quadTo_y1'>y1</a>), (<a href='#SkPath_quadTo_x2'>x2</a>, <a href='#SkPath_quadTo_y2'>y2</a>) +to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_quadTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> -control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in x</td> - </tr> <tr> <td><a name="SkPath_quadTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> -control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in y</td> - </tr> <tr> <td><a name="SkPath_quadTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in x</td> - </tr> <tr> <td><a name="SkPath_quadTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in y</td> +<table> <tr> <td><a name='SkPath_quadTo_x1'><code><strong>x1</strong></code></a></td> + <td>control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Quad'>Quad</a> in x</td> + </tr> + <tr> <td><a name='SkPath_quadTo_y1'><code><strong>y1</strong></code></a></td> + <td>control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Quad'>Quad</a> in y</td> + </tr> + <tr> <td><a name='SkPath_quadTo_x2'><code><strong>x2</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Quad'>Quad</a> in x</td> + </tr> + <tr> <td><a name='SkPath_quadTo_y2'><code><strong>y2</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Quad'>Quad</a> in y</td> </tr> </table> @@ -2323,30 +3128,31 @@ end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in y ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_rQuadTo">rQuadTo</a> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_rQuadTo'>rQuadTo</a> --- -<a name="SkPath_quadTo_2"></a> +<a name='SkPath_quadTo_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void quadTo(const SkPoint& p1, const SkPoint& p2) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_quadTo'>quadTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2) </pre> -Adds <a href="#Quad">Quad</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_quadTo_2_p1">p1</a>, to <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_quadTo_2_p2">p2</a>. -If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) -before adding <a href="#Quad">Quad</a>. +Adds <a href='#Quad'>Quad</a> from <a href='#Last_Point'>Last Point</a> towards <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_quadTo_2_p1'>p1</a>, to <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_quadTo_2_p2'>p2</a>. +If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) +before adding <a href='#Quad'>Quad</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; -then appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>; and <a href="SkPoint_Reference#Point">Points</a> <a href="#SkPath_quadTo_2_p1">p1</a>, <a href="#SkPath_quadTo_2_p2">p2</a> -to <a href="#Point_Array">Point Array</a>. +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed; +then appends <a href='#SkPath_kQuad_Verb'>kQuad Verb</a> to <a href='#Verb_Array'>Verb Array</a>; and <a href='SkPoint_Reference#Point'>Points</a> <a href='#SkPath_quadTo_2_p1'>p1</a>, <a href='#SkPath_quadTo_2_p2'>p2</a> +to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_quadTo_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> -control <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Quad">Quad</a></td> - </tr> <tr> <td><a name="SkPath_quadTo_2_p2"> <code><strong>p2 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Quad">Quad</a></td> +<table> <tr> <td><a name='SkPath_quadTo_2_p1'><code><strong>p1</strong></code></a></td> + <td>control <a href='SkPoint_Reference#Point'>Point</a> of added <a href='#Quad'>Quad</a></td> + </tr> + <tr> <td><a name='SkPath_quadTo_2_p2'><code><strong>p2</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of added <a href='#Quad'>Quad</a></td> </tr> </table> @@ -2356,38 +3162,41 @@ end <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Quad">Quad</a ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_rQuadTo">rQuadTo</a> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_rQuadTo'>rQuadTo</a> --- -<a name="SkPath_rQuadTo"></a> +<a name='SkPath_rQuadTo'></a> ## rQuadTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rQuadTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rQuadTo'>rQuadTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2) </pre> -Adds <a href="#Quad">Quad</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rQuadTo_dx1">dx1</a>, <a href="#SkPath_rQuadTo_dy1">dy1</a>), to <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rQuadTo_dx2">dx2</a>, <a href="#SkPath_rQuadTo_dy2">dy2</a>). -If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> -is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="#Quad">Quad</a>. +Adds <a href='#Quad'>Quad</a> from <a href='#Last_Point'>Last Point</a> towards <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rQuadTo_dx1'>dx1</a>, <a href='#SkPath_rQuadTo_dy1'>dy1</a>), to <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rQuadTo_dx2'>dx2</a>, <a href='#SkPath_rQuadTo_dy2'>dy2</a>). +If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> +is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) before adding <a href='#Quad'>Quad</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, -if needed; then appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>; and appends <a href="#Quad">Quad</a> -control and <a href="#Quad">Quad</a> end to <a href="#Point_Array">Point Array</a>. -<a href="#Quad">Quad</a> control is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rQuadTo_dx1">dx1</a>, <a href="#SkPath_rQuadTo_dy1">dy1</a>). -<a href="#Quad">Quad</a> end is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rQuadTo_dx2">dx2</a>, <a href="#SkPath_rQuadTo_dy2">dy2</a>). +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, +if needed; then appends <a href='#SkPath_kQuad_Verb'>kQuad Verb</a> to <a href='#Verb_Array'>Verb Array</a>; and appends <a href='#Quad'>Quad</a> +control and <a href='#Quad'>Quad</a> end to <a href='#Point_Array'>Point Array</a>. +<a href='#Quad'>Quad</a> control is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rQuadTo_dx1'>dx1</a>, <a href='#SkPath_rQuadTo_dy1'>dy1</a>). +<a href='#Quad'>Quad</a> end is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rQuadTo_dx2'>dx2</a>, <a href='#SkPath_rQuadTo_dy2'>dy2</a>). Function name stands for "relative quad to". ### Parameters -<table> <tr> <td><a name="SkPath_rQuadTo_dx1"> <code><strong>dx1 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> control x</td> - </tr> <tr> <td><a name="SkPath_rQuadTo_dy1"> <code><strong>dy1 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> control y</td> - </tr> <tr> <td><a name="SkPath_rQuadTo_dx2"> <code><strong>dx2 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> end x</td> - </tr> <tr> <td><a name="SkPath_rQuadTo_dy2"> <code><strong>dy2 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> end y</td> +<table> <tr> <td><a name='SkPath_rQuadTo_dx1'><code><strong>dx1</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Quad'>Quad</a> control x</td> + </tr> + <tr> <td><a name='SkPath_rQuadTo_dy1'><code><strong>dy1</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Quad'>Quad</a> control y</td> + </tr> + <tr> <td><a name='SkPath_rQuadTo_dx2'><code><strong>dx2</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Quad'>Quad</a> end x</td> + </tr> + <tr> <td><a name='SkPath_rQuadTo_dy2'><code><strong>dy2</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Quad'>Quad</a> end y</td> </tr> </table> @@ -2397,29 +3206,34 @@ offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> e ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -## <a name="Conic"></a> Conic +## <a name='Conic'>Conic</a> -<a href="#Conic">Conic</a> describes a conical section: a piece of an ellipse, or a piece of a -parabola, or a piece of a hyperbola. <a href="#Conic">Conic</a> begins at a start <a href="SkPoint_Reference#Point">Point</a>, -curves towards a control <a href="SkPoint_Reference#Point">Point</a>, and then curves to an end <a href="SkPoint_Reference#Point">Point</a>. The influence -of the control <a href="SkPoint_Reference#Point">Point</a> is determined by <a href="#Conic_Weight">Conic Weight</a>. +<a href='#Conic'>Conic</a> describes a conical section: a piece of an ellipse, or a piece of a +parabola, or a piece of a hyperbola. <a href='#Conic'>Conic</a> begins at a start <a href='SkPoint_Reference#Point'>Point</a>, +curves towards a control <a href='SkPoint_Reference#Point'>Point</a>, and then curves to an end <a href='SkPoint_Reference#Point'>Point</a>. The influence +of the control <a href='SkPoint_Reference#Point'>Point</a> is determined by <a href='#Conic_Weight'>Conic Weight</a>. -Each <a href="#Conic">Conic</a> in <a href="#Path">Path</a> adds two <a href="SkPoint_Reference#Point">Points</a> and one <a href="#Conic_Weight">Conic Weight</a>. <a href="#Conic_Weight">Conic Weights</a> in <a href="#Path">Path</a> -may be inspected with <a href="#SkPath_Iter">Iter</a>, or with <a href="#SkPath_RawIter">RawIter</a>. +Each <a href='#Conic'>Conic</a> in <a href='#Path'>Path</a> adds two <a href='SkPoint_Reference#Point'>Points</a> and one <a href='#Conic_Weight'>Conic Weight</a>. <a href='#Conic_Weight'>Conic Weights</a> in <a href='#Path'>Path</a> +may be inspected with <a href='#SkPath_Iter'>Iter</a>, or with <a href='#SkPath_RawIter'>RawIter</a>. -## <a name="Conic_Weight"></a> Conic Weight +## <a name='Conic_Weight'>Conic Weight</a> -<a href="#Conic_Weight">Weight</a> determines both the strength of the control <a href="SkPoint_Reference#Point">Point</a> and the type of <a href="#Conic">Conic</a>. -If <a href="#Conic_Weight">Weight</a> is exactly one, then <a href="#Conic">Conic</a> is identical to <a href="#Quad">Quad</a>; it is always a -parabolic segment. +<a href='#Conic_Weight'>Weight</a> determines both the strength of the control <a href='SkPoint_Reference#Point'>Point</a> and the type of <a href='#Conic'>Conic</a>. +<a href='#Conic_Weight'>Weight</a> varies from zero to infinity. At zero, <a href='#Conic_Weight'>Weight</a> causes the control <a href='SkPoint_Reference#Point'>Point</a> to +have no effect; <a href='#Conic'>Conic</a> is identical to a line segment from start <a href='SkPoint_Reference#Point'>Point</a> to end +point. If <a href='#Conic_Weight'>Weight</a> is less than one, <a href='#Conic'>Conic</a> follows an elliptical arc. +If <a href='#Conic_Weight'>Weight</a> is exactly one, then <a href='#Conic'>Conic</a> is identical to <a href='#Quad'>Quad</a>; <a href='#Conic'>Conic</a> follows a +parabolic arc. If <a href='#Conic_Weight'>Weight</a> is greater than one, <a href='#Conic'>Conic</a> follows a hyperbolic +arc. If <a href='#Conic_Weight'>Weight</a> is infinity, <a href='#Conic'>Conic</a> is indentical to two line segments, connecting +start <a href='SkPoint_Reference#Point'>Point</a> to control <a href='SkPoint_Reference#Point'>Point</a>, and control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>. ### Example -<div><fiddle-embed name="2aadded3d20dfef34d1c8abe28c7bc8d"><div>When <a href="#Conic_Weight">Conic Weight</a> is one, <a href="#Quad">Quad</a> is added to path; the two are identical. +<div><fiddle-embed name="2aadded3d20dfef34d1c8abe28c7bc8d"><div>When <a href='#Conic_Weight'>Conic Weight</a> is one, <a href='#Quad'>Quad</a> is added to path; the two are identical. </div> #### Example Output @@ -2432,7 +3246,7 @@ done </fiddle-embed></div> -If weight is less than one, <a href="#Conic">Conic</a> is an elliptical segment. +If weight is less than one, <a href='#Conic'>Conic</a> is an elliptical segment. ### Example @@ -2449,9 +3263,9 @@ done </fiddle-embed></div> -If weight is greater than one, <a href="#Conic">Conic</a> is a hyperbolic segment. As weight gets large, +If weight is greater than one, <a href='#Conic'>Conic</a> is a hyperbolic segment. As weight gets large, a hyperbolic segment can be approximated by straight lines connecting the -control <a href="SkPoint_Reference#Point">Point</a> with the end <a href="SkPoint_Reference#Point">Points</a>. +control <a href='SkPoint_Reference#Point'>Point</a> with the end <a href='SkPoint_Reference#Point'>Points</a>. ### Example @@ -2468,40 +3282,44 @@ done </fiddle-embed></div> -<a name="SkPath_conicTo"></a> +<a name='SkPath_conicTo'></a> ## conicTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_conicTo'>conicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> w) </pre> -Adds <a href="#Conic">Conic</a> from <a href="#Last_Point">Last Point</a> towards (<a href="#SkPath_conicTo_x1">x1</a>, <a href="#SkPath_conicTo_y1">y1</a>), to (<a href="#SkPath_conicTo_x2">x2</a>, <a href="#SkPath_conicTo_y2">y2</a>), weighted by <a href="#SkPath_conicTo_w">w</a>. -If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) -before adding <a href="#Conic">Conic</a>. +Adds <a href='#Conic'>Conic</a> from <a href='#Last_Point'>Last Point</a> towards (<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), to (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>), weighted by <a href='#SkPath_conicTo_w'>w</a>. +If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) +before adding <a href='#Conic'>Conic</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed. +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed. -If <a href="#SkPath_conicTo_w">w</a> is finite and not one, appends <a href="#SkPath_kConic_Verb">kConic Verb</a> to <a href="#Verb_Array">Verb Array</a>; -and (<a href="#SkPath_conicTo_x1">x1</a>, <a href="#SkPath_conicTo_y1">y1</a>), (<a href="#SkPath_conicTo_x2">x2</a>, <a href="#SkPath_conicTo_y2">y2</a>) to <a href="#Point_Array">Point Array</a>; and <a href="#SkPath_conicTo_w">w</a> to <a href="#Conic_Weight">Conic Weights</a>. +If <a href='#SkPath_conicTo_w'>w</a> is finite and not one, appends <a href='#SkPath_kConic_Verb'>kConic Verb</a> to <a href='#Verb_Array'>Verb Array</a>; +and (<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>) to <a href='#Point_Array'>Point Array</a>; and <a href='#SkPath_conicTo_w'>w</a> to <a href='#Conic_Weight'>Conic Weights</a>. -If <a href="#SkPath_conicTo_w">w</a> is one, appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>, and -(<a href="#SkPath_conicTo_x1">x1</a>, <a href="#SkPath_conicTo_y1">y1</a>), (<a href="#SkPath_conicTo_x2">x2</a>, <a href="#SkPath_conicTo_y2">y2</a>) to <a href="#Point_Array">Point Array</a>. +If <a href='#SkPath_conicTo_w'>w</a> is one, appends <a href='#SkPath_kQuad_Verb'>kQuad Verb</a> to <a href='#Verb_Array'>Verb Array</a>, and +(<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>) to <a href='#Point_Array'>Point Array</a>. -If <a href="#SkPath_conicTo_w">w</a> is not finite, appends <a href="#SkPath_kLine_Verb">kLine Verb</a> twice to <a href="#Verb_Array">Verb Array</a>, and -(<a href="#SkPath_conicTo_x1">x1</a>, <a href="#SkPath_conicTo_y1">y1</a>), (<a href="#SkPath_conicTo_x2">x2</a>, <a href="#SkPath_conicTo_y2">y2</a>) to <a href="#Point_Array">Point Array</a>. +If <a href='#SkPath_conicTo_w'>w</a> is not finite, appends <a href='#SkPath_kLine_Verb'>kLine Verb</a> twice to <a href='#Verb_Array'>Verb Array</a>, and +(<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>) to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_conicTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> -control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in x</td> - </tr> <tr> <td><a name="SkPath_conicTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> -control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in y</td> - </tr> <tr> <td><a name="SkPath_conicTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in x</td> - </tr> <tr> <td><a name="SkPath_conicTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in y</td> - </tr> <tr> <td><a name="SkPath_conicTo_w"> <code><strong>w </strong></code> </a></td> <td> -weight of added <a href="#Conic">Conic</a></td> +<table> <tr> <td><a name='SkPath_conicTo_x1'><code><strong>x1</strong></code></a></td> + <td>control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Conic'>Conic</a> in x</td> + </tr> + <tr> <td><a name='SkPath_conicTo_y1'><code><strong>y1</strong></code></a></td> + <td>control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Conic'>Conic</a> in y</td> + </tr> + <tr> <td><a name='SkPath_conicTo_x2'><code><strong>x2</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Conic'>Conic</a> in x</td> + </tr> + <tr> <td><a name='SkPath_conicTo_y2'><code><strong>y2</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Conic'>Conic</a> in y</td> + </tr> + <tr> <td><a name='SkPath_conicTo_w'><code><strong>w</strong></code></a></td> + <td>weight of added <a href='#Conic'>Conic</a></td> </tr> </table> @@ -2514,90 +3332,97 @@ top curve is hyperbolic. ### See Also -<a href="#SkPath_rConicTo">rConicTo</a> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_addArc">addArc</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#SkPath_rConicTo'>rConicTo</a> <a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkPath_addArc'>addArc</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -<a name="SkPath_conicTo_2"></a> +<a name='SkPath_conicTo_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void conicTo(const SkPoint& p1, const SkPoint& p2, SkScalar w) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_conicTo'>conicTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, <a href='undocumented#SkScalar'>SkScalar</a> w) </pre> -Adds <a href="#Conic">Conic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_conicTo_2_p1">p1</a>, to <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_conicTo_2_p2">p2</a>, weighted by <a href="#SkPath_conicTo_2_w">w</a>. -If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) -before adding <a href="#Conic">Conic</a>. +Adds <a href='#Conic'>Conic</a> from <a href='#Last_Point'>Last Point</a> towards <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, to <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_conicTo_2_p2'>p2</a>, weighted by <a href='#SkPath_conicTo_2_w'>w</a>. +If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) +before adding <a href='#Conic'>Conic</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed. +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed. -If <a href="#SkPath_conicTo_2_w">w</a> is finite and not one, appends <a href="#SkPath_kConic_Verb">kConic Verb</a> to <a href="#Verb_Array">Verb Array</a>; -and <a href="SkPoint_Reference#Point">Points</a> <a href="#SkPath_conicTo_2_p1">p1</a>, <a href="#SkPath_conicTo_2_p2">p2</a> to <a href="#Point_Array">Point Array</a>; and <a href="#SkPath_conicTo_2_w">w</a> to <a href="#Conic_Weight">Conic Weights</a>. +If <a href='#SkPath_conicTo_2_w'>w</a> is finite and not one, appends <a href='#SkPath_kConic_Verb'>kConic Verb</a> to <a href='#Verb_Array'>Verb Array</a>; +and <a href='SkPoint_Reference#Point'>Points</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, <a href='#SkPath_conicTo_2_p2'>p2</a> to <a href='#Point_Array'>Point Array</a>; and <a href='#SkPath_conicTo_2_w'>w</a> to <a href='#Conic_Weight'>Conic Weights</a>. -If <a href="#SkPath_conicTo_2_w">w</a> is one, appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>, and <a href="SkPoint_Reference#Point">Points</a> <a href="#SkPath_conicTo_2_p1">p1</a>, <a href="#SkPath_conicTo_2_p2">p2</a> -to <a href="#Point_Array">Point Array</a>. +If <a href='#SkPath_conicTo_2_w'>w</a> is one, appends <a href='#SkPath_kQuad_Verb'>kQuad Verb</a> to <a href='#Verb_Array'>Verb Array</a>, and <a href='SkPoint_Reference#Point'>Points</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, <a href='#SkPath_conicTo_2_p2'>p2</a> +to <a href='#Point_Array'>Point Array</a>. -If <a href="#SkPath_conicTo_2_w">w</a> is not finite, appends <a href="#SkPath_kLine_Verb">kLine Verb</a> twice to <a href="#Verb_Array">Verb Array</a>, and -<a href="SkPoint_Reference#Point">Points</a> <a href="#SkPath_conicTo_2_p1">p1</a>, <a href="#SkPath_conicTo_2_p2">p2</a> to <a href="#Point_Array">Point Array</a>. +If <a href='#SkPath_conicTo_2_w'>w</a> is not finite, appends <a href='#SkPath_kLine_Verb'>kLine Verb</a> twice to <a href='#Verb_Array'>Verb Array</a>, and +<a href='SkPoint_Reference#Point'>Points</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, <a href='#SkPath_conicTo_2_p2'>p2</a> to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_conicTo_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> -control <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Conic">Conic</a></td> - </tr> <tr> <td><a name="SkPath_conicTo_2_p2"> <code><strong>p2 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Conic">Conic</a></td> - </tr> <tr> <td><a name="SkPath_conicTo_2_w"> <code><strong>w </strong></code> </a></td> <td> -weight of added <a href="#Conic">Conic</a></td> +<table> <tr> <td><a name='SkPath_conicTo_2_p1'><code><strong>p1</strong></code></a></td> + <td>control <a href='SkPoint_Reference#Point'>Point</a> of added <a href='#Conic'>Conic</a></td> + </tr> + <tr> <td><a name='SkPath_conicTo_2_p2'><code><strong>p2</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of added <a href='#Conic'>Conic</a></td> + </tr> + <tr> <td><a name='SkPath_conicTo_2_w'><code><strong>w</strong></code></a></td> + <td>weight of added <a href='#Conic'>Conic</a></td> </tr> </table> ### Example -<div><fiddle-embed name="22d25e03b19d5bae92118877e462361b"><div><a href="#Conic">Conics</a> and arcs use identical representations. As the arc sweep increases -the <a href="#Conic_Weight">Conic Weight</a> also increases, but remains smaller than one. +<div><fiddle-embed name="22d25e03b19d5bae92118877e462361b"><div><a href='#Conic'>Conics</a> and arcs use identical representations. As the arc sweep increases +the <a href='#Conic_Weight'>Conic Weight</a> also increases, but remains smaller than one. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_rConicTo">rConicTo</a> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_addArc">addArc</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#SkPath_rConicTo'>rConicTo</a> <a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkPath_addArc'>addArc</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -<a name="SkPath_rConicTo"></a> +<a name='SkPath_rConicTo'></a> ## rConicTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rConicTo'>rConicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2, <a href='undocumented#SkScalar'>SkScalar</a> w) </pre> -Adds <a href="#Conic">Conic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rConicTo_dx1">dx1</a>, <a href="#SkPath_rConicTo_dy1">dy1</a>), to <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rConicTo_dx2">dx2</a>, <a href="#SkPath_rConicTo_dy2">dy2</a>), -weighted by <a href="#SkPath_rConicTo_w">w</a>. If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> -is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="#Conic">Conic</a>. +Adds <a href='#Conic'>Conic</a> from <a href='#Last_Point'>Last Point</a> towards <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rConicTo_dx1'>dx1</a>, <a href='#SkPath_rConicTo_dy1'>dy1</a>), to <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rConicTo_dx2'>dx2</a>, <a href='#SkPath_rConicTo_dy2'>dy2</a>), +weighted by <a href='#SkPath_rConicTo_w'>w</a>. If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> +is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) before adding <a href='#Conic'>Conic</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed. -If <a href="#SkPath_rConicTo_w">w</a> is finite and not one, next appends <a href="#SkPath_kConic_Verb">kConic Verb</a> to <a href="#Verb_Array">Verb Array</a>, -and <a href="#SkPath_rConicTo_w">w</a> is recorded as <a href="#Conic_Weight">Conic Weight</a>; otherwise, if <a href="#SkPath_rConicTo_w">w</a> is one, appends -<a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>; or if <a href="#SkPath_rConicTo_w">w</a> is not finite, appends <a href="#SkPath_kLine_Verb">kLine Verb</a> -twice to <a href="#Verb_Array">Verb Array</a>. -In all cases appends <a href="SkPoint_Reference#Point">Points</a> control and end to <a href="#Point_Array">Point Array</a>. -control is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rConicTo_dx1">dx1</a>, <a href="#SkPath_rConicTo_dy1">dy1</a>). -end is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (<a href="#SkPath_rConicTo_dx2">dx2</a>, <a href="#SkPath_rConicTo_dy2">dy2</a>). +If <a href='#SkPath_rConicTo_w'>w</a> is finite and not one, next appends <a href='#SkPath_kConic_Verb'>kConic Verb</a> to <a href='#Verb_Array'>Verb Array</a>, +and <a href='#SkPath_rConicTo_w'>w</a> is recorded as <a href='#Conic_Weight'>Conic Weight</a>; otherwise, if <a href='#SkPath_rConicTo_w'>w</a> is one, appends +<a href='#SkPath_kQuad_Verb'>kQuad Verb</a> to <a href='#Verb_Array'>Verb Array</a>; or if <a href='#SkPath_rConicTo_w'>w</a> is not finite, appends <a href='#SkPath_kLine_Verb'>kLine Verb</a> +twice to <a href='#Verb_Array'>Verb Array</a>. + +In all cases appends <a href='SkPoint_Reference#Point'>Points</a> control and end to <a href='#Point_Array'>Point Array</a>. +control is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rConicTo_dx1'>dx1</a>, <a href='#SkPath_rConicTo_dy1'>dy1</a>). +end is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkPath_rConicTo_dx2'>dx2</a>, <a href='#SkPath_rConicTo_dy2'>dy2</a>). Function name stands for "relative conic to". ### Parameters -<table> <tr> <td><a name="SkPath_rConicTo_dx1"> <code><strong>dx1 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> control x</td> - </tr> <tr> <td><a name="SkPath_rConicTo_dy1"> <code><strong>dy1 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> control y</td> - </tr> <tr> <td><a name="SkPath_rConicTo_dx2"> <code><strong>dx2 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> end x</td> - </tr> <tr> <td><a name="SkPath_rConicTo_dy2"> <code><strong>dy2 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> end y</td> - </tr> <tr> <td><a name="SkPath_rConicTo_w"> <code><strong>w </strong></code> </a></td> <td> -weight of added <a href="#Conic">Conic</a></td> +<table> <tr> <td><a name='SkPath_rConicTo_dx1'><code><strong>dx1</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Conic'>Conic</a> control x</td> + </tr> + <tr> <td><a name='SkPath_rConicTo_dy1'><code><strong>dy1</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Conic'>Conic</a> control y</td> + </tr> + <tr> <td><a name='SkPath_rConicTo_dx2'><code><strong>dx2</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Conic'>Conic</a> end x</td> + </tr> + <tr> <td><a name='SkPath_rConicTo_dy2'><code><strong>dy2</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Conic'>Conic</a> end y</td> + </tr> + <tr> <td><a name='SkPath_rConicTo_w'><code><strong>w</strong></code></a></td> + <td>weight of added <a href='#Conic'>Conic</a></td> </tr> </table> @@ -2607,49 +3432,54 @@ weight of added <a href="#Conic">Conic</a></td> ### See Also -<a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_addArc">addArc</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> <a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkPath_addArc'>addArc</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -## <a name="Cubic"></a> Cubic +## <a name='Cubic'>Cubic</a> -<a href="#Cubic">Cubic</a> describes a Bezier_Curve segment described by a third-order polynomial. -<a href="#Cubic">Cubic</a> begins at a start <a href="SkPoint_Reference#Point">Point</a>, curving towards the first control <a href="SkPoint_Reference#Point">Point</a>; -and curves from the end <a href="SkPoint_Reference#Point">Point</a> towards the second control <a href="SkPoint_Reference#Point">Point</a>. +<a href='#Cubic'>Cubic</a> describes a Bezier_Curve segment described by a third-order polynomial. +<a href='#Cubic'>Cubic</a> begins at a start <a href='SkPoint_Reference#Point'>Point</a>, curving towards the first control <a href='SkPoint_Reference#Point'>Point</a>; +and curves from the end <a href='SkPoint_Reference#Point'>Point</a> towards the second control <a href='SkPoint_Reference#Point'>Point</a>. ### Example <div><fiddle-embed name="466445ed991d86de08587066392d654a"></fiddle-embed></div> -<a name="SkPath_cubicTo"></a> +<a name='SkPath_cubicTo'></a> ## cubicTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_cubicTo'>cubicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> x3, <a href='undocumented#SkScalar'>SkScalar</a> y3) </pre> -Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a> towards (<a href="#SkPath_cubicTo_x1">x1</a>, <a href="#SkPath_cubicTo_y1">y1</a>), then towards (<a href="#SkPath_cubicTo_x2">x2</a>, <a href="#SkPath_cubicTo_y2">y2</a>), ending at -(<a href="#SkPath_cubicTo_x3">x3</a>, <a href="#SkPath_cubicTo_y3">y3</a>). If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to -(0, 0) before adding <a href="#Cubic">Cubic</a>. +Adds <a href='#Cubic'>Cubic</a> from <a href='#Last_Point'>Last Point</a> towards (<a href='#SkPath_cubicTo_x1'>x1</a>, <a href='#SkPath_cubicTo_y1'>y1</a>), then towards (<a href='#SkPath_cubicTo_x2'>x2</a>, <a href='#SkPath_cubicTo_y2'>y2</a>), ending at +(<a href='#SkPath_cubicTo_x3'>x3</a>, <a href='#SkPath_cubicTo_y3'>y3</a>). If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to +(0, 0) before adding <a href='#Cubic'>Cubic</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; -then appends <a href="#SkPath_kCubic_Verb">kCubic Verb</a> to <a href="#Verb_Array">Verb Array</a>; and (<a href="#SkPath_cubicTo_x1">x1</a>, <a href="#SkPath_cubicTo_y1">y1</a>), (<a href="#SkPath_cubicTo_x2">x2</a>, <a href="#SkPath_cubicTo_y2">y2</a>), (<a href="#SkPath_cubicTo_x3">x3</a>, <a href="#SkPath_cubicTo_y3">y3</a>) -to <a href="#Point_Array">Point Array</a>. +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed; +then appends <a href='#SkPath_kCubic_Verb'>kCubic Verb</a> to <a href='#Verb_Array'>Verb Array</a>; and (<a href='#SkPath_cubicTo_x1'>x1</a>, <a href='#SkPath_cubicTo_y1'>y1</a>), (<a href='#SkPath_cubicTo_x2'>x2</a>, <a href='#SkPath_cubicTo_y2'>y2</a>), (<a href='#SkPath_cubicTo_x3'>x3</a>, <a href='#SkPath_cubicTo_y3'>y3</a>) +to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_cubicTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> -first control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in x</td> - </tr> <tr> <td><a name="SkPath_cubicTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> -first control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in y</td> - </tr> <tr> <td><a name="SkPath_cubicTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> -second control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in x</td> - </tr> <tr> <td><a name="SkPath_cubicTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> -second control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in y</td> - </tr> <tr> <td><a name="SkPath_cubicTo_x3"> <code><strong>x3 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in x</td> - </tr> <tr> <td><a name="SkPath_cubicTo_y3"> <code><strong>y3 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in y</td> +<table> <tr> <td><a name='SkPath_cubicTo_x1'><code><strong>x1</strong></code></a></td> + <td>first control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a> in x</td> + </tr> + <tr> <td><a name='SkPath_cubicTo_y1'><code><strong>y1</strong></code></a></td> + <td>first control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a> in y</td> + </tr> + <tr> <td><a name='SkPath_cubicTo_x2'><code><strong>x2</strong></code></a></td> + <td>second control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a> in x</td> + </tr> + <tr> <td><a name='SkPath_cubicTo_y2'><code><strong>y2</strong></code></a></td> + <td>second control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a> in y</td> + </tr> + <tr> <td><a name='SkPath_cubicTo_x3'><code><strong>x3</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a> in x</td> + </tr> + <tr> <td><a name='SkPath_cubicTo_y3'><code><strong>y3</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a> in y</td> </tr> </table> @@ -2659,32 +3489,34 @@ end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rCubicTo">rCubicTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_rCubicTo'>rCubicTo</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -<a name="SkPath_cubicTo_2"></a> +<a name='SkPath_cubicTo_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void cubicTo(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_cubicTo'>cubicTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3) </pre> -Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_cubicTo_2_p1">p1</a>, then towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_cubicTo_2_p2">p2</a>, ending at -<a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_cubicTo_2_p3">p3</a>. If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to -(0, 0) before adding <a href="#Cubic">Cubic</a>. +Adds <a href='#Cubic'>Cubic</a> from <a href='#Last_Point'>Last Point</a> towards <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_cubicTo_2_p1'>p1</a>, then towards <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_cubicTo_2_p2'>p2</a>, ending at +<a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_cubicTo_2_p3'>p3</a>. If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to +(0, 0) before adding <a href='#Cubic'>Cubic</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; -then appends <a href="#SkPath_kCubic_Verb">kCubic Verb</a> to <a href="#Verb_Array">Verb Array</a>; and <a href="SkPoint_Reference#Point">Points</a> <a href="#SkPath_cubicTo_2_p1">p1</a>, <a href="#SkPath_cubicTo_2_p2">p2</a>, <a href="#SkPath_cubicTo_2_p3">p3</a> -to <a href="#Point_Array">Point Array</a>. +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, if needed; +then appends <a href='#SkPath_kCubic_Verb'>kCubic Verb</a> to <a href='#Verb_Array'>Verb Array</a>; and <a href='SkPoint_Reference#Point'>Points</a> <a href='#SkPath_cubicTo_2_p1'>p1</a>, <a href='#SkPath_cubicTo_2_p2'>p2</a>, <a href='#SkPath_cubicTo_2_p3'>p3</a> +to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_cubicTo_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> -first control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></td> - </tr> <tr> <td><a name="SkPath_cubicTo_2_p2"> <code><strong>p2 </strong></code> </a></td> <td> -second control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></td> - </tr> <tr> <td><a name="SkPath_cubicTo_2_p3"> <code><strong>p3 </strong></code> </a></td> <td> -end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></td> +<table> <tr> <td><a name='SkPath_cubicTo_2_p1'><code><strong>p1</strong></code></a></td> + <td>first control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a></td> + </tr> + <tr> <td><a name='SkPath_cubicTo_2_p2'><code><strong>p2</strong></code></a></td> + <td>second control <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a></td> + </tr> + <tr> <td><a name='SkPath_cubicTo_2_p3'><code><strong>p3</strong></code></a></td> + <td>end <a href='SkPoint_Reference#Point'>Point</a> of <a href='#Cubic'>Cubic</a></td> </tr> </table> @@ -2694,43 +3526,48 @@ end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></t ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rCubicTo">rCubicTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_rCubicTo'>rCubicTo</a> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -<a name="SkPath_rCubicTo"></a> +<a name='SkPath_rCubicTo'></a> ## rCubicTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rCubicTo'>rCubicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> x3, <a href='undocumented#SkScalar'>SkScalar</a> y3) </pre> -Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Vector">Vector</a> (dx1, dy1), then towards -<a href="SkPoint_Reference#Vector">Vector</a> (dx2, dy2), to <a href="SkPoint_Reference#Vector">Vector</a> (dx3, dy3). -If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> -is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="#Cubic">Cubic</a>. +Adds <a href='#Cubic'>Cubic</a> from <a href='#Last_Point'>Last Point</a> towards <a href='SkPoint_Reference#Vector'>Vector</a> (dx1, dy1), then towards +<a href='SkPoint_Reference#Vector'>Vector</a> (dx2, dy2), to <a href='SkPoint_Reference#Vector'>Vector</a> (dx3, dy3). +If <a href='#Path'>Path</a> is empty, or last <a href='#SkPath_Verb'>Verb</a> +is <a href='#SkPath_kClose_Verb'>kClose Verb</a>, <a href='#Last_Point'>Last Point</a> is set to (0, 0) before adding <a href='#Cubic'>Cubic</a>. -Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, -if needed; then appends <a href="#SkPath_kCubic_Verb">kCubic Verb</a> to <a href="#Verb_Array">Verb Array</a>; and appends <a href="#Cubic">Cubic</a> -control and <a href="#Cubic">Cubic</a> end to <a href="#Point_Array">Point Array</a>. -<a href="#Cubic">Cubic</a> control is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (dx1, dy1). -<a href="#Cubic">Cubic</a> end is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (dx2, dy2). +Appends <a href='#SkPath_kMove_Verb'>kMove Verb</a> to <a href='#Verb_Array'>Verb Array</a> and (0, 0) to <a href='#Point_Array'>Point Array</a>, +if needed; then appends <a href='#SkPath_kCubic_Verb'>kCubic Verb</a> to <a href='#Verb_Array'>Verb Array</a>; and appends <a href='#Cubic'>Cubic</a> +control and <a href='#Cubic'>Cubic</a> end to <a href='#Point_Array'>Point Array</a>. +<a href='#Cubic'>Cubic</a> control is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (dx1, dy1). +<a href='#Cubic'>Cubic</a> end is <a href='#Last_Point'>Last Point</a> plus <a href='SkPoint_Reference#Vector'>Vector</a> (dx2, dy2). Function name stands for "relative cubic to". ### Parameters -<table> <tr> <td><a name="SkPath_rCubicTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to first <a href="#Cubic">Cubic</a> control x</td> - </tr> <tr> <td><a name="SkPath_rCubicTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to first <a href="#Cubic">Cubic</a> control y</td> - </tr> <tr> <td><a name="SkPath_rCubicTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to second <a href="#Cubic">Cubic</a> control x</td> - </tr> <tr> <td><a name="SkPath_rCubicTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to second <a href="#Cubic">Cubic</a> control y</td> - </tr> <tr> <td><a name="SkPath_rCubicTo_x3"> <code><strong>x3 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Cubic">Cubic</a> end x</td> - </tr> <tr> <td><a name="SkPath_rCubicTo_y3"> <code><strong>y3 </strong></code> </a></td> <td> -offset from <a href="#Last_Point">Last Point</a> x to <a href="#Cubic">Cubic</a> end y</td> +<table> <tr> <td><a name='SkPath_rCubicTo_x1'><code><strong>x1</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to first <a href='#Cubic'>Cubic</a> control x</td> + </tr> + <tr> <td><a name='SkPath_rCubicTo_y1'><code><strong>y1</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to first <a href='#Cubic'>Cubic</a> control y</td> + </tr> + <tr> <td><a name='SkPath_rCubicTo_x2'><code><strong>x2</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to second <a href='#Cubic'>Cubic</a> control x</td> + </tr> + <tr> <td><a name='SkPath_rCubicTo_y2'><code><strong>y2</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to second <a href='#Cubic'>Cubic</a> control y</td> + </tr> + <tr> <td><a name='SkPath_rCubicTo_x3'><code><strong>x3</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Cubic'>Cubic</a> end x</td> + </tr> + <tr> <td><a name='SkPath_rCubicTo_y3'><code><strong>y3</strong></code></a></td> + <td>offset from <a href='#Last_Point'>Last Point</a> x to <a href='#Cubic'>Cubic</a> end y</td> </tr> </table> @@ -2740,51 +3577,56 @@ offset from <a href="#Last_Point">Last Point</a> x to <a href="#Cubic">Cubic</a> ### See Also -<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> +<a href='#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a><sup><a href='#SkPath_moveTo_2'>[2]</a></sup> <a href='#SkPath_cubicTo'>cubicTo</a><sup><a href='#SkPath_cubicTo_2'>[2]</a></sup> <a href='#SkPath_quadTo'>quadTo</a><sup><a href='#SkPath_quadTo_2'>[2]</a></sup> --- -## <a name="Arc"></a> Arc +## <a name='Arc'>Arc</a> -<a href="#Arc">Arc</a> can be constructed in a number of ways. <a href="#Arc">Arc</a> may be described by part of <a href="undocumented#Oval">Oval</a> and angles, +<a href='#Arc'>Arc</a> can be constructed in a number of ways. <a href='#Arc'>Arc</a> may be described by part of <a href='undocumented#Oval'>Oval</a> and angles, by start point and end point, and by radius and tangent lines. Each construction has advantages, -and some constructions correspond to <a href="#Arc">Arc</a> drawing in graphics standards. +and some constructions correspond to <a href='#Arc'>Arc</a> drawing in graphics standards. -All <a href="#Arc">Arc</a> draws are implemented by one or more <a href="#Conic">Conic</a> draws. When <a href="#Conic_Weight">Conic Weight</a> is less than one, -<a href="#Conic">Conic</a> describes an <a href="#Arc">Arc</a> of some <a href="undocumented#Oval">Oval</a> or <a href="undocumented#Circle">Circle</a>. +All <a href='#Arc'>Arc</a> draws are implemented by one or more <a href='#Conic'>Conic</a> draws. When <a href='#Conic_Weight'>Conic Weight</a> is less than one, +<a href='#Conic'>Conic</a> describes an <a href='#Arc'>Arc</a> of some <a href='undocumented#Oval'>Oval</a> or <a href='undocumented#Circle'>Circle</a>. -<a href="#SkPath_arcTo">arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a> -describes <a href="#Arc">Arc</a> as a piece of <a href="undocumented#Oval">Oval</a>, beginning at start angle, sweeping clockwise or counterclockwise, -which may continue <a href="#Contour">Contour</a> or start a new one. This construction is similar to <a href="undocumented#PostScript">PostScript</a> and -<a href="undocumented#HTML_Canvas">HTML Canvas</a> arcs. Variation <a href="#SkPath_addArc">addArc</a> always starts new <a href="#Contour">Contour</a>. Canvas::drawArc draws without -requiring <a href="#Path">Path</a>. +<a href='#SkPath_arcTo'>arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a> +describes <a href='#Arc'>Arc</a> as a piece of <a href='undocumented#Oval'>Oval</a>, beginning at start angle, sweeping clockwise or counterclockwise, +which may continue <a href='#Contour'>Contour</a> or start a new one. This construction is similar to <a href='undocumented#PostScript'>PostScript</a> and +<a href='undocumented#HTML_Canvas'>HTML Canvas</a> arcs. Variation <a href='#SkPath_addArc'>addArc</a> always starts new <a href='#Contour'>Contour</a>. Canvas::drawArc draws without +requiring <a href='#Path'>Path</a>. -<a href="#SkPath_arcTo_2">arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a> -describes <a href="#Arc">Arc</a> as tangent to the line (x0, y0), (x1, y1) and tangent to the line (x1, y1), (x2, y2) -where (x0, y0) is the last <a href="SkPoint_Reference#Point">Point</a> added to <a href="#Path">Path</a>. This construction is similar to <a href="undocumented#PostScript">PostScript</a> and -<a href="undocumented#HTML_Canvas">HTML Canvas</a> arcs. +<a href='#SkPath_arcTo_2'>arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a> +describes <a href='#Arc'>Arc</a> as tangent to the line (x0, y0), (x1, y1) and tangent to the line (x1, y1), (x2, y2) +where (x0, y0) is the last <a href='SkPoint_Reference#Point'>Point</a> added to <a href='#Path'>Path</a>. This construction is similar to <a href='undocumented#PostScript'>PostScript</a> and +<a href='undocumented#HTML_Canvas'>HTML Canvas</a> arcs. -<a href="#SkPath_arcTo_4">arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, +<a href='#SkPath_arcTo_4'>arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y)</a> -describes <a href="#Arc">Arc</a> as part of <a href="undocumented#Oval">Oval</a> with radii (rx, ry), beginning at -last <a href="SkPoint_Reference#Point">Point</a> added to <a href="#Path">Path</a> and ending at (x, y). More than one <a href="#Arc">Arc</a> satisfies this criteria, -so additional values choose a single solution. This construction is similar to <a href="undocumented#SVG">SVG</a> arcs. +describes <a href='#Arc'>Arc</a> as part of <a href='undocumented#Oval'>Oval</a> with radii (rx, ry), beginning at +last <a href='SkPoint_Reference#Point'>Point</a> added to <a href='#Path'>Path</a> and ending at (x, y). More than one <a href='#Arc'>Arc</a> satisfies this criteria, +so additional values choose a single solution. This construction is similar to <a href='undocumented#SVG'>SVG</a> arcs. -<a href="#SkPath_conicTo">conicTo</a> describes <a href="#Arc">Arc</a> of less than 180 degrees as a pair of tangent lines and <a href="#Conic_Weight">Conic Weight</a>. -<a href="#SkPath_conicTo">conicTo</a> can represent any <a href="#Arc">Arc</a> with a sweep less than 180 degrees at any rotation. All <a href="#SkPath_arcTo">arcTo</a> -constructions are converted to <a href="#Conic">Conic</a> data when added to <a href="#Path">Path</a>. +<a href='#SkPath_conicTo'>conicTo</a> describes <a href='#Arc'>Arc</a> of less than 180 degrees as a pair of tangent lines and <a href='#Conic_Weight'>Conic Weight</a>. +<a href='#SkPath_conicTo'>conicTo</a> can represent any <a href='#Arc'>Arc</a> with a sweep less than 180 degrees at any rotation. All <a href='#SkPath_arcTo'>arcTo</a> +constructions are converted to <a href='#Conic'>Conic</a> data when added to <a href='#Path'>Path</a>. ### Example <div><fiddle-embed name="891ac93abd0cdb27c4156685d3b1bb4c"><div> <table> <tr> - <td><sup>1</sup> <a href="#SkPath_arcTo">arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a></td> </tr> <tr> - <td><sup>2</sup> parameter sets force MoveTo</td> </tr> <tr> - <td><sup>3</sup> start angle must be multiple of 90 degrees</td> </tr> <tr> - <td><sup>4</sup> <a href="#SkPath_arcTo_2">arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a></td> </tr> <tr> - <td><sup>5</sup> <a href="#SkPath_arcTo_4">arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, -Direction sweep, SkScalar x, SkScalar y)</a></td> </tr> + <td><sup>1</sup> <a href='#SkPath_arcTo'>arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a></td> + </tr> <tr> + <td><sup>2</sup> parameter sets force MoveTo</td> + </tr> <tr> + <td><sup>3</sup> start angle must be multiple of 90 degrees</td> + </tr> <tr> + <td><sup>4</sup> <a href='#SkPath_arcTo_2'>arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a></td> + </tr> <tr> + <td><sup>5</sup> <a href='#SkPath_arcTo_4'>arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, +Direction sweep, SkScalar x, SkScalar y)</a></td> + </tr> </table> </div></fiddle-embed></div> @@ -2793,99 +3635,106 @@ Direction sweep, SkScalar x, SkScalar y)</a></td> </tr> <div><fiddle-embed name="5acc77eba0cb4d00bbf3a8f4db0c0aee"><div>1 describes an arc from an oval, a starting angle, and a sweep angle. 2 is similar to 1, but does not require building a path to draw. -3 is similar to 1, but always begins new <a href="#Contour">Contour</a>. +3 is similar to 1, but always begins new <a href='#Contour'>Contour</a>. 4 describes an arc from a pair of tangent lines and a radius. -5 describes an arc from <a href="undocumented#Oval">Oval</a> center, arc start <a href="SkPoint_Reference#Point">Point</a> and arc end <a href="SkPoint_Reference#Point">Point</a>. -6 describes an arc from a pair of tangent lines and a <a href="#Conic_Weight">Conic Weight</a>. +5 describes an arc from <a href='undocumented#Oval'>Oval</a> center, arc start <a href='SkPoint_Reference#Point'>Point</a> and arc end <a href='SkPoint_Reference#Point'>Point</a>. +6 describes an arc from a pair of tangent lines and a <a href='#Conic_Weight'>Conic Weight</a>. </div></fiddle-embed></div> -<a name="SkPath_arcTo"></a> +<a name='SkPath_arcTo'></a> ## arcTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle, bool forceMoveTo) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> added is part of ellipse -bounded by <a href="#SkPath_arcTo_oval">oval</a>, from <a href="#SkPath_arcTo_startAngle">startAngle</a> through <a href="#SkPath_arcTo_sweepAngle">sweepAngle</a>. Both <a href="#SkPath_arcTo_startAngle">startAngle</a> and -<a href="#SkPath_arcTo_sweepAngle">sweepAngle</a> are measured in degrees, where zero degrees is aligned with the -positive x-axis, and positive sweeps extends <a href="#Arc">Arc</a> clockwise. +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>. <a href='#Arc'>Arc</a> added is part of ellipse +bounded by <a href='#SkPath_arcTo_oval'>oval</a>, from <a href='#SkPath_arcTo_startAngle'>startAngle</a> through <a href='#SkPath_arcTo_sweepAngle'>sweepAngle</a>. Both <a href='#SkPath_arcTo_startAngle'>startAngle</a> and +<a href='#SkPath_arcTo_sweepAngle'>sweepAngle</a> are measured in degrees, where zero degrees is aligned with the +positive x-axis, and positive sweeps extends <a href='#Arc'>Arc</a> clockwise. -<a href="#SkPath_arcTo">arcTo</a> adds <a href="undocumented#Line">Line</a> connecting <a href="#Path">Path</a> last <a href="SkPoint_Reference#Point">Point</a> to initial <a href="#Arc">Arc</a> <a href="SkPoint_Reference#Point">Point</a> if <a href="#SkPath_arcTo_forceMoveTo">forceMoveTo</a> -is false and <a href="#Path">Path</a> is not empty. Otherwise, added <a href="#Contour">Contour</a> begins with first point -of <a href="#Arc">Arc</a>. Angles greater than -360 and less than 360 are treated modulo 360. +<a href='#SkPath_arcTo'>arcTo</a> adds <a href='undocumented#Line'>Line</a> connecting <a href='#Path'>Path</a> last <a href='SkPoint_Reference#Point'>Point</a> to initial <a href='#Arc'>Arc</a> <a href='SkPoint_Reference#Point'>Point</a> if <a href='#SkPath_arcTo_forceMoveTo'>forceMoveTo</a> +is false and <a href='#Path'>Path</a> is not empty. Otherwise, added <a href='#Contour'>Contour</a> begins with first point +of <a href='#Arc'>Arc</a>. Angles greater than -360 and less than 360 are treated modulo 360. ### Parameters -<table> <tr> <td><a name="SkPath_arcTo_oval"> <code><strong>oval </strong></code> </a></td> <td> -bounds of ellipse containing <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_arcTo_startAngle"> <code><strong>startAngle </strong></code> </a></td> <td> -starting angle of <a href="#Arc">Arc</a> in degrees</td> - </tr> <tr> <td><a name="SkPath_arcTo_sweepAngle"> <code><strong>sweepAngle </strong></code> </a></td> <td> -sweep, in degrees. Positive is clockwise; treated modulo 360</td> - </tr> <tr> <td><a name="SkPath_arcTo_forceMoveTo"> <code><strong>forceMoveTo </strong></code> </a></td> <td> -true to start a new contour with <a href="#Arc">Arc</a></td> +<table> <tr> <td><a name='SkPath_arcTo_oval'><code><strong>oval</strong></code></a></td> + <td>bounds of ellipse containing <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_arcTo_startAngle'><code><strong>startAngle</strong></code></a></td> + <td>starting angle of <a href='#Arc'>Arc</a> in degrees</td> + </tr> + <tr> <td><a name='SkPath_arcTo_sweepAngle'><code><strong>sweepAngle</strong></code></a></td> + <td>sweep, in degrees. Positive is clockwise; treated modulo 360</td> + </tr> + <tr> <td><a name='SkPath_arcTo_forceMoveTo'><code><strong>forceMoveTo</strong></code></a></td> + <td>true to start a new contour with <a href='#Arc'>Arc</a></td> </tr> </table> ### Example -<div><fiddle-embed name="5f02890edaa10cb5e1a4243a82b6a382"><div><a href="#SkPath_arcTo">arcTo</a> continues a previous contour when <a href="#SkPath_arcTo_forceMoveTo">forceMoveTo</a> is false and when <a href="#Path">Path</a> +<div><fiddle-embed name="5f02890edaa10cb5e1a4243a82b6a382"><div><a href='#SkPath_arcTo'>arcTo</a> continues a previous contour when <a href='#SkPath_arcTo_forceMoveTo'>forceMoveTo</a> is false and when <a href='#Path'>Path</a> is not empty. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_addArc">addArc</a> <a href="SkCanvas_Reference#SkCanvas_drawArc">SkCanvas::drawArc</a> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> +<a href='#SkPath_addArc'>addArc</a> <a href='SkCanvas_Reference#SkCanvas_drawArc'>SkCanvas::drawArc</a> <a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> --- -<a name="SkPath_arcTo_2"></a> +<a name='SkPath_arcTo_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_arcTo'>arcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> radius) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, after appending <a href="undocumented#Line">Line</a> if needed. <a href="#Arc">Arc</a> is implemented by <a href="#Conic">Conic</a> -weighted to describe part of <a href="undocumented#Circle">Circle</a>. <a href="#Arc">Arc</a> is contained by tangent from -last <a href="#Path">Path</a> point (x0, y0) to (<a href="#SkPath_arcTo_2_x1">x1</a>, <a href="#SkPath_arcTo_2_y1">y1</a>), and tangent from (<a href="#SkPath_arcTo_2_x1">x1</a>, <a href="#SkPath_arcTo_2_y1">y1</a>) to (<a href="#SkPath_arcTo_2_x2">x2</a>, <a href="#SkPath_arcTo_2_y2">y2</a>). <a href="#Arc">Arc</a> -is part of <a href="undocumented#Circle">Circle</a> sized to <a href="#SkPath_arcTo_2_radius">radius</a>, positioned so it touches both tangent lines. +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>, after appending <a href='undocumented#Line'>Line</a> if needed. <a href='#Arc'>Arc</a> is implemented by <a href='#Conic'>Conic</a> +weighted to describe part of <a href='undocumented#Circle'>Circle</a>. <a href='#Arc'>Arc</a> is contained by tangent from +last <a href='#Path'>Path</a> point (x0, y0) to (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>), and tangent from (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>) to (<a href='#SkPath_arcTo_2_x2'>x2</a>, <a href='#SkPath_arcTo_2_y2'>y2</a>). <a href='#Arc'>Arc</a> +is part of <a href='undocumented#Circle'>Circle</a> sized to <a href='#SkPath_arcTo_2_radius'>radius</a>, positioned so it touches both tangent lines. ### Example <div><fiddle-embed name="d9c6435f26f37b3d63c664a99028f77f"></fiddle-embed></div> -If last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> does not start <a href="#Arc">Arc</a>, <a href="#SkPath_arcTo">arcTo</a> appends connecting <a href="undocumented#Line">Line</a> to <a href="#Path">Path</a>. -The length of <a href="SkPoint_Reference#Vector">Vector</a> from (<a href="#SkPath_arcTo_2_x1">x1</a>, <a href="#SkPath_arcTo_2_y1">y1</a>) to (<a href="#SkPath_arcTo_2_x2">x2</a>, <a href="#SkPath_arcTo_2_y2">y2</a>) does not affect <a href="#Arc">Arc</a>. +If last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> does not start <a href='#Arc'>Arc</a>, <a href='#SkPath_arcTo'>arcTo</a> appends connecting <a href='undocumented#Line'>Line</a> to <a href='#Path'>Path</a>. +The length of <a href='SkPoint_Reference#Vector'>Vector</a> from (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>) to (<a href='#SkPath_arcTo_2_x2'>x2</a>, <a href='#SkPath_arcTo_2_y2'>y2</a>) does not affect <a href='#Arc'>Arc</a>. ### Example <div><fiddle-embed name="01d2ddfd539ab86a86989e210640dffc"></fiddle-embed></div> -<a href="#Arc">Arc</a> sweep is always less than 180 degrees. If <a href="#SkPath_arcTo_2_radius">radius</a> is zero, or if -tangents are nearly parallel, <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to (<a href="#SkPath_arcTo_2_x1">x1</a>, <a href="#SkPath_arcTo_2_y1">y1</a>). +<a href='#Arc'>Arc</a> sweep is always less than 180 degrees. If <a href='#SkPath_arcTo_2_radius'>radius</a> is zero, or if +tangents are nearly parallel, <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>). -<a href="#SkPath_arcTo">arcTo</a> appends at most one <a href="undocumented#Line">Line</a> and one <a href="#Conic">Conic</a>. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#Arct">PostScript Arct</a> and <a href="undocumented#ArcTo">HTML Canvas ArcTo</a>. +<a href='#SkPath_arcTo'>arcTo</a> appends at most one <a href='undocumented#Line'>Line</a> and one <a href='#Conic'>Conic</a>. +<a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='undocumented#Arct'>PostScript Arct</a> and <a href='undocumented#ArcTo'>HTML Canvas ArcTo</a>. ### Parameters -<table> <tr> <td><a name="SkPath_arcTo_2_x1"> <code><strong>x1 </strong></code> </a></td> <td> -x common to pair of tangents</td> - </tr> <tr> <td><a name="SkPath_arcTo_2_y1"> <code><strong>y1 </strong></code> </a></td> <td> -y common to pair of tangents</td> - </tr> <tr> <td><a name="SkPath_arcTo_2_x2"> <code><strong>x2 </strong></code> </a></td> <td> -x end of second tangent</td> - </tr> <tr> <td><a name="SkPath_arcTo_2_y2"> <code><strong>y2 </strong></code> </a></td> <td> -y end of second tangent</td> - </tr> <tr> <td><a name="SkPath_arcTo_2_radius"> <code><strong>radius </strong></code> </a></td> <td> -distance from <a href="#Arc">Arc</a> to <a href="undocumented#Circle">Circle</a> center</td> +<table> <tr> <td><a name='SkPath_arcTo_2_x1'><code><strong>x1</strong></code></a></td> + <td>x common to pair of tangents</td> + </tr> + <tr> <td><a name='SkPath_arcTo_2_y1'><code><strong>y1</strong></code></a></td> + <td>y common to pair of tangents</td> + </tr> + <tr> <td><a name='SkPath_arcTo_2_x2'><code><strong>x2</strong></code></a></td> + <td>x end of second tangent</td> + </tr> + <tr> <td><a name='SkPath_arcTo_2_y2'><code><strong>y2</strong></code></a></td> + <td>y end of second tangent</td> + </tr> + <tr> <td><a name='SkPath_arcTo_2_radius'><code><strong>radius</strong></code></a></td> + <td>distance from <a href='#Arc'>Arc</a> to <a href='undocumented#Circle'>Circle</a> center</td> </tr> </table> ### Example -<div><fiddle-embed name="498360fa0a201cc5db04b1c27256358f"><div><a href="#SkPath_arcTo">arcTo</a> is represented by <a href="undocumented#Line">Line</a> and circular <a href="#Conic">Conic</a> in <a href="#Path">Path</a>. +<div><fiddle-embed name="498360fa0a201cc5db04b1c27256358f"><div><a href='#SkPath_arcTo'>arcTo</a> is represented by <a href='undocumented#Line'>Line</a> and circular <a href='#Conic'>Conic</a> in <a href='#Path'>Path</a>. </div> #### Example Output @@ -2900,45 +3749,47 @@ conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683 ### See Also -<a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> +<a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> --- -<a name="SkPath_arcTo_3"></a> +<a name='SkPath_arcTo_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p2, <a href='undocumented#SkScalar'>SkScalar</a> radius) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, after appending <a href="undocumented#Line">Line</a> if needed. <a href="#Arc">Arc</a> is implemented by <a href="#Conic">Conic</a> -weighted to describe part of <a href="undocumented#Circle">Circle</a>. <a href="#Arc">Arc</a> is contained by tangent from -last <a href="#Path">Path</a> point to <a href="#SkPath_arcTo_3_p1">p1</a>, and tangent from <a href="#SkPath_arcTo_3_p1">p1</a> to <a href="#SkPath_arcTo_3_p2">p2</a>. <a href="#Arc">Arc</a> -is part of <a href="undocumented#Circle">Circle</a> sized to <a href="#SkPath_arcTo_3_radius">radius</a>, positioned so it touches both tangent lines. +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>, after appending <a href='undocumented#Line'>Line</a> if needed. <a href='#Arc'>Arc</a> is implemented by <a href='#Conic'>Conic</a> +weighted to describe part of <a href='undocumented#Circle'>Circle</a>. <a href='#Arc'>Arc</a> is contained by tangent from +last <a href='#Path'>Path</a> point to <a href='#SkPath_arcTo_3_p1'>p1</a>, and tangent from <a href='#SkPath_arcTo_3_p1'>p1</a> to <a href='#SkPath_arcTo_3_p2'>p2</a>. <a href='#Arc'>Arc</a> +is part of <a href='undocumented#Circle'>Circle</a> sized to <a href='#SkPath_arcTo_3_radius'>radius</a>, positioned so it touches both tangent lines. -If last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> does not start <a href="#Arc">Arc</a>, <a href="#SkPath_arcTo">arcTo</a> appends connecting <a href="undocumented#Line">Line</a> to <a href="#Path">Path</a>. -The length of <a href="SkPoint_Reference#Vector">Vector</a> from <a href="#SkPath_arcTo_3_p1">p1</a> to <a href="#SkPath_arcTo_3_p2">p2</a> does not affect <a href="#Arc">Arc</a>. +If last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> does not start <a href='#Arc'>Arc</a>, <a href='#SkPath_arcTo'>arcTo</a> appends connecting <a href='undocumented#Line'>Line</a> to <a href='#Path'>Path</a>. +The length of <a href='SkPoint_Reference#Vector'>Vector</a> from <a href='#SkPath_arcTo_3_p1'>p1</a> to <a href='#SkPath_arcTo_3_p2'>p2</a> does not affect <a href='#Arc'>Arc</a>. -<a href="#Arc">Arc</a> sweep is always less than 180 degrees. If <a href="#SkPath_arcTo_3_radius">radius</a> is zero, or if -tangents are nearly parallel, <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to <a href="#SkPath_arcTo_3_p1">p1</a>. +<a href='#Arc'>Arc</a> sweep is always less than 180 degrees. If <a href='#SkPath_arcTo_3_radius'>radius</a> is zero, or if +tangents are nearly parallel, <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to <a href='#SkPath_arcTo_3_p1'>p1</a>. -<a href="#SkPath_arcTo">arcTo</a> appends at most one <a href="undocumented#Line">Line</a> and one <a href="#Conic">Conic</a>. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#Arct">PostScript Arct</a> and <a href="undocumented#ArcTo">HTML Canvas ArcTo</a>. +<a href='#SkPath_arcTo'>arcTo</a> appends at most one <a href='undocumented#Line'>Line</a> and one <a href='#Conic'>Conic</a>. +<a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='undocumented#Arct'>PostScript Arct</a> and <a href='undocumented#ArcTo'>HTML Canvas ArcTo</a>. ### Parameters -<table> <tr> <td><a name="SkPath_arcTo_3_p1"> <code><strong>p1 </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> common to pair of tangents</td> - </tr> <tr> <td><a name="SkPath_arcTo_3_p2"> <code><strong>p2 </strong></code> </a></td> <td> -end of second tangent</td> - </tr> <tr> <td><a name="SkPath_arcTo_3_radius"> <code><strong>radius </strong></code> </a></td> <td> -distance from <a href="#Arc">Arc</a> to <a href="undocumented#Circle">Circle</a> center</td> +<table> <tr> <td><a name='SkPath_arcTo_3_p1'><code><strong>p1</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> common to pair of tangents</td> + </tr> + <tr> <td><a name='SkPath_arcTo_3_p2'><code><strong>p2</strong></code></a></td> + <td>end of second tangent</td> + </tr> + <tr> <td><a name='SkPath_arcTo_3_radius'><code><strong>radius</strong></code></a></td> + <td>distance from <a href='#Arc'>Arc</a> to <a href='undocumented#Circle'>Circle</a> center</td> </tr> </table> ### Example -<div><fiddle-embed name="0c056264a361579c18e5d02d3172d4d4"><div>Because tangent lines are parallel, <a href="#SkPath_arcTo">arcTo</a> appends line from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to -<a href="#SkPath_arcTo_3_p1">p1</a>, but does not append a circular <a href="#Conic">Conic</a>. +<div><fiddle-embed name="0c056264a361579c18e5d02d3172d4d4"><div>Because tangent lines are parallel, <a href='#SkPath_arcTo'>arcTo</a> appends line from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to +<a href='#SkPath_arcTo_3_p1'>p1</a>, but does not append a circular <a href='#Conic'>Conic</a>. </div> #### Example Output @@ -2952,84 +3803,97 @@ line (156,20),(200,20) ### See Also -<a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> +<a href='#SkPath_conicTo'>conicTo</a><sup><a href='#SkPath_conicTo_2'>[2]</a></sup> --- -## <a name="SkPath_ArcSize"></a> Enum SkPath::ArcSize +## <a name='SkPath_ArcSize'>Enum SkPath::ArcSize</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPath_ArcSize">ArcSize</a> { - <a href="#SkPath_kSmall_ArcSize">kSmall ArcSize</a>, - <a href="#SkPath_kLarge_ArcSize">kLarge ArcSize</a>, + enum <a href='#SkPath_ArcSize'>ArcSize</a> { + <a href='#SkPath_kSmall_ArcSize'>kSmall ArcSize</a>, + <a href='#SkPath_kLarge_ArcSize'>kLarge ArcSize</a>, }; </pre> -Four <a href="undocumented#Oval">Oval</a> parts with radii (rx, ry) start at last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and ends at (x, y). -<a href="#SkPath_ArcSize">ArcSize</a> and <a href="#SkPath_Direction">Direction</a> select one of the four <a href="undocumented#Oval">Oval</a> parts. +Four <a href='undocumented#Oval'>Oval</a> parts with radii (rx, ry) start at last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> and ends at (x, y). +<a href='#SkPath_ArcSize'>ArcSize</a> and <a href='#SkPath_Direction'>Direction</a> select one of the four <a href='undocumented#Oval'>Oval</a> parts. ### Constants -<table> - <tr> - <td><a name="SkPath_kSmall_ArcSize"> <code><strong>SkPath::kSmall_ArcSize </strong></code> </a></td><td>0</td><td>smaller of <a href="#Arc">Arc</a> pair</td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kSmall_ArcSize'><code>SkPath::kSmall_ArcSize</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +smaller of Arc pair</td> </tr> <tr> - <td><a name="SkPath_kLarge_ArcSize"> <code><strong>SkPath::kLarge_ArcSize </strong></code> </a></td><td>1</td><td>larger of <a href="#Arc">Arc</a> pair</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kLarge_ArcSize'><code>SkPath::kLarge_ArcSize</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +larger of Arc pair</td> </tr> </table> ### Example -<div><fiddle-embed name="8e40c546eecd9cc213200717240898ba"><div><a href="#Arc">Arc</a> begins at top of <a href="undocumented#Oval">Oval</a> pair and ends at bottom. <a href="#Arc">Arc</a> can take four routes to get there. +<div><fiddle-embed name="8e40c546eecd9cc213200717240898ba"><div><a href='#Arc'>Arc</a> begins at top of <a href='undocumented#Oval'>Oval</a> pair and ends at bottom. <a href='#Arc'>Arc</a> can take four routes to get there. Two routes are large, and two routes are counterclockwise. The one route both large and counterclockwise is blue. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_Direction">Direction</a> - - +<a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkPath_Direction'>Direction</a> -<a name="SkPath_arcTo_4"></a> +<a name='SkPath_arcTo_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, - SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_arcTo'>arcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, + <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> is implemented by one or more <a href="#Conic">Conics</a> weighted to -describe part of <a href="undocumented#Oval">Oval</a> with radii (<a href="#SkPath_arcTo_4_rx">rx</a>, <a href="#SkPath_arcTo_4_ry">ry</a>) rotated by <a href="#SkPath_arcTo_4_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> -curves from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>), choosing one of four possible routes: +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>. <a href='#Arc'>Arc</a> is implemented by one or more <a href='#Conic'>Conics</a> weighted to +describe part of <a href='undocumented#Oval'>Oval</a> with radii (<a href='#SkPath_arcTo_4_rx'>rx</a>, <a href='#SkPath_arcTo_4_ry'>ry</a>) rotated by <a href='#SkPath_arcTo_4_xAxisRotate'>xAxisRotate</a> degrees. <a href='#Arc'>Arc</a> +curves from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger. -<a href="#Arc">Arc</a> <a href="#SkPath_arcTo_4_sweep">sweep</a> is always less than 360 degrees. <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> to (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>) if -either radii are zero, or if last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> equals (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>). <a href="#SkPath_arcTo">arcTo</a> scales radii -(<a href="#SkPath_arcTo_4_rx">rx</a>, <a href="#SkPath_arcTo_4_ry">ry</a>) to fit last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>) if both are greater than zero but +<a href='#Arc'>Arc</a> <a href='#SkPath_arcTo_4_sweep'>sweep</a> is always less than 360 degrees. <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> to (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>) if +either radii are zero, or if last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> equals (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>). <a href='#SkPath_arcTo'>arcTo</a> scales radii +(<a href='#SkPath_arcTo_4_rx'>rx</a>, <a href='#SkPath_arcTo_4_ry'>ry</a>) to fit last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> and (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>) if both are greater than zero but too small. -<a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_4_sweep">sweep</a>-flag" value -is opposite the integer value of <a href="#SkPath_arcTo_4_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_4_sweep">sweep</a>-flag" uses 1 for clockwise, -while <a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. +<a href='#SkPath_arcTo'>arcTo</a> appends up to four <a href='#Conic'>Conic</a> curves. +<a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='undocumented#Arc'>SVG Arc</a>, although <a href='undocumented#SVG'>SVG</a> "<a href='#SkPath_arcTo_4_sweep'>sweep</a>-flag" value +is opposite the integer value of <a href='#SkPath_arcTo_4_sweep'>sweep</a>; <a href='undocumented#SVG'>SVG</a> "<a href='#SkPath_arcTo_4_sweep'>sweep</a>-flag" uses 1 for clockwise, +while <a href='#SkPath_kCW_Direction'>kCW Direction</a> cast to int is zero. ### Parameters -<table> <tr> <td><a name="SkPath_arcTo_4_rx"> <code><strong>rx </strong></code> </a></td> <td> -radius in <a href="#SkPath_arcTo_4_x">x</a> before <a href="#SkPath_arcTo_4_x">x</a>-axis rotation</td> - </tr> <tr> <td><a name="SkPath_arcTo_4_ry"> <code><strong>ry </strong></code> </a></td> <td> -radius in <a href="#SkPath_arcTo_4_y">y</a> before <a href="#SkPath_arcTo_4_x">x</a>-axis rotation</td> - </tr> <tr> <td><a name="SkPath_arcTo_4_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> -<a href="#SkPath_arcTo_4_x">x</a>-axis rotation in degrees; positive values are clockwise</td> - </tr> <tr> <td><a name="SkPath_arcTo_4_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> -chooses smaller or larger <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_arcTo_4_sweep"> <code><strong>sweep </strong></code> </a></td> <td> -chooses clockwise or counterclockwise <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_arcTo_4_x"> <code><strong>x </strong></code> </a></td> <td> -end of <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_arcTo_4_y"> <code><strong>y </strong></code> </a></td> <td> -end of <a href="#Arc">Arc</a></td> +<table> <tr> <td><a name='SkPath_arcTo_4_rx'><code><strong>rx</strong></code></a></td> + <td>radius in <a href='#SkPath_arcTo_4_x'>x</a> before <a href='#SkPath_arcTo_4_x'>x</a>-axis rotation</td> + </tr> + <tr> <td><a name='SkPath_arcTo_4_ry'><code><strong>ry</strong></code></a></td> + <td>radius in <a href='#SkPath_arcTo_4_y'>y</a> before <a href='#SkPath_arcTo_4_x'>x</a>-axis rotation</td> + </tr> + <tr> <td><a name='SkPath_arcTo_4_xAxisRotate'><code><strong>xAxisRotate</strong></code></a></td> + <td><a href='#SkPath_arcTo_4_x'>x</a>-axis rotation in degrees; positive values are clockwise</td> + </tr> + <tr> <td><a name='SkPath_arcTo_4_largeArc'><code><strong>largeArc</strong></code></a></td> + <td>chooses smaller or larger <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_arcTo_4_sweep'><code><strong>sweep</strong></code></a></td> + <td>chooses clockwise or counterclockwise <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_arcTo_4_x'><code><strong>x</strong></code></a></td> + <td>end of <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_arcTo_4_y'><code><strong>y</strong></code></a></td> + <td>end of <a href='#Arc'>Arc</a></td> </tr> </table> @@ -3039,42 +3903,46 @@ end of <a href="#Arc">Arc</a></td> ### See Also -<a href="#SkPath_rArcTo">rArcTo</a> <a href="#SkPath_ArcSize">ArcSize</a> <a href="#SkPath_Direction">Direction</a> +<a href='#SkPath_rArcTo'>rArcTo</a> <a href='#SkPath_ArcSize'>ArcSize</a> <a href='#SkPath_Direction'>Direction</a> --- -<a name="SkPath_arcTo_5"></a> +<a name='SkPath_arcTo_5'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, const SkPoint xy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> r, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> xy) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> is implemented by one or more <a href="#Conic">Conic</a> weighted to describe part of <a href="undocumented#Oval">Oval</a> -with radii (<a href="#SkPath_arcTo_5_r">r</a>.fX, <a href="#SkPath_arcTo_5_r">r</a>.fY) rotated by <a href="#SkPath_arcTo_5_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to -(<a href="#SkPath_arcTo_5_xy">xy</a>.fX, <a href="#SkPath_arcTo_5_xy">xy</a>.fY), choosing one of four possible routes: clockwise or counterclockwise, +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>. <a href='#Arc'>Arc</a> is implemented by one or more <a href='#Conic'>Conic</a> weighted to describe part of <a href='undocumented#Oval'>Oval</a> +with radii (<a href='#SkPath_arcTo_5_r'>r</a>.fX, <a href='#SkPath_arcTo_5_r'>r</a>.fY) rotated by <a href='#SkPath_arcTo_5_xAxisRotate'>xAxisRotate</a> degrees. <a href='#Arc'>Arc</a> curves from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to +(<a href='#SkPath_arcTo_5_xy'>xy</a>.fX, <a href='#SkPath_arcTo_5_xy'>xy</a>.fY), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger. -<a href="#Arc">Arc</a> <a href="#SkPath_arcTo_5_sweep">sweep</a> is always less than 360 degrees. <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> to <a href="#SkPath_arcTo_5_xy">xy</a> if either radii are zero, -or if last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> equals (x, y). <a href="#SkPath_arcTo">arcTo</a> scales radii <a href="#SkPath_arcTo_5_r">r</a> to fit last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and -<a href="#SkPath_arcTo_5_xy">xy</a> if both are greater than zero but too small to describe an arc. +<a href='#Arc'>Arc</a> <a href='#SkPath_arcTo_5_sweep'>sweep</a> is always less than 360 degrees. <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> to <a href='#SkPath_arcTo_5_xy'>xy</a> if either radii are zero, +or if last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> equals (x, y). <a href='#SkPath_arcTo'>arcTo</a> scales radii <a href='#SkPath_arcTo_5_r'>r</a> to fit last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> and +<a href='#SkPath_arcTo_5_xy'>xy</a> if both are greater than zero but too small to describe an arc. -<a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_5_sweep">sweep</a>-flag" value is -opposite the integer value of <a href="#SkPath_arcTo_5_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_5_sweep">sweep</a>-flag" uses 1 for clockwise, while -<a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. +<a href='#SkPath_arcTo'>arcTo</a> appends up to four <a href='#Conic'>Conic</a> curves. +<a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='undocumented#Arc'>SVG Arc</a>, although <a href='undocumented#SVG'>SVG</a> "<a href='#SkPath_arcTo_5_sweep'>sweep</a>-flag" value is +opposite the integer value of <a href='#SkPath_arcTo_5_sweep'>sweep</a>; <a href='undocumented#SVG'>SVG</a> "<a href='#SkPath_arcTo_5_sweep'>sweep</a>-flag" uses 1 for clockwise, while +<a href='#SkPath_kCW_Direction'>kCW Direction</a> cast to int is zero. ### Parameters -<table> <tr> <td><a name="SkPath_arcTo_5_r"> <code><strong>r </strong></code> </a></td> <td> -radii in x and y before x-axis rotation</td> - </tr> <tr> <td><a name="SkPath_arcTo_5_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> -x-axis rotation in degrees; positive values are clockwise</td> - </tr> <tr> <td><a name="SkPath_arcTo_5_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> -chooses smaller or larger <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_arcTo_5_sweep"> <code><strong>sweep </strong></code> </a></td> <td> -chooses clockwise or counterclockwise <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_arcTo_5_xy"> <code><strong>xy </strong></code> </a></td> <td> -end of <a href="#Arc">Arc</a></td> +<table> <tr> <td><a name='SkPath_arcTo_5_r'><code><strong>r</strong></code></a></td> + <td>radii in x and y before x-axis rotation</td> + </tr> + <tr> <td><a name='SkPath_arcTo_5_xAxisRotate'><code><strong>xAxisRotate</strong></code></a></td> + <td>x-axis rotation in degrees; positive values are clockwise</td> + </tr> + <tr> <td><a name='SkPath_arcTo_5_largeArc'><code><strong>largeArc</strong></code></a></td> + <td>chooses smaller or larger <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_arcTo_5_sweep'><code><strong>sweep</strong></code></a></td> + <td>chooses clockwise or counterclockwise <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_arcTo_5_xy'><code><strong>xy</strong></code></a></td> + <td>end of <a href='#Arc'>Arc</a></td> </tr> </table> @@ -3084,54 +3952,60 @@ end of <a href="#Arc">Arc</a></td> ### See Also -<a href="#SkPath_rArcTo">rArcTo</a> <a href="#SkPath_ArcSize">ArcSize</a> <a href="#SkPath_Direction">Direction</a> +<a href='#SkPath_rArcTo'>rArcTo</a> <a href='#SkPath_ArcSize'>ArcSize</a> <a href='#SkPath_Direction'>Direction</a> --- -<a name="SkPath_rArcTo"></a> +<a name='SkPath_rArcTo'></a> ## rArcTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, - SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_rArcTo'>rArcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, + <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, relative to last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a>. <a href="#Arc">Arc</a> is implemented by one or -more <a href="#Conic">Conic</a>, weighted to describe part of <a href="undocumented#Oval">Oval</a> with radii (<a href="#SkPath_rArcTo_rx">rx</a>, <a href="#SkPath_rArcTo_ry">ry</a>) rotated by -<a href="#SkPath_rArcTo_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> (x0, y0) to end <a href="SkPoint_Reference#Point">Point</a>: +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>, relative to last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a>. <a href='#Arc'>Arc</a> is implemented by one or +more <a href='#Conic'>Conic</a>, weighted to describe part of <a href='undocumented#Oval'>Oval</a> with radii (<a href='#SkPath_rArcTo_rx'>rx</a>, <a href='#SkPath_rArcTo_ry'>ry</a>) rotated by +<a href='#SkPath_rArcTo_xAxisRotate'>xAxisRotate</a> degrees. <a href='#Arc'>Arc</a> curves from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> (x0, y0) to end <a href='SkPoint_Reference#Point'>Point</a>: -(x0 + <a href="#SkPath_rArcTo_dx">dx</a>, y0 + <a href="#SkPath_rArcTo_dy">dy</a>) +(x0 + <a href='#SkPath_rArcTo_dx'>dx</a>, y0 + <a href='#SkPath_rArcTo_dy'>dy</a>) , choosing one of four possible routes: clockwise or -counterclockwise, and smaller or larger. If <a href="#Path">Path</a> is empty, the start <a href="#Arc">Arc</a> <a href="SkPoint_Reference#Point">Point</a> +counterclockwise, and smaller or larger. If <a href='#Path'>Path</a> is empty, the start <a href='#Arc'>Arc</a> <a href='SkPoint_Reference#Point'>Point</a> is (0, 0). -<a href="#Arc">Arc</a> <a href="#SkPath_rArcTo_sweep">sweep</a> is always less than 360 degrees. <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> to end <a href="SkPoint_Reference#Point">Point</a> -if either radii are zero, or if last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> equals end <a href="SkPoint_Reference#Point">Point</a>. -<a href="#SkPath_arcTo">arcTo</a> scales radii (<a href="#SkPath_rArcTo_rx">rx</a>, <a href="#SkPath_rArcTo_ry">ry</a>) to fit last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and end <a href="SkPoint_Reference#Point">Point</a> if both are +<a href='#Arc'>Arc</a> <a href='#SkPath_rArcTo_sweep'>sweep</a> is always less than 360 degrees. <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> to end <a href='SkPoint_Reference#Point'>Point</a> +if either radii are zero, or if last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> equals end <a href='SkPoint_Reference#Point'>Point</a>. +<a href='#SkPath_arcTo'>arcTo</a> scales radii (<a href='#SkPath_rArcTo_rx'>rx</a>, <a href='#SkPath_rArcTo_ry'>ry</a>) to fit last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> and end <a href='SkPoint_Reference#Point'>Point</a> if both are greater than zero but too small to describe an arc. -<a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_rArcTo_sweep">sweep</a>-flag" value is -opposite the integer value of <a href="#SkPath_rArcTo_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_rArcTo_sweep">sweep</a>-flag" uses 1 for clockwise, while -<a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. +<a href='#SkPath_arcTo'>arcTo</a> appends up to four <a href='#Conic'>Conic</a> curves. +<a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='undocumented#Arc'>SVG Arc</a>, although <a href='undocumented#SVG'>SVG</a> "<a href='#SkPath_rArcTo_sweep'>sweep</a>-flag" value is +opposite the integer value of <a href='#SkPath_rArcTo_sweep'>sweep</a>; <a href='undocumented#SVG'>SVG</a> "<a href='#SkPath_rArcTo_sweep'>sweep</a>-flag" uses 1 for clockwise, while +<a href='#SkPath_kCW_Direction'>kCW Direction</a> cast to int is zero. ### Parameters -<table> <tr> <td><a name="SkPath_rArcTo_rx"> <code><strong>rx </strong></code> </a></td> <td> -radius in x before x-axis rotation</td> - </tr> <tr> <td><a name="SkPath_rArcTo_ry"> <code><strong>ry </strong></code> </a></td> <td> -radius in y before x-axis rotation</td> - </tr> <tr> <td><a name="SkPath_rArcTo_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> -x-axis rotation in degrees; positive values are clockwise</td> - </tr> <tr> <td><a name="SkPath_rArcTo_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> -chooses smaller or larger <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_rArcTo_sweep"> <code><strong>sweep </strong></code> </a></td> <td> -chooses clockwise or counterclockwise <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_rArcTo_dx"> <code><strong>dx </strong></code> </a></td> <td> -x offset end of <a href="#Arc">Arc</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a></td> - </tr> <tr> <td><a name="SkPath_rArcTo_dy"> <code><strong>dy </strong></code> </a></td> <td> -y offset end of <a href="#Arc">Arc</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a></td> +<table> <tr> <td><a name='SkPath_rArcTo_rx'><code><strong>rx</strong></code></a></td> + <td>radius in x before x-axis rotation</td> + </tr> + <tr> <td><a name='SkPath_rArcTo_ry'><code><strong>ry</strong></code></a></td> + <td>radius in y before x-axis rotation</td> + </tr> + <tr> <td><a name='SkPath_rArcTo_xAxisRotate'><code><strong>xAxisRotate</strong></code></a></td> + <td>x-axis rotation in degrees; positive values are clockwise</td> + </tr> + <tr> <td><a name='SkPath_rArcTo_largeArc'><code><strong>largeArc</strong></code></a></td> + <td>chooses smaller or larger <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_rArcTo_sweep'><code><strong>sweep</strong></code></a></td> + <td>chooses clockwise or counterclockwise <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_rArcTo_dx'><code><strong>dx</strong></code></a></td> + <td>x offset end of <a href='#Arc'>Arc</a> from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> <td><a name='SkPath_rArcTo_dy'><code><strong>dy</strong></code></a></td> + <td>y offset end of <a href='#Arc'>Arc</a> from last <a href='#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a></td> </tr> </table> @@ -3141,24 +4015,24 @@ y offset end of <a href="#Arc">Arc</a> from last <a href="#Path">Path</a> <a hre ### See Also -<a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_ArcSize">ArcSize</a> <a href="#SkPath_Direction">Direction</a> +<a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='#SkPath_ArcSize'>ArcSize</a> <a href='#SkPath_Direction'>Direction</a> --- -<a name="SkPath_close"></a> +<a name='SkPath_close'></a> ## close -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void close() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_close'>close</a>() </pre> -Append <a href="#SkPath_kClose_Verb">kClose Verb</a> to <a href="#Path">Path</a>. A closed <a href="#Contour">Contour</a> connects the first and last <a href="SkPoint_Reference#Point">Point</a> -with <a href="undocumented#Line">Line</a>, forming a continuous loop. Open and closed <a href="#Contour">Contour</a> draw the same -with <a href="SkPaint_Reference#SkPaint_kFill_Style">SkPaint::kFill Style</a>. With <a href="SkPaint_Reference#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>, open <a href="#Contour">Contour</a> draws -<a href="SkPaint_Reference#Stroke_Cap">Paint Stroke Cap</a> at <a href="#Contour">Contour</a> start and end; closed <a href="#Contour">Contour</a> draws -<a href="SkPaint_Reference#Stroke_Join">Paint Stroke Join</a> at <a href="#Contour">Contour</a> start and end. +Append <a href='#SkPath_kClose_Verb'>kClose Verb</a> to <a href='#Path'>Path</a>. A closed <a href='#Contour'>Contour</a> connects the first and last <a href='SkPoint_Reference#Point'>Point</a> +with <a href='undocumented#Line'>Line</a>, forming a continuous loop. Open and closed <a href='#Contour'>Contour</a> draw the same +with <a href='SkPaint_Reference#SkPaint_kFill_Style'>SkPaint::kFill Style</a>. With <a href='SkPaint_Reference#SkPaint_kStroke_Style'>SkPaint::kStroke Style</a>, open <a href='#Contour'>Contour</a> draws +<a href='SkPaint_Reference#Stroke_Cap'>Paint Stroke Cap</a> at <a href='#Contour'>Contour</a> start and end; closed <a href='#Contour'>Contour</a> draws +<a href='SkPaint_Reference#Stroke_Join'>Paint Stroke Join</a> at <a href='#Contour'>Contour</a> start and end. -<a href="#SkPath_close">close</a> has no effect if <a href="#Path">Path</a> is empty or last <a href="#Path">Path</a> <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>. +<a href='#SkPath_close'>close</a> has no effect if <a href='#Path'>Path</a> is empty or last <a href='#Path'>Path</a> <a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose Verb</a>. ### Example @@ -3168,34 +4042,34 @@ with <a href="SkPaint_Reference#SkPaint_kFill_Style">SkPaint::kFill Style</a>. W --- -<a name="SkPath_IsInverseFillType"></a> +<a name='SkPath_IsInverseFillType'></a> ## IsInverseFillType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool IsInverseFillType(FillType fill) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkPath_IsInverseFillType'>IsInverseFillType</a>(<a href='#SkPath_FillType'>FillType</a> fill) </pre> -Returns true if <a href="#SkPath_IsInverseFillType_fill">fill</a> is inverted and <a href="#Path">Path</a> with <a href="#SkPath_IsInverseFillType_fill">fill</a> represents area outside +Returns true if <a href='#SkPath_IsInverseFillType_fill'>fill</a> is inverted and <a href='#Path'>Path</a> with <a href='#SkPath_IsInverseFillType_fill'>fill</a> represents area outside of its geometric bounds. -| <a href="#SkPath_FillType">FillType</a> | is inverse | +| <a href='#SkPath_FillType'>FillType</a> | is inverse | | --- | --- | -| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | false | -| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | false | -| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | true | -| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | true | +| <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | false | +| <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | false | +| <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> | true | +| <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> | true | ### Parameters -<table> <tr> <td><a name="SkPath_IsInverseFillType_fill"> <code><strong>fill </strong></code> </a></td> <td> -one of: <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, -<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a></td> +<table> <tr> <td><a name='SkPath_IsInverseFillType_fill'><code><strong>fill</strong></code></a></td> + <td>one of: <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a>, +<a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a>, <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a></td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> fills outside its bounds +true if <a href='#Path'>Path</a> fills outside its bounds ### Example @@ -3214,42 +4088,42 @@ IsInverseFillType(kInverseEvenOdd_FillType) == true ### See Also -<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_ConvertToNonInverseFillType">ConvertToNonInverseFillType</a> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a> --- -<a name="SkPath_ConvertToNonInverseFillType"></a> +<a name='SkPath_ConvertToNonInverseFillType'></a> ## ConvertToNonInverseFillType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static FillType ConvertToNonInverseFillType(FillType fill) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a>(<a href='#SkPath_FillType'>FillType</a> fill) </pre> -Returns equivalent <a href="#Fill_Type">Fill Type</a> representing <a href="#Path">Path</a> <a href="#SkPath_ConvertToNonInverseFillType_fill">fill</a> inside its bounds. +Returns equivalent <a href='#Fill_Type'>Fill Type</a> representing <a href='#Path'>Path</a> <a href='#SkPath_ConvertToNonInverseFillType_fill'>fill</a> inside its bounds. . -| <a href="#SkPath_FillType">FillType</a> | inside <a href="#SkPath_FillType">FillType</a> | +| <a href='#SkPath_FillType'>FillType</a> | inside <a href='#SkPath_FillType'>FillType</a> | | --- | --- | -| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | -| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | -| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | -| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | +| <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | +| <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | +| <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> | <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | +| <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | ### Parameters -<table> <tr> <td><a name="SkPath_ConvertToNonInverseFillType_fill"> <code><strong>fill </strong></code> </a></td> <td> -one of: <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, -<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a></td> +<table> <tr> <td><a name='SkPath_ConvertToNonInverseFillType_fill'><code><strong>fill</strong></code></a></td> + <td>one of: <a href='#SkPath_kWinding_FillType'>kWinding FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a>, +<a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a>, <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a></td> </tr> </table> ### Return Value -<a href="#SkPath_ConvertToNonInverseFillType_fill">fill</a>, or <a href="#SkPath_kWinding_FillType">kWinding FillType</a> or <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> if <a href="#SkPath_ConvertToNonInverseFillType_fill">fill</a> is inverted +<a href='#SkPath_ConvertToNonInverseFillType_fill'>fill</a>, or <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> or <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> if <a href='#SkPath_ConvertToNonInverseFillType_fill'>fill</a> is inverted ### Example -<div><fiddle-embed name="adfae398bbe9e37495f8220ad544c8f8"> +<div><fiddle-embed name="319f6b124458dcc0f9ce4d7bbde65810"> #### Example Output @@ -3264,103 +4138,111 @@ ConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType ### See Also -<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_IsInverseFillType">IsInverseFillType</a> +<a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_IsInverseFillType'>IsInverseFillType</a> --- -<a name="SkPath_ConvertConicToQuads"></a> +<a name='SkPath_ConvertConicToQuads'></a> ## ConvertConicToQuads -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static int ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w, - SkPoint pts[], int pow2) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static int <a href='#SkPath_ConvertConicToQuads'>ConvertConicToQuads</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p0, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, <a href='undocumented#SkScalar'>SkScalar</a> w, + <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int pow2) </pre> -Approximates <a href="#Conic">Conic</a> with <a href="#Quad">Quad</a> array. <a href="#Conic">Conic</a> is constructed from start <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_ConvertConicToQuads_p0">p0</a>, -control <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_ConvertConicToQuads_p1">p1</a>, end <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_ConvertConicToQuads_p2">p2</a>, and weight <a href="#SkPath_ConvertConicToQuads_w">w</a>. -<a href="#Quad">Quad</a> array is stored in <a href="#SkPath_ConvertConicToQuads_pts">pts</a>; this storage is supplied by caller. -Maximum <a href="#Quad">Quad</a> count is 2 to the <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a>. -Every third point in array shares last <a href="SkPoint_Reference#Point">Point</a> of previous <a href="#Quad">Quad</a> and first <a href="SkPoint_Reference#Point">Point</a> of -next <a href="#Quad">Quad</a>. Maximum <a href="#SkPath_ConvertConicToQuads_pts">pts</a> storage size is given by: -(1 + 2 * (1 << <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a>)) * sizeof(SkPoint). +Approximates <a href='#Conic'>Conic</a> with <a href='#Quad'>Quad</a> array. <a href='#Conic'>Conic</a> is constructed from start <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_ConvertConicToQuads_p0'>p0</a>, +control <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_ConvertConicToQuads_p1'>p1</a>, end <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_ConvertConicToQuads_p2'>p2</a>, and weight <a href='#SkPath_ConvertConicToQuads_w'>w</a>. +<a href='#Quad'>Quad</a> array is stored in <a href='#SkPath_ConvertConicToQuads_pts'>pts</a>; this storage is supplied by caller. +Maximum <a href='#Quad'>Quad</a> count is 2 to the <a href='#SkPath_ConvertConicToQuads_pow2'>pow2</a>. +Every third point in array shares last <a href='SkPoint_Reference#Point'>Point</a> of previous <a href='#Quad'>Quad</a> and first <a href='SkPoint_Reference#Point'>Point</a> of +next <a href='#Quad'>Quad</a>. Maximum <a href='#SkPath_ConvertConicToQuads_pts'>pts</a> storage size is given by: +(1 + 2 * (1 << <a href='#SkPath_ConvertConicToQuads_pow2'>pow2</a>)) * sizeof(SkPoint). -Returns <a href="#Quad">Quad</a> count used the approximation, which may be smaller +Returns <a href='#Quad'>Quad</a> count used the approximation, which may be smaller than the number requested. -<a href="#Conic_Weight">Conic Weight</a> determines the amount of influence <a href="#Conic">Conic</a> control point has on the curve. -<a href="#SkPath_ConvertConicToQuads_w">w</a> less than one represents an elliptical section. <a href="#SkPath_ConvertConicToQuads_w">w</a> greater than one represents -a hyperbolic section. <a href="#SkPath_ConvertConicToQuads_w">w</a> equal to one represents a parabolic section. -Two <a href="#Quad">Quad</a> curves are sufficient to approximate an elliptical <a href="#Conic">Conic</a> with a sweep -of up to 90 degrees; in this case, set <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a> to one. +<a href='#Conic_Weight'>Conic Weight</a> determines the amount of influence <a href='#Conic'>Conic</a> control point has on the curve. +<a href='#SkPath_ConvertConicToQuads_w'>w</a> less than one represents an elliptical section. <a href='#SkPath_ConvertConicToQuads_w'>w</a> greater than one represents +a hyperbolic section. <a href='#SkPath_ConvertConicToQuads_w'>w</a> equal to one represents a parabolic section. + +Two <a href='#Quad'>Quad</a> curves are sufficient to approximate an elliptical <a href='#Conic'>Conic</a> with a sweep +of up to 90 degrees; in this case, set <a href='#SkPath_ConvertConicToQuads_pow2'>pow2</a> to one. ### Parameters -<table> <tr> <td><a name="SkPath_ConvertConicToQuads_p0"> <code><strong>p0 </strong></code> </a></td> <td> -<a href="#Conic">Conic</a> start <a href="SkPoint_Reference#Point">Point</a></td> - </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_p1"> <code><strong>p1 </strong></code> </a></td> <td> -<a href="#Conic">Conic</a> control <a href="SkPoint_Reference#Point">Point</a></td> - </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_p2"> <code><strong>p2 </strong></code> </a></td> <td> -<a href="#Conic">Conic</a> end <a href="SkPoint_Reference#Point">Point</a></td> - </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_w"> <code><strong>w </strong></code> </a></td> <td> -<a href="#Conic">Conic</a> weight</td> - </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_pts"> <code><strong>pts </strong></code> </a></td> <td> -storage for <a href="#Quad">Quad</a> array</td> - </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_pow2"> <code><strong>pow2 </strong></code> </a></td> <td> -<a href="#Quad">Quad</a> count, as power of two, normally 0 to 5 (1 to 32 <a href="#Quad">Quad</a> curves)</td> +<table> <tr> <td><a name='SkPath_ConvertConicToQuads_p0'><code><strong>p0</strong></code></a></td> + <td><a href='#Conic'>Conic</a> start <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> <td><a name='SkPath_ConvertConicToQuads_p1'><code><strong>p1</strong></code></a></td> + <td><a href='#Conic'>Conic</a> control <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> <td><a name='SkPath_ConvertConicToQuads_p2'><code><strong>p2</strong></code></a></td> + <td><a href='#Conic'>Conic</a> end <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> <td><a name='SkPath_ConvertConicToQuads_w'><code><strong>w</strong></code></a></td> + <td><a href='#Conic'>Conic</a> weight</td> + </tr> + <tr> <td><a name='SkPath_ConvertConicToQuads_pts'><code><strong>pts</strong></code></a></td> + <td>storage for <a href='#Quad'>Quad</a> array</td> + </tr> + <tr> <td><a name='SkPath_ConvertConicToQuads_pow2'><code><strong>pow2</strong></code></a></td> + <td><a href='#Quad'>Quad</a> count, as power of two, normally 0 to 5 (1 to 32 <a href='#Quad'>Quad</a> curves)</td> </tr> </table> ### Return Value -number of <a href="#Quad">Quad</a> curves written to <a href="#SkPath_ConvertConicToQuads_pts">pts</a> +number of <a href='#Quad'>Quad</a> curves written to <a href='#SkPath_ConvertConicToQuads_pts'>pts</a> ### Example -<div><fiddle-embed name="3ba94448a4ba48f926e643baeb5b1016"><div>A pair of <a href="#Quad">Quad</a> curves are drawn in red on top of the elliptical <a href="#Conic">Conic</a> curve in black. +<div><fiddle-embed name="3ba94448a4ba48f926e643baeb5b1016"><div>A pair of <a href='#Quad'>Quad</a> curves are drawn in red on top of the elliptical <a href='#Conic'>Conic</a> curve in black. The middle curve is nearly circular. The top-right curve is parabolic, which can -be drawn exactly with a single <a href="#Quad">Quad</a>. +be drawn exactly with a single <a href='#Quad'>Quad</a>. </div></fiddle-embed></div> ### See Also -<a href="#Conic">Conic</a> <a href="#Quad">Quad</a> +<a href='#Conic'>Conic</a> <a href='#Quad'>Quad</a> --- -<a name="SkPath_isRect"></a> +<a name='SkPath_isRect'></a> ## isRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isRect(SkRect* rect, bool* isClosed = nullptr, Direction* direction = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isRect'>isRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* rect, bool* isClosed = nullptr, <a href='#SkPath_Direction'>Direction</a>* direction = nullptr) const </pre> -Returns true if <a href="#Path">Path</a> is equivalent to <a href="SkRect_Reference#Rect">Rect</a> when filled. -If false: <a href="#SkPath_isRect_rect">rect</a>, <a href="#SkPath_isRect_isClosed">isClosed</a>, and <a href="#SkPath_isRect_direction">direction</a> are unchanged. -If true: <a href="#SkPath_isRect_rect">rect</a>, <a href="#SkPath_isRect_isClosed">isClosed</a>, and <a href="#SkPath_isRect_direction">direction</a> are written to if not nullptr. +Returns true if <a href='#Path'>Path</a> is equivalent to <a href='SkRect_Reference#Rect'>Rect</a> when filled. +If false: <a href='#SkPath_isRect_rect'>rect</a>, <a href='#SkPath_isRect_isClosed'>isClosed</a>, and <a href='#SkPath_isRect_direction'>direction</a> are unchanged. +If true: <a href='#SkPath_isRect_rect'>rect</a>, <a href='#SkPath_isRect_isClosed'>isClosed</a>, and <a href='#SkPath_isRect_direction'>direction</a> are written to if not nullptr. -<a href="#SkPath_isRect_rect">rect</a> may be smaller than the <a href="#Path">Path</a> bounds. <a href="#Path">Path</a> bounds may include <a href="#SkPath_kMove_Verb">kMove Verb</a> points -that do not alter the area drawn by the returned <a href="#SkPath_isRect_rect">rect</a>. +<a href='#SkPath_isRect_rect'>rect</a> may be smaller than the <a href='#Path'>Path</a> bounds. <a href='#Path'>Path</a> bounds may include <a href='#SkPath_kMove_Verb'>kMove Verb</a> points +that do not alter the area drawn by the returned <a href='#SkPath_isRect_rect'>rect</a>. ### Parameters -<table> <tr> <td><a name="SkPath_isRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -storage for bounds of <a href="SkRect_Reference#Rect">Rect</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkPath_isRect_isClosed"> <code><strong>isClosed </strong></code> </a></td> <td> -storage set to true if <a href="#Path">Path</a> is closed; may be nullptr</td> - </tr> <tr> <td><a name="SkPath_isRect_direction"> <code><strong>direction </strong></code> </a></td> <td> -storage set to <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_isRect_direction">direction</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_isRect_rect'><code><strong>rect</strong></code></a></td> + <td>storage for bounds of <a href='SkRect_Reference#Rect'>Rect</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkPath_isRect_isClosed'><code><strong>isClosed</strong></code></a></td> + <td>storage set to true if <a href='#Path'>Path</a> is closed; may be nullptr</td> + </tr> + <tr> <td><a name='SkPath_isRect_direction'><code><strong>direction</strong></code></a></td> + <td>storage set to <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_isRect_direction'>direction</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> contains <a href="SkRect_Reference#Rect">Rect</a> +true if <a href='#Path'>Path</a> contains <a href='SkRect_Reference#Rect'>Rect</a> ### Example -<div><fiddle-embed name="063a5f0a8de1fe998d227393e0866557"><div>After <a href="#SkPath_addRect">addRect</a>, <a href="#SkPath_isRect">isRect</a> returns true. Following <a href="#SkPath_moveTo">moveTo</a> permits <a href="#SkPath_isRect">isRect</a> to return true, but -following <a href="#SkPath_lineTo">lineTo</a> does not. <a href="#SkPath_addPoly">addPoly</a> returns true even though <a href="#SkPath_isRect_rect">rect</a> is not closed, and one -side of <a href="#SkPath_isRect_rect">rect</a> is made up of consecutive line segments. +<div><fiddle-embed name="81a2aac1b8f0ff3d4c8d35ccb9149b16"><div>After <a href='#SkPath_addRect'>addRect</a>, <a href='#SkPath_isRect'>isRect</a> returns true. Following <a href='#SkPath_moveTo'>moveTo</a> permits <a href='#SkPath_isRect'>isRect</a> to return true, but +following <a href='#SkPath_lineTo'>lineTo</a> does not. <a href='#SkPath_addPoly'>addPoly</a> returns true even though <a href='#SkPath_isRect_rect'>rect</a> is not closed, and one +side of <a href='#SkPath_isRect_rect'>rect</a> is made up of consecutive line segments. </div> #### Example Output @@ -3377,36 +4259,37 @@ addPoly is rect (0, 0, 80, 80); is not closed; direction CCW ### See Also -<a href="#SkPath_computeTightBounds">computeTightBounds</a> <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> <a href="#SkPath_getBounds">getBounds</a> <a href="#SkPath_isConvex">isConvex</a> <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> +<a href='#SkPath_computeTightBounds'>computeTightBounds</a> <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a> <a href='#SkPath_getBounds'>getBounds</a> <a href='#SkPath_isConvex'>isConvex</a> <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a> <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a> --- -<a name="SkPath_isNestedFillRects"></a> +<a name='SkPath_isNestedFillRects'></a> ## isNestedFillRects -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isNestedFillRects(SkRect rect[2], Direction dirs[2] = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a>(<a href='SkRect_Reference#SkRect'>SkRect</a> rect[2], <a href='#SkPath_Direction'>Direction</a> dirs[2] = nullptr) const </pre> -Returns true if <a href="#Path">Path</a> is equivalent to nested <a href="SkRect_Reference#Rect">Rect</a> pair when filled. -If false, <a href="#SkPath_isNestedFillRects_rect">rect</a> and <a href="#SkPath_isNestedFillRects_dirs">dirs</a> are unchanged. -If true, <a href="#SkPath_isNestedFillRects_rect">rect</a> and <a href="#SkPath_isNestedFillRects_dirs">dirs</a> are written to if not nullptr: -setting <a href="#SkPath_isNestedFillRects_rect">rect</a>[0] to outer <a href="SkRect_Reference#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_rect">rect</a>[1] to inner <a href="SkRect_Reference#Rect">Rect</a>; -setting <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[0] to <a href="#SkPath_Direction">Direction</a> of outer <a href="SkRect_Reference#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[1] to <a href="#SkPath_Direction">Direction</a> of inner -<a href="SkRect_Reference#Rect">Rect</a>. +Returns true if <a href='#Path'>Path</a> is equivalent to nested <a href='SkRect_Reference#Rect'>Rect</a> pair when filled. +If false, <a href='#SkPath_isNestedFillRects_rect'>rect</a> and <a href='#SkPath_isNestedFillRects_dirs'>dirs</a> are unchanged. +If true, <a href='#SkPath_isNestedFillRects_rect'>rect</a> and <a href='#SkPath_isNestedFillRects_dirs'>dirs</a> are written to if not nullptr: +setting <a href='#SkPath_isNestedFillRects_rect'>rect</a>[0] to outer <a href='SkRect_Reference#Rect'>Rect</a>, and <a href='#SkPath_isNestedFillRects_rect'>rect</a>[1] to inner <a href='SkRect_Reference#Rect'>Rect</a>; +setting <a href='#SkPath_isNestedFillRects_dirs'>dirs</a>[0] to <a href='#SkPath_Direction'>Direction</a> of outer <a href='SkRect_Reference#Rect'>Rect</a>, and <a href='#SkPath_isNestedFillRects_dirs'>dirs</a>[1] to <a href='#SkPath_Direction'>Direction</a> of inner +<a href='SkRect_Reference#Rect'>Rect</a>. ### Parameters -<table> <tr> <td><a name="SkPath_isNestedFillRects_rect"> <code><strong>rect </strong></code> </a></td> <td> -storage for <a href="SkRect_Reference#Rect">Rect</a> pair; may be nullptr</td> - </tr> <tr> <td><a name="SkPath_isNestedFillRects_dirs"> <code><strong>dirs </strong></code> </a></td> <td> -storage for <a href="#SkPath_Direction">Direction</a> pair; may be nullptr</td> +<table> <tr> <td><a name='SkPath_isNestedFillRects_rect'><code><strong>rect</strong></code></a></td> + <td>storage for <a href='SkRect_Reference#Rect'>Rect</a> pair; may be nullptr</td> + </tr> + <tr> <td><a name='SkPath_isNestedFillRects_dirs'><code><strong>dirs</strong></code></a></td> + <td>storage for <a href='#SkPath_Direction'>Direction</a> pair; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Path">Path</a> contains nested <a href="SkRect_Reference#Rect">Rect</a> pair +true if <a href='#Path'>Path</a> contains nested <a href='SkRect_Reference#Rect'>Rect</a> pair ### Example @@ -3423,55 +4306,56 @@ inner (12.5, 22.5, 27.5, 37.5); direction CCW ### See Also -<a href="#SkPath_computeTightBounds">computeTightBounds</a> <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> <a href="#SkPath_getBounds">getBounds</a> <a href="#SkPath_isConvex">isConvex</a> <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> <a href="#SkPath_isRect">isRect</a> +<a href='#SkPath_computeTightBounds'>computeTightBounds</a> <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a> <a href='#SkPath_getBounds'>getBounds</a> <a href='#SkPath_isConvex'>isConvex</a> <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a> <a href='#SkPath_isRect'>isRect</a> --- -<a name="SkPath_addRect"></a> +<a name='SkPath_addRect'></a> ## addRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRect(const SkRect& rect, Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRect'>addRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Add <a href="SkRect_Reference#Rect">Rect</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>, -starting with top-left corner of <a href="SkRect_Reference#Rect">Rect</a>; followed by top-right, bottom-right, -and bottom-left if <a href="#SkPath_addRect_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>; or followed by bottom-left, -bottom-right, and top-right if <a href="#SkPath_addRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. +Add <a href='SkRect_Reference#Rect'>Rect</a> to <a href='#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove Verb</a>, three <a href='#SkPath_kLine_Verb'>kLine Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>, +starting with top-left corner of <a href='SkRect_Reference#Rect'>Rect</a>; followed by top-right, bottom-right, +and bottom-left if <a href='#SkPath_addRect_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>; or followed by bottom-left, +bottom-right, and top-right if <a href='#SkPath_addRect_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to add as a closed contour</td> - </tr> <tr> <td><a name="SkPath_addRect_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind added contour</td> +<table> <tr> <td><a name='SkPath_addRect_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to add as a closed contour</td> + </tr> + <tr> <td><a name='SkPath_addRect_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind added contour</td> </tr> </table> ### Example -<div><fiddle-embed name="0f841e4eaebb613b5069800567917c2d"><div>The left <a href="SkRect_Reference#Rect">Rect</a> dashes starting at the top-left corner, to the right. -The right <a href="SkRect_Reference#Rect">Rect</a> dashes starting at the top-left corner, towards the bottom. +<div><fiddle-embed name="0f841e4eaebb613b5069800567917c2d"><div>The left <a href='SkRect_Reference#Rect'>Rect</a> dashes starting at the top-left corner, to the right. +The right <a href='SkRect_Reference#Rect'>Rect</a> dashes starting at the top-left corner, towards the bottom. </div></fiddle-embed></div> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawRect">SkCanvas::drawRect</a> <a href="#SkPath_Direction">Direction</a> +<a href='SkCanvas_Reference#SkCanvas_drawRect'>SkCanvas::drawRect</a> <a href='#SkPath_Direction'>Direction</a> --- -<a name="SkPath_addRect_2"></a> +<a name='SkPath_addRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRect(const SkRect& rect, Direction dir, unsigned start) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRect'>addRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start) </pre> -Add <a href="SkRect_Reference#Rect">Rect</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>. -If <a href="#SkPath_addRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="SkRect_Reference#Rect">Rect</a> corners are added clockwise; if <a href="#SkPath_addRect_2_dir">dir</a> is -<a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="SkRect_Reference#Rect">Rect</a> corners are added counterclockwise. -<a href="#SkPath_addRect_2_start">start</a> determines the first corner added. +Add <a href='SkRect_Reference#Rect'>Rect</a> to <a href='#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove Verb</a>, three <a href='#SkPath_kLine_Verb'>kLine Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>. +If <a href='#SkPath_addRect_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, <a href='SkRect_Reference#Rect'>Rect</a> corners are added clockwise; if <a href='#SkPath_addRect_2_dir'>dir</a> is +<a href='#SkPath_kCCW_Direction'>kCCW Direction</a>, <a href='SkRect_Reference#Rect'>Rect</a> corners are added counterclockwise. +<a href='#SkPath_addRect_2_start'>start</a> determines the first corner added. -| <a href="#SkPath_addRect_2_start">start</a> | first corner | +| <a href='#SkPath_addRect_2_start'>start</a> | first corner | | --- | --- | | 0 | top-left | | 1 | top-right | @@ -3480,85 +4364,92 @@ If <a href="#SkPath_addRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kC ### Parameters -<table> <tr> <td><a name="SkPath_addRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td> -<a href="SkRect_Reference#Rect">Rect</a> to add as a closed contour</td> - </tr> <tr> <td><a name="SkPath_addRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind added contour</td> - </tr> <tr> <td><a name="SkPath_addRect_2_start"> <code><strong>start </strong></code> </a></td> <td> -initial corner of <a href="SkRect_Reference#Rect">Rect</a> to add</td> +<table> <tr> <td><a name='SkPath_addRect_2_rect'><code><strong>rect</strong></code></a></td> + <td><a href='SkRect_Reference#Rect'>Rect</a> to add as a closed contour</td> + </tr> + <tr> <td><a name='SkPath_addRect_2_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind added contour</td> + </tr> + <tr> <td><a name='SkPath_addRect_2_start'><code><strong>start</strong></code></a></td> + <td>initial corner of <a href='SkRect_Reference#Rect'>Rect</a> to add</td> </tr> </table> ### Example <div><fiddle-embed name="9202430b3f4f5275af8eec5cc9d7baa8"><div>The arrow is just after the initial corner and points towards the next -corner appended to <a href="#Path">Path</a>. +corner appended to <a href='#Path'>Path</a>. </div></fiddle-embed></div> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawRect">SkCanvas::drawRect</a> <a href="#SkPath_Direction">Direction</a> +<a href='SkCanvas_Reference#SkCanvas_drawRect'>SkCanvas::drawRect</a> <a href='#SkPath_Direction'>Direction</a> --- -<a name="SkPath_addRect_3"></a> +<a name='SkPath_addRect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, - Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRect'>addRect</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom, + <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Add <a href="SkRect_Reference#Rect">Rect</a> (<a href="#SkPath_addRect_3_left">left</a>, <a href="#SkPath_addRect_3_top">top</a>, <a href="#SkPath_addRect_3_right">right</a>, <a href="#SkPath_addRect_3_bottom">bottom</a>) to <a href="#Path">Path</a>, -appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>, -starting with <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_left">left</a> corner of <a href="SkRect_Reference#Rect">Rect</a>; followed by <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_right">right</a>, <a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_right">right</a>, -and <a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_left">left</a> if <a href="#SkPath_addRect_3_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>; or followed by <a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_left">left</a>, -<a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_right">right</a>, and <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_right">right</a> if <a href="#SkPath_addRect_3_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. +Add <a href='SkRect_Reference#Rect'>Rect</a> (<a href='#SkPath_addRect_3_left'>left</a>, <a href='#SkPath_addRect_3_top'>top</a>, <a href='#SkPath_addRect_3_right'>right</a>, <a href='#SkPath_addRect_3_bottom'>bottom</a>) to <a href='#Path'>Path</a>, +appending <a href='#SkPath_kMove_Verb'>kMove Verb</a>, three <a href='#SkPath_kLine_Verb'>kLine Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>, +starting with <a href='#SkPath_addRect_3_top'>top</a>-<a href='#SkPath_addRect_3_left'>left</a> corner of <a href='SkRect_Reference#Rect'>Rect</a>; followed by <a href='#SkPath_addRect_3_top'>top</a>-<a href='#SkPath_addRect_3_right'>right</a>, <a href='#SkPath_addRect_3_bottom'>bottom</a>-<a href='#SkPath_addRect_3_right'>right</a>, +and <a href='#SkPath_addRect_3_bottom'>bottom</a>-<a href='#SkPath_addRect_3_left'>left</a> if <a href='#SkPath_addRect_3_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>; or followed by <a href='#SkPath_addRect_3_bottom'>bottom</a>-<a href='#SkPath_addRect_3_left'>left</a>, +<a href='#SkPath_addRect_3_bottom'>bottom</a>-<a href='#SkPath_addRect_3_right'>right</a>, and <a href='#SkPath_addRect_3_top'>top</a>-<a href='#SkPath_addRect_3_right'>right</a> if <a href='#SkPath_addRect_3_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addRect_3_left"> <code><strong>left </strong></code> </a></td> <td> -smaller x of <a href="SkRect_Reference#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRect_3_top"> <code><strong>top </strong></code> </a></td> <td> -smaller y of <a href="SkRect_Reference#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRect_3_right"> <code><strong>right </strong></code> </a></td> <td> -larger x of <a href="SkRect_Reference#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRect_3_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -larger y of <a href="SkRect_Reference#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRect_3_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind added contour</td> +<table> <tr> <td><a name='SkPath_addRect_3_left'><code><strong>left</strong></code></a></td> + <td>smaller x of <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRect_3_top'><code><strong>top</strong></code></a></td> + <td>smaller y of <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRect_3_right'><code><strong>right</strong></code></a></td> + <td>larger x of <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRect_3_bottom'><code><strong>bottom</strong></code></a></td> + <td>larger y of <a href='SkRect_Reference#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRect_3_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind added contour</td> </tr> </table> ### Example -<div><fiddle-embed name="3837827310e8b88b8c2e128ef9fbbd65"><div>The <a href="#SkPath_addRect_3_left">left</a> <a href="SkRect_Reference#Rect">Rect</a> dashes start at the <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_left">left</a> corner, and continue to the <a href="#SkPath_addRect_3_right">right</a>. -The <a href="#SkPath_addRect_3_right">right</a> <a href="SkRect_Reference#Rect">Rect</a> dashes start at the <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_left">left</a> corner, and continue down. +<div><fiddle-embed name="3837827310e8b88b8c2e128ef9fbbd65"><div>The <a href='#SkPath_addRect_3_left'>left</a> <a href='SkRect_Reference#Rect'>Rect</a> dashes start at the <a href='#SkPath_addRect_3_top'>top</a>-<a href='#SkPath_addRect_3_left'>left</a> corner, and continue to the <a href='#SkPath_addRect_3_right'>right</a>. +The <a href='#SkPath_addRect_3_right'>right</a> <a href='SkRect_Reference#Rect'>Rect</a> dashes start at the <a href='#SkPath_addRect_3_top'>top</a>-<a href='#SkPath_addRect_3_left'>left</a> corner, and continue down. </div></fiddle-embed></div> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawRect">SkCanvas::drawRect</a> <a href="#SkPath_Direction">Direction</a> +<a href='SkCanvas_Reference#SkCanvas_drawRect'>SkCanvas::drawRect</a> <a href='#SkPath_Direction'>Direction</a> --- -<a name="SkPath_addOval"></a> +<a name='SkPath_addOval'></a> ## addOval -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addOval(const SkRect& oval, Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addOval'>addOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Add <a href="undocumented#Oval">Oval</a> to path, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, four <a href="#SkPath_kConic_Verb">kConic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>. -<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addOval_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_oval">oval</a> width -and half <a href="#SkPath_addOval_oval">oval</a> height. <a href="undocumented#Oval">Oval</a> begins at (<a href="#SkPath_addOval_oval">oval</a>.fRight, <a href="#SkPath_addOval_oval">oval</a>.centerY()) and continues -clockwise if <a href="#SkPath_addOval_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, counterclockwise if <a href="#SkPath_addOval_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. +Add <a href='undocumented#Oval'>Oval</a> to path, appending <a href='#SkPath_kMove_Verb'>kMove Verb</a>, four <a href='#SkPath_kConic_Verb'>kConic Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>. +<a href='undocumented#Oval'>Oval</a> is upright ellipse bounded by <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_addOval_oval'>oval</a> with radii equal to half <a href='#SkPath_addOval_oval'>oval</a> width +and half <a href='#SkPath_addOval_oval'>oval</a> height. <a href='undocumented#Oval'>Oval</a> begins at (<a href='#SkPath_addOval_oval'>oval</a>.fRight, <a href='#SkPath_addOval_oval'>oval</a>.centerY()) and continues +clockwise if <a href='#SkPath_addOval_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, counterclockwise if <a href='#SkPath_addOval_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addOval_oval"> <code><strong>oval </strong></code> </a></td> <td> -bounds of ellipse added</td> - </tr> <tr> <td><a name="SkPath_addOval_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind ellipse</td> +<table> <tr> <td><a name='SkPath_addOval_oval'><code><strong>oval</strong></code></a></td> + <td>bounds of ellipse added</td> + </tr> + <tr> <td><a name='SkPath_addOval_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind ellipse</td> </tr> </table> @@ -3568,36 +4459,38 @@ bounds of ellipse added</td> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawOval">SkCanvas::drawOval</a> <a href="#SkPath_Direction">Direction</a> <a href="undocumented#Oval">Oval</a> +<a href='SkCanvas_Reference#SkCanvas_drawOval'>SkCanvas::drawOval</a> <a href='#SkPath_Direction'>Direction</a> <a href='undocumented#Oval'>Oval</a> --- -<a name="SkPath_addOval_2"></a> +<a name='SkPath_addOval_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addOval(const SkRect& oval, Direction dir, unsigned start) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addOval'>addOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start) </pre> -Add <a href="undocumented#Oval">Oval</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, four <a href="#SkPath_kConic_Verb">kConic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>. -<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addOval_2_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_2_oval">oval</a> width -and half <a href="#SkPath_addOval_2_oval">oval</a> height. <a href="undocumented#Oval">Oval</a> begins at <a href="#SkPath_addOval_2_start">start</a> and continues -clockwise if <a href="#SkPath_addOval_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, counterclockwise if <a href="#SkPath_addOval_2_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. +Add <a href='undocumented#Oval'>Oval</a> to <a href='#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove Verb</a>, four <a href='#SkPath_kConic_Verb'>kConic Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>. +<a href='undocumented#Oval'>Oval</a> is upright ellipse bounded by <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_addOval_2_oval'>oval</a> with radii equal to half <a href='#SkPath_addOval_2_oval'>oval</a> width +and half <a href='#SkPath_addOval_2_oval'>oval</a> height. <a href='undocumented#Oval'>Oval</a> begins at <a href='#SkPath_addOval_2_start'>start</a> and continues +clockwise if <a href='#SkPath_addOval_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, counterclockwise if <a href='#SkPath_addOval_2_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>. -| <a href="#SkPath_addOval_2_start">start</a> | <a href="SkPoint_Reference#Point">Point</a> | +| <a href='#SkPath_addOval_2_start'>start</a> | <a href='SkPoint_Reference#Point'>Point</a> | | --- | --- | -| 0 | <a href="#SkPath_addOval_2_oval">oval</a>.centerX(), <a href="#SkPath_addOval_2_oval">oval</a>.fTop | -| 1 | <a href="#SkPath_addOval_2_oval">oval</a>.fRight, <a href="#SkPath_addOval_2_oval">oval</a>.centerY() | -| 2 | <a href="#SkPath_addOval_2_oval">oval</a>.centerX(), <a href="#SkPath_addOval_2_oval">oval</a>.fBottom | -| 3 | <a href="#SkPath_addOval_2_oval">oval</a>.fLeft, <a href="#SkPath_addOval_2_oval">oval</a>.centerY() | +| 0 | <a href='#SkPath_addOval_2_oval'>oval</a>.centerX(), <a href='#SkPath_addOval_2_oval'>oval</a>.fTop | +| 1 | <a href='#SkPath_addOval_2_oval'>oval</a>.fRight, <a href='#SkPath_addOval_2_oval'>oval</a>.centerY() | +| 2 | <a href='#SkPath_addOval_2_oval'>oval</a>.centerX(), <a href='#SkPath_addOval_2_oval'>oval</a>.fBottom | +| 3 | <a href='#SkPath_addOval_2_oval'>oval</a>.fLeft, <a href='#SkPath_addOval_2_oval'>oval</a>.centerY() | ### Parameters -<table> <tr> <td><a name="SkPath_addOval_2_oval"> <code><strong>oval </strong></code> </a></td> <td> -bounds of ellipse added</td> - </tr> <tr> <td><a name="SkPath_addOval_2_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind ellipse</td> - </tr> <tr> <td><a name="SkPath_addOval_2_start"> <code><strong>start </strong></code> </a></td> <td> -index of initial point of ellipse</td> +<table> <tr> <td><a name='SkPath_addOval_2_oval'><code><strong>oval</strong></code></a></td> + <td>bounds of ellipse added</td> + </tr> + <tr> <td><a name='SkPath_addOval_2_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind ellipse</td> + </tr> + <tr> <td><a name='SkPath_addOval_2_start'><code><strong>start</strong></code></a></td> + <td>index of initial point of ellipse</td> </tr> </table> @@ -3607,36 +4500,39 @@ index of initial point of ellipse</td> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawOval">SkCanvas::drawOval</a> <a href="#SkPath_Direction">Direction</a> <a href="undocumented#Oval">Oval</a> +<a href='SkCanvas_Reference#SkCanvas_drawOval'>SkCanvas::drawOval</a> <a href='#SkPath_Direction'>Direction</a> <a href='undocumented#Oval'>Oval</a> --- -<a name="SkPath_addCircle"></a> +<a name='SkPath_addCircle'></a> ## addCircle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addCircle(SkScalar x, SkScalar y, SkScalar radius, Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addCircle'>addCircle</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> radius, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Add <a href="undocumented#Circle">Circle</a> centered at (<a href="#SkPath_addCircle_x">x</a>, <a href="#SkPath_addCircle_y">y</a>) of size <a href="#SkPath_addCircle_radius">radius</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, -four <a href="#SkPath_kConic_Verb">kConic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>. <a href="undocumented#Circle">Circle</a> begins at: -(<a href="#SkPath_addCircle_x">x</a> + <a href="#SkPath_addCircle_radius">radius</a>, <a href="#SkPath_addCircle_y">y</a>) +Add <a href='undocumented#Circle'>Circle</a> centered at (<a href='#SkPath_addCircle_x'>x</a>, <a href='#SkPath_addCircle_y'>y</a>) of size <a href='#SkPath_addCircle_radius'>radius</a> to <a href='#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove Verb</a>, +four <a href='#SkPath_kConic_Verb'>kConic Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose Verb</a>. <a href='undocumented#Circle'>Circle</a> begins at: +(<a href='#SkPath_addCircle_x'>x</a> + <a href='#SkPath_addCircle_radius'>radius</a>, <a href='#SkPath_addCircle_y'>y</a>) , continuing -clockwise if <a href="#SkPath_addCircle_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, and counterclockwise if <a href="#SkPath_addCircle_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. +clockwise if <a href='#SkPath_addCircle_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, and counterclockwise if <a href='#SkPath_addCircle_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>. -Has no effect if <a href="#SkPath_addCircle_radius">radius</a> is zero or negative. +Has no effect if <a href='#SkPath_addCircle_radius'>radius</a> is zero or negative. ### Parameters -<table> <tr> <td><a name="SkPath_addCircle_x"> <code><strong>x </strong></code> </a></td> <td> -center of <a href="undocumented#Circle">Circle</a></td> - </tr> <tr> <td><a name="SkPath_addCircle_y"> <code><strong>y </strong></code> </a></td> <td> -center of <a href="undocumented#Circle">Circle</a></td> - </tr> <tr> <td><a name="SkPath_addCircle_radius"> <code><strong>radius </strong></code> </a></td> <td> -distance from center to edge</td> - </tr> <tr> <td><a name="SkPath_addCircle_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Circle">Circle</a></td> +<table> <tr> <td><a name='SkPath_addCircle_x'><code><strong>x</strong></code></a></td> + <td>center of <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> <td><a name='SkPath_addCircle_y'><code><strong>y</strong></code></a></td> + <td>center of <a href='undocumented#Circle'>Circle</a></td> + </tr> + <tr> <td><a name='SkPath_addCircle_radius'><code><strong>radius</strong></code></a></td> + <td>distance from center to edge</td> + </tr> + <tr> <td><a name='SkPath_addCircle_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='undocumented#Circle'>Circle</a></td> </tr> </table> @@ -3646,108 +4542,113 @@ distance from center to edge</td> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawCircle">SkCanvas::drawCircle</a><sup><a href="SkCanvas_Reference#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkPath_Direction">Direction</a> <a href="undocumented#Circle">Circle</a> +<a href='SkCanvas_Reference#SkCanvas_drawCircle'>SkCanvas::drawCircle</a><sup><a href='SkCanvas_Reference#SkCanvas_drawCircle_2'>[2]</a></sup> <a href='#SkPath_Direction'>Direction</a> <a href='undocumented#Circle'>Circle</a> --- -<a name="SkPath_addArc"></a> +<a name='SkPath_addArc'></a> ## addArc -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addArc'>addArc</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& oval, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, as the start of new <a href="#Contour">Contour</a>. <a href="#Arc">Arc</a> added is part of ellipse -bounded by <a href="#SkPath_addArc_oval">oval</a>, from <a href="#SkPath_addArc_startAngle">startAngle</a> through <a href="#SkPath_addArc_sweepAngle">sweepAngle</a>. Both <a href="#SkPath_addArc_startAngle">startAngle</a> and -<a href="#SkPath_addArc_sweepAngle">sweepAngle</a> are measured in degrees, where zero degrees is aligned with the -positive x-axis, and positive sweeps extends <a href="#Arc">Arc</a> clockwise. +Append <a href='#Arc'>Arc</a> to <a href='#Path'>Path</a>, as the start of new <a href='#Contour'>Contour</a>. <a href='#Arc'>Arc</a> added is part of ellipse +bounded by <a href='#SkPath_addArc_oval'>oval</a>, from <a href='#SkPath_addArc_startAngle'>startAngle</a> through <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a>. Both <a href='#SkPath_addArc_startAngle'>startAngle</a> and +<a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> are measured in degrees, where zero degrees is aligned with the +positive x-axis, and positive sweeps extends <a href='#Arc'>Arc</a> clockwise. -If <a href="#SkPath_addArc_sweepAngle">sweepAngle</a> <= -360, or <a href="#SkPath_addArc_sweepAngle">sweepAngle</a> >= 360; and <a href="#SkPath_addArc_startAngle">startAngle</a> modulo 90 is nearly -zero, append <a href="undocumented#Oval">Oval</a> instead of <a href="#Arc">Arc</a>. Otherwise, <a href="#SkPath_addArc_sweepAngle">sweepAngle</a> values are treated -modulo 360, and <a href="#Arc">Arc</a> may or may not draw depending on numeric rounding. +If <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> <= -360, or <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> >= 360; and <a href='#SkPath_addArc_startAngle'>startAngle</a> modulo 90 is nearly +zero, append <a href='undocumented#Oval'>Oval</a> instead of <a href='#Arc'>Arc</a>. Otherwise, <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> values are treated +modulo 360, and <a href='#Arc'>Arc</a> may or may not draw depending on numeric rounding. ### Parameters -<table> <tr> <td><a name="SkPath_addArc_oval"> <code><strong>oval </strong></code> </a></td> <td> -bounds of ellipse containing <a href="#Arc">Arc</a></td> - </tr> <tr> <td><a name="SkPath_addArc_startAngle"> <code><strong>startAngle </strong></code> </a></td> <td> -starting angle of <a href="#Arc">Arc</a> in degrees</td> - </tr> <tr> <td><a name="SkPath_addArc_sweepAngle"> <code><strong>sweepAngle </strong></code> </a></td> <td> -sweep, in degrees. Positive is clockwise; treated modulo 360</td> +<table> <tr> <td><a name='SkPath_addArc_oval'><code><strong>oval</strong></code></a></td> + <td>bounds of ellipse containing <a href='#Arc'>Arc</a></td> + </tr> + <tr> <td><a name='SkPath_addArc_startAngle'><code><strong>startAngle</strong></code></a></td> + <td>starting angle of <a href='#Arc'>Arc</a> in degrees</td> + </tr> + <tr> <td><a name='SkPath_addArc_sweepAngle'><code><strong>sweepAngle</strong></code></a></td> + <td>sweep, in degrees. Positive is clockwise; treated modulo 360</td> </tr> </table> ### Example <div><fiddle-embed name="9cf5122475624e4cf39f06c698f80b1a"><div>The middle row of the left and right columns draw differently from the entries -above and below because <a href="#SkPath_addArc_sweepAngle">sweepAngle</a> is outside of the range of +/-360, -and <a href="#SkPath_addArc_startAngle">startAngle</a> modulo 90 is not zero. +above and below because <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> is outside of the range of +/-360, +and <a href='#SkPath_addArc_startAngle'>startAngle</a> modulo 90 is not zero. </div></fiddle-embed></div> ### See Also -<a href="#Arc">Arc</a> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawArc">SkCanvas::drawArc</a> +<a href='#Arc'>Arc</a> <a href='#SkPath_arcTo'>arcTo</a><sup><a href='#SkPath_arcTo_2'>[2]</a></sup><sup><a href='#SkPath_arcTo_3'>[3]</a></sup><sup><a href='#SkPath_arcTo_4'>[4]</a></sup><sup><a href='#SkPath_arcTo_5'>[5]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawArc'>SkCanvas::drawArc</a> --- -<a name="SkPath_addRoundRect"></a> +<a name='SkPath_addRoundRect'></a> ## addRoundRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRoundRect'>addRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, <a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Append <a href="undocumented#Round_Rect">Round Rect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. <a href="undocumented#Round_Rect">Round Rect</a> has bounds -equal to <a href="#SkPath_addRoundRect_rect">rect</a>; each corner is 90 degrees of an ellipse with radii (<a href="#SkPath_addRoundRect_rx">rx</a>, <a href="#SkPath_addRoundRect_ry">ry</a>). If -<a href="#SkPath_addRoundRect_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at top-left of the lower-left corner and -winds clockwise. If <a href="#SkPath_addRoundRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at the bottom-left +Append <a href='undocumented#Round_Rect'>Round Rect</a> to <a href='#Path'>Path</a>, creating a new closed <a href='#Contour'>Contour</a>. <a href='undocumented#Round_Rect'>Round Rect</a> has bounds +equal to <a href='#SkPath_addRoundRect_rect'>rect</a>; each corner is 90 degrees of an ellipse with radii (<a href='#SkPath_addRoundRect_rx'>rx</a>, <a href='#SkPath_addRoundRect_ry'>ry</a>). If +<a href='#SkPath_addRoundRect_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, <a href='undocumented#Round_Rect'>Round Rect</a> starts at top-left of the lower-left corner and +winds clockwise. If <a href='#SkPath_addRoundRect_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>, <a href='undocumented#Round_Rect'>Round Rect</a> starts at the bottom-left of the upper-left corner and winds counterclockwise. -If either <a href="#SkPath_addRoundRect_rx">rx</a> or <a href="#SkPath_addRoundRect_ry">ry</a> is too large, <a href="#SkPath_addRoundRect_rx">rx</a> and <a href="#SkPath_addRoundRect_ry">ry</a> are scaled uniformly until the -corners fit. If <a href="#SkPath_addRoundRect_rx">rx</a> or <a href="#SkPath_addRoundRect_ry">ry</a> is less than or equal to zero, <a href="#SkPath_addRoundRect">addRoundRect</a> appends -<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addRoundRect_rect">rect</a> to <a href="#Path">Path</a>. +If either <a href='#SkPath_addRoundRect_rx'>rx</a> or <a href='#SkPath_addRoundRect_ry'>ry</a> is too large, <a href='#SkPath_addRoundRect_rx'>rx</a> and <a href='#SkPath_addRoundRect_ry'>ry</a> are scaled uniformly until the +corners fit. If <a href='#SkPath_addRoundRect_rx'>rx</a> or <a href='#SkPath_addRoundRect_ry'>ry</a> is less than or equal to zero, <a href='#SkPath_addRoundRect'>addRoundRect</a> appends +<a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_addRoundRect_rect'>rect</a> to <a href='#Path'>Path</a>. -After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect. +After appending, <a href='#Path'>Path</a> may be empty, or may contain: <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, or RoundRect. ### Parameters -<table> <tr> <td><a name="SkPath_addRoundRect_rect"> <code><strong>rect </strong></code> </a></td> <td> -bounds of <a href="undocumented#Round_Rect">Round Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRoundRect_rx"> <code><strong>rx </strong></code> </a></td> <td> -x-radius of rounded corners on the <a href="undocumented#Round_Rect">Round Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRoundRect_ry"> <code><strong>ry </strong></code> </a></td> <td> -y-radius of rounded corners on the <a href="undocumented#Round_Rect">Round Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRoundRect_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> +<table> <tr> <td><a name='SkPath_addRoundRect_rect'><code><strong>rect</strong></code></a></td> + <td>bounds of <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRoundRect_rx'><code><strong>rx</strong></code></a></td> + <td>x-radius of rounded corners on the <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRoundRect_ry'><code><strong>ry</strong></code></a></td> + <td>y-radius of rounded corners on the <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRoundRect_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='undocumented#Round_Rect'>Round Rect</a></td> </tr> </table> ### Example -<div><fiddle-embed name="24736f685f265cf533f1700c042db353"><div>If either radius is zero, path contains <a href="SkRect_Reference#Rect">Rect</a> and is drawn red. -If sides are only radii, path contains <a href="undocumented#Oval">Oval</a> and is drawn blue. +<div><fiddle-embed name="24736f685f265cf533f1700c042db353"><div>If either radius is zero, path contains <a href='SkRect_Reference#Rect'>Rect</a> and is drawn red. +If sides are only radii, path contains <a href='undocumented#Oval'>Oval</a> and is drawn blue. All remaining path draws are convex, and are drawn in gray; no -paths constructed from <a href="#SkPath_addRoundRect">addRoundRect</a> are concave, so none are +paths constructed from <a href='#SkPath_addRoundRect'>addRoundRect</a> are concave, so none are drawn in green. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_addRRect">addRRect</a><sup><a href="#SkPath_addRRect_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawRoundRect">SkCanvas::drawRoundRect</a> +<a href='#SkPath_addRRect'>addRRect</a><sup><a href='#SkPath_addRRect_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawRoundRect'>SkCanvas::drawRoundRect</a> --- -<a name="SkPath_addRoundRect_2"></a> +<a name='SkPath_addRoundRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRoundRect'>addRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect, const <a href='undocumented#SkScalar'>SkScalar</a> radii[], <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Append <a href="undocumented#Round_Rect">Round Rect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. <a href="undocumented#Round_Rect">Round Rect</a> has bounds -equal to <a href="#SkPath_addRoundRect_2_rect">rect</a>; each corner is 90 degrees of an ellipse with <a href="#SkPath_addRoundRect_2_radii">radii</a> from the +Append <a href='undocumented#Round_Rect'>Round Rect</a> to <a href='#Path'>Path</a>, creating a new closed <a href='#Contour'>Contour</a>. <a href='undocumented#Round_Rect'>Round Rect</a> has bounds +equal to <a href='#SkPath_addRoundRect_2_rect'>rect</a>; each corner is 90 degrees of an ellipse with <a href='#SkPath_addRoundRect_2_radii'>radii</a> from the array. -| <a href="#SkPath_addRoundRect_2_radii">radii</a> index | location | +| <a href='#SkPath_addRoundRect_2_radii'>radii</a> index | location | | --- | --- | | 0 | x-radius of top-left corner | | 1 | y-radius of top-left corner | @@ -3758,24 +4659,26 @@ array. | 6 | x-radius of bottom-left corner | | 7 | y-radius of bottom-left corner | -If <a href="#SkPath_addRoundRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at top-left of the lower-left corner -and winds clockwise. If <a href="#SkPath_addRoundRect_2_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at the +If <a href='#SkPath_addRoundRect_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, <a href='undocumented#Round_Rect'>Round Rect</a> starts at top-left of the lower-left corner +and winds clockwise. If <a href='#SkPath_addRoundRect_2_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>, <a href='undocumented#Round_Rect'>Round Rect</a> starts at the bottom-left of the upper-left corner and winds counterclockwise. -If both <a href="#SkPath_addRoundRect_2_radii">radii</a> on any side of <a href="#SkPath_addRoundRect_2_rect">rect</a> exceed its length, all <a href="#SkPath_addRoundRect_2_radii">radii</a> are scaled +If both <a href='#SkPath_addRoundRect_2_radii'>radii</a> on any side of <a href='#SkPath_addRoundRect_2_rect'>rect</a> exceed its length, all <a href='#SkPath_addRoundRect_2_radii'>radii</a> 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. -After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect. +After appending, <a href='#Path'>Path</a> may be empty, or may contain: <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, or RoundRect. ### Parameters -<table> <tr> <td><a name="SkPath_addRoundRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td> -bounds of <a href="undocumented#Round_Rect">Round Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRoundRect_2_radii"> <code><strong>radii </strong></code> </a></td> <td> -array of 8 <a href="undocumented#SkScalar">SkScalar</a> values, a radius pair for each corner</td> - </tr> <tr> <td><a name="SkPath_addRoundRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> +<table> <tr> <td><a name='SkPath_addRoundRect_2_rect'><code><strong>rect</strong></code></a></td> + <td>bounds of <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRoundRect_2_radii'><code><strong>radii</strong></code></a></td> + <td>array of 8 <a href='undocumented#SkScalar'>SkScalar</a> values, a radius pair for each corner</td> + </tr> + <tr> <td><a name='SkPath_addRoundRect_2_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='undocumented#Round_Rect'>Round Rect</a></td> </tr> </table> @@ -3785,30 +4688,31 @@ array of 8 <a href="undocumented#SkScalar">SkScalar</a> values, a radius pair fo ### See Also -<a href="#SkPath_addRRect">addRRect</a><sup><a href="#SkPath_addRRect_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawRoundRect">SkCanvas::drawRoundRect</a> +<a href='#SkPath_addRRect'>addRRect</a><sup><a href='#SkPath_addRRect_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawRoundRect'>SkCanvas::drawRoundRect</a> --- -<a name="SkPath_addRRect"></a> +<a name='SkPath_addRRect'></a> ## addRRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRRect'>addRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& rrect, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW Direction</a>) </pre> -Add <a href="#SkPath_addRRect_rrect">rrect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. If -<a href="#SkPath_addRRect_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="#SkPath_addRRect_rrect">rrect</a> starts at top-left of the lower-left corner and -winds clockwise. If <a href="#SkPath_addRRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="#SkPath_addRRect_rrect">rrect</a> starts at the bottom-left +Add <a href='#SkPath_addRRect_rrect'>rrect</a> to <a href='#Path'>Path</a>, creating a new closed <a href='#Contour'>Contour</a>. If +<a href='#SkPath_addRRect_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, <a href='#SkPath_addRRect_rrect'>rrect</a> starts at top-left of the lower-left corner and +winds clockwise. If <a href='#SkPath_addRRect_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>, <a href='#SkPath_addRRect_rrect'>rrect</a> starts at the bottom-left of the upper-left corner and winds counterclockwise. -After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or <a href="undocumented#Round_Rect">Round Rect</a>. +After appending, <a href='#Path'>Path</a> may be empty, or may contain: <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, or <a href='undocumented#Round_Rect'>Round Rect</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -bounds and radii of rounded rectangle</td> - </tr> <tr> <td><a name="SkPath_addRRect_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> +<table> <tr> <td><a name='SkPath_addRRect_rrect'><code><strong>rrect</strong></code></a></td> + <td>bounds and radii of rounded rectangle</td> + </tr> + <tr> <td><a name='SkPath_addRRect_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='undocumented#Round_Rect'>Round Rect</a></td> </tr> </table> @@ -3818,21 +4722,21 @@ bounds and radii of rounded rectangle</td> ### See Also -<a href="#SkPath_addRoundRect">addRoundRect</a><sup><a href="#SkPath_addRoundRect_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawRRect">SkCanvas::drawRRect</a> +<a href='#SkPath_addRoundRect'>addRoundRect</a><sup><a href='#SkPath_addRoundRect_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawRRect'>SkCanvas::drawRRect</a> --- -<a name="SkPath_addRRect_2"></a> +<a name='SkPath_addRRect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addRRect(const SkRRect& rrect, Direction dir, unsigned start) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addRRect'>addRRect</a>(const <a href='undocumented#SkRRect'>SkRRect</a>& rrect, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start) </pre> -Add <a href="#SkPath_addRRect_2_rrect">rrect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. If <a href="#SkPath_addRRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="#SkPath_addRRect_2_rrect">rrect</a> -winds clockwise; if <a href="#SkPath_addRRect_2_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="#SkPath_addRRect_2_rrect">rrect</a> winds counterclockwise. -<a href="#SkPath_addRRect_2_start">start</a> determines the first point of <a href="#SkPath_addRRect_2_rrect">rrect</a> to add. +Add <a href='#SkPath_addRRect_2_rrect'>rrect</a> to <a href='#Path'>Path</a>, creating a new closed <a href='#Contour'>Contour</a>. If <a href='#SkPath_addRRect_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW Direction</a>, <a href='#SkPath_addRRect_2_rrect'>rrect</a> +winds clockwise; if <a href='#SkPath_addRRect_2_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW Direction</a>, <a href='#SkPath_addRRect_2_rrect'>rrect</a> winds counterclockwise. +<a href='#SkPath_addRRect_2_start'>start</a> determines the first point of <a href='#SkPath_addRRect_2_rrect'>rrect</a> to add. -| <a href="#SkPath_addRRect_2_start">start</a> | location | +| <a href='#SkPath_addRRect_2_start'>start</a> | location | | --- | --- | | 0 | right of top-left corner | | 1 | left of top-right corner | @@ -3843,16 +4747,18 @@ winds clockwise; if <a href="#SkPath_addRRect_2_dir">dir</a> is <a href="#SkPath | 6 | top of bottom-left corner | | 7 | bottom of top-left corner | -After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or <a href="undocumented#Round_Rect">Round Rect</a>. +After appending, <a href='#Path'>Path</a> may be empty, or may contain: <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, or <a href='undocumented#Round_Rect'>Round Rect</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addRRect_2_rrect"> <code><strong>rrect </strong></code> </a></td> <td> -bounds and radii of rounded rectangle</td> - </tr> <tr> <td><a name="SkPath_addRRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td> -<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> - </tr> <tr> <td><a name="SkPath_addRRect_2_start"> <code><strong>start </strong></code> </a></td> <td> -index of initial point of <a href="undocumented#Round_Rect">Round Rect</a></td> +<table> <tr> <td><a name='SkPath_addRRect_2_rrect'><code><strong>rrect</strong></code></a></td> + <td>bounds and radii of rounded rectangle</td> + </tr> + <tr> <td><a name='SkPath_addRRect_2_dir'><code><strong>dir</strong></code></a></td> + <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='undocumented#Round_Rect'>Round Rect</a></td> + </tr> + <tr> <td><a name='SkPath_addRRect_2_start'><code><strong>start</strong></code></a></td> + <td>index of initial point of <a href='undocumented#Round_Rect'>Round Rect</a></td> </tr> </table> @@ -3862,33 +4768,35 @@ index of initial point of <a href="undocumented#Round_Rect">Round Rect</a></td> ### See Also -<a href="#SkPath_addRoundRect">addRoundRect</a><sup><a href="#SkPath_addRoundRect_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawRRect">SkCanvas::drawRRect</a> +<a href='#SkPath_addRoundRect'>addRoundRect</a><sup><a href='#SkPath_addRoundRect_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawRRect'>SkCanvas::drawRRect</a> --- -<a name="SkPath_addPoly"></a> +<a name='SkPath_addPoly'></a> ## addPoly -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addPoly(const SkPoint pts[], int count, bool close) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addPoly'>addPoly</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count, bool close) </pre> -Add <a href="#Contour">Contour</a> created from <a href="undocumented#Line">Line</a> array, adding (<a href="#SkPath_addPoly_count">count</a> - 1) <a href="undocumented#Line">Line</a> segments. -<a href="#Contour">Contour</a> added starts at <a href="#SkPath_addPoly_pts">pts</a>[0], then adds a line for every additional <a href="SkPoint_Reference#Point">Point</a> -in <a href="#SkPath_addPoly_pts">pts</a> array. If close is true,appends <a href="#SkPath_kClose_Verb">kClose Verb</a> to <a href="#Path">Path</a>, connecting -<a href="#SkPath_addPoly_pts">pts</a>[<a href="#SkPath_addPoly_count">count</a> - 1] and <a href="#SkPath_addPoly_pts">pts</a>[0]. +Add <a href='#Contour'>Contour</a> created from <a href='undocumented#Line'>Line</a> array, adding (<a href='#SkPath_addPoly_count'>count</a> - 1) <a href='undocumented#Line'>Line</a> segments. +<a href='#Contour'>Contour</a> added starts at <a href='#SkPath_addPoly_pts'>pts</a>[0], then adds a line for every additional <a href='SkPoint_Reference#Point'>Point</a> +in <a href='#SkPath_addPoly_pts'>pts</a> array. If close is true,appends <a href='#SkPath_kClose_Verb'>kClose Verb</a> to <a href='#Path'>Path</a>, connecting +<a href='#SkPath_addPoly_pts'>pts</a>[<a href='#SkPath_addPoly_count'>count</a> - 1] and <a href='#SkPath_addPoly_pts'>pts</a>[0]. -If <a href="#SkPath_addPoly_count">count</a> is zero, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to path. -Has no effect if <a href="#SkPath_addPoly_count">count</a> is less than one. +If <a href='#SkPath_addPoly_count'>count</a> is zero, append <a href='#SkPath_kMove_Verb'>kMove Verb</a> to path. +Has no effect if <a href='#SkPath_addPoly_count'>count</a> is less than one. ### Parameters -<table> <tr> <td><a name="SkPath_addPoly_pts"> <code><strong>pts </strong></code> </a></td> <td> -array of <a href="undocumented#Line">Line</a> sharing end and start <a href="SkPoint_Reference#Point">Point</a></td> - </tr> <tr> <td><a name="SkPath_addPoly_count"> <code><strong>count </strong></code> </a></td> <td> -length of <a href="SkPoint_Reference#Point">Point</a> array</td> - </tr> <tr> <td><a name="SkPath_addPoly_close"> <code><strong>close </strong></code> </a></td> <td> -true to add <a href="undocumented#Line">Line</a> connecting <a href="#Contour">Contour</a> end and start</td> +<table> <tr> <td><a name='SkPath_addPoly_pts'><code><strong>pts</strong></code></a></td> + <td>array of <a href='undocumented#Line'>Line</a> sharing end and start <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr> <td><a name='SkPath_addPoly_count'><code><strong>count</strong></code></a></td> + <td>length of <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr> <td><a name='SkPath_addPoly_close'><code><strong>close</strong></code></a></td> + <td>true to add <a href='undocumented#Line'>Line</a> connecting <a href='#Contour'>Contour</a> end and start</td> </tr> </table> @@ -3898,33 +4806,44 @@ true to add <a href="undocumented#Line">Line</a> connecting <a href="#Contour">C ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawPoints">SkCanvas::drawPoints</a> +<a href='SkCanvas_Reference#SkCanvas_drawPoints'>SkCanvas::drawPoints</a> --- -## <a name="SkPath_AddPathMode"></a> Enum SkPath::AddPathMode +## <a name='SkPath_AddPathMode'>Enum SkPath::AddPathMode</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPath_AddPathMode">AddPathMode</a> { - <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>, - <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>, + enum <a href='#SkPath_AddPathMode'>AddPathMode</a> { + <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>, + <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a>, }; </pre> -<a href="#SkPath_AddPathMode">AddPathMode</a> chooses how <a href="#SkPath_addPath">addPath</a> appends. Adding one <a href="#Path">Path</a> to another can extend -the last <a href="#Contour">Contour</a> or start a new <a href="#Contour">Contour</a>. +<a href='#SkPath_AddPathMode'>AddPathMode</a> chooses how <a href='#SkPath_addPath'>addPath</a> appends. Adding one <a href='#Path'>Path</a> to another can extend +the last <a href='#Contour'>Contour</a> or start a new <a href='#Contour'>Contour</a>. ### Constants -<table> - <tr> - <td><a name="SkPath_kAppend_AddPathMode"> <code><strong>SkPath::kAppend_AddPathMode </strong></code> </a></td><td>Path Verbs, Points, and Conic_Weights are appended to destination unaltered.</td><td>Since <a href="#Path">Path</a> <a href="#Verb_Array">Verb Array</a> begins with <a href="#SkPath_kMove_Verb">kMove Verb</a> if src is not empty, this -starts a new <a href="#Contour">Contour</a>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kAppend_AddPathMode'><code>SkPath::kAppend_AddPathMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # appended to destination unaltered ##</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +<a href='#Path'>Path</a> <a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a> are appended to destination unaltered. +Since <a href='#Path'>Path</a> <a href='#Verb_Array'>Verb Array</a> begins with <a href='#SkPath_kMove_Verb'>kMove Verb</a> if src is not empty, this +starts a new <a href='#Contour'>Contour</a>. </td> </tr> <tr> - <td><a name="SkPath_kExtend_AddPathMode"> <code><strong>SkPath::kExtend_AddPathMode </strong></code> </a></td><td>If destination is closed or empty, start a new Contour. If destination</td><td>is not empty, add <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to added <a href="#Path">Path</a> first <a href="SkPoint_Reference#Point">Point</a>. Skip added -<a href="#Path">Path</a> initial <a href="#SkPath_kMove_Verb">kMove Verb</a>, then append remining <a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kExtend_AddPathMode'><code>SkPath::kExtend_AddPathMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # add line if prior Contour is not closed ##</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +If destination is closed or empty, start a new <a href='#Contour'>Contour</a>. If destination +is not empty, add <a href='undocumented#Line'>Line</a> from <a href='#Last_Point'>Last Point</a> to added <a href='#Path'>Path</a> first <a href='SkPoint_Reference#Point'>Point</a>. Skip added +<a href='#Path'>Path</a> initial <a href='#SkPath_kMove_Verb'>kMove Verb</a>, then append remining <a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a>. </td> </tr> </table> @@ -3932,39 +4851,40 @@ starts a new <a href="#Contour">Contour</a>. ### Example <div><fiddle-embed name="801b02e74c64aafdb734f2e5cf3e5ab0"><div>test is built from path, open on the top row, and closed on the bottom row. -The left column uses <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>; the right uses <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>. +The left column uses <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>; the right uses <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a>. The top right composition is made up of one contour; the other three have two. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_reverseAddPath">reverseAddPath</a> +<a href='#SkPath_addPath'>addPath</a><sup><a href='#SkPath_addPath_2'>[2]</a></sup><sup><a href='#SkPath_addPath_3'>[3]</a></sup> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> - - -<a name="SkPath_addPath"></a> +<a name='SkPath_addPath'></a> ## addPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend_AddPathMode) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addPath'>addPath</a>(const <a href='#SkPath'>SkPath</a>& src, <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>) </pre> -Append <a href="#SkPath_addPath_src">src</a> to <a href="#Path">Path</a>, offset by (<a href="#SkPath_addPath_dx">dx</a>, <a href="#SkPath_addPath_dy">dy</a>). +Append <a href='#SkPath_addPath_src'>src</a> to <a href='#Path'>Path</a>, offset by (<a href='#SkPath_addPath_dx'>dx</a>, <a href='#SkPath_addPath_dy'>dy</a>). -If <a href="#SkPath_addPath_mode">mode</a> is <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>, <a href="#SkPath_addPath_src">src</a> <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weights</a> are -added unaltered. If <a href="#SkPath_addPath_mode">mode</a> is <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>, add <a href="undocumented#Line">Line</a> before appending -<a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a>. +If <a href='#SkPath_addPath_mode'>mode</a> is <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>, <a href='#SkPath_addPath_src'>src</a> <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weights</a> are +added unaltered. If <a href='#SkPath_addPath_mode'>mode</a> is <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a>, add <a href='undocumented#Line'>Line</a> before appending +<a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addPath_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a> to add</td> - </tr> <tr> <td><a name="SkPath_addPath_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#SkPath_addPath_src">src</a> <a href="#Point_Array">Point Array</a> x coordinates</td> - </tr> <tr> <td><a name="SkPath_addPath_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#SkPath_addPath_src">src</a> <a href="#Point_Array">Point Array</a> y coordinates</td> - </tr> <tr> <td><a name="SkPath_addPath_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a> or <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a></td> +<table> <tr> <td><a name='SkPath_addPath_src'><code><strong>src</strong></code></a></td> + <td><a href='#Path'>Path</a> <a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a> to add</td> + </tr> + <tr> <td><a name='SkPath_addPath_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#SkPath_addPath_src'>src</a> <a href='#Point_Array'>Point Array</a> x coordinates</td> + </tr> + <tr> <td><a name='SkPath_addPath_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#SkPath_addPath_src'>src</a> <a href='#Point_Array'>Point Array</a> y coordinates</td> + </tr> + <tr> <td><a name='SkPath_addPath_mode'><code><strong>mode</strong></code></a></td> + <td><a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a> or <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a></td> </tr> </table> @@ -3974,28 +4894,29 @@ offset added to <a href="#SkPath_addPath_src">src</a> <a href="#Point_Array">Poi ### See Also -<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkPath_reverseAddPath">reverseAddPath</a> +<a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_offset'>offset</a><sup><a href='#SkPath_offset_2'>[2]</a></sup> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> --- -<a name="SkPath_addPath_2"></a> +<a name='SkPath_addPath_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addPath'>addPath</a>(const <a href='#SkPath'>SkPath</a>& src, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>) </pre> -Append <a href="#SkPath_addPath_2_src">src</a> to <a href="#Path">Path</a>. +Append <a href='#SkPath_addPath_2_src'>src</a> to <a href='#Path'>Path</a>. -If <a href="#SkPath_addPath_2_mode">mode</a> is <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>, <a href="#SkPath_addPath_2_src">src</a> <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weights</a> are -added unaltered. If <a href="#SkPath_addPath_2_mode">mode</a> is <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>, add <a href="undocumented#Line">Line</a> before appending -<a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a>. +If <a href='#SkPath_addPath_2_mode'>mode</a> is <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>, <a href='#SkPath_addPath_2_src'>src</a> <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weights</a> are +added unaltered. If <a href='#SkPath_addPath_2_mode'>mode</a> is <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a>, add <a href='undocumented#Line'>Line</a> before appending +<a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addPath_2_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a> to add</td> - </tr> <tr> <td><a name="SkPath_addPath_2_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a> or <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a></td> +<table> <tr> <td><a name='SkPath_addPath_2_src'><code><strong>src</strong></code></a></td> + <td><a href='#Path'>Path</a> <a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a> to add</td> + </tr> + <tr> <td><a name='SkPath_addPath_2_mode'><code><strong>mode</strong></code></a></td> + <td><a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a> or <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a></td> </tr> </table> @@ -4005,31 +4926,33 @@ added unaltered. If <a href="#SkPath_addPath_2_mode">mode</a> is <a href="#SkPat ### See Also -<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_reverseAddPath">reverseAddPath</a> +<a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> --- -<a name="SkPath_addPath_3"></a> +<a name='SkPath_addPath_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend_AddPathMode) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_addPath'>addPath</a>(const <a href='#SkPath'>SkPath</a>& src, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>) </pre> -Append <a href="#SkPath_addPath_3_src">src</a> to <a href="#Path">Path</a>, transformed by <a href="#SkPath_addPath_3_matrix">matrix</a>. Transformed curves may have different -<a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a>. +Append <a href='#SkPath_addPath_3_src'>src</a> to <a href='#Path'>Path</a>, transformed by <a href='#SkPath_addPath_3_matrix'>matrix</a>. Transformed curves may have different +<a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a>. -If <a href="#SkPath_addPath_3_mode">mode</a> is <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>, <a href="#SkPath_addPath_3_src">src</a> <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weights</a> are -added unaltered. If <a href="#SkPath_addPath_3_mode">mode</a> is <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>, add <a href="undocumented#Line">Line</a> before appending -<a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a>. +If <a href='#SkPath_addPath_3_mode'>mode</a> is <a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a>, <a href='#SkPath_addPath_3_src'>src</a> <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weights</a> are +added unaltered. If <a href='#SkPath_addPath_3_mode'>mode</a> is <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a>, add <a href='undocumented#Line'>Line</a> before appending +<a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a>. ### Parameters -<table> <tr> <td><a name="SkPath_addPath_3_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a> to add</td> - </tr> <tr> <td><a name="SkPath_addPath_3_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -transform applied to <a href="#SkPath_addPath_3_src">src</a></td> - </tr> <tr> <td><a name="SkPath_addPath_3_mode"> <code><strong>mode </strong></code> </a></td> <td> -<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a> or <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a></td> +<table> <tr> <td><a name='SkPath_addPath_3_src'><code><strong>src</strong></code></a></td> + <td><a href='#Path'>Path</a> <a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a> to add</td> + </tr> + <tr> <td><a name='SkPath_addPath_3_matrix'><code><strong>matrix</strong></code></a></td> + <td>transform applied to <a href='#SkPath_addPath_3_src'>src</a></td> + </tr> + <tr> <td><a name='SkPath_addPath_3_mode'><code><strong>mode</strong></code></a></td> + <td><a href='#SkPath_kAppend_AddPathMode'>kAppend AddPathMode</a> or <a href='#SkPath_kExtend_AddPathMode'>kExtend AddPathMode</a></td> </tr> </table> @@ -4039,24 +4962,24 @@ transform applied to <a href="#SkPath_addPath_3_src">src</a></td> ### See Also -<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkPath_reverseAddPath">reverseAddPath</a> +<a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_transform'>transform</a><sup><a href='#SkPath_transform_2'>[2]</a></sup> <a href='#SkPath_offset'>offset</a><sup><a href='#SkPath_offset_2'>[2]</a></sup> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> --- -<a name="SkPath_reverseAddPath"></a> +<a name='SkPath_reverseAddPath'></a> ## reverseAddPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reverseAddPath(const SkPath& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_reverseAddPath'>reverseAddPath</a>(const <a href='#SkPath'>SkPath</a>& src) </pre> -Append <a href="#SkPath_reverseAddPath_src">src</a> to <a href="#Path">Path</a>, from back to front. -Reversed <a href="#SkPath_reverseAddPath_src">src</a> always appends a new <a href="#Contour">Contour</a> to <a href="#Path">Path</a>. +Append <a href='#SkPath_reverseAddPath_src'>src</a> to <a href='#Path'>Path</a>, from back to front. +Reversed <a href='#SkPath_reverseAddPath_src'>src</a> always appends a new <a href='#Contour'>Contour</a> to <a href='#Path'>Path</a>. ### Parameters -<table> <tr> <td><a name="SkPath_reverseAddPath_src"> <code><strong>src </strong></code> </a></td> <td> -<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="SkPoint_Reference#Point">Points</a>, and <a href="#Conic_Weight">Conic Weights</a> to add</td> +<table> <tr> <td><a name='SkPath_reverseAddPath_src'><code><strong>src</strong></code></a></td> + <td><a href='#Path'>Path</a> <a href='#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Conic_Weight'>Conic Weights</a> to add</td> </tr> </table> @@ -4066,28 +4989,30 @@ Reversed <a href="#SkPath_reverseAddPath_src">src</a> always appends a new <a hr ### See Also -<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> +<a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_transform'>transform</a><sup><a href='#SkPath_transform_2'>[2]</a></sup> <a href='#SkPath_offset'>offset</a><sup><a href='#SkPath_offset_2'>[2]</a></sup> <a href='#SkPath_addPath'>addPath</a><sup><a href='#SkPath_addPath_2'>[2]</a></sup><sup><a href='#SkPath_addPath_3'>[3]</a></sup> --- -<a name="SkPath_offset"></a> +<a name='SkPath_offset'></a> ## offset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(SkScalar dx, SkScalar dy, SkPath* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='#SkPath'>SkPath</a>* dst) const </pre> -Offset <a href="#Point_Array">Point Array</a> by (<a href="#SkPath_offset_dx">dx</a>, <a href="#SkPath_offset_dy">dy</a>). Offset <a href="#Path">Path</a> replaces <a href="#SkPath_offset_dst">dst</a>. -If <a href="#SkPath_offset_dst">dst</a> is nullptr, <a href="#Path">Path</a> is replaced by offset data. +Offset <a href='#Point_Array'>Point Array</a> by (<a href='#SkPath_offset_dx'>dx</a>, <a href='#SkPath_offset_dy'>dy</a>). Offset <a href='#Path'>Path</a> replaces <a href='#SkPath_offset_dst'>dst</a>. +If <a href='#SkPath_offset_dst'>dst</a> is nullptr, <a href='#Path'>Path</a> is replaced by offset data. ### Parameters -<table> <tr> <td><a name="SkPath_offset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#Point_Array">Point Array</a> x coordinates</td> - </tr> <tr> <td><a name="SkPath_offset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#Point_Array">Point Array</a> y coordinates</td> - </tr> <tr> <td><a name="SkPath_offset_dst"> <code><strong>dst </strong></code> </a></td> <td> -overwritten, translated copy of <a href="#Path">Path</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_offset_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#Point_Array'>Point Array</a> x coordinates</td> + </tr> + <tr> <td><a name='SkPath_offset_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#Point_Array'>Point Array</a> y coordinates</td> + </tr> + <tr> <td><a name='SkPath_offset_dst'><code><strong>dst</strong></code></a></td> + <td>overwritten, translated copy of <a href='#Path'>Path</a>; may be nullptr</td> </tr> </table> @@ -4097,35 +5022,58 @@ overwritten, translated copy of <a href="#Path">Path</a>; may be nullptr</td> ### See Also -<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> +<a href='#SkPath_addPath'>addPath</a><sup><a href='#SkPath_addPath_2'>[2]</a></sup><sup><a href='#SkPath_addPath_3'>[3]</a></sup> <a href='#SkPath_transform'>transform</a><sup><a href='#SkPath_transform_2'>[2]</a></sup> --- -## <a name="Transform"></a> Transform +## <a name='Transform'>Transform</a> + -| name | description | -| --- | --- | -| <a href="#SkPath_offset">offset</a> | translates <a href="#Point_Array">Point Array</a> | -| | <a href="#SkPath_offset">offset(SkScalar dx, SkScalar dy, SkPath* dst)</a> const | -| | <a href="#SkPath_offset_2">offset(SkScalar dx, SkScalar dy)</a> | -| <a href="#SkPath_transform">transform</a> | applies <a href="SkMatrix_Reference#Matrix">Matrix</a> to <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Weights</a> | -| | <a href="#SkPath_transform">transform(const SkMatrix& matrix, SkPath* dst)</a> const | -| | <a href="#SkPath_transform_2">transform(const SkMatrix& matrix)</a> | +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point_Array'>Point Array</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_offset'>offset(SkScalar dx, SkScalar dy, SkPath* dst)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_offset_2'>offset(SkScalar dx, SkScalar dy)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_transform'>transform</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>applies <a href='SkMatrix_Reference#Matrix'>Matrix</a> to <a href='#Point_Array'>Point Array</a> and <a href='#Conic_Weight'>Weights</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_transform'>transform(const SkMatrix& matrix, SkPath* dst)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_transform_2'>transform(const SkMatrix& matrix)</a></td> + </tr> +</table> -<a name="SkPath_offset_2"></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(SkScalar dx, SkScalar dy) +<a name='SkPath_offset_2'></a> + +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Offset <a href="#Point_Array">Point Array</a> by (<a href="#SkPath_offset_2_dx">dx</a>, <a href="#SkPath_offset_2_dy">dy</a>). <a href="#Path">Path</a> is replaced by offset data. +Offset <a href='#Point_Array'>Point Array</a> by (<a href='#SkPath_offset_2_dx'>dx</a>, <a href='#SkPath_offset_2_dy'>dy</a>). <a href='#Path'>Path</a> is replaced by offset data. ### Parameters -<table> <tr> <td><a name="SkPath_offset_2_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#Point_Array">Point Array</a> x coordinates</td> - </tr> <tr> <td><a name="SkPath_offset_2_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#Point_Array">Point Array</a> y coordinates</td> +<table> <tr> <td><a name='SkPath_offset_2_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#Point_Array'>Point Array</a> x coordinates</td> + </tr> + <tr> <td><a name='SkPath_offset_2_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#Point_Array'>Point Array</a> y coordinates</td> </tr> </table> @@ -4135,28 +5083,29 @@ offset added to <a href="#Point_Array">Point Array</a> y coordinates</td> ### See Also -<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_translate">SkCanvas::translate()</a> +<a href='#SkPath_addPath'>addPath</a><sup><a href='#SkPath_addPath_2'>[2]</a></sup><sup><a href='#SkPath_addPath_3'>[3]</a></sup> <a href='#SkPath_transform'>transform</a><sup><a href='#SkPath_transform_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_translate'>SkCanvas::translate()</a> --- -<a name="SkPath_transform"></a> +<a name='SkPath_transform'></a> ## transform -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void transform(const SkMatrix& matrix, SkPath* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix, <a href='#SkPath'>SkPath</a>* dst) const </pre> -<a href="#Transform">Transform</a> <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and weight by <a href="#SkPath_transform_matrix">matrix</a>. -transform may change <a href="#Verb">Verbs</a> and increase their number. -Transformed <a href="#Path">Path</a> replaces <a href="#SkPath_transform_dst">dst</a>; if <a href="#SkPath_transform_dst">dst</a> is nullptr, original data +<a href='#Transform'>Transform</a> <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and weight by <a href='#SkPath_transform_matrix'>matrix</a>. +transform may change <a href='#Verb'>Verbs</a> and increase their number. +Transformed <a href='#Path'>Path</a> replaces <a href='#SkPath_transform_dst'>dst</a>; if <a href='#SkPath_transform_dst'>dst</a> is nullptr, original data is replaced. ### Parameters -<table> <tr> <td><a name="SkPath_transform_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="SkMatrix_Reference#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td> - </tr> <tr> <td><a name="SkPath_transform_dst"> <code><strong>dst </strong></code> </a></td> <td> -overwritten, transformed copy of <a href="#Path">Path</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_transform_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='SkMatrix_Reference#Matrix'>Matrix</a> to apply to <a href='#Path'>Path</a></td> + </tr> + <tr> <td><a name='SkPath_transform_dst'><code><strong>dst</strong></code></a></td> + <td>overwritten, transformed copy of <a href='#Path'>Path</a>; may be nullptr</td> </tr> </table> @@ -4166,24 +5115,24 @@ overwritten, transformed copy of <a href="#Path">Path</a>; may be nullptr</td> ### See Also -<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_concat">SkCanvas::concat()</a> <a href="SkMatrix_Reference#SkMatrix">SkMatrix</a> +<a href='#SkPath_addPath'>addPath</a><sup><a href='#SkPath_addPath_2'>[2]</a></sup><sup><a href='#SkPath_addPath_3'>[3]</a></sup> <a href='#SkPath_offset'>offset</a><sup><a href='#SkPath_offset_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_concat'>SkCanvas::concat()</a> <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> --- -<a name="SkPath_transform_2"></a> +<a name='SkPath_transform_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void transform(const SkMatrix& matrix) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix) </pre> -<a href="#Transform">Transform</a> <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and weight by <a href="#SkPath_transform_2_matrix">matrix</a>. -transform may change <a href="#Verb">Verbs</a> and increase their number. -<a href="#Path">Path</a> is replaced by transformed data. +<a href='#Transform'>Transform</a> <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and weight by <a href='#SkPath_transform_2_matrix'>matrix</a>. +transform may change <a href='#Verb'>Verbs</a> and increase their number. +<a href='#Path'>Path</a> is replaced by transformed data. ### Parameters -<table> <tr> <td><a name="SkPath_transform_2_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="SkMatrix_Reference#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td> +<table> <tr> <td><a name='SkPath_transform_2_matrix'><code><strong>matrix</strong></code></a></td> + <td><a href='SkMatrix_Reference#Matrix'>Matrix</a> to apply to <a href='#Path'>Path</a></td> </tr> </table> @@ -4193,36 +5142,36 @@ transform may change <a href="#Verb">Verbs</a> and increase their number. ### See Also -<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="SkCanvas_Reference#SkCanvas_concat">SkCanvas::concat()</a> <a href="SkMatrix_Reference#SkMatrix">SkMatrix</a> +<a href='#SkPath_addPath'>addPath</a><sup><a href='#SkPath_addPath_2'>[2]</a></sup><sup><a href='#SkPath_addPath_3'>[3]</a></sup> <a href='#SkPath_offset'>offset</a><sup><a href='#SkPath_offset_2'>[2]</a></sup> <a href='SkCanvas_Reference#SkCanvas_concat'>SkCanvas::concat()</a> <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> --- -## <a name="Last_Point"></a> Last Point +## <a name='Last_Point'>Last Point</a> -<a href="#Path">Path</a> is defined cumulatively, often by adding a segment to the end of last -<a href="#Contour">Contour</a>. <a href="#Last_Point">Last Point</a> of <a href="#Contour">Contour</a> is shared as first <a href="SkPoint_Reference#Point">Point</a> of added <a href="undocumented#Line">Line</a> or <a href="undocumented#Curve">Curve</a>. -<a href="#Last_Point">Last Point</a> can be read and written directly with <a href="#SkPath_getLastPt">getLastPt</a> and <a href="#SkPath_setLastPt">setLastPt</a>. +<a href='#Path'>Path</a> is defined cumulatively, often by adding a segment to the end of last +<a href='#Contour'>Contour</a>. <a href='#Last_Point'>Last Point</a> of <a href='#Contour'>Contour</a> is shared as first <a href='SkPoint_Reference#Point'>Point</a> of added <a href='undocumented#Line'>Line</a> or <a href='undocumented#Curve'>Curve</a>. +<a href='#Last_Point'>Last Point</a> can be read and written directly with <a href='#SkPath_getLastPt'>getLastPt</a> and <a href='#SkPath_setLastPt'>setLastPt</a>. -<a name="SkPath_getLastPt"></a> +<a name='SkPath_getLastPt'></a> ## getLastPt -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getLastPt(SkPoint* lastPt) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_getLastPt'>getLastPt</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a>* lastPt) const </pre> -Returns <a href="#Last_Point">Last Point</a> on <a href="#Path">Path</a> in <a href="#SkPath_getLastPt_lastPt">lastPt</a>. Returns false if <a href="#Point_Array">Point Array</a> is empty, -storing (0, 0) if <a href="#SkPath_getLastPt_lastPt">lastPt</a> is not nullptr. +Returns <a href='#Last_Point'>Last Point</a> on <a href='#Path'>Path</a> in <a href='#SkPath_getLastPt_lastPt'>lastPt</a>. Returns false if <a href='#Point_Array'>Point Array</a> is empty, +storing (0, 0) if <a href='#SkPath_getLastPt_lastPt'>lastPt</a> is not nullptr. ### Parameters -<table> <tr> <td><a name="SkPath_getLastPt_lastPt"> <code><strong>lastPt </strong></code> </a></td> <td> -storage for final <a href="SkPoint_Reference#Point">Point</a> in <a href="#Point_Array">Point Array</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_getLastPt_lastPt'><code><strong>lastPt</strong></code></a></td> + <td>storage for final <a href='SkPoint_Reference#Point'>Point</a> in <a href='#Point_Array'>Point Array</a>; may be nullptr</td> </tr> </table> ### Return Value -true if <a href="#Point_Array">Point Array</a> contains one or more <a href="SkPoint_Reference#Point">Points</a> +true if <a href='#Point_Array'>Point Array</a> contains one or more <a href='SkPoint_Reference#Point'>Points</a> ### Example @@ -4238,26 +5187,27 @@ last point: 35.2786, 52.9772 ### See Also -<a href="#SkPath_setLastPt">setLastPt</a><sup><a href="#SkPath_setLastPt_2">[2]</a></sup> +<a href='#SkPath_setLastPt'>setLastPt</a><sup><a href='#SkPath_setLastPt_2'>[2]</a></sup> --- -<a name="SkPath_setLastPt"></a> +<a name='SkPath_setLastPt'></a> ## setLastPt -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLastPt(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_setLastPt'>setLastPt</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Set <a href="#Last_Point">Last Point</a> to (<a href="#SkPath_setLastPt_x">x</a>, <a href="#SkPath_setLastPt_y">y</a>). If <a href="#Point_Array">Point Array</a> is empty, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to -<a href="#Verb_Array">Verb Array</a> and append (<a href="#SkPath_setLastPt_x">x</a>, <a href="#SkPath_setLastPt_y">y</a>) to <a href="#Point_Array">Point Array</a>. +Set <a href='#Last_Point'>Last Point</a> to (<a href='#SkPath_setLastPt_x'>x</a>, <a href='#SkPath_setLastPt_y'>y</a>). If <a href='#Point_Array'>Point Array</a> is empty, append <a href='#SkPath_kMove_Verb'>kMove Verb</a> to +<a href='#Verb_Array'>Verb Array</a> and append (<a href='#SkPath_setLastPt_x'>x</a>, <a href='#SkPath_setLastPt_y'>y</a>) to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_setLastPt_x"> <code><strong>x </strong></code> </a></td> <td> -set <a href="#SkPath_setLastPt_x">x</a>-coordinate of <a href="#Last_Point">Last Point</a></td> - </tr> <tr> <td><a name="SkPath_setLastPt_y"> <code><strong>y </strong></code> </a></td> <td> -set <a href="#SkPath_setLastPt_y">y</a>-coordinate of <a href="#Last_Point">Last Point</a></td> +<table> <tr> <td><a name='SkPath_setLastPt_x'><code><strong>x</strong></code></a></td> + <td>set <a href='#SkPath_setLastPt_x'>x</a>-coordinate of <a href='#Last_Point'>Last Point</a></td> + </tr> + <tr> <td><a name='SkPath_setLastPt_y'><code><strong>y</strong></code></a></td> + <td>set <a href='#SkPath_setLastPt_y'>y</a>-coordinate of <a href='#Last_Point'>Last Point</a></td> </tr> </table> @@ -4267,23 +5217,23 @@ set <a href="#SkPath_setLastPt_y">y</a>-coordinate of <a href="#Last_Point">Last ### See Also -<a href="#SkPath_getLastPt">getLastPt</a> +<a href='#SkPath_getLastPt'>getLastPt</a> --- -<a name="SkPath_setLastPt_2"></a> +<a name='SkPath_setLastPt_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLastPt(const SkPoint& p) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_setLastPt'>setLastPt</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p) </pre> -Set the last point on the path. If <a href="#Point_Array">Point Array</a> is empty, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to -<a href="#Verb_Array">Verb Array</a> and append <a href="#SkPath_setLastPt_2_p">p</a> to <a href="#Point_Array">Point Array</a>. +Set the last point on the path. If <a href='#Point_Array'>Point Array</a> is empty, append <a href='#SkPath_kMove_Verb'>kMove Verb</a> to +<a href='#Verb_Array'>Verb Array</a> and append <a href='#SkPath_setLastPt_2_p'>p</a> to <a href='#Point_Array'>Point Array</a>. ### Parameters -<table> <tr> <td><a name="SkPath_setLastPt_2_p"> <code><strong>p </strong></code> </a></td> <td> -set value of <a href="#Last_Point">Last Point</a></td> +<table> <tr> <td><a name='SkPath_setLastPt_2_p'><code><strong>p</strong></code></a></td> + <td>set value of <a href='#Last_Point'>Last Point</a></td> </tr> </table> @@ -4293,48 +5243,63 @@ set value of <a href="#Last_Point">Last Point</a></td> ### See Also -<a href="#SkPath_getLastPt">getLastPt</a> +<a href='#SkPath_getLastPt'>getLastPt</a> --- -## <a name="SkPath_SegmentMask"></a> Enum SkPath::SegmentMask +## <a name='SkPath_SegmentMask'>Enum SkPath::SegmentMask</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkPath_SegmentMask">SegmentMask</a> { - <a href="#SkPath_kLine_SegmentMask">kLine SegmentMask</a> = 1 << 0, - <a href="#SkPath_kQuad_SegmentMask">kQuad SegmentMask</a> = 1 << 1, - <a href="#SkPath_kConic_SegmentMask">kConic SegmentMask</a> = 1 << 2, - <a href="#SkPath_kCubic_SegmentMask">kCubic SegmentMask</a> = 1 << 3, + enum <a href='#SkPath_SegmentMask'>SegmentMask</a> { + <a href='#SkPath_kLine_SegmentMask'>kLine SegmentMask</a> = 1 << 0, + <a href='#SkPath_kQuad_SegmentMask'>kQuad SegmentMask</a> = 1 << 1, + <a href='#SkPath_kConic_SegmentMask'>kConic SegmentMask</a> = 1 << 2, + <a href='#SkPath_kCubic_SegmentMask'>kCubic SegmentMask</a> = 1 << 3, }; </pre> -<a href="#SkPath_SegmentMask">SegmentMask</a> constants correspond to each drawing <a href="#SkPath_Verb">Verb</a> type in <a href="#Path">Path</a>; for -instance, if <a href="#Path">Path</a> only contains <a href="undocumented#Line">Lines</a>, only the <a href="#SkPath_kLine_SegmentMask">kLine SegmentMask</a> bit is set. +<a href='#SkPath_SegmentMask'>SegmentMask</a> constants correspond to each drawing <a href='#SkPath_Verb'>Verb</a> type in <a href='#Path'>Path</a>; for +instance, if <a href='#Path'>Path</a> only contains <a href='undocumented#Line'>Lines</a>, only the <a href='#SkPath_kLine_SegmentMask'>kLine SegmentMask</a> bit is set. ### Constants -<table> - <tr> - <td><a name="SkPath_kLine_SegmentMask"> <code><strong>SkPath::kLine_SegmentMask </strong></code> </a></td><td>1</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kLine_Verb">kLine Verb</a>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kLine_SegmentMask'><code>SkPath::kLine_SegmentMask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Set if <a href='#Verb_Array'>Verb Array</a> contains <a href='#SkPath_kLine_Verb'>kLine Verb</a>. </td> </tr> <tr> - <td><a name="SkPath_kQuad_SegmentMask"> <code><strong>SkPath::kQuad_SegmentMask </strong></code> </a></td><td>2</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kQuad_Verb">kQuad Verb</a>. Note that <a href="#SkPath_conicTo">conicTo</a> may add a <a href="#Quad">Quad</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kQuad_SegmentMask'><code>SkPath::kQuad_SegmentMask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Set if <a href='#Verb_Array'>Verb Array</a> contains <a href='#SkPath_kQuad_Verb'>kQuad Verb</a>. Note that <a href='#SkPath_conicTo'>conicTo</a> may add a <a href='#Quad'>Quad</a>. </td> </tr> - <tr> - <td><a name="SkPath_kConic_SegmentMask"> <code><strong>SkPath::kConic_SegmentMask </strong></code> </a></td><td>4</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kConic_Verb">kConic Verb</a>. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConic_SegmentMask'><code>SkPath::kConic_SegmentMask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Set if <a href='#Verb_Array'>Verb Array</a> contains <a href='#SkPath_kConic_Verb'>kConic Verb</a>. </td> </tr> <tr> - <td><a name="SkPath_kCubic_SegmentMask"> <code><strong>SkPath::kCubic_SegmentMask </strong></code> </a></td><td>8</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kCubic_Verb">kCubic Verb</a>. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCubic_SegmentMask'><code>SkPath::kCubic_SegmentMask</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Set if <a href='#Verb_Array'>Verb Array</a> contains <a href='#SkPath_kCubic_Verb'>kCubic Verb</a>. </td> </tr> </table> ### Example -<div><fiddle-embed name="0972a1bd6e012c7519d3998afc32e69f"><div>When <a href="#SkPath_conicTo">conicTo</a> has a weight of one, <a href="#Quad">Quad</a> is added to <a href="#Path">Path</a>. +<div><fiddle-embed name="a61e5758574e28190ec4ed8c4ae7e7fa"><div>When <a href='#SkPath_conicTo'>conicTo</a> has a weight of one, <a href='#Quad'>Quad</a> is added to <a href='#Path'>Path</a>. </div> #### Example Output @@ -4348,30 +5313,28 @@ Path kQuad_SegmentMask is set ### See Also -<a href="#SkPath_getSegmentMasks">getSegmentMasks</a> <a href="#SkPath_Verb">Verb</a> +<a href='#SkPath_getSegmentMasks'>getSegmentMasks</a> <a href='#SkPath_Verb'>Verb</a> - - -<a name="SkPath_getSegmentMasks"></a> +<a name='SkPath_getSegmentMasks'></a> ## getSegmentMasks -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t getSegmentMasks() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkPath_getSegmentMasks'>getSegmentMasks</a>() const </pre> -Returns a mask, where each set bit corresponds to a <a href="#SkPath_SegmentMask">SegmentMask</a> constant -if <a href="#Path">Path</a> contains one or more <a href="#Verb">Verbs</a> of that type. -Returns zero if <a href="#Path">Path</a> contains no <a href="undocumented#Line">Lines</a>, or <a href="undocumented#Curve">Curves</a>: <a href="#Quad">Quads</a>, <a href="#Conic">Conics</a>, or <a href="#Cubic">Cubics</a>. +Returns a mask, where each set bit corresponds to a <a href='#SkPath_SegmentMask'>SegmentMask</a> constant +if <a href='#Path'>Path</a> contains one or more <a href='#Verb'>Verbs</a> of that type. +Returns zero if <a href='#Path'>Path</a> contains no <a href='undocumented#Line'>Lines</a>, or <a href='undocumented#Curve'>Curves</a>: <a href='#Quad'>Quads</a>, <a href='#Conic'>Conics</a>, or <a href='#Cubic'>Cubics</a>. -<a href="#SkPath_getSegmentMasks">getSegmentMasks</a> returns a cached result; it is very fast. +<a href='#SkPath_getSegmentMasks'>getSegmentMasks</a> returns a cached result; it is very fast. ### Return Value -<a href="#SkPath_SegmentMask">SegmentMask</a> bits or zero +<a href='#SkPath_SegmentMask'>SegmentMask</a> bits or zero ### Example -<div><fiddle-embed name="dd9f620b419c8ca18cd306c881aadb5f"> +<div><fiddle-embed name="657a3f3e11acafea92b84d6bb0c13633"> #### Example Output @@ -4383,39 +5346,40 @@ mask quad set ### See Also -<a href="#SkPath_getSegmentMasks">getSegmentMasks</a> <a href="#SkPath_Verb">Verb</a> +<a href='#SkPath_getSegmentMasks'>getSegmentMasks</a> <a href='#SkPath_Verb'>Verb</a> --- -<a name="SkPath_contains"></a> +<a name='SkPath_contains'></a> ## contains -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(SkScalar x, SkScalar y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_contains'>contains</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const </pre> -Returns true if the point (<a href="#SkPath_contains_x">x</a>, <a href="#SkPath_contains_y">y</a>) is contained by <a href="#Path">Path</a>, taking into -account <a href="#SkPath_FillType">FillType</a>. +Returns true if the point (<a href='#SkPath_contains_x'>x</a>, <a href='#SkPath_contains_y'>y</a>) is contained by <a href='#Path'>Path</a>, taking into +account <a href='#SkPath_FillType'>FillType</a>. -| <a href="#SkPath_FillType">FillType</a> | <a href="#SkPath_contains">contains</a> returns true if <a href="SkPoint_Reference#Point">Point</a> is enclosed by | +| <a href='#SkPath_FillType'>FillType</a> | <a href='#SkPath_contains'>contains</a> returns true if <a href='SkPoint_Reference#Point'>Point</a> is enclosed by | | --- | --- | -| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | a non-zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>. | -| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | an odd number of <a href="#Contour">Contours</a>. | -| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | a zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>. | -| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | and even number of <a href="#Contour">Contours</a>. | +| <a href='#SkPath_kWinding_FillType'>kWinding FillType</a> | a non-zero sum of <a href='#Contour'>Contour</a> <a href='#Direction'>Directions</a>. | +| <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd FillType</a> | an odd number of <a href='#Contour'>Contours</a>. | +| <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding FillType</a> | a zero sum of <a href='#Contour'>Contour</a> <a href='#Direction'>Directions</a>. | +| <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd FillType</a> | and even number of <a href='#Contour'>Contours</a>. | ### Parameters -<table> <tr> <td><a name="SkPath_contains_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="#SkPath_contains_x">x</a>-coordinate of containment test</td> - </tr> <tr> <td><a name="SkPath_contains_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="#SkPath_contains_y">y</a>-coordinate of containment test</td> +<table> <tr> <td><a name='SkPath_contains_x'><code><strong>x</strong></code></a></td> + <td><a href='#SkPath_contains_x'>x</a>-coordinate of containment test</td> + </tr> + <tr> <td><a name='SkPath_contains_y'><code><strong>y</strong></code></a></td> + <td><a href='#SkPath_contains_y'>y</a>-coordinate of containment test</td> </tr> </table> ### Return Value -true if <a href="SkPoint_Reference#Point">Point</a> is in <a href="#Path">Path</a> +true if <a href='SkPoint_Reference#Point'>Point</a> is in <a href='#Path'>Path</a> ### Example @@ -4423,30 +5387,32 @@ true if <a href="SkPoint_Reference#Point">Point</a> is in <a href="#Path">Path</ ### See Also -<a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> <a href="#Fill_Type">Fill Type</a> <a href="undocumented#Op">Op</a> +<a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a> <a href='#Fill_Type'>Fill Type</a> <a href='undocumented#Op'>Op</a> --- -<a name="SkPath_dump"></a> +<a name='SkPath_dump'></a> ## dump -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_dump'>dump</a>(<a href='undocumented#SkWStream'>SkWStream</a>* stream, bool forceClose, bool dumpAsHex) const </pre> -Writes text representation of <a href="#Path">Path</a> to <a href="#SkPath_dump_stream">stream</a>. If <a href="#SkPath_dump_stream">stream</a> is nullptr, writes to -standard output. Set <a href="#SkPath_dump_forceClose">forceClose</a> to true to get edges used to fill <a href="#Path">Path</a>. -Set <a href="#SkPath_dump_dumpAsHex">dumpAsHex</a> true to generate exact binary representations -of floating point numbers used in <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Conic Weights</a>. +Writes text representation of <a href='#Path'>Path</a> to <a href='#SkPath_dump_stream'>stream</a>. If <a href='#SkPath_dump_stream'>stream</a> is nullptr, writes to +standard output. Set <a href='#SkPath_dump_forceClose'>forceClose</a> to true to get edges used to fill <a href='#Path'>Path</a>. +Set <a href='#SkPath_dump_dumpAsHex'>dumpAsHex</a> true to generate exact binary representations +of floating point numbers used in <a href='#Point_Array'>Point Array</a> and <a href='#Conic_Weight'>Conic Weights</a>. ### Parameters -<table> <tr> <td><a name="SkPath_dump_stream"> <code><strong>stream </strong></code> </a></td> <td> -writable <a href="undocumented#Stream">Stream</a> receiving <a href="#Path">Path</a> text representation; may be nullptr</td> - </tr> <tr> <td><a name="SkPath_dump_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> -true if missing <a href="#SkPath_kClose_Verb">kClose Verb</a> is output</td> - </tr> <tr> <td><a name="SkPath_dump_dumpAsHex"> <code><strong>dumpAsHex </strong></code> </a></td> <td> -true if <a href="undocumented#SkScalar">SkScalar</a> values are written as hexadecimal</td> +<table> <tr> <td><a name='SkPath_dump_stream'><code><strong>stream</strong></code></a></td> + <td>writable <a href='undocumented#Stream'>Stream</a> receiving <a href='#Path'>Path</a> text representation; may be nullptr</td> + </tr> + <tr> <td><a name='SkPath_dump_forceClose'><code><strong>forceClose</strong></code></a></td> + <td>true if missing <a href='#SkPath_kClose_Verb'>kClose Verb</a> is output</td> + </tr> + <tr> <td><a name='SkPath_dump_dumpAsHex'><code><strong>dumpAsHex</strong></code></a></td> + <td>true if <a href='undocumented#SkScalar'>SkScalar</a> values are written as hexadecimal</td> </tr> </table> @@ -4479,19 +5445,19 @@ path.close(); ### See Also -<a href="SkRect_Reference#SkRect_dump">SkRect::dump()</a><sup><a href="SkRect_Reference#SkRect_dump_2">[2]</a></sup> <a href="undocumented#SkRRect_dump">SkRRect::dump()</a> <a href="undocumented#SkPathMeasure_dump">SkPathMeasure::dump()</a> +<a href='SkRect_Reference#SkRect_dump'>SkRect::dump()</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='undocumented#SkRRect_dump'>SkRRect::dump()</a> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump()</a> --- -<a name="SkPath_dump_2"></a> +<a name='SkPath_dump_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_dump'>dump</a>() const </pre> -Writes text representation of <a href="#Path">Path</a> to standard output. The representation may be +Writes text representation of <a href='#Path'>Path</a> to standard output. The representation may be directly compiled as C++ code. Floating point values are written -with limited precision; it may not be possible to reconstruct original <a href="#Path">Path</a> +with limited precision; it may not be possible to reconstruct original <a href='#Path'>Path</a> from output. ### Example @@ -4511,23 +5477,23 @@ path is not equal to copy ### See Also -<a href="#SkPath_dumpHex">dumpHex</a> <a href="SkRect_Reference#SkRect_dump">SkRect::dump()</a><sup><a href="SkRect_Reference#SkRect_dump_2">[2]</a></sup> <a href="undocumented#SkRRect_dump">SkRRect::dump()</a> <a href="undocumented#SkPathMeasure_dump">SkPathMeasure::dump()</a> <a href="#SkPath_writeToMemory">writeToMemory</a> +<a href='#SkPath_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect_dump'>SkRect::dump()</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='undocumented#SkRRect_dump'>SkRRect::dump()</a> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump()</a> <a href='#SkPath_writeToMemory'>writeToMemory</a> --- -<a name="SkPath_dumpHex"></a> +<a name='SkPath_dumpHex'></a> ## dumpHex -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dumpHex() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_dumpHex'>dumpHex</a>() const </pre> -Writes text representation of <a href="#Path">Path</a> to standard output. The representation may be +Writes text representation of <a href='#Path'>Path</a> to standard output. The representation may be directly compiled as C++ code. Floating point values are written in hexadecimal to preserve their exact bit pattern. The output reconstructs the -original <a href="#Path">Path</a>. +original <a href='#Path'>Path</a>. -Use instead of <a href="#SkPath_dump_2">dump</a> when submitting <a href="http://bug.skia.org">bug reports against Skia</a> . +Use instead of <a href='#SkPath_dump_2'>dump</a> when submitting <a href='https://bug.skia.org'>bug reports against Skia</a></a> . ### Example @@ -4546,36 +5512,36 @@ path is equal to copy ### See Also -<a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_dumpHex">SkRect::dumpHex</a> <a href="undocumented#SkRRect_dumpHex">SkRRect::dumpHex</a> <a href="#SkPath_writeToMemory">writeToMemory</a> +<a href='#SkPath_dump'>dump</a><sup><a href='#SkPath_dump_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_dumpHex'>SkRect::dumpHex</a> <a href='undocumented#SkRRect_dumpHex'>SkRRect::dumpHex</a> <a href='#SkPath_writeToMemory'>writeToMemory</a> --- -<a name="SkPath_writeToMemory"></a> +<a name='SkPath_writeToMemory'></a> ## writeToMemory -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t writeToMemory(void* buffer) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkPath_writeToMemory'>writeToMemory</a>(void* buffer) const </pre> -Writes <a href="#Path">Path</a> to <a href="#SkPath_writeToMemory_buffer">buffer</a>, returning the number of bytes written. +Writes <a href='#Path'>Path</a> to <a href='#SkPath_writeToMemory_buffer'>buffer</a>, returning the number of bytes written. Pass nullptr to obtain the storage size. -Writes <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Conic Weight</a>, and -additionally writes computed information like <a href="#SkPath_Convexity">Convexity</a> and bounds. +Writes <a href='#Fill_Type'>Fill Type</a>, <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, <a href='#Conic_Weight'>Conic Weight</a>, and +additionally writes computed information like <a href='#SkPath_Convexity'>Convexity</a> and bounds. -Use only be used in concert with <a href="#SkPath_readFromMemory">readFromMemory</a>; -the format used for <a href="#Path">Path</a> in memory is not guaranteed. +Use only be used in concert with <a href='#SkPath_readFromMemory'>readFromMemory</a>; +the format used for <a href='#Path'>Path</a> in memory is not guaranteed. ### Parameters -<table> <tr> <td><a name="SkPath_writeToMemory_buffer"> <code><strong>buffer </strong></code> </a></td> <td> -storage for <a href="#Path">Path</a>; may be nullptr</td> +<table> <tr> <td><a name='SkPath_writeToMemory_buffer'><code><strong>buffer</strong></code></a></td> + <td>storage for <a href='#Path'>Path</a>; may be nullptr</td> </tr> </table> ### Return Value -size of storage required for <a href="#Path">Path</a>; always a multiple of 4 +size of storage required for <a href='#Path'>Path</a>; always a multiple of 4 ### Example @@ -4591,28 +5557,28 @@ path is equal to copy ### See Also -<a href="#SkPath_serialize">serialize</a> <a href="#SkPath_readFromMemory">readFromMemory</a> <a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> <a href="#SkPath_dumpHex">dumpHex</a> +<a href='#SkPath_serialize'>serialize</a> <a href='#SkPath_readFromMemory'>readFromMemory</a> <a href='#SkPath_dump'>dump</a><sup><a href='#SkPath_dump_2'>[2]</a></sup> <a href='#SkPath_dumpHex'>dumpHex</a> --- -<a name="SkPath_serialize"></a> +<a name='SkPath_serialize'></a> ## serialize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkData> serialize() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkPath_serialize'>serialize</a>() const </pre> -Write <a href="#Path">Path</a> to buffer, returning the buffer written to, wrapped in <a href="undocumented#Data">Data</a>. +Write <a href='#Path'>Path</a> to buffer, returning the buffer written to, wrapped in <a href='undocumented#Data'>Data</a>. -<a href="#SkPath_serialize">serialize</a> writes <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Conic Weight</a>, and -additionally writes computed information like <a href="#SkPath_Convexity">Convexity</a> and bounds. +<a href='#SkPath_serialize'>serialize</a> writes <a href='#Fill_Type'>Fill Type</a>, <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, <a href='#Conic_Weight'>Conic Weight</a>, and +additionally writes computed information like <a href='#SkPath_Convexity'>Convexity</a> and bounds. -<a href="#SkPath_serialize">serialize</a> should only be used in concert with <a href="#SkPath_readFromMemory">readFromMemory</a>. -The format used for <a href="#Path">Path</a> in memory is not guaranteed. +<a href='#SkPath_serialize'>serialize</a> should only be used in concert with <a href='#SkPath_readFromMemory'>readFromMemory</a>. +The format used for <a href='#Path'>Path</a> in memory is not guaranteed. ### Return Value -<a href="#Path">Path</a> data wrapped in <a href="undocumented#Data">Data</a> buffer +<a href='#Path'>Path</a> data wrapped in <a href='undocumented#Data'>Data</a> buffer ### Example @@ -4628,32 +5594,33 @@ path is equal to copy ### See Also -<a href="#SkPath_writeToMemory">writeToMemory</a> <a href="#SkPath_readFromMemory">readFromMemory</a> <a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> <a href="#SkPath_dumpHex">dumpHex</a> +<a href='#SkPath_writeToMemory'>writeToMemory</a> <a href='#SkPath_readFromMemory'>readFromMemory</a> <a href='#SkPath_dump'>dump</a><sup><a href='#SkPath_dump_2'>[2]</a></sup> <a href='#SkPath_dumpHex'>dumpHex</a> --- -<a name="SkPath_readFromMemory"></a> +<a name='SkPath_readFromMemory'></a> ## readFromMemory -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t readFromMemory(const void* buffer, size_t length) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkPath_readFromMemory'>readFromMemory</a>(const void* buffer, size_t length) </pre> -Initializes <a href="#Path">Path</a> from <a href="#SkPath_readFromMemory_buffer">buffer</a> of size <a href="#SkPath_readFromMemory_length">length</a>. Returns zero if the <a href="#SkPath_readFromMemory_buffer">buffer</a> is -data is inconsistent, or the <a href="#SkPath_readFromMemory_length">length</a> is too small. +Initializes <a href='#Path'>Path</a> from <a href='#SkPath_readFromMemory_buffer'>buffer</a> of size <a href='#SkPath_readFromMemory_length'>length</a>. Returns zero if the <a href='#SkPath_readFromMemory_buffer'>buffer</a> is +data is inconsistent, or the <a href='#SkPath_readFromMemory_length'>length</a> is too small. -Reads <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Conic Weight</a>, and -additionally reads computed information like <a href="#SkPath_Convexity">Convexity</a> and bounds. +Reads <a href='#Fill_Type'>Fill Type</a>, <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, <a href='#Conic_Weight'>Conic Weight</a>, and +additionally reads computed information like <a href='#SkPath_Convexity'>Convexity</a> and bounds. -Used only in concert with <a href="#SkPath_writeToMemory">writeToMemory</a>; -the format used for <a href="#Path">Path</a> in memory is not guaranteed. +Used only in concert with <a href='#SkPath_writeToMemory'>writeToMemory</a>; +the format used for <a href='#Path'>Path</a> in memory is not guaranteed. ### Parameters -<table> <tr> <td><a name="SkPath_readFromMemory_buffer"> <code><strong>buffer </strong></code> </a></td> <td> -storage for <a href="#Path">Path</a></td> - </tr> <tr> <td><a name="SkPath_readFromMemory_length"> <code><strong>length </strong></code> </a></td> <td> -<a href="#SkPath_readFromMemory_buffer">buffer</a> size in bytes; must be multiple of 4</td> +<table> <tr> <td><a name='SkPath_readFromMemory_buffer'><code><strong>buffer</strong></code></a></td> + <td>storage for <a href='#Path'>Path</a></td> + </tr> + <tr> <td><a name='SkPath_readFromMemory_length'><code><strong>length</strong></code></a></td> + <td><a href='#SkPath_readFromMemory_buffer'>buffer</a> size in bytes; must be multiple of 4</td> </tr> </table> @@ -4676,33 +5643,33 @@ length = 40; returned by readFromMemory = 36 ### See Also -<a href="#SkPath_writeToMemory">writeToMemory</a> +<a href='#SkPath_writeToMemory'>writeToMemory</a> --- -## <a name="Generation_ID"></a> Generation ID +## <a name='Generation_ID'>Generation ID</a> -<a href="#Generation_ID">Generation ID</a> provides a quick way to check if <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, or -<a href="#Conic_Weight">Conic Weight</a> has changed. <a href="#Generation_ID">Generation ID</a> is not a hash; identical <a href="#Path">Paths</a> will -not necessarily have matching <a href="#Generation_ID">Generation IDs</a>. +<a href='#Generation_ID'>Generation ID</a> provides a quick way to check if <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, or +<a href='#Conic_Weight'>Conic Weight</a> has changed. <a href='#Generation_ID'>Generation ID</a> is not a hash; identical <a href='#Path'>Paths</a> will +not necessarily have matching <a href='#Generation_ID'>Generation IDs</a>. -Empty <a href="#Path">Paths</a> have a <a href="#Generation_ID">Generation ID</a> of one. +Empty <a href='#Path'>Paths</a> have a <a href='#Generation_ID'>Generation ID</a> of one. -<a name="SkPath_getGenerationID"></a> +<a name='SkPath_getGenerationID'></a> ## getGenerationID -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t getGenerationID() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkPath_getGenerationID'>getGenerationID</a>() const </pre> Returns a non-zero, globally unique value. A different value is returned -if <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, or <a href="#Conic_Weight">Conic Weight</a> changes. +if <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, or <a href='#Conic_Weight'>Conic Weight</a> changes. -Setting <a href="#Fill_Type">Fill Type</a> does not change <a href="#Generation_ID">Generation ID</a>. +Setting <a href='#Fill_Type'>Fill Type</a> does not change <a href='#Generation_ID'>Generation ID</a>. -Each time the path is modified, a different <a href="#Generation_ID">Generation ID</a> will be returned. +Each time the path is modified, a different <a href='#Generation_ID'>Generation ID</a> will be returned. -<a href="#Fill_Type">Fill Type</a> does affect <a href="#Generation_ID">Generation ID</a> on Android framework. +<a href='#Fill_Type'>Fill Type</a> does affect <a href='#Generation_ID'>Generation ID</a> on Android framework. ### Return Value @@ -4725,79 +5692,100 @@ empty genID = 1 ### See Also -<a href="#SkPath_equal_operator">operator==(const SkPath& a, const SkPath& b)</a> +<a href='#SkPath_equal_operator'>operator==(const SkPath& a, const SkPath& b)</a> --- -<a name="SkPath_isValid"></a> +<a name='SkPath_isValid'></a> ## isValid -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isValid() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_isValid'>isValid</a>() const </pre> -Returns if <a href="#Path">Path</a> data is consistent. Corrupt <a href="#Path">Path</a> data is detected if +Returns if <a href='#Path'>Path</a> data is consistent. Corrupt <a href='#Path'>Path</a> data is detected if internal values are out of range or internal storage does not match array dimensions. ### Return Value -true if <a href="#Path">Path</a> data is consistent +true if <a href='#Path'>Path</a> data is consistent --- -<a name="SkPath_pathRefIsValid"></a> +<a name='SkPath_pathRefIsValid'></a> ## pathRefIsValid -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool pathRefIsValid() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_pathRefIsValid'>pathRefIsValid</a>() const </pre> +Deprecated. + soon --- -# <a name="SkPath::Iter"></a> Class SkPath::Iter -Iterates through <a href="#Verb_Array">Verb Array</a>, and associated <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Conic Weight</a>. -Provides options to treat open <a href="#Contour">Contours</a> as closed, and to ignore +# <a name='SkPath_Iter'>Class SkPath::Iter</a> + +## <a name='Constructor'>Constructor</a> + + +SkPath can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> + + +## <a name='Member_Function'>Member_Function</a> + + +SkPath member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> +Iterates through <a href='#Verb_Array'>Verb Array</a>, and associated <a href='#Point_Array'>Point Array</a> and <a href='#Conic_Weight'>Conic Weight</a>. +Provides options to treat open <a href='#Contour'>Contours</a> as closed, and to ignore degenerate data. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -class <a href="#SkPath_Iter_Iter">Iter</a> { +class <a href='#SkPath_Iter_Iter'>Iter</a> { public: - <a href="#SkPath_Iter_Iter">Iter()</a>; - <a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a>; - void <a href="#SkPath_Iter_setPath">setPath(const SkPath& path, bool forceClose)</a>; - <a href="#SkPath_Verb">Verb</a> <a href="#SkPath_Iter_next">next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)</a>; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_Iter_conicWeight">conicWeight</a> const; - bool <a href="#SkPath_Iter_isCloseLine">isCloseLine</a> const; - bool <a href="#SkPath_Iter_isClosedContour">isClosedContour</a> const; + <a href='#SkPath_Iter_Iter'>Iter()</a>; + <a href='#SkPath_Iter_Iter_2'>Iter(const SkPath& path, bool forceClose)</a>; + void <a href='#SkPath_Iter_setPath'>setPath(const SkPath& path, bool forceClose)</a>; + <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_Iter_next'>next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)</a>; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_Iter_conicWeight'>conicWeight</a> const; + bool <a href='#SkPath_Iter_isCloseLine'>isCloseLine</a> const; + bool <a href='#SkPath_Iter_isClosedContour'>isClosedContour</a> const; }; </pre> ### Example -<div><fiddle-embed name="3ca8417e2a1466bf5b3ac97780a8070c"><div>Ignoring the actual <a href="#Verb">Verbs</a> and replacing them with <a href="#Quad">Quads</a> rounds the +<div><fiddle-embed name="2f53df9201769ab7e7c0e164a1334309"><div>Ignoring the actual <a href='#Verb'>Verbs</a> and replacing them with <a href='#Quad'>Quads</a> rounds the path of the glyph. </div></fiddle-embed></div> ### See Also -<a href="#SkPath_RawIter">RawIter</a> +<a href='#SkPath_RawIter'>RawIter</a> -<a name="SkPath_Iter_Iter"></a> +<a name='SkPath_Iter_Iter'></a> ## Iter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Iter() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Iter_Iter'>Iter</a>() </pre> -Initializes <a href="#SkPath_Iter_Iter">Iter</a> with an empty <a href="#Path">Path</a>. <a href="#SkPath_Iter_next">next</a> on <a href="#SkPath_Iter_Iter">Iter</a> returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. -Call <a href="#SkPath_Iter_setPath">setPath</a> to initialize <a href="#SkPath_Iter_Iter">Iter</a> at a later time. +Initializes <a href='#SkPath_Iter_Iter'>Iter</a> with an empty <a href='#Path'>Path</a>. <a href='#SkPath_Iter_next'>next</a> on <a href='#SkPath_Iter_Iter'>Iter</a> returns <a href='#SkPath_kDone_Verb'>kDone Verb</a>. +Call <a href='#SkPath_Iter_setPath'>setPath</a> to initialize <a href='#SkPath_Iter_Iter'>Iter</a> at a later time. ### Return Value -<a href="#SkPath_Iter_Iter">Iter</a> of empty <a href="#Path">Path</a> +<a href='#SkPath_Iter_Iter'>Iter</a> of empty <a href='#Path'>Path</a> ### Example @@ -4814,32 +5802,33 @@ iter is done ### See Also -<a href="#SkPath_Iter_setPath">setPath</a> +<a href='#SkPath_Iter_setPath'>setPath</a> --- -<a name="SkPath_Iter_Iter_2"></a> +<a name='SkPath_Iter_Iter_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Iter(const SkPath& path, bool forceClose) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Iter_Iter'>Iter</a>(const <a href='#SkPath'>SkPath</a>& path, bool forceClose) </pre> -Sets <a href="#SkPath_Iter_Iter">Iter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_Iter_Iter_2_path">path</a>. -If <a href="#SkPath_Iter_Iter_2_forceClose">forceClose</a> is true, <a href="#SkPath_Iter_Iter">Iter</a> will add <a href="#SkPath_kLine_Verb">kLine Verb</a> and <a href="#SkPath_kClose_Verb">kClose Verb</a> after each -open <a href="#Contour">Contour</a>. <a href="#SkPath_Iter_Iter_2_path">path</a> is not altered. +Sets <a href='#SkPath_Iter_Iter'>Iter</a> to return elements of <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weight</a> in <a href='#SkPath_Iter_Iter_2_path'>path</a>. +If <a href='#SkPath_Iter_Iter_2_forceClose'>forceClose</a> is true, <a href='#SkPath_Iter_Iter'>Iter</a> will add <a href='#SkPath_kLine_Verb'>kLine Verb</a> and <a href='#SkPath_kClose_Verb'>kClose Verb</a> after each +open <a href='#Contour'>Contour</a>. <a href='#SkPath_Iter_Iter_2_path'>path</a> is not altered. ### Parameters -<table> <tr> <td><a name="SkPath_Iter_Iter_2_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Path">Path</a> to iterate</td> - </tr> <tr> <td><a name="SkPath_Iter_Iter_2_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> -true if open <a href="#Contour">Contours</a> generate <a href="#SkPath_kClose_Verb">kClose Verb</a></td> +<table> <tr> <td><a name='SkPath_Iter_Iter_2_path'><code><strong>path</strong></code></a></td> + <td><a href='#Path'>Path</a> to iterate</td> + </tr> + <tr> <td><a name='SkPath_Iter_Iter_2_forceClose'><code><strong>forceClose</strong></code></a></td> + <td>true if open <a href='#Contour'>Contours</a> generate <a href='#SkPath_kClose_Verb'>kClose Verb</a></td> </tr> </table> ### Return Value -<a href="#SkPath_Iter_Iter">Iter</a> of <a href="#SkPath_Iter_Iter_2_path">path</a> +<a href='#SkPath_Iter_Iter'>Iter</a> of <a href='#SkPath_Iter_Iter_2_path'>path</a> ### Example @@ -4864,27 +5853,28 @@ kDone_Verb ### See Also -<a href="#SkPath_Iter_setPath">setPath</a> +<a href='#SkPath_Iter_setPath'>setPath</a> --- -<a name="SkPath_Iter_setPath"></a> +<a name='SkPath_Iter_setPath'></a> ## setPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPath(const SkPath& path, bool forceClose) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_Iter_setPath'>setPath</a>(const <a href='#SkPath'>SkPath</a>& path, bool forceClose) </pre> -Sets <a href="#SkPath_Iter_Iter">Iter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_Iter_setPath_path">path</a>. -If <a href="#SkPath_Iter_setPath_forceClose">forceClose</a> is true, <a href="#SkPath_Iter_Iter">Iter</a> will add <a href="#SkPath_kLine_Verb">kLine Verb</a> and <a href="#SkPath_kClose_Verb">kClose Verb</a> after each -open <a href="#Contour">Contour</a>. <a href="#SkPath_Iter_setPath_path">path</a> is not altered. +Sets <a href='#SkPath_Iter_Iter'>Iter</a> to return elements of <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weight</a> in <a href='#SkPath_Iter_setPath_path'>path</a>. +If <a href='#SkPath_Iter_setPath_forceClose'>forceClose</a> is true, <a href='#SkPath_Iter_Iter'>Iter</a> will add <a href='#SkPath_kLine_Verb'>kLine Verb</a> and <a href='#SkPath_kClose_Verb'>kClose Verb</a> after each +open <a href='#Contour'>Contour</a>. <a href='#SkPath_Iter_setPath_path'>path</a> is not altered. ### Parameters -<table> <tr> <td><a name="SkPath_Iter_setPath_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Path">Path</a> to iterate</td> - </tr> <tr> <td><a name="SkPath_Iter_setPath_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> -true if open <a href="#Contour">Contours</a> generate <a href="#SkPath_kClose_Verb">kClose Verb</a></td> +<table> <tr> <td><a name='SkPath_Iter_setPath_path'><code><strong>path</strong></code></a></td> + <td><a href='#Path'>Path</a> to iterate</td> + </tr> + <tr> <td><a name='SkPath_Iter_setPath_forceClose'><code><strong>forceClose</strong></code></a></td> + <td>true if open <a href='#Contour'>Contours</a> generate <a href='#SkPath_kClose_Verb'>kClose Verb</a></td> </tr> </table> @@ -4911,52 +5901,54 @@ kDone_Verb ### See Also -<a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a> +<a href='#SkPath_Iter_Iter_2'>Iter(const SkPath& path, bool forceClose)</a> --- -<a name="SkPath_Iter_next"></a> +<a name='SkPath_Iter_next'></a> ## next -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_Iter_next'>next</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[4], bool doConsumeDegenerates = true, bool exact = false) </pre> -Returns next <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>, and advances <a href="#SkPath_Iter_Iter">Iter</a>. -When <a href="#Verb_Array">Verb Array</a> is exhausted, returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. +Returns next <a href='#SkPath_Verb'>Verb</a> in <a href='#Verb_Array'>Verb Array</a>, and advances <a href='#SkPath_Iter_Iter'>Iter</a>. +When <a href='#Verb_Array'>Verb Array</a> is exhausted, returns <a href='#SkPath_kDone_Verb'>kDone Verb</a>. -Zero to four <a href="SkPoint_Reference#Point">Points</a> are stored in <a href="#SkPath_Iter_next_pts">pts</a>, depending on the returned <a href="#SkPath_Verb">Verb</a>. +Zero to four <a href='SkPoint_Reference#Point'>Points</a> are stored in <a href='#SkPath_Iter_next_pts'>pts</a>, depending on the returned <a href='#SkPath_Verb'>Verb</a>. -If <a href="#SkPath_Iter_next_doConsumeDegenerates">doConsumeDegenerates</a> is true, skip consecutive <a href="#SkPath_kMove_Verb">kMove Verb</a> entries, returning -only the last in the series; and skip very small <a href="undocumented#Line">Lines</a>, <a href="#Quad">Quads</a>, and <a href="#Conic">Conics</a>; and -skip <a href="#SkPath_kClose_Verb">kClose Verb</a> following <a href="#SkPath_kMove_Verb">kMove Verb</a>. -if <a href="#SkPath_Iter_next_doConsumeDegenerates">doConsumeDegenerates</a> is true and <a href="#SkPath_Iter_next_exact">exact</a> is true, only skip <a href="undocumented#Line">Lines</a>, <a href="#Quad">Quads</a>, and -<a href="#Conic">Conics</a> with zero lengths. +If <a href='#SkPath_Iter_next_doConsumeDegenerates'>doConsumeDegenerates</a> is true, skip consecutive <a href='#SkPath_kMove_Verb'>kMove Verb</a> entries, returning +only the last in the series; and skip very small <a href='undocumented#Line'>Lines</a>, <a href='#Quad'>Quads</a>, and <a href='#Conic'>Conics</a>; and +skip <a href='#SkPath_kClose_Verb'>kClose Verb</a> following <a href='#SkPath_kMove_Verb'>kMove Verb</a>. +if <a href='#SkPath_Iter_next_doConsumeDegenerates'>doConsumeDegenerates</a> is true and <a href='#SkPath_Iter_next_exact'>exact</a> is true, only skip <a href='undocumented#Line'>Lines</a>, <a href='#Quad'>Quads</a>, and +<a href='#Conic'>Conics</a> with zero lengths. ### Parameters -<table> <tr> <td><a name="SkPath_Iter_next_pts"> <code><strong>pts </strong></code> </a></td> <td> -storage for <a href="SkPoint_Reference#Point">Point</a> data describing returned <a href="#SkPath_Verb">Verb</a></td> - </tr> <tr> <td><a name="SkPath_Iter_next_doConsumeDegenerates"> <code><strong>doConsumeDegenerates </strong></code> </a></td> <td> -if true, skip degenerate <a href="#Verb">Verbs</a></td> - </tr> <tr> <td><a name="SkPath_Iter_next_exact"> <code><strong>exact </strong></code> </a></td> <td> -skip zero length curves</td> +<table> <tr> <td><a name='SkPath_Iter_next_pts'><code><strong>pts</strong></code></a></td> + <td>storage for <a href='SkPoint_Reference#Point'>Point</a> data describing returned <a href='#SkPath_Verb'>Verb</a></td> + </tr> + <tr> <td><a name='SkPath_Iter_next_doConsumeDegenerates'><code><strong>doConsumeDegenerates</strong></code></a></td> + <td>if true, skip degenerate <a href='#Verb'>Verbs</a></td> + </tr> + <tr> <td><a name='SkPath_Iter_next_exact'><code><strong>exact</strong></code></a></td> + <td>skip zero length curves</td> </tr> </table> ### Return Value -next <a href="#SkPath_Verb">Verb</a> from <a href="#Verb_Array">Verb Array</a> +next <a href='#SkPath_Verb'>Verb</a> from <a href='#Verb_Array'>Verb Array</a> ### Example -<div><fiddle-embed name="00ae8984856486bdb626d0ed6587855a"><div>skip degenerate skips the first in a <a href="#SkPath_kMove_Verb">kMove Verb</a> pair, the <a href="#SkPath_kMove_Verb">kMove Verb</a> -followed by the <a href="#SkPath_kClose_Verb">kClose Verb</a>, the zero length <a href="undocumented#Line">Line</a> and the very small <a href="undocumented#Line">Line</a>. +<div><fiddle-embed name="00ae8984856486bdb626d0ed6587855a"><div>skip degenerate skips the first in a <a href='#SkPath_kMove_Verb'>kMove Verb</a> pair, the <a href='#SkPath_kMove_Verb'>kMove Verb</a> +followed by the <a href='#SkPath_kClose_Verb'>kClose Verb</a>, the zero length <a href='undocumented#Line'>Line</a> and the very small <a href='undocumented#Line'>Line</a>. -skip degenerate if <a href="#SkPath_Iter_next_exact">exact</a> skips the same as skip degenerate, but shows -the very small <a href="undocumented#Line">Line</a>. +skip degenerate if <a href='#SkPath_Iter_next_exact'>exact</a> skips the same as skip degenerate, but shows +the very small <a href='undocumented#Line'>Line</a>. -skip none shows all of the <a href="#Verb">Verbs</a> and <a href="SkPoint_Reference#Point">Points</a> in <a href="#Path">Path</a>. +skip none shows all of the <a href='#Verb'>Verbs</a> and <a href='SkPoint_Reference#Point'>Points</a> in <a href='#Path'>Path</a>. </div> #### Example Output @@ -4989,29 +5981,29 @@ kDone_Verb ### See Also -<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> <a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> +<a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a> <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a> <a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a> --- -<a name="SkPath_Iter_conicWeight"></a> +<a name='SkPath_Iter_conicWeight'></a> ## conicWeight -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar conicWeight() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_Iter_conicWeight'>conicWeight</a>() const </pre> -Returns <a href="#Conic_Weight">Conic Weight</a> if <a href="#SkPath_Iter_next">next</a> returned <a href="#SkPath_kConic_Verb">kConic Verb</a>. +Returns <a href='#Conic_Weight'>Conic Weight</a> if <a href='#SkPath_Iter_next'>next</a> returned <a href='#SkPath_kConic_Verb'>kConic Verb</a>. -If <a href="#SkPath_Iter_next">next</a> has not been called, or <a href="#SkPath_Iter_next">next</a> did not return <a href="#SkPath_kConic_Verb">kConic Verb</a>, +If <a href='#SkPath_Iter_next'>next</a> has not been called, or <a href='#SkPath_Iter_next'>next</a> did not return <a href='#SkPath_kConic_Verb'>kConic Verb</a>, result is undefined. ### Return Value -<a href="#Conic_Weight">Conic Weight</a> for <a href="#Conic">Conic</a> <a href="SkPoint_Reference#Point">Points</a> returned by <a href="#SkPath_Iter_next">next</a> +<a href='#Conic_Weight'>Conic Weight</a> for <a href='#Conic'>Conic</a> <a href='SkPoint_Reference#Point'>Points</a> returned by <a href='#SkPath_Iter_next'>next</a> ### Example -<div><fiddle-embed name="f97cc1191cf2eef161d6b97fcba67b02"> +<div><fiddle-embed name="7cdea37741d50f0594c6244eb07fd175"> #### Example Output @@ -5026,31 +6018,31 @@ conic weight: 0.5 ### See Also -<a href="#Conic_Weight">Conic Weight</a> +<a href='#Conic_Weight'>Conic Weight</a> --- -<a name="SkPath_Iter_isCloseLine"></a> +<a name='SkPath_Iter_isCloseLine'></a> ## isCloseLine -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isCloseLine() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_Iter_isCloseLine'>isCloseLine</a>() const </pre> -Returns true if last <a href="#SkPath_kLine_Verb">kLine Verb</a> returned by <a href="#SkPath_Iter_next">next</a> was generated -by <a href="#SkPath_kClose_Verb">kClose Verb</a>. When true, the end point returned by <a href="#SkPath_Iter_next">next</a> is -also the start point of <a href="#Contour">Contour</a>. +Returns true if last <a href='#SkPath_kLine_Verb'>kLine Verb</a> returned by <a href='#SkPath_Iter_next'>next</a> was generated +by <a href='#SkPath_kClose_Verb'>kClose Verb</a>. When true, the end point returned by <a href='#SkPath_Iter_next'>next</a> is +also the start point of <a href='#Contour'>Contour</a>. -If <a href="#SkPath_Iter_next">next</a> has not been called, or <a href="#SkPath_Iter_next">next</a> did not return <a href="#SkPath_kLine_Verb">kLine Verb</a>, +If <a href='#SkPath_Iter_next'>next</a> has not been called, or <a href='#SkPath_Iter_next'>next</a> did not return <a href='#SkPath_kLine_Verb'>kLine Verb</a>, result is undefined. ### Return Value -true if last <a href="#SkPath_kLine_Verb">kLine Verb</a> was generated by <a href="#SkPath_kClose_Verb">kClose Verb</a> +true if last <a href='#SkPath_kLine_Verb'>kLine Verb</a> was generated by <a href='#SkPath_kClose_Verb'>kClose Verb</a> ### Example -<div><fiddle-embed name="345e0646a010f7dce571078d1321f4df"> +<div><fiddle-embed name="7000b501f49341629bfdd9f80e686103"> #### Example Output @@ -5068,28 +6060,28 @@ line generated by close ### See Also -<a href="#SkPath_close">close</a> +<a href='#SkPath_close'>close</a> --- -<a name="SkPath_Iter_isClosedContour"></a> +<a name='SkPath_Iter_isClosedContour'></a> ## isClosedContour -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isClosedContour() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPath_Iter_isClosedContour'>isClosedContour</a>() const </pre> -Returns true if subsequent calls to <a href="#SkPath_Iter_next">next</a> return <a href="#SkPath_kClose_Verb">kClose Verb</a> before returning -<a href="#SkPath_kMove_Verb">kMove Verb</a>. if true, <a href="#Contour">Contour</a> <a href="#SkPath_Iter_Iter">Iter</a> is processing may end with <a href="#SkPath_kClose_Verb">kClose Verb</a>, or -<a href="#SkPath_Iter_Iter">Iter</a> may have been initialized with force close set to true. +Returns true if subsequent calls to <a href='#SkPath_Iter_next'>next</a> return <a href='#SkPath_kClose_Verb'>kClose Verb</a> before returning +<a href='#SkPath_kMove_Verb'>kMove Verb</a>. if true, <a href='#Contour'>Contour</a> <a href='#SkPath_Iter_Iter'>Iter</a> is processing may end with <a href='#SkPath_kClose_Verb'>kClose Verb</a>, or +<a href='#SkPath_Iter_Iter'>Iter</a> may have been initialized with force close set to true. ### Return Value -true if <a href="#Contour">Contour</a> is closed +true if <a href='#Contour'>Contour</a> is closed ### Example -<div><fiddle-embed name="145ead5d4f5fb9ba0a0320cb6a5bf3e8"> +<div><fiddle-embed name="b0d48a6e949db1cb545216ae9c3c3c70"> #### Example Output @@ -5104,102 +6096,121 @@ with close(), forceClose is true : isClosedContour returns true ### See Also -<a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a> +<a href='#SkPath_Iter_Iter_2'>Iter(const SkPath& path, bool forceClose)</a> --- -# <a name="SkPath::RawIter"></a> Class SkPath::RawIter -Iterates through <a href="#Verb_Array">Verb Array</a>, and associated <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Conic Weight</a>. -<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> are returned unaltered. +# <a name='SkPath_RawIter'>Class SkPath::RawIter</a> + +## <a name='Constructor'>Constructor</a> + + +SkPath can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> + + +## <a name='Member_Function'>Member_Function</a> + + +SkPath member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> +Iterates through <a href='#Verb_Array'>Verb Array</a>, and associated <a href='#Point_Array'>Point Array</a> and <a href='#Conic_Weight'>Conic Weight</a>. +<a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weight</a> are returned unaltered. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - class <a href="#SkPath_RawIter_RawIter">RawIter</a> { + class <a href='#SkPath_RawIter_RawIter'>RawIter</a> { public: - <a href="#SkPath_RawIter_RawIter">RawIter()</a>; - <a href="#SkPath_RawIter_RawIter_2">RawIter(const SkPath& path)</a>; - void <a href="#SkPath_RawIter_setPath">setPath(const SkPath& path)</a>; - <a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_next">next(SkPoint pts[4])</a>; - <a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_peek">peek</a> const; - <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_RawIter_conicWeight">conicWeight</a> const; + <a href='#SkPath_RawIter_RawIter'>RawIter()</a>; + <a href='#SkPath_RawIter_RawIter_2'>RawIter(const SkPath& path)</a>; + void <a href='#SkPath_RawIter_setPath'>setPath(const SkPath& path)</a>; + <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_next'>next(SkPoint pts[4])</a>; + <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_peek'>peek</a> const; + <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_RawIter_conicWeight'>conicWeight</a> const; } </pre> -<a name="SkPath_RawIter_RawIter"></a> +<a name='SkPath_RawIter_RawIter'></a> ## RawIter -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -RawIter() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_RawIter_RawIter'>RawIter</a>() </pre> -Initializes <a href="#SkPath_RawIter_RawIter">RawIter</a> with an empty <a href="#Path">Path</a>. <a href="#SkPath_RawIter_next">next</a> on <a href="#SkPath_RawIter_RawIter">RawIter</a> returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. -Call <a href="#SkPath_RawIter_setPath">setPath</a> to initialize <a href="#SkPath_Iter">SkPath::Iter</a> at a later time. +Initializes <a href='#SkPath_RawIter_RawIter'>RawIter</a> with an empty <a href='#Path'>Path</a>. <a href='#SkPath_RawIter_next'>next</a> on <a href='#SkPath_RawIter_RawIter'>RawIter</a> returns <a href='#SkPath_kDone_Verb'>kDone Verb</a>. +Call <a href='#SkPath_RawIter_setPath'>setPath</a> to initialize <a href='#SkPath_Iter'>SkPath::Iter</a> at a later time. ### Return Value -<a href="#SkPath_RawIter_RawIter">RawIter</a> of empty <a href="#Path">Path</a> +<a href='#SkPath_RawIter_RawIter'>RawIter</a> of empty <a href='#Path'>Path</a> --- -<a name="SkPath_RawIter_RawIter_2"></a> +<a name='SkPath_RawIter_RawIter_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -RawIter(const SkPath& path) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_RawIter_RawIter'>RawIter</a>(const <a href='#SkPath'>SkPath</a>& path) </pre> -Sets <a href="#SkPath_RawIter_RawIter">RawIter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_RawIter_RawIter_2_path">path</a>. +Sets <a href='#SkPath_RawIter_RawIter'>RawIter</a> to return elements of <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weight</a> in <a href='#SkPath_RawIter_RawIter_2_path'>path</a>. ### Parameters -<table> <tr> <td><a name="SkPath_RawIter_RawIter_2_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Path">Path</a> to iterate</td> +<table> <tr> <td><a name='SkPath_RawIter_RawIter_2_path'><code><strong>path</strong></code></a></td> + <td><a href='#Path'>Path</a> to iterate</td> </tr> </table> ### Return Value -<a href="#SkPath_RawIter_RawIter">RawIter</a> of <a href="#SkPath_RawIter_RawIter_2_path">path</a> +<a href='#SkPath_RawIter_RawIter'>RawIter</a> of <a href='#SkPath_RawIter_RawIter_2_path'>path</a> --- -<a name="SkPath_RawIter_setPath"></a> +<a name='SkPath_RawIter_setPath'></a> ## setPath -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setPath(const SkPath& path) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPath_RawIter_setPath'>setPath</a>(const <a href='#SkPath'>SkPath</a>& path) </pre> -Sets <a href="#SkPath_Iter">SkPath::Iter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_RawIter_setPath_path">path</a>. +Sets <a href='#SkPath_Iter'>SkPath::Iter</a> to return elements of <a href='#Verb_Array'>Verb Array</a>, <a href='#Point_Array'>Point Array</a>, and <a href='#Conic_Weight'>Conic Weight</a> in <a href='#SkPath_RawIter_setPath_path'>path</a>. ### Parameters -<table> <tr> <td><a name="SkPath_RawIter_setPath_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Path">Path</a> to iterate</td> +<table> <tr> <td><a name='SkPath_RawIter_setPath_path'><code><strong>path</strong></code></a></td> + <td><a href='#Path'>Path</a> to iterate</td> </tr> </table> --- -<a name="SkPath_RawIter_next"></a> +<a name='SkPath_RawIter_next'></a> ## next -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Verb next(SkPoint pts[4]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_next'>next</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[4]) </pre> -Returns next <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>, and advances <a href="#SkPath_RawIter_RawIter">RawIter</a>. -When <a href="#Verb_Array">Verb Array</a> is exhausted, returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. -Zero to four <a href="SkPoint_Reference#Point">Points</a> are stored in <a href="#SkPath_RawIter_next_pts">pts</a>, depending on the returned <a href="#SkPath_Verb">Verb</a>. +Returns next <a href='#SkPath_Verb'>Verb</a> in <a href='#Verb_Array'>Verb Array</a>, and advances <a href='#SkPath_RawIter_RawIter'>RawIter</a>. +When <a href='#Verb_Array'>Verb Array</a> is exhausted, returns <a href='#SkPath_kDone_Verb'>kDone Verb</a>. +Zero to four <a href='SkPoint_Reference#Point'>Points</a> are stored in <a href='#SkPath_RawIter_next_pts'>pts</a>, depending on the returned <a href='#SkPath_Verb'>Verb</a>. ### Parameters -<table> <tr> <td><a name="SkPath_RawIter_next_pts"> <code><strong>pts </strong></code> </a></td> <td> -storage for <a href="SkPoint_Reference#Point">Point</a> data describing returned <a href="#SkPath_Verb">Verb</a></td> +<table> <tr> <td><a name='SkPath_RawIter_next_pts'><code><strong>pts</strong></code></a></td> + <td>storage for <a href='SkPoint_Reference#Point'>Point</a> data describing returned <a href='#SkPath_Verb'>Verb</a></td> </tr> </table> ### Return Value -next <a href="#SkPath_Verb">Verb</a> from <a href="#Verb_Array">Verb Array</a> +next <a href='#SkPath_Verb'>Verb</a> from <a href='#Verb_Array'>Verb Array</a> ### Example @@ -5222,22 +6233,22 @@ kDone_Verb ### See Also -<a href="#SkPath_RawIter_peek">peek</a> +<a href='#SkPath_RawIter_peek'>peek</a> --- -<a name="SkPath_RawIter_peek"></a> +<a name='SkPath_RawIter_peek'></a> ## peek -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -Verb peek() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_peek'>peek</a>() const </pre> -Returns next <a href="#SkPath_Verb">Verb</a>, but does not advance <a href="#SkPath_RawIter_RawIter">RawIter</a>. +Returns next <a href='#SkPath_Verb'>Verb</a>, but does not advance <a href='#SkPath_RawIter_RawIter'>RawIter</a>. ### Return Value -next <a href="#SkPath_Verb">Verb</a> from <a href="#Verb_Array">Verb Array</a> +next <a href='#SkPath_Verb'>Verb</a> from <a href='#Verb_Array'>Verb Array</a> ### Example @@ -5257,36 +6268,36 @@ peek Done == verb Done </fiddle-embed></div> -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) ### See Also -<a href="#SkPath_RawIter_next">next</a> +<a href='#SkPath_RawIter_next'>next</a> --- -<a name="SkPath_RawIter_conicWeight"></a> +<a name='SkPath_RawIter_conicWeight'></a> ## conicWeight -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar conicWeight() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_RawIter_conicWeight'>conicWeight</a>() const </pre> -Returns <a href="#Conic_Weight">Conic Weight</a> if <a href="#SkPath_RawIter_next">next</a> returned <a href="#SkPath_kConic_Verb">kConic Verb</a>. +Returns <a href='#Conic_Weight'>Conic Weight</a> if <a href='#SkPath_RawIter_next'>next</a> returned <a href='#SkPath_kConic_Verb'>kConic Verb</a>. -If <a href="#SkPath_RawIter_next">next</a> has not been called, or <a href="#SkPath_RawIter_next">next</a> did not return <a href="#SkPath_kConic_Verb">kConic Verb</a>, +If <a href='#SkPath_RawIter_next'>next</a> has not been called, or <a href='#SkPath_RawIter_next'>next</a> did not return <a href='#SkPath_kConic_Verb'>kConic Verb</a>, result is undefined. ### Return Value -<a href="#Conic_Weight">Conic Weight</a> for <a href="#Conic">Conic</a> <a href="SkPoint_Reference#Point">Points</a> returned by <a href="#SkPath_RawIter_next">next</a> +<a href='#Conic_Weight'>Conic Weight</a> for <a href='#Conic'>Conic</a> <a href='SkPoint_Reference#Point'>Points</a> returned by <a href='#SkPath_RawIter_next'>next</a> ### Example -<div><fiddle-embed name="9747e8177a50ea551471ba0b706f544b"> +<div><fiddle-embed name="69f360a0ba8f40c51ef4cd9f972c5893"> #### Example Output @@ -5301,7 +6312,7 @@ conic weight: 0.5 ### See Also -<a href="#Conic_Weight">Conic Weight</a> +<a href='#Conic_Weight'>Conic Weight</a> --- diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md index d76a2ffd5b..25802bd670 100644 --- a/site/user/api/SkPixmap_Reference.md +++ b/site/user/api/SkPixmap_Reference.md @@ -1,102 +1,247 @@ SkPixmap Reference === -# <a name="Pixmap"></a> Pixmap +# <a name='Pixmap'>Pixmap</a> -## <a name="Overview"></a> Overview +# <a name='SkPixmap'>Class SkPixmap</a> +<a href='#Pixmap'>Pixmap</a> provides a utility to pair <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> with pixels and row bytes. +<a href='#Pixmap'>Pixmap</a> is a low level class which provides convenience functions to access +raster destinations. <a href='SkCanvas_Reference#Canvas'>Canvas</a> can not draw <a href='#Pixmap'>Pixmap</a>, nor does <a href='#Pixmap'>Pixmap</a> provide +a direct drawing destination. -## <a name="Overview_Subtopic"></a> Overview Subtopic +Use <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> to draw pixels referenced by <a href='#Pixmap'>Pixmap</a>; use <a href='SkSurface_Reference#Surface'>Surface</a> to draw into +pixels referenced by <a href='#Pixmap'>Pixmap</a>. -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkPixmap">SkPixmap</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | +<a href='#Pixmap'>Pixmap</a> does not try to manage the lifetime of the pixel memory. Use <a href='undocumented#Pixel_Ref'>Pixel Ref</a> +to manage pixel memory; <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is safe across threads. + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkPixmap'>SkPixmap</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkPixmap global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Image_Info_Access'>Image Info Access</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns all or part of <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Initialization'>Initialization</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets fields for use</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Pixels'>Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>read and write pixel values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Readable_Address'>Readable Address</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns read only pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Reader'>Reader</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>examine pixel value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Writable_Address'>Writable Address</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixels</td> + </tr> +</table> -# <a name="SkPixmap"></a> Class SkPixmap -<a href="#Pixmap">Pixmap</a> provides a utility to pair <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> with pixels and row bytes. -<a href="#Pixmap">Pixmap</a> is a low level class which provides convenience functions to access -raster destinations. <a href="SkCanvas_Reference#Canvas">Canvas</a> can not draw <a href="#Pixmap">Pixmap</a>, nor does <a href="#Pixmap">Pixmap</a> provide -a direct drawing destination. -Use <a href="SkBitmap_Reference#Bitmap">Bitmap</a> to draw pixels referenced by <a href="#Pixmap">Pixmap</a>; use <a href="SkSurface_Reference#Surface">Surface</a> to draw into -pixels referenced by <a href="#Pixmap">Pixmap</a>. - -<a href="#Pixmap">Pixmap</a> does not try to manage the lifetime of the pixel memory. Use <a href="undocumented#Pixel_Ref">Pixel Ref</a> -to manage pixel memory; <a href="undocumented#Pixel_Ref">Pixel Ref</a> is safe across threads. - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Image_Info_Access">Image Info Access</a> | returns all or part of <a href="SkImageInfo_Reference#Image_Info">Image Info</a> | -| <a href="#Initialization">Initialization</a> | sets fields for use | -| <a href="#Pixels">Pixels</a> | read and write pixel values | -| <a href="#Readable_Address">Readable Address</a> | returns read only pixels | -| <a href="#Reader">Reader</a> | examine pixel value | -| <a href="#Writable_Address">Writable Address</a> | returns writable pixels | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkPixmap_empty_constructor">SkPixmap()</a> | constructs with default values | -| <a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> | constructs from <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, pixels | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkPixmap_addr">addr</a> | returns readable pixel address as void pointer | -| <a href="#SkPixmap_addr16">addr16</a> | returns readable pixel address as 16-bit pointer | -| <a href="#SkPixmap_addr32">addr32</a> | returns readable pixel address as 32-bit pointer | -| <a href="#SkPixmap_addr64">addr64</a> | returns readable pixel address as 64-bit pointer | -| <a href="#SkPixmap_addr8">addr8</a> | returns readable pixel address as 8-bit pointer | -| <a href="#SkPixmap_addrF16">addrF16</a> | returns readable pixel component address as 16-bit pointer | -| <a href="#SkPixmap_alphaType">alphaType</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> | -| <a href="#SkPixmap_bounds">bounds</a> | returns width and height as Rectangle | -| <a href="#SkPixmap_colorSpace">colorSpace</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkPixmap_colorType">colorType</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> | -| <a href="#SkPixmap_computeByteSize">computeByteSize</a> | returns size required for pixels | -| <a href="#SkPixmap_computeIsOpaque">computeIsOpaque</a> | returns true if all pixels are opaque | -| <a href="#SkPixmap_erase">erase</a> | writes <a href="SkColor_Reference#Color">Color</a> to pixels | -| <a href="#SkPixmap_extractSubset">extractSubset</a> | sets pointer to portion of original | -| <a href="#SkPixmap_getColor">getColor</a> | returns one pixel as <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> | -| <a href="#SkPixmap_height">height</a> | returns pixel row count | -| <a href="#SkPixmap_info">info</a> | returns <a href="SkImageInfo_Reference#Image_Info">Image Info</a> | -| <a href="#SkPixmap_isOpaque">isOpaque</a> | returns true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> describes opaque pixels | -| <a href="#SkPixmap_readPixels">readPixels</a> | copies and converts pixels | -| <a href="#SkPixmap_reset">reset</a> | reuses existing <a href="#Pixmap">Pixmap</a> with replacement values | -| <a href="#SkPixmap_rowBytes">rowBytes</a> | returns interval between rows in bytes | -| <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> | returns interval between rows in pixels | -| <a href="#SkPixmap_scalePixels">scalePixels</a> | scales and converts pixels | -| <a href="#SkPixmap_setColorSpace">setColorSpace</a> | sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a> | -| <a href="#SkPixmap_shiftPerPixel">shiftPerPixel</a> | returns bit shift from pixels to bytes | -| <a href="#SkPixmap_width">width</a> | returns pixel column count | -| <a href="#SkPixmap_writable_addr">writable addr</a> | returns writable pixel address as void pointer | -| <a href="#SkPixmap_writable_addr16">writable addr16</a> | returns writable pixel address as 16-bit pointer | -| <a href="#SkPixmap_writable_addr32">writable addr32</a> | returns writable pixel address as 32-bit pointer | -| <a href="#SkPixmap_writable_addr64">writable addr64</a> | returns writable pixel address as 64-bit pointer | -| <a href="#SkPixmap_writable_addr8">writable addr8</a> | returns writable pixel address as 8-bit pointer | -| <a href="#SkPixmap_writable_addrF16">writable addrF16</a> | returns writable pixel component address as 16-bit pointer | - -## <a name="Initialization"></a> Initialization - -<a name="SkPixmap_empty_constructor"></a> +## <a name='Constructor'>Constructor</a> + + +SkPixmap can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_empty_constructor'>SkPixmap()</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs with default values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_const_SkImageInfo_const_star'>SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, pixels</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkPixmap member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_addr'>addr</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as void pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_addr16'>addr16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 16-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_addr32'>addr32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 32-bit pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_addr64'>addr64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 64-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_addr8'>addr8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 8-bit pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_addrF16'>addrF16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel component address as 16-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_alphaType'>alphaType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_bounds'>bounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns width and height as Rectangle</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_colorSpace'>colorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_colorType'>colorType</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_computeByteSize'>computeByteSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns size required for pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_computeIsOpaque'>computeIsOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if all pixels are opaque</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_erase'>erase</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_extractSubset'>extractSubset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets pointer to portion of original</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_getColor'>getColor</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one pixel as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_info'>info</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_isOpaque'>isOpaque</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> describes opaque pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_reset'>reset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reuses existing <a href='#Pixmap'>Pixmap</a> with replacement values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_rowBytes'>rowBytes</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in bytes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_rowBytesAsPixels'>rowBytesAsPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_scalePixels'>scalePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and converts pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_setColorSpace'>setColorSpace</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_shiftPerPixel'>shiftPerPixel</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr'>writable addr</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as void pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr16'>writable addr16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 16-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr32'>writable addr32</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 32-bit pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr64'>writable addr64</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 64-bit pointer</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr8'>writable addr8</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 8-bit pointer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addrF16'>writable addrF16</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel component address as 16-bit pointer</td> + </tr> +</table> + + +## <a name='Initialization'>Initialization</a> + +<a name='SkPixmap_empty_constructor'></a> ## SkPixmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPixmap() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPixmap'>SkPixmap</a>() </pre> -Creates an empty <a href="#Pixmap">Pixmap</a> without pixels, with <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, with -<a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, and with a width and height of zero. Use -<a href="#SkPixmap_reset">reset</a> to associate pixels, <a href="SkImageInfo_Reference#SkColorType">SkColorType</a>, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, width, and height -after <a href="#Pixmap">Pixmap</a> has been created. +Creates an empty <a href='#Pixmap'>Pixmap</a> without pixels, with <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, with +<a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, and with a width and height of zero. Use +<a href='#SkPixmap_reset'>reset</a> to associate pixels, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a>, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, width, and height +after <a href='#Pixmap'>Pixmap</a> has been created. ### Return Value -empty <a href="#Pixmap">Pixmap</a> +empty <a href='#Pixmap'>Pixmap</a> ### Example @@ -113,49 +258,51 @@ width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType ### See Also -<a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href="#SkPixmap_reset">reset</a><sup><a href="#SkPixmap_reset_2">[2]</a></sup><sup><a href="#SkPixmap_reset_3">[3]</a></sup> <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> +<a href='#SkPixmap_const_SkImageInfo_const_star'>SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href='#SkPixmap_reset'>reset</a><sup><a href='#SkPixmap_reset_2'>[2]</a></sup><sup><a href='#SkPixmap_reset_3'>[3]</a></sup> <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> --- -<a name="SkPixmap_const_SkImageInfo_const_star"></a> +<a name='SkPixmap_const_SkImageInfo_const_star'></a> ## SkPixmap -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPixmap'>SkPixmap</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, const void* addr, size_t <a href='#SkPixmap_rowBytes'>rowBytes</a>) </pre> -Creates <a href="#Pixmap">Pixmap</a> from info width, height, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, and <a href="SkImageInfo_Reference#SkColorType">SkColorType</a>. -addr points to pixels, or nullptr. <a href="#SkPixmap_rowBytes">rowBytes</a> should be info.<a href="#SkPixmap_width">width</a> times +Creates <a href='#Pixmap'>Pixmap</a> from info width, height, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, and <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a>. +addr points to pixels, or nullptr. <a href='#SkPixmap_rowBytes'>rowBytes</a> should be info.<a href='#SkPixmap_width'>width</a> times info.bytesPerPixel(), or larger. No parameter checking is performed; it is up to the caller to ensure that -addr and <a href="#SkPixmap_rowBytes">rowBytes</a> agree with info. +addr and <a href='#SkPixmap_rowBytes'>rowBytes</a> agree with info. -The memory lifetime of pixels is managed by the caller. When <a href="#Pixmap">Pixmap</a> goes +The memory lifetime of pixels is managed by the caller. When <a href='#Pixmap'>Pixmap</a> goes out of scope, addr is unaffected. -<a href="#Pixmap">Pixmap</a> may be later modified by <a href="#SkPixmap_reset">reset</a> to change its size, pixel type, or +<a href='#Pixmap'>Pixmap</a> may be later modified by <a href='#SkPixmap_reset'>reset</a> to change its size, pixel type, or storage. ### Parameters -<table> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_info"> <code><strong>info </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> of <a href="SkImageInfo_Reference#Image_Info">Image Info</a></td> - </tr> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_addr"> <code><strong>addr </strong></code> </a></td> <td> -pointer to pixels allocated by caller; may be nullptr</td> - </tr> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of one row of addr; width times pixel size, or larger</td> +<table> <tr> <td><a name='SkPixmap_const_SkImageInfo_const_star_info'><code><strong>info</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> of <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> + </tr> + <tr> <td><a name='SkPixmap_const_SkImageInfo_const_star_addr'><code><strong>addr</strong></code></a></td> + <td>pointer to pixels allocated by caller; may be nullptr</td> + </tr> + <tr> <td><a name='SkPixmap_const_SkImageInfo_const_star_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of one row of addr; width times pixel size, or larger</td> </tr> </table> ### Return Value -initialized <a href="#Pixmap">Pixmap</a> +initialized <a href='#Pixmap'>Pixmap</a> ### Example -<div><fiddle-embed name="9a00774be57d7308313b3a9073e6e696"><div><a href="SkImage_Reference#SkImage_MakeRasterCopy">SkImage::MakeRasterCopy</a> takes const <a href="#SkPixmap">SkPixmap</a>& as an argument. The example -constructs a <a href="#SkPixmap">SkPixmap</a> from the brace-delimited parameters. +<div><fiddle-embed name="9a00774be57d7308313b3a9073e6e696"><div><a href='SkImage_Reference#SkImage_MakeRasterCopy'>SkImage::MakeRasterCopy</a> takes const <a href='#SkPixmap'>SkPixmap</a>& as an argument. The example +constructs a <a href='#SkPixmap'>SkPixmap</a> from the brace-delimited parameters. </div> #### Example Output @@ -169,19 +316,19 @@ copy alpha only = true ### See Also -<a href="#SkPixmap_empty_constructor">SkPixmap()</a> <a href="#SkPixmap_reset">reset</a><sup><a href="#SkPixmap_reset_2">[2]</a></sup><sup><a href="#SkPixmap_reset_3">[3]</a></sup> <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> +<a href='#SkPixmap_empty_constructor'>SkPixmap()</a> <a href='#SkPixmap_reset'>reset</a><sup><a href='#SkPixmap_reset_2'>[2]</a></sup><sup><a href='#SkPixmap_reset_3'>[3]</a></sup> <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> --- -<a name="SkPixmap_reset"></a> +<a name='SkPixmap_reset'></a> ## reset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPixmap_reset'>reset</a>() </pre> -Sets width, height, row bytes to zero; pixel address to nullptr; <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> to -<a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>; and <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> to <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>. +Sets width, height, row bytes to zero; pixel address to nullptr; <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> to +<a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>; and <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> to <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>. The prior pixels are unaffected; it is up to the caller to release pixels memory if desired. @@ -201,69 +348,71 @@ width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType ### See Also -<a href="#SkPixmap_empty_constructor">SkPixmap()</a> <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> +<a href='#SkPixmap_empty_constructor'>SkPixmap()</a> <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> --- -<a name="SkPixmap_reset_2"></a> +<a name='SkPixmap_reset_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void reset(const SkImageInfo& info, const void* addr, size_t rowBytes) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPixmap_reset'>reset</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& info, const void* addr, size_t <a href='#SkPixmap_rowBytes'>rowBytes</a>) </pre> -Sets width, height, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, and <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> from info. +Sets width, height, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, and <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> from info. Sets pixel address from addr, which may be nullptr. -Sets row bytes from <a href="#SkPixmap_rowBytes">rowBytes</a>, which should be info.<a href="#SkPixmap_width">width</a> times +Sets row bytes from <a href='#SkPixmap_rowBytes'>rowBytes</a>, which should be info.<a href='#SkPixmap_width'>width</a> times info.bytesPerPixel(), or larger. -Does not check addr. Asserts if built with SK_DEBUG defined and if <a href="#SkPixmap_rowBytes">rowBytes</a> is +Does not check addr. Asserts if built with SK_DEBUG defined and if <a href='#SkPixmap_rowBytes'>rowBytes</a> is too small to hold one row of pixels. -The memory lifetime pixels are managed by the caller. When <a href="#Pixmap">Pixmap</a> goes +The memory lifetime pixels are managed by the caller. When <a href='#Pixmap'>Pixmap</a> goes out of scope, addr is unaffected. ### Parameters -<table> <tr> <td><a name="SkPixmap_reset_2_info"> <code><strong>info </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> of <a href="SkImageInfo_Reference#Image_Info">Image Info</a></td> - </tr> <tr> <td><a name="SkPixmap_reset_2_addr"> <code><strong>addr </strong></code> </a></td> <td> -pointer to pixels allocated by caller; may be nullptr</td> - </tr> <tr> <td><a name="SkPixmap_reset_2_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -size of one row of addr; width times pixel size, or larger</td> +<table> <tr> <td><a name='SkPixmap_reset_2_info'><code><strong>info</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> of <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> + </tr> + <tr> <td><a name='SkPixmap_reset_2_addr'><code><strong>addr</strong></code></a></td> + <td>pointer to pixels allocated by caller; may be nullptr</td> + </tr> + <tr> <td><a name='SkPixmap_reset_2_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>size of one row of addr; width times pixel size, or larger</td> </tr> </table> ### Example -<div><fiddle-embed name="a7c9bfe44f5d888ab5b9996f2b126788"></fiddle-embed></div> +<div><fiddle-embed name="9a392b753167cfa849cebeefd5a6e07d"></fiddle-embed></div> ### See Also -<a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href="#SkPixmap_reset">reset</a><sup><a href="#SkPixmap_reset_2">[2]</a></sup><sup><a href="#SkPixmap_reset_3">[3]</a></sup> <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a> <a href="SkImageInfo_Reference#SkColorType">SkColorType</a> +<a href='#SkPixmap_const_SkImageInfo_const_star'>SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href='#SkPixmap_reset'>reset</a><sup><a href='#SkPixmap_reset_2'>[2]</a></sup><sup><a href='#SkPixmap_reset_3'>[3]</a></sup> <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> --- -<a name="SkPixmap_setColorSpace"></a> +<a name='SkPixmap_setColorSpace'></a> ## setColorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setColorSpace(sk_sp<SkColorSpace> colorSpace) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPixmap_setColorSpace'>setColorSpace</a>(<a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> <a href='#SkPixmap_colorSpace'>colorSpace</a>) </pre> -Changes <a href="undocumented#Color_Space">Color Space</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a>; preserves width, height, <a href="SkImageInfo_Reference#SkAlphaType">SkAlphaType</a>, and -<a href="SkImageInfo_Reference#SkColorType">SkColorType</a> in <a href="SkImage_Reference#Image">Image</a>, and leaves pixel address and row bytes unchanged. -<a href="undocumented#Color_Space">Color Space</a> reference count is incremented. +Changes <a href='undocumented#Color_Space'>Color Space</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>; preserves width, height, <a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a>, and +<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> in <a href='SkImage_Reference#Image'>Image</a>, and leaves pixel address and row bytes unchanged. +<a href='undocumented#Color_Space'>Color Space</a> reference count is incremented. ### Parameters -<table> <tr> <td><a name="SkPixmap_setColorSpace_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -<a href="undocumented#Color_Space">Color Space</a> moved to <a href="SkImageInfo_Reference#Image_Info">Image Info</a></td> +<table> <tr> <td><a name='SkPixmap_setColorSpace_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td><a href='undocumented#Color_Space'>Color Space</a> moved to <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td> </tr> </table> ### Example -<div><fiddle-embed name="bc42aea1e30b7234544bc25b4fc09dd0"> +<div><fiddle-embed name="30d70aec4de17c831dba71e03dc9664a"> #### Example Output @@ -276,45 +425,48 @@ is not unique ### See Also -<a href="undocumented#Color_Space">Color Space</a> <a href="SkImageInfo_Reference#SkImageInfo_makeColorSpace">SkImageInfo::makeColorSpace</a> +<a href='undocumented#Color_Space'>Color Space</a> <a href='SkImageInfo_Reference#SkImageInfo_makeColorSpace'>SkImageInfo::makeColorSpace</a> --- -<a name="SkPixmap_reset_3"></a> +<a name='SkPixmap_reset_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkPixmap_reset'>reset</a>(const <a href='undocumented#SkMask'>SkMask</a>& mask) </pre> +Deprecated. + soon --- -<a name="SkPixmap_extractSubset"></a> +<a name='SkPixmap_extractSubset'></a> ## extractSubset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT extractSubset(SkPixmap* subset, const SkIRect& area) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkPixmap_extractSubset'>extractSubset</a>(<a href='#SkPixmap'>SkPixmap</a>* subset, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& area) const </pre> -Sets <a href="#SkPixmap_extractSubset_subset">subset</a> width, height, pixel address to intersection of <a href="#Pixmap">Pixmap</a> with <a href="#SkPixmap_extractSubset_area">area</a>, -if intersection is not empty; and return true. Otherwise, leave <a href="#SkPixmap_extractSubset_subset">subset</a> unchanged +Sets <a href='#SkPixmap_extractSubset_subset'>subset</a> width, height, pixel address to intersection of <a href='#Pixmap'>Pixmap</a> with <a href='#SkPixmap_extractSubset_area'>area</a>, +if intersection is not empty; and return true. Otherwise, leave <a href='#SkPixmap_extractSubset_subset'>subset</a> unchanged and return false. Failing to read the return value generates a compile time warning. ### Parameters -<table> <tr> <td><a name="SkPixmap_extractSubset_subset"> <code><strong>subset </strong></code> </a></td> <td> -storage for width, height, pixel address of intersection</td> - </tr> <tr> <td><a name="SkPixmap_extractSubset_area"> <code><strong>area </strong></code> </a></td> <td> -bounds to intersect with <a href="#Pixmap">Pixmap</a></td> +<table> <tr> <td><a name='SkPixmap_extractSubset_subset'><code><strong>subset</strong></code></a></td> + <td>storage for width, height, pixel address of intersection</td> + </tr> + <tr> <td><a name='SkPixmap_extractSubset_area'><code><strong>area</strong></code></a></td> + <td>bounds to intersect with <a href='#Pixmap'>Pixmap</a></td> </tr> </table> ### Return Value -true if intersection of <a href="#Pixmap">Pixmap</a> and <a href="#SkPixmap_extractSubset_area">area</a> is not empty +true if intersection of <a href='#Pixmap'>Pixmap</a> and <a href='#SkPixmap_extractSubset_area'>area</a> is not empty ### Example @@ -322,20 +474,20 @@ true if intersection of <a href="#Pixmap">Pixmap</a> and <a href="#SkPixmap_extr ### See Also -<a href="#SkPixmap_reset">reset</a><sup><a href="#SkPixmap_reset_2">[2]</a></sup><sup><a href="#SkPixmap_reset_3">[3]</a></sup> <a href="SkIRect_Reference#SkIRect_intersect">SkIRect::intersect</a><sup><a href="SkIRect_Reference#SkIRect_intersect_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_intersect_3">[3]</a></sup> +<a href='#SkPixmap_reset'>reset</a><sup><a href='#SkPixmap_reset_2'>[2]</a></sup><sup><a href='#SkPixmap_reset_3'>[3]</a></sup> <a href='SkIRect_Reference#SkIRect_intersect'>SkIRect::intersect</a><sup><a href='SkIRect_Reference#SkIRect_intersect_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_intersect_3'>[3]</a></sup> --- -## <a name="Image_Info_Access"></a> Image Info Access +## <a name='Image_Info_Access'>Image Info Access</a> -<a name="SkPixmap_info"></a> +<a name='SkPixmap_info'></a> ## info -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkImageInfo& info() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& <a href='#SkPixmap_info'>info</a>() const </pre> -Returns width, height, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and <a href="undocumented#Color_Space">Color Space</a>. +Returns width, height, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and <a href='undocumented#Color_Space'>Color Space</a>. ### Return Value @@ -355,23 +507,23 @@ width: 384 height: 384 color: BGRA_8888 alpha: Opaque ### See Also -<a href="SkImageInfo_Reference#Image_Info">Image Info</a> +<a href='SkImageInfo_Reference#Image_Info'>Image Info</a> --- -<a name="SkPixmap_rowBytes"></a> +<a name='SkPixmap_rowBytes'></a> ## rowBytes -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t rowBytes() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkPixmap_rowBytes'>rowBytes</a>() const </pre> Returns row bytes, the interval from one pixel row to the next. Row bytes is at least as large as: -<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel(). +<a href='#SkPixmap_width'>width</a> * <a href='#SkPixmap_info'>info</a>.bytesPerPixel(). -Returns zero if <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. -It is up to the <a href="SkBitmap_Reference#Bitmap">Bitmap</a> creator to ensure that row bytes is a useful value. +Returns zero if <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. +It is up to the <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> creator to ensure that row bytes is a useful value. ### Return Value @@ -379,7 +531,7 @@ byte length of pixel row ### Example -<div><fiddle-embed name="da5e1f7f49891d3805a5a6103a000eff"> +<div><fiddle-embed name="19ac8bb81854680bd408fec8cb797d5c"> #### Example Output @@ -392,20 +544,20 @@ rowBytes: 8 minRowBytes: 4 ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_info">info</a> <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_info'>info</a> <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a> --- -<a name="SkPixmap_addr"></a> +<a name='SkPixmap_addr'></a> ## addr -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const void* addr() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const void* <a href='#SkPixmap_addr'>addr</a>() const </pre> Returns pixel address, the base address corresponding to the pixel origin. -It is up to the <a href="#Pixmap">Pixmap</a> creator to ensure that pixel address is a useful value. +It is up to the <a href='#Pixmap'>Pixmap</a> creator to ensure that pixel address is a useful value. ### Return Value @@ -427,24 +579,24 @@ inset address: 0x7f2a440fb210 ### See Also -<a href="#SkPixmap_addr_2">addr(int x, int y)</a> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_info">info</a> <a href="#SkPixmap_rowBytes">rowBytes</a> +<a href='#SkPixmap_addr_2'>addr(int x, int y)</a> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_info'>info</a> <a href='#SkPixmap_rowBytes'>rowBytes</a> --- -<a name="SkPixmap_width"></a> +<a name='SkPixmap_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPixmap_width'>width</a>() const </pre> Returns pixel count in each pixel row. Should be equal or less than: -<a href="#SkPixmap_rowBytes">rowBytes</a> / <a href="#SkPixmap_info">info</a>.bytesPerPixel(). +<a href='#SkPixmap_rowBytes'>rowBytes</a> / <a href='#SkPixmap_info'>info</a>.bytesPerPixel(). ### Return Value -pixel width in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +pixel width in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -460,22 +612,22 @@ pixmap width: 16 info width: 16 ### See Also -<a href="#SkPixmap_height">height</a> <a href="SkImageInfo_Reference#SkImageInfo_width">SkImageInfo::width()</a> +<a href='#SkPixmap_height'>height</a> <a href='SkImageInfo_Reference#SkImageInfo_width'>SkImageInfo::width()</a> --- -<a name="SkPixmap_height"></a> +<a name='SkPixmap_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPixmap_height'>height</a>() const </pre> Returns pixel row count. ### Return Value -pixel height in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +pixel height in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -491,25 +643,25 @@ pixmap height: 32 info height: 32 ### See Also -<a href="#SkPixmap_width">width</a> ImageInfo::height() +<a href='#SkPixmap_width'>width</a> ImageInfo::height() --- -<a name="SkPixmap_colorType"></a> +<a name='SkPixmap_colorType'></a> ## colorType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorType colorType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> <a href='#SkPixmap_colorType'>colorType</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>. +Returns <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>. ### Return Value -<a href="SkImageInfo_Reference#Color_Type">Color Type</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +<a href='SkImageInfo_Reference#Color_Type'>Color Type</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -525,23 +677,23 @@ color type: kAlpha_8_SkColorType ### See Also -<a href="#SkPixmap_alphaType">alphaType</a> <a href="SkImageInfo_Reference#SkImageInfo_colorType">SkImageInfo::colorType</a> +<a href='#SkPixmap_alphaType'>alphaType</a> <a href='SkImageInfo_Reference#SkImageInfo_colorType'>SkImageInfo::colorType</a> --- -<a name="SkPixmap_alphaType"></a> +<a name='SkPixmap_alphaType'></a> ## alphaType -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkAlphaType alphaType() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkImageInfo_Reference#SkAlphaType'>SkAlphaType</a> <a href='#SkPixmap_alphaType'>alphaType</a>() const </pre> -Returns <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, one of: <a href="SkImageInfo_Reference#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>, -<a href="SkImageInfo_Reference#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>. +Returns <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, one of: <a href='SkImageInfo_Reference#kUnknown_SkAlphaType'>kUnknown_SkAlphaType</a>, <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>, +<a href='SkImageInfo_Reference#kUnpremul_SkAlphaType'>kUnpremul_SkAlphaType</a>. ### Return Value -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> ### Example @@ -557,29 +709,29 @@ alpha type: kPremul_SkAlphaType ### See Also -<a href="#SkPixmap_colorType">colorType</a> <a href="SkImageInfo_Reference#SkImageInfo_alphaType">SkImageInfo::alphaType</a> +<a href='#SkPixmap_colorType'>colorType</a> <a href='SkImageInfo_Reference#SkImageInfo_alphaType'>SkImageInfo::alphaType</a> --- -<a name="SkPixmap_colorSpace"></a> +<a name='SkPixmap_colorSpace'></a> ## colorSpace -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColorSpace* colorSpace() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkColorSpace'>SkColorSpace</a>* <a href='#SkPixmap_colorSpace'>colorSpace</a>() const </pre> -Returns <a href="undocumented#Color_Space">Color Space</a>, the range of colors, associated with <a href="SkImageInfo_Reference#Image_Info">Image Info</a>. The -reference count of <a href="undocumented#Color_Space">Color Space</a> is unchanged. The returned <a href="undocumented#Color_Space">Color Space</a> is +Returns <a href='undocumented#Color_Space'>Color Space</a>, the range of colors, associated with <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>. The +reference count of <a href='undocumented#Color_Space'>Color Space</a> is unchanged. The returned <a href='undocumented#Color_Space'>Color Space</a> is immutable. ### Return Value -<a href="undocumented#Color_Space">Color Space</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a>, or nullptr +<a href='undocumented#Color_Space'>Color Space</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a>, or nullptr ### Example -<div><fiddle-embed name="34c71f803b8edb48eaf1cd0c55bb212e"><div><a href="undocumented#SkColorSpace_MakeSRGBLinear">SkColorSpace::MakeSRGBLinear</a> creates <a href="undocumented#Color_Space">Color Space</a> with linear gamma -and an sRGB gamut. This <a href="undocumented#Color_Space">Color Space</a> gamma is not close to sRGB gamma. +<div><fiddle-embed name="3421bb20a302d563832ba7bb45e0cc58"><div><a href='undocumented#SkColorSpace_MakeSRGBLinear'>SkColorSpace::MakeSRGBLinear</a> creates <a href='undocumented#Color_Space'>Color Space</a> with linear gamma +and an sRGB gamut. This <a href='undocumented#Color_Space'>Color Space</a> gamma is not close to sRGB gamma. </div> #### Example Output @@ -592,28 +744,28 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false ### See Also -<a href="undocumented#Color_Space">Color Space</a> <a href="SkImageInfo_Reference#SkImageInfo_colorSpace">SkImageInfo::colorSpace</a> +<a href='undocumented#Color_Space'>Color Space</a> <a href='SkImageInfo_Reference#SkImageInfo_colorSpace'>SkImageInfo::colorSpace</a> --- -<a name="SkPixmap_isOpaque"></a> +<a name='SkPixmap_isOpaque'></a> ## isOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isOpaque() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_isOpaque'>isOpaque</a>() const </pre> -Returns true if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>. -Does not check if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> allows <a href="SkColor_Reference#Alpha">Alpha</a>, or if any pixel value has +Returns true if <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>. +Does not check if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> allows <a href='SkColor_Reference#Alpha'>Alpha</a>, or if any pixel value has transparency. ### Return Value -true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> has opaque <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> has opaque <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> ### Example -<div><fiddle-embed name="efd083f121e888a523455ea8a49e50d1"><div><a href="#SkPixmap_isOpaque">isOpaque</a> ignores whether all pixels are opaque or not. +<div><fiddle-embed name="efd083f121e888a523455ea8a49e50d1"><div><a href='#SkPixmap_isOpaque'>isOpaque</a> ignores whether all pixels are opaque or not. </div> #### Example Output @@ -629,22 +781,22 @@ isOpaque: true ### See Also -<a href="#SkPixmap_computeIsOpaque">computeIsOpaque</a> <a href="SkImageInfo_Reference#SkImageInfo_isOpaque">SkImageInfo::isOpaque</a> +<a href='#SkPixmap_computeIsOpaque'>computeIsOpaque</a> <a href='SkImageInfo_Reference#SkImageInfo_isOpaque'>SkImageInfo::isOpaque</a> --- -<a name="SkPixmap_bounds"></a> +<a name='SkPixmap_bounds'></a> ## bounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect bounds() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkPixmap_bounds'>bounds</a>() const </pre> -Returns <a href="SkIRect_Reference#IRect">IRect</a> { 0, 0, <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a> }. +Returns <a href='SkIRect_Reference#IRect'>IRect</a> { 0, 0, <a href='#SkPixmap_width'>width</a>, <a href='#SkPixmap_height'>height</a> }. ### Return Value -integral rectangle from origin to <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a> +integral rectangle from origin to <a href='#SkPixmap_width'>width</a> and <a href='#SkPixmap_height'>height</a> ### Example @@ -663,19 +815,19 @@ width: 2 height: 2 empty: false ### See Also -<a href="#SkPixmap_height">height</a> <a href="#SkPixmap_width">width</a> <a href="SkIRect_Reference#IRect">IRect</a> +<a href='#SkPixmap_height'>height</a> <a href='#SkPixmap_width'>width</a> <a href='SkIRect_Reference#IRect'>IRect</a> --- -<a name="SkPixmap_rowBytesAsPixels"></a> +<a name='SkPixmap_rowBytesAsPixels'></a> ## rowBytesAsPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int rowBytesAsPixels() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPixmap_rowBytesAsPixels'>rowBytesAsPixels</a>() const </pre> Returns number of pixels that fit on row. Should be greater than or equal to -<a href="#SkPixmap_width">width</a>. +<a href='#SkPixmap_width'>width</a>. ### Return Value @@ -699,19 +851,19 @@ rowBytes: 8 rowBytesAsPixels: 2 ### See Also -<a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_shiftPerPixel">shiftPerPixel</a> <a href="#SkPixmap_width">width</a> <a href="SkImageInfo_Reference#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> +<a href='#SkPixmap_rowBytes'>rowBytes</a> <a href='#SkPixmap_shiftPerPixel'>shiftPerPixel</a> <a href='#SkPixmap_width'>width</a> <a href='SkImageInfo_Reference#SkImageInfo_bytesPerPixel'>SkImageInfo::bytesPerPixel</a> --- -<a name="SkPixmap_shiftPerPixel"></a> +<a name='SkPixmap_shiftPerPixel'></a> ## shiftPerPixel -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int shiftPerPixel() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPixmap_shiftPerPixel'>shiftPerPixel</a>() const </pre> Returns bit shift converting row bytes to row pixels. -Returns zero for <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns zero for <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -719,7 +871,7 @@ one of: 0, 1, 2, 3; left shift to convert pixels to bytes ### Example -<div><fiddle-embed name="2e778ffd6edea51af4b07f5d322ceb6a"> +<div><fiddle-embed name="bf31ee140e2c163c3957276e6d4c4f0c"> #### Example Output @@ -738,22 +890,22 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3 ### See Also -<a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> <a href="#SkPixmap_width">width</a> <a href="SkImageInfo_Reference#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> +<a href='#SkPixmap_rowBytes'>rowBytes</a> <a href='#SkPixmap_rowBytesAsPixels'>rowBytesAsPixels</a> <a href='#SkPixmap_width'>width</a> <a href='SkImageInfo_Reference#SkImageInfo_bytesPerPixel'>SkImageInfo::bytesPerPixel</a> --- -<a name="SkPixmap_computeByteSize"></a> +<a name='SkPixmap_computeByteSize'></a> ## computeByteSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -size_t computeByteSize() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +size_t <a href='#SkPixmap_computeByteSize'>computeByteSize</a>() const </pre> Returns minimum memory required for pixel storage. -Does not include unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkPixmap_width">width</a>. +Does not include unused memory on last row when <a href='#SkPixmap_rowBytesAsPixels'>rowBytesAsPixels</a> exceeds <a href='#SkPixmap_width'>width</a>. Returns zero if result does not fit in size_t. -Returns zero if <a href="#SkPixmap_height">height</a> or <a href="#SkPixmap_width">width</a> is 0. -Returns <a href="#SkPixmap_height">height</a> times <a href="#SkPixmap_rowBytes">rowBytes</a> if <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns zero if <a href='#SkPixmap_height'>height</a> or <a href='#SkPixmap_width'>width</a> is 0. +Returns <a href='#SkPixmap_height'>height</a> times <a href='#SkPixmap_rowBytes'>rowBytes</a> if <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value @@ -781,36 +933,36 @@ width: 1000000 height: 1000000 computeByteSize: 4999999000000 ### See Also -<a href="SkImageInfo_Reference#SkImageInfo_computeByteSize">SkImageInfo::computeByteSize</a> +<a href='SkImageInfo_Reference#SkImageInfo_computeByteSize'>SkImageInfo::computeByteSize</a> --- -## <a name="Reader"></a> Reader +## <a name='Reader'>Reader</a> -<a name="SkPixmap_computeIsOpaque"></a> +<a name='SkPixmap_computeIsOpaque'></a> ## computeIsOpaque -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool computeIsOpaque() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_computeIsOpaque'>computeIsOpaque</a>() const </pre> -Returns true if all pixels are opaque. <a href="SkImageInfo_Reference#Color_Type">Color Type</a> determines how pixels -are encoded, and whether pixel describes <a href="SkColor_Reference#Alpha">Alpha</a>. Returns true for <a href="SkImageInfo_Reference#Color_Type">Color Types</a> -without alpha in each pixel; for other <a href="SkImageInfo_Reference#Color_Type">Color Types</a>, returns true if all +Returns true if all pixels are opaque. <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> determines how pixels +are encoded, and whether pixel describes <a href='SkColor_Reference#Alpha'>Alpha</a>. Returns true for <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> +without alpha in each pixel; for other <a href='SkImageInfo_Reference#Color_Type'>Color Types</a>, returns true if all pixels have alpha values equivalent to 1.0 or greater. -For <a href="SkImageInfo_Reference#Color_Type">Color Types</a> <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> or <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>: always -returns true. For <a href="SkImageInfo_Reference#Color_Type">Color Types</a> <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, -<a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>: returns true if all pixel <a href="SkColor_Reference#Alpha">Alpha</a> values are 255. -For <a href="SkImageInfo_Reference#Color_Type">Color Type</a> <a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>: returns true if all pixel <a href="SkColor_Reference#Alpha">Alpha</a> values are 15. -For <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>: returns true if all pixel <a href="SkColor_Reference#Alpha">Alpha</a> values are 1.0 or +For <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> or <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>: always +returns true. For <a href='SkImageInfo_Reference#Color_Type'>Color Types</a> <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, +<a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>: returns true if all pixel <a href='SkColor_Reference#Alpha'>Alpha</a> values are 255. +For <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> <a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>: returns true if all pixel <a href='SkColor_Reference#Alpha'>Alpha</a> values are 15. +For <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a>: returns true if all pixel <a href='SkColor_Reference#Alpha'>Alpha</a> values are 1.0 or greater. -Returns false for <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Returns false for <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Return Value -true if all pixels have opaque values or <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is opaque +true if all pixels have opaque values or <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is opaque ### Example @@ -829,41 +981,42 @@ computeIsOpaque: true ### See Also -<a href="#SkPixmap_isOpaque">isOpaque</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> <a href="SkColor_Reference#Alpha">Alpha</a> +<a href='#SkPixmap_isOpaque'>isOpaque</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> <a href='SkColor_Reference#Alpha'>Alpha</a> --- -<a name="SkPixmap_getColor"></a> +<a name='SkPixmap_getColor'></a> ## getColor -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkColor getColor(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkColor_Reference#SkColor'>SkColor</a> <a href='#SkPixmap_getColor'>getColor</a>(int x, int y) const </pre> -Returns pixel at (<a href="#SkPixmap_getColor_x">x</a>, <a href="#SkPixmap_getColor_y">y</a>) as <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a>. -Returns black with <a href="SkColor_Reference#Alpha">Alpha</a> if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>. +Returns pixel at (<a href='#SkPixmap_getColor_x'>x</a>, <a href='#SkPixmap_getColor_y'>y</a>) as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a>. +Returns black with <a href='SkColor_Reference#Alpha'>Alpha</a> if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>. -Input is not validated: out of bounds values of <a href="#SkPixmap_getColor_x">x</a> or <a href="#SkPixmap_getColor_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkPixmap_getColor_x'>x</a> or <a href='#SkPixmap_getColor_y'>y</a> trigger an assert() if built with SK_DEBUG defined; and returns undefined values or may crash if -SK_RELEASE is defined. Fails if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a> or +SK_RELEASE is defined. Fails if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a> or pixel address is nullptr. -<a href="undocumented#Color_Space">Color Space</a> in <a href="SkImageInfo_Reference#Image_Info">Image Info</a> is ignored. Some <a href="SkColor_Reference#Color">Color</a> precision may be lost in the -conversion to <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a>; original pixel data may have additional +<a href='undocumented#Color_Space'>Color Space</a> in <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> is ignored. Some <a href='SkColor_Reference#Color'>Color</a> precision may be lost in the +conversion to <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a>; original pixel data may have additional precision. ### Parameters -<table> <tr> <td><a name="SkPixmap_getColor_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_getColor_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_getColor_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_getColor_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -pixel converted to <a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> +pixel converted to <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a> ### Example @@ -888,32 +1041,33 @@ Unpremultiplied: ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_readPixels">readPixels</a><sup><a href="#SkPixmap_readPixels_2">[2]</a></sup><sup><a href="#SkPixmap_readPixels_3">[3]</a></sup><sup><a href="#SkPixmap_readPixels_4">[4]</a></sup><sup><a href="#SkPixmap_readPixels_5">[5]</a></sup> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_readPixels'>readPixels</a><sup><a href='#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='#SkPixmap_readPixels_4'>[4]</a></sup><sup><a href='#SkPixmap_readPixels_5'>[5]</a></sup> --- -## <a name="Readable_Address"></a> Readable Address +## <a name='Readable_Address'>Readable Address</a> -<a name="SkPixmap_addr_2"></a> +<a name='SkPixmap_addr_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const void* addr(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const void* <a href='#SkPixmap_addr'>addr</a>(int x, int y) const </pre> -Returns readable pixel address at (<a href="#SkPixmap_addr_2_x">x</a>, <a href="#SkPixmap_addr_2_y">y</a>). Returns nullptr if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr. +Returns readable pixel address at (<a href='#SkPixmap_addr_2_x'>x</a>, <a href='#SkPixmap_addr_2_y'>y</a>). Returns nullptr if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr. -Input is not validated: out of bounds values of <a href="#SkPixmap_addr_2_x">x</a> or <a href="#SkPixmap_addr_2_y">y</a> trigger an assert() if -built with SK_DEBUG defined. Returns nullptr if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Input is not validated: out of bounds values of <a href='#SkPixmap_addr_2_x'>x</a> or <a href='#SkPixmap_addr_2_y'>y</a> trigger an assert() if +built with SK_DEBUG defined. Returns nullptr if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. Performs a lookup of pixel size; for better performance, call -one of: <a href="#SkPixmap_addr8">addr8</a>, <a href="#SkPixmap_addr16">addr16</a>, <a href="#SkPixmap_addr32">addr32</a>, <a href="#SkPixmap_addr64">addr64</a>, or <a href="#SkPixmap_addrF16">addrF16</a>. +one of: <a href='#SkPixmap_addr8'>addr8</a>, <a href='#SkPixmap_addr16'>addr16</a>, <a href='#SkPixmap_addr32'>addr32</a>, <a href='#SkPixmap_addr64'>addr64</a>, or <a href='#SkPixmap_addrF16'>addrF16</a>. ### Parameters -<table> <tr> <td><a name="SkPixmap_addr_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_addr_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_addr_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_addr_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -935,20 +1089,20 @@ pixmap.addr(1, 2) == &storage[1 + 2 * w] ### See Also -<a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="SkBitmap_Reference#SkBitmap_getAddr">SkBitmap::getAddr</a> +<a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='SkBitmap_Reference#SkBitmap_getAddr'>SkBitmap::getAddr</a> --- -<a name="SkPixmap_addr8"></a> +<a name='SkPixmap_addr8'></a> ## addr8 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint8_t* addr8() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint8_t* <a href='#SkPixmap_addr8'>addr8</a>() const </pre> Returns readable base pixel address. Result is addressable as unsigned 8-bit bytes. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a> or -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, and is built with SK_DEBUG defined. +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a> or +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, and is built with SK_DEBUG defined. One byte corresponds to one pixel. @@ -970,20 +1124,20 @@ pixmap.addr8() == storage ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr8">writable addr8</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr8'>writable addr8</a> --- -<a name="SkPixmap_addr16"></a> +<a name='SkPixmap_addr16'></a> ## addr16 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint16_t* addr16() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint16_t* <a href='#SkPixmap_addr16'>addr16</a>() const </pre> Returns readable base pixel address. Result is addressable as unsigned 16-bit words. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> or -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, and is built with SK_DEBUG defined. +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> or +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, and is built with SK_DEBUG defined. One word corresponds to one pixel. @@ -1005,20 +1159,20 @@ pixmap.addr16() == storage ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr16">writable addr16</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr16'>writable addr16</a> --- -<a name="SkPixmap_addr32"></a> +<a name='SkPixmap_addr32'></a> ## addr32 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint32_t* addr32() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint32_t* <a href='#SkPixmap_addr32'>addr32</a>() const </pre> Returns readable base pixel address. Result is addressable as unsigned 32-bit words. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a> or -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, and is built with SK_DEBUG defined. +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> or +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, and is built with SK_DEBUG defined. One word corresponds to one pixel. @@ -1040,19 +1194,19 @@ pixmap.addr32() == storage ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr32">writable addr32</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr32'>writable addr32</a> --- -<a name="SkPixmap_addr64"></a> +<a name='SkPixmap_addr64'></a> ## addr64 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint64_t* addr64() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint64_t* <a href='#SkPixmap_addr64'>addr64</a>() const </pre> Returns readable base pixel address. Result is addressable as unsigned 64-bit words. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> and is built +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. One word corresponds to one pixel. @@ -1075,19 +1229,19 @@ pixmap.addr64() == storage ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr64">writable addr64</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr64'>writable addr64</a> --- -<a name="SkPixmap_addrF16"></a> +<a name='SkPixmap_addrF16'></a> ## addrF16 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint16_t* addrF16() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint16_t* <a href='#SkPixmap_addrF16'>addrF16</a>() const </pre> Returns readable base pixel address. Result is addressable as unsigned 16-bit words. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> and is built +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. Each word represents one color component encoded as a half float. @@ -1111,36 +1265,37 @@ pixmap.addrF16() == storage ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> --- -<a name="SkPixmap_addr8_2"></a> +<a name='SkPixmap_addr8_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint8_t* addr8(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint8_t* <a href='#SkPixmap_addr8'>addr8</a>(int x, int y) const </pre> -Returns readable pixel address at (<a href="#SkPixmap_addr8_2_x">x</a>, <a href="#SkPixmap_addr8_2_y">y</a>). +Returns readable pixel address at (<a href='#SkPixmap_addr8_2_x'>x</a>, <a href='#SkPixmap_addr8_2_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkPixmap_addr8_2_x">x</a> or <a href="#SkPixmap_addr8_2_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkPixmap_addr8_2_x'>x</a> or <a href='#SkPixmap_addr8_2_y'>y</a> trigger an assert() if built with SK_DEBUG defined. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a> or -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, and is built with SK_DEBUG defined. +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a> or +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, and is built with SK_DEBUG defined. ### Parameters -<table> <tr> <td><a name="SkPixmap_addr8_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_addr8_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_addr8_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_addr8_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -readable unsigned 8-bit pointer to pixel at (<a href="#SkPixmap_addr8_2_x">x</a>, <a href="#SkPixmap_addr8_2_y">y</a>) +readable unsigned 8-bit pointer to pixel at (<a href='#SkPixmap_addr8_2_x'>x</a>, <a href='#SkPixmap_addr8_2_y'>y</a>) ### Example @@ -1156,36 +1311,37 @@ pixmap.addr8(1, 2) == &storage[1 + 2 * w] ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr8">writable addr8</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr8'>writable addr8</a> --- -<a name="SkPixmap_addr16_2"></a> +<a name='SkPixmap_addr16_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint16_t* addr16(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint16_t* <a href='#SkPixmap_addr16'>addr16</a>(int x, int y) const </pre> -Returns readable pixel address at (<a href="#SkPixmap_addr16_2_x">x</a>, <a href="#SkPixmap_addr16_2_y">y</a>). +Returns readable pixel address at (<a href='#SkPixmap_addr16_2_x'>x</a>, <a href='#SkPixmap_addr16_2_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkPixmap_addr16_2_x">x</a> or <a href="#SkPixmap_addr16_2_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkPixmap_addr16_2_x'>x</a> or <a href='#SkPixmap_addr16_2_y'>y</a> trigger an assert() if built with SK_DEBUG defined. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> or -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, and is built with SK_DEBUG defined. +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> or +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, and is built with SK_DEBUG defined. ### Parameters -<table> <tr> <td><a name="SkPixmap_addr16_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_addr16_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_addr16_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_addr16_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -readable unsigned 16-bit pointer to pixel at (<a href="#SkPixmap_addr16_2_x">x</a>, <a href="#SkPixmap_addr16_2_y">y</a>) +readable unsigned 16-bit pointer to pixel at (<a href='#SkPixmap_addr16_2_x'>x</a>, <a href='#SkPixmap_addr16_2_y'>y</a>) ### Example @@ -1201,36 +1357,37 @@ pixmap.addr16(1, 2) == &storage[1 + 2 * w] ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr16">writable addr16</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr16'>writable addr16</a> --- -<a name="SkPixmap_addr32_2"></a> +<a name='SkPixmap_addr32_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint32_t* addr32(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint32_t* <a href='#SkPixmap_addr32'>addr32</a>(int x, int y) const </pre> -Returns readable pixel address at (<a href="#SkPixmap_addr32_2_x">x</a>, <a href="#SkPixmap_addr32_2_y">y</a>). +Returns readable pixel address at (<a href='#SkPixmap_addr32_2_x'>x</a>, <a href='#SkPixmap_addr32_2_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkPixmap_addr32_2_x">x</a> or <a href="#SkPixmap_addr32_2_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkPixmap_addr32_2_x'>x</a> or <a href='#SkPixmap_addr32_2_y'>y</a> trigger an assert() if built with SK_DEBUG defined. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a> or -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, and is built with SK_DEBUG defined. +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> or +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, and is built with SK_DEBUG defined. ### Parameters -<table> <tr> <td><a name="SkPixmap_addr32_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_addr32_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_addr32_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_addr32_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -readable unsigned 32-bit pointer to pixel at (<a href="#SkPixmap_addr32_2_x">x</a>, <a href="#SkPixmap_addr32_2_y">y</a>) +readable unsigned 32-bit pointer to pixel at (<a href='#SkPixmap_addr32_2_x'>x</a>, <a href='#SkPixmap_addr32_2_y'>y</a>) ### Example @@ -1246,36 +1403,37 @@ pixmap.addr32(1, 2) == &storage[1 + 2 * w] ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr64">writable addr64</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr64'>writable addr64</a> --- -<a name="SkPixmap_addr64_2"></a> +<a name='SkPixmap_addr64_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint64_t* addr64(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint64_t* <a href='#SkPixmap_addr64'>addr64</a>(int x, int y) const </pre> -Returns readable pixel address at (<a href="#SkPixmap_addr64_2_x">x</a>, <a href="#SkPixmap_addr64_2_y">y</a>). +Returns readable pixel address at (<a href='#SkPixmap_addr64_2_x'>x</a>, <a href='#SkPixmap_addr64_2_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkPixmap_addr64_2_x">x</a> or <a href="#SkPixmap_addr64_2_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkPixmap_addr64_2_x'>x</a> or <a href='#SkPixmap_addr64_2_y'>y</a> trigger an assert() if built with SK_DEBUG defined. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> and is built +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. ### Parameters -<table> <tr> <td><a name="SkPixmap_addr64_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_addr64_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_addr64_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_addr64_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -readable unsigned 64-bit pointer to pixel at (<a href="#SkPixmap_addr64_2_x">x</a>, <a href="#SkPixmap_addr64_2_y">y</a>) +readable unsigned 64-bit pointer to pixel at (<a href='#SkPixmap_addr64_2_x'>x</a>, <a href='#SkPixmap_addr64_2_y'>y</a>) ### Example @@ -1291,22 +1449,22 @@ pixmap.addr64(1, 2) == &storage[1 + 2 * w] ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr64">writable addr64</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr64'>writable addr64</a> --- -<a name="SkPixmap_addrF16_2"></a> +<a name='SkPixmap_addrF16_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const uint16_t* addrF16(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const uint16_t* <a href='#SkPixmap_addrF16'>addrF16</a>(int x, int y) const </pre> -Returns readable pixel address at (<a href="#SkPixmap_addrF16_2_x">x</a>, <a href="#SkPixmap_addrF16_2_y">y</a>). +Returns readable pixel address at (<a href='#SkPixmap_addrF16_2_x'>x</a>, <a href='#SkPixmap_addrF16_2_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkPixmap_addrF16_2_x">x</a> or <a href="#SkPixmap_addrF16_2_y">y</a> trigger an assert() if +Input is not validated: out of bounds values of <a href='#SkPixmap_addrF16_2_x'>x</a> or <a href='#SkPixmap_addrF16_2_y'>y</a> trigger an assert() if built with SK_DEBUG defined. -Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> and is built +Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. Each unsigned 16-bit word represents one color component encoded as a half float. @@ -1314,16 +1472,17 @@ Four words correspond to one pixel. ### Parameters -<table> <tr> <td><a name="SkPixmap_addrF16_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_addrF16_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_addrF16_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_addrF16_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -readable unsigned 16-bit pointer to pixel component at (<a href="#SkPixmap_addrF16_2_x">x</a>, <a href="#SkPixmap_addrF16_2_y">y</a>) +readable unsigned 16-bit pointer to pixel component at (<a href='#SkPixmap_addrF16_2_x'>x</a>, <a href='#SkPixmap_addrF16_2_y'>y</a>) ### Example @@ -1339,17 +1498,17 @@ pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords] ### See Also -<a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> +<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> <a href='#SkPixmap_getColor'>getColor</a> <a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> --- -## <a name="Writable_Address"></a> Writable Address +## <a name='Writable_Address'>Writable Address</a> -<a name="SkPixmap_writable_addr"></a> +<a name='SkPixmap_writable_addr'></a> ## writable_addr -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void* writable_addr() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void* <a href='#SkPixmap_writable_addr'>writable addr</a>() const </pre> Returns writable base pixel address. @@ -1374,27 +1533,28 @@ pixmap.getColor(0, 0) == 0xFFFFFFFF ### See Also -<a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr8'>writable addr8</a> <a href='#SkPixmap_writable_addr16'>writable addr16</a> <a href='#SkPixmap_writable_addr32'>writable addr32</a> <a href='#SkPixmap_writable_addr64'>writable addr64</a> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> --- -<a name="SkPixmap_writable_addr_2"></a> +<a name='SkPixmap_writable_addr_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void* writable_addr(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void* <a href='#SkPixmap_writable_addr'>writable addr</a>(int x, int y) const </pre> -Returns writable pixel address at (<a href="#SkPixmap_writable_addr_2_x">x</a>, <a href="#SkPixmap_writable_addr_2_y">y</a>). +Returns writable pixel address at (<a href='#SkPixmap_writable_addr_2_x'>x</a>, <a href='#SkPixmap_writable_addr_2_y'>y</a>). -Input is not validated: out of bounds values of <a href="#SkPixmap_writable_addr_2_x">x</a> or <a href="#SkPixmap_writable_addr_2_y">y</a> trigger an assert() if -built with SK_DEBUG defined. Returns zero if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>. +Input is not validated: out of bounds values of <a href='#SkPixmap_writable_addr_2_x'>x</a> or <a href='#SkPixmap_writable_addr_2_y'>y</a> trigger an assert() if +built with SK_DEBUG defined. Returns zero if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>. ### Parameters -<table> <tr> <td><a name="SkPixmap_writable_addr_2_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_writable_addr_2_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_writable_addr_2_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_writable_addr_2_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -1418,29 +1578,30 @@ pixmap.getColor(1, 2) == 0xFFFFFFFF ### See Also -<a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr8'>writable addr8</a> <a href='#SkPixmap_writable_addr16'>writable addr16</a> <a href='#SkPixmap_writable_addr32'>writable addr32</a> <a href='#SkPixmap_writable_addr64'>writable addr64</a> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> --- -<a name="SkPixmap_writable_addr8"></a> +<a name='SkPixmap_writable_addr8'></a> ## writable_addr8 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint8_t* writable_addr8(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint8_t* <a href='#SkPixmap_writable_addr8'>writable addr8</a>(int x, int y) const </pre> -Returns writable pixel address at (<a href="#SkPixmap_writable_addr8_x">x</a>, <a href="#SkPixmap_writable_addr8_y">y</a>). Result is addressable as unsigned -8-bit bytes. Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a> -or <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, and is built with SK_DEBUG defined. +Returns writable pixel address at (<a href='#SkPixmap_writable_addr8_x'>x</a>, <a href='#SkPixmap_writable_addr8_y'>y</a>). Result is addressable as unsigned +8-bit bytes. Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a> +or <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, and is built with SK_DEBUG defined. One byte corresponds to one pixel. ### Parameters -<table> <tr> <td><a name="SkPixmap_writable_addr8_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_writable_addr8_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_writable_addr8_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_writable_addr8_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -1450,36 +1611,37 @@ writable unsigned 8-bit pointer to pixels ### Example -<div><fiddle-embed name="809284db136748208b3efc31cd89de29"><div>Altering pixels after drawing <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is not guaranteed to affect subsequent -drawing on all platforms. Adding a second <a href="SkBitmap_Reference#SkBitmap_installPixels">SkBitmap::installPixels</a> after editing +<div><fiddle-embed name="809284db136748208b3efc31cd89de29"><div>Altering pixels after drawing <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> is not guaranteed to affect subsequent +drawing on all platforms. Adding a second <a href='SkBitmap_Reference#SkBitmap_installPixels'>SkBitmap::installPixels</a> after editing pixel memory is safer. </div></fiddle-embed></div> ### See Also -<a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr8">addr8</a><sup><a href="#SkPixmap_addr8_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr16'>writable addr16</a> <a href='#SkPixmap_writable_addr32'>writable addr32</a> <a href='#SkPixmap_writable_addr64'>writable addr64</a> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr8'>addr8</a><sup><a href='#SkPixmap_addr8_2'>[2]</a></sup> --- -<a name="SkPixmap_writable_addr16"></a> +<a name='SkPixmap_writable_addr16'></a> ## writable_addr16 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint16_t* writable_addr16(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint16_t* <a href='#SkPixmap_writable_addr16'>writable addr16</a>(int x, int y) const </pre> -Returns <a href="#SkPixmap_writable_addr">writable addr</a> pixel address at (<a href="#SkPixmap_writable_addr16_x">x</a>, <a href="#SkPixmap_writable_addr16_y">y</a>). Result is addressable as unsigned -16-bit words. Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a> -or <a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, and is built with SK_DEBUG defined. +Returns <a href='#SkPixmap_writable_addr'>writable addr</a> pixel address at (<a href='#SkPixmap_writable_addr16_x'>x</a>, <a href='#SkPixmap_writable_addr16_y'>y</a>). Result is addressable as unsigned +16-bit words. Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a> +or <a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, and is built with SK_DEBUG defined. One word corresponds to one pixel. ### Parameters -<table> <tr> <td><a name="SkPixmap_writable_addr16_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_writable_addr16_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_writable_addr16_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_writable_addr16_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -1490,35 +1652,36 @@ writable unsigned 16-bit pointer to pixel ### Example <div><fiddle-embed name="6da54774f6432b46b47ea9013c15f280"><div>Draw a five by five bitmap, and draw it again with a center black pixel. -The low nibble of the 16-bit word is <a href="SkColor_Reference#Alpha">Alpha</a>. +The low nibble of the 16-bit word is <a href='SkColor_Reference#Alpha'>Alpha</a>. </div></fiddle-embed></div> ### See Also -<a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr16">addr16</a><sup><a href="#SkPixmap_addr16_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr8'>writable addr8</a> <a href='#SkPixmap_writable_addr32'>writable addr32</a> <a href='#SkPixmap_writable_addr64'>writable addr64</a> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr16'>addr16</a><sup><a href='#SkPixmap_addr16_2'>[2]</a></sup> --- -<a name="SkPixmap_writable_addr32"></a> +<a name='SkPixmap_writable_addr32'></a> ## writable_addr32 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t* writable_addr32(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t* <a href='#SkPixmap_writable_addr32'>writable addr32</a>(int x, int y) const </pre> -Returns writable pixel address at (<a href="#SkPixmap_writable_addr32_x">x</a>, <a href="#SkPixmap_writable_addr32_y">y</a>). Result is addressable as unsigned -32-bit words. Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not -<a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a> or <a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, and is built with SK_DEBUG +Returns writable pixel address at (<a href='#SkPixmap_writable_addr32_x'>x</a>, <a href='#SkPixmap_writable_addr32_y'>y</a>). Result is addressable as unsigned +32-bit words. Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not +<a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a> or <a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, and is built with SK_DEBUG defined. One word corresponds to one pixel. ### Parameters -<table> <tr> <td><a name="SkPixmap_writable_addr32_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_writable_addr32_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_writable_addr32_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_writable_addr32_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -1528,33 +1691,34 @@ writable unsigned 32-bit pointer to pixel ### Example -<div><fiddle-embed name="f4fdce206b8c0a4e79f0a9f52b7f47a6"></fiddle-embed></div> +<div><fiddle-embed name="d99d5d394182e8c2c0cab402f93ca6c7"></fiddle-embed></div> ### See Also -<a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr32">addr32</a><sup><a href="#SkPixmap_addr32_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr8'>writable addr8</a> <a href='#SkPixmap_writable_addr16'>writable addr16</a> <a href='#SkPixmap_writable_addr64'>writable addr64</a> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr32'>addr32</a><sup><a href='#SkPixmap_addr32_2'>[2]</a></sup> --- -<a name="SkPixmap_writable_addr64"></a> +<a name='SkPixmap_writable_addr64'></a> ## writable_addr64 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint64_t* writable_addr64(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint64_t* <a href='#SkPixmap_writable_addr64'>writable addr64</a>(int x, int y) const </pre> -Returns writable pixel address at (<a href="#SkPixmap_writable_addr64_x">x</a>, <a href="#SkPixmap_writable_addr64_y">y</a>). Result is addressable as unsigned -64-bit words. Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not -<a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. +Returns writable pixel address at (<a href='#SkPixmap_writable_addr64_x'>x</a>, <a href='#SkPixmap_writable_addr64_y'>y</a>). Result is addressable as unsigned +64-bit words. Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not +<a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. One word corresponds to one pixel. ### Parameters -<table> <tr> <td><a name="SkPixmap_writable_addr64_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_writable_addr64_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_writable_addr64_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_writable_addr64_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -1568,30 +1732,31 @@ writable unsigned 64-bit pointer to pixel ### See Also -<a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addr64">addr64</a><sup><a href="#SkPixmap_addr64_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr8'>writable addr8</a> <a href='#SkPixmap_writable_addr16'>writable addr16</a> <a href='#SkPixmap_writable_addr32'>writable addr32</a> <a href='#SkPixmap_writable_addrF16'>writable addrF16</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addr64'>addr64</a><sup><a href='#SkPixmap_addr64_2'>[2]</a></sup> --- -<a name="SkPixmap_writable_addrF16"></a> +<a name='SkPixmap_writable_addrF16'></a> ## writable_addrF16 -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint16_t* writable_addrF16(int x, int y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint16_t* <a href='#SkPixmap_writable_addrF16'>writable addrF16</a>(int x, int y) const </pre> -Returns writable pixel address at (<a href="#SkPixmap_writable_addrF16_x">x</a>, <a href="#SkPixmap_writable_addrF16_y">y</a>). Result is addressable as unsigned -16-bit words. Will trigger an assert() if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> is not -<a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. +Returns writable pixel address at (<a href='#SkPixmap_writable_addrF16_x'>x</a>, <a href='#SkPixmap_writable_addrF16_y'>y</a>). Result is addressable as unsigned +16-bit words. Will trigger an assert() if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> is not +<a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> and is built with SK_DEBUG defined. Each word represents one color component encoded as a half float. Four words correspond to one pixel. ### Parameters -<table> <tr> <td><a name="SkPixmap_writable_addrF16_x"> <code><strong>x </strong></code> </a></td> <td> -column index, zero or greater, and less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_writable_addrF16_y"> <code><strong>y </strong></code> </a></td> <td> -row index, zero or greater, and less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_writable_addrF16_x'><code><strong>x</strong></code></a></td> + <td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_writable_addrF16_y'><code><strong>y</strong></code></a></td> + <td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> @@ -1607,80 +1772,123 @@ is drawn after overwriting bottom half float color with top half float color. ### See Also -<a href="#SkPixmap_writable_addr">writable addr</a><sup><a href="#SkPixmap_writable_addr_2">[2]</a></sup> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_addr">addr</a><sup><a href="#SkPixmap_addr_2">[2]</a></sup> <a href="#SkPixmap_addrF16">addrF16</a><sup><a href="#SkPixmap_addrF16_2">[2]</a></sup> +<a href='#SkPixmap_writable_addr'>writable addr</a><sup><a href='#SkPixmap_writable_addr_2'>[2]</a></sup> <a href='#SkPixmap_writable_addr8'>writable addr8</a> <a href='#SkPixmap_writable_addr16'>writable addr16</a> <a href='#SkPixmap_writable_addr32'>writable addr32</a> <a href='#SkPixmap_writable_addr64'>writable addr64</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_addrF16'>addrF16</a><sup><a href='#SkPixmap_addrF16_2'>[2]</a></sup> --- -## <a name="Pixels"></a> Pixels - -| name | description | -| --- | --- | -| <a href="#SkPixmap_erase">erase</a> | writes <a href="SkColor_Reference#Color">Color</a> to pixels | -| | <a href="#SkPixmap_erase">erase(SkColor color, const SkIRect& subset)</a> const | -| | <a href="#SkPixmap_erase_2">erase(SkColor color)</a> const | -| | <a href="#SkPixmap_erase_3">erase(const SkColor4f& color, const SkIRect* subset = nullptr)</a> const | -| <a href="#SkPixmap_readPixels">readPixels</a> | copies and converts pixels | -| | <a href="#SkPixmap_readPixels">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior)</a> const | -| | <a href="#SkPixmap_readPixels_2">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes)</a> const | -| | <a href="#SkPixmap_readPixels_3">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a> const | -| | <a href="#SkPixmap_readPixels_4">readPixels(const SkPixmap& dst, int srcX, int srcY)</a> const | -| | <a href="#SkPixmap_readPixels_5">readPixels(const SkPixmap& dst)</a> const | -| <a href="#SkPixmap_scalePixels">scalePixels</a> | scales and converts pixels | - -<a name="SkPixmap_readPixels"></a> +## <a name='Pixels'>Pixels</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_erase'>erase</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>writes <a href='SkColor_Reference#Color'>Color</a> to pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_erase'>erase(SkColor color, const SkIRect& subset)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_erase_2'>erase(SkColor color)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_erase_3'>erase(const SkColor4f& color, const SkIRect* subset = nullptr)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels_2'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels_3'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels_4'>readPixels(const SkPixmap& dst, int srcX, int srcY)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels_5'>readPixels(const SkPixmap& dst)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_scalePixels'>scalePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and converts pixels</td> + </tr> +</table> + + +<a name='SkPixmap_readPixels'></a> ## readPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, - SkTransferFunctionBehavior behavior) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, + <a href='undocumented#SkTransferFunctionBehavior'>SkTransferFunctionBehavior</a> behavior) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_srcX">srcX</a>, <a href="#SkPixmap_readPixels_srcY">srcY</a>), and does not -exceed <a href="#Pixmap">Pixmap</a> (<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels to <a href='#SkPixmap_readPixels_dstPixels'>dstPixels</a>. Copy starts at (<a href='#SkPixmap_readPixels_srcX'>srcX</a>, <a href='#SkPixmap_readPixels_srcY'>srcY</a>), and does not +exceed <a href='#Pixmap'>Pixmap</a> (<a href='#SkPixmap_width'>width</a>, <a href='#SkPixmap_height'>height</a>). -<a href="#SkPixmap_readPixels_dstInfo">dstInfo</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and -<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +<a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and +<a href='undocumented#Color_Space'>Color Space</a> of destination. <a href='#SkPixmap_readPixels_dstRowBytes'>dstRowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if -<a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>. +<a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkPixmap_addr'>addr</a> equals nullptr, or <a href='#SkPixmap_readPixels_dstRowBytes'>dstRowBytes</a> is less than <a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>. -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must -match. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorType'>colorType</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkPixmap_alphaType'>alphaType</a> must +match. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkPixmap_readPixels_srcX">srcX</a> and <a href="#SkPixmap_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. Returns false if: -abs(srcX) >= <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a>, -or ifabs(srcY) >= <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_height">height</a>. +<a href='#SkPixmap_readPixels_srcX'>srcX</a> and <a href='#SkPixmap_readPixels_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#SkPixmap_width'>width</a> or <a href='#SkPixmap_height'>height</a> is zero or negative. Returns false if: + +abs(srcX) >= <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a>, +or ifabs(srcY) >= <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_height'>height</a>. -If <a href="#SkPixmap_readPixels_behavior">behavior</a> is <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts source -pixels to a linear space before converting to <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>. -If <a href="#SkPixmap_readPixels_behavior">behavior</a> is <a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: source +If <a href='#SkPixmap_readPixels_behavior'>behavior</a> is <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>: converts source +pixels to a linear space before converting to <a href='#SkPixmap_readPixels_dstInfo'>dstInfo</a>. +If <a href='#SkPixmap_readPixels_behavior'>behavior</a> is <a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a>: source pixels are treated as if they are linear, regardless of how they are encoded. ### Parameters -<table> <tr> <td><a name="SkPixmap_readPixels_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -destination width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -destination pixel storage</td> - </tr> <tr> <td><a name="SkPixmap_readPixels_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -destination row length</td> - </tr> <tr> <td><a name="SkPixmap_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_behavior"> <code><strong>behavior </strong></code> </a></td> <td> -one of: <a href="undocumented#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>, -<a href="undocumented#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a></td> +<table> <tr> <td><a name='SkPixmap_readPixels_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>destination width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>destination pixel storage</td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>destination row length</td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkPixmap_height'>height</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_behavior'><code><strong>behavior</strong></code></a></td> + <td>one of: <a href='undocumented#SkTransferFunctionBehavior_kRespect'>SkTransferFunctionBehavior::kRespect</a>, +<a href='undocumented#SkTransferFunctionBehavior_kIgnore'>SkTransferFunctionBehavior::kIgnore</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a> +true if pixels are copied to <a href='#SkPixmap_readPixels_dstPixels'>dstPixels</a> ### Example @@ -1688,47 +1896,49 @@ true if pixels are copied to <a href="#SkPixmap_readPixels_dstPixels">dstPixels< ### See Also -<a href="#SkPixmap_erase">erase</a><sup><a href="#SkPixmap_erase_2">[2]</a></sup><sup><a href="#SkPixmap_erase_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkPixmap_erase'>erase</a><sup><a href='#SkPixmap_erase_2'>[2]</a></sup><sup><a href='#SkPixmap_erase_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkPixmap_readPixels_2"></a> +<a name='SkPixmap_readPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a>. Copy starts at (0, 0), and does not -exceed <a href="#Pixmap">Pixmap</a> (<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels to <a href='#SkPixmap_readPixels_2_dstPixels'>dstPixels</a>. Copy starts at (0, 0), and does not +exceed <a href='#Pixmap'>Pixmap</a> (<a href='#SkPixmap_width'>width</a>, <a href='#SkPixmap_height'>height</a>). -<a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and -<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_2_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +<a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and +<a href='undocumented#Color_Space'>Color Space</a> of destination. <a href='#SkPixmap_readPixels_2_dstRowBytes'>dstRowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if -<a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_2_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>. +<a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkPixmap_addr'>addr</a> equals nullptr, or <a href='#SkPixmap_readPixels_2_dstRowBytes'>dstRowBytes</a> is less than <a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>. -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must -match. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorType'>colorType</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkPixmap_alphaType'>alphaType</a> must +match. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkPixmap_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -Returns false if <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. +Returns false if <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a> or <a href='#SkPixmap_height'>height</a> is zero or negative. ### Parameters -<table> <tr> <td><a name="SkPixmap_readPixels_2_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -destination width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_2_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -destination pixel storage</td> - </tr> <tr> <td><a name="SkPixmap_readPixels_2_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -destination row length</td> +<table> <tr> <td><a name='SkPixmap_readPixels_2_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>destination width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_2_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>destination pixel storage</td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_2_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>destination row length</td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a> +true if pixels are copied to <a href='#SkPixmap_readPixels_2_dstPixels'>dstPixels</a> ### Example @@ -1738,54 +1948,59 @@ creates visible banding. ### See Also -<a href="#SkPixmap_erase">erase</a><sup><a href="#SkPixmap_erase_2">[2]</a></sup><sup><a href="#SkPixmap_erase_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkPixmap_erase'>erase</a><sup><a href='#SkPixmap_erase_2'>[2]</a></sup><sup><a href='#SkPixmap_erase_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkPixmap_readPixels_3"></a> +<a name='SkPixmap_readPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_3_srcX">srcX</a>, <a href="#SkPixmap_readPixels_3_srcY">srcY</a>), and does not -exceed <a href="#Pixmap">Pixmap</a> (<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>). +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels to <a href='#SkPixmap_readPixels_3_dstPixels'>dstPixels</a>. Copy starts at (<a href='#SkPixmap_readPixels_3_srcX'>srcX</a>, <a href='#SkPixmap_readPixels_3_srcY'>srcY</a>), and does not +exceed <a href='#Pixmap'>Pixmap</a> (<a href='#SkPixmap_width'>width</a>, <a href='#SkPixmap_height'>height</a>). -<a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and -<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_3_dstRowBytes">dstRowBytes</a> specifics the gap from one destination +<a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and +<a href='undocumented#Color_Space'>Color Space</a> of destination. <a href='#SkPixmap_readPixels_3_dstRowBytes'>dstRowBytes</a> specifics the gap from one destination row to the next. Returns true if pixels are copied. Returns false if -<a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_3_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="SkImageInfo_Reference#SkImageInfo">minRowBytes</a>. +<a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a>.<a href='#SkPixmap_addr'>addr</a> equals nullptr, or <a href='#SkPixmap_readPixels_3_dstRowBytes'>dstRowBytes</a> is less than <a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a>.<a href='SkImageInfo_Reference#SkImageInfo'>minRowBytes</a>. -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must -match. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorType'>colorType</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a>.<a href='#SkPixmap_alphaType'>alphaType</a> must +match. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkPixmap_readPixels_3_dstInfo'>dstInfo</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkPixmap_readPixels_3_srcX">srcX</a> and <a href="#SkPixmap_readPixels_3_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false if <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. Returns false if: -abs(srcX) >= <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a>, -or ifabs(srcY) >= <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_height">height</a>. +<a href='#SkPixmap_readPixels_3_srcX'>srcX</a> and <a href='#SkPixmap_readPixels_3_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false if <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a> or <a href='#SkPixmap_height'>height</a> is zero or negative. Returns false if: + +abs(srcX) >= <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a>, +or ifabs(srcY) >= <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_height'>height</a>. ### Parameters -<table> <tr> <td><a name="SkPixmap_readPixels_3_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -destination width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_3_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -destination pixel storage</td> - </tr> <tr> <td><a name="SkPixmap_readPixels_3_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -destination row length</td> - </tr> <tr> <td><a name="SkPixmap_readPixels_3_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_3_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_readPixels_3_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>destination width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_3_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>destination pixel storage</td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_3_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>destination row length</td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_3_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_3_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a> +true if pixels are copied to <a href='#SkPixmap_readPixels_3_dstPixels'>dstPixels</a> ### Example @@ -1793,48 +2008,51 @@ true if pixels are copied to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixel ### See Also -<a href="#SkPixmap_erase">erase</a><sup><a href="#SkPixmap_erase_2">[2]</a></sup><sup><a href="#SkPixmap_erase_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkPixmap_erase'>erase</a><sup><a href='#SkPixmap_erase_2'>[2]</a></sup><sup><a href='#SkPixmap_erase_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkPixmap_readPixels_4"></a> +<a name='SkPixmap_readPixels_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& dst, int srcX, int srcY) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_readPixels'>readPixels</a>(const <a href='#SkPixmap'>SkPixmap</a>& dst, int srcX, int srcY) const </pre> -Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_4_dst">dst</a>. Copy starts at (<a href="#SkPixmap_readPixels_4_srcX">srcX</a>, <a href="#SkPixmap_readPixels_4_srcY">srcY</a>), and does not -exceed <a href="#Pixmap">Pixmap</a> (<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>). <a href="#SkPixmap_readPixels_4_dst">dst</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of destination. Returns true if pixels are copied. -Returns false if <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is less than -<a href="#SkPixmap_readPixels_4_dst">dst</a> <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. - -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorType">colorType</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_alphaType">alphaType</a> must -match. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns +Copies a <a href='SkRect_Reference#Rect'>Rect</a> of pixels to <a href='#SkPixmap_readPixels_4_dst'>dst</a>. Copy starts at (<a href='#SkPixmap_readPixels_4_srcX'>srcX</a>, <a href='#SkPixmap_readPixels_4_srcY'>srcY</a>), and does not +exceed <a href='#Pixmap'>Pixmap</a> (<a href='#SkPixmap_width'>width</a>, <a href='#SkPixmap_height'>height</a>). <a href='#SkPixmap_readPixels_4_dst'>dst</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a> of destination. Returns true if pixels are copied. +Returns false if <a href='#SkPixmap_readPixels_4_dst'>dst</a>.<a href='#SkPixmap_addr'>addr</a> equals nullptr, or <a href='#SkPixmap_readPixels_4_dst'>dst</a>.<a href='#SkPixmap_rowBytes'>rowBytes</a> is less than +<a href='#SkPixmap_readPixels_4_dst'>dst</a> <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a>. + +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkPixmap_readPixels_4_dst'>dst</a>.<a href='#SkPixmap_info'>info</a>.<a href='#SkPixmap_colorType'>colorType</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkPixmap_readPixels_4_dst'>dst</a>.<a href='#SkPixmap_info'>info</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkPixmap_readPixels_4_dst'>dst</a>.<a href='#SkPixmap_info'>info</a>.<a href='#SkPixmap_alphaType'>alphaType</a> must +match. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkPixmap_readPixels_4_dst'>dst</a>.<a href='#SkPixmap_info'>info</a>.<a href='#SkPixmap_colorSpace'>colorSpace</a> must match. Returns false if pixel conversion is not possible. -<a href="#SkPixmap_readPixels_4_srcX">srcX</a> and <a href="#SkPixmap_readPixels_4_srcY">srcY</a> may be negative to copy only top or left of source. Returns -false <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. Returns false if: -abs(srcX) >= <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a>, -or ifabs(srcY) >= <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_height">height</a>. +<a href='#SkPixmap_readPixels_4_srcX'>srcX</a> and <a href='#SkPixmap_readPixels_4_srcY'>srcY</a> may be negative to copy only top or left of source. Returns +false <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a> or <a href='#SkPixmap_height'>height</a> is zero or negative. Returns false if: + +abs(srcX) >= <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a>, +or ifabs(srcY) >= <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_height'>height</a>. ### Parameters -<table> <tr> <td><a name="SkPixmap_readPixels_4_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a> and pixel address to write to</td> - </tr> <tr> <td><a name="SkPixmap_readPixels_4_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td> - </tr> <tr> <td><a name="SkPixmap_readPixels_4_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td> +<table> <tr> <td><a name='SkPixmap_readPixels_4_dst'><code><strong>dst</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a> and pixel address to write to</td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_4_srcX'><code><strong>srcX</strong></code></a></td> + <td>column index whose absolute value is less than <a href='#SkPixmap_width'>width</a></td> + </tr> + <tr> <td><a name='SkPixmap_readPixels_4_srcY'><code><strong>srcY</strong></code></a></td> + <td>row index whose absolute value is less than <a href='#SkPixmap_height'>height</a></td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkPixmap_readPixels_4_dst">dst</a> +true if pixels are copied to <a href='#SkPixmap_readPixels_4_dst'>dst</a> ### Example @@ -1842,39 +2060,40 @@ true if pixels are copied to <a href="#SkPixmap_readPixels_4_dst">dst</a> ### See Also -<a href="#SkPixmap_erase">erase</a><sup><a href="#SkPixmap_erase_2">[2]</a></sup><sup><a href="#SkPixmap_erase_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkPixmap_erase'>erase</a><sup><a href='#SkPixmap_erase_2'>[2]</a></sup><sup><a href='#SkPixmap_erase_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkPixmap_readPixels_5"></a> +<a name='SkPixmap_readPixels_5'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_readPixels'>readPixels</a>(const <a href='#SkPixmap'>SkPixmap</a>& dst) const </pre> -Copies pixels inside <a href="#SkPixmap_bounds">bounds</a> to <a href="#SkPixmap_readPixels_5_dst">dst</a>. <a href="#SkPixmap_readPixels_5_dst">dst</a> specifies width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of destination. Returns true if pixels are copied. -Returns false if <a href="#SkPixmap_readPixels_5_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_5_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is less than -<a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. +Copies pixels inside <a href='#SkPixmap_bounds'>bounds</a> to <a href='#SkPixmap_readPixels_5_dst'>dst</a>. <a href='#SkPixmap_readPixels_5_dst'>dst</a> specifies width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and <a href='undocumented#Color_Space'>Color Space</a> of destination. Returns true if pixels are copied. +Returns false if <a href='#SkPixmap_readPixels_5_dst'>dst</a>.<a href='#SkPixmap_addr'>addr</a> equals nullptr, or <a href='#SkPixmap_readPixels_5_dst'>dst</a>.<a href='#SkPixmap_rowBytes'>rowBytes</a> is less than +<a href='#SkPixmap_readPixels_5_dst'>dst</a> <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a>. -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkPixmap_readPixels_5_dst'>dst</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkPixmap_readPixels_5_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkPixmap_readPixels_5_dst'>dst</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkPixmap_readPixels_5_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns false if pixel conversion is not possible. -Returns false if <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. + +Returns false if <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_width'>width</a> or <a href='#SkPixmap_height'>height</a> is zero or negative. ### Parameters -<table> <tr> <td><a name="SkPixmap_readPixels_5_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a> and pixel address to write to</td> +<table> <tr> <td><a name='SkPixmap_readPixels_5_dst'><code><strong>dst</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a> and pixel address to write to</td> </tr> </table> ### Return Value -true if pixels are copied to <a href="#SkPixmap_readPixels_5_dst">dst</a> +true if pixels are copied to <a href='#SkPixmap_readPixels_5_dst'>dst</a> ### Example @@ -1882,51 +2101,52 @@ true if pixels are copied to <a href="#SkPixmap_readPixels_5_dst">dst</a> ### See Also -<a href="#SkPixmap_erase">erase</a><sup><a href="#SkPixmap_erase_2">[2]</a></sup><sup><a href="#SkPixmap_erase_3">[3]</a></sup> <a href="SkBitmap_Reference#SkBitmap_readPixels">SkBitmap::readPixels</a><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_2">[2]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_3">[3]</a></sup><sup><a href="SkBitmap_Reference#SkBitmap_readPixels_4">[4]</a></sup> <a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="SkCanvas_Reference#SkCanvas_readPixels">SkCanvas::readPixels</a><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_2">[2]</a></sup><sup><a href="SkCanvas_Reference#SkCanvas_readPixels_3">[3]</a></sup> <a href="SkImage_Reference#SkImage_readPixels">SkImage::readPixels</a><sup><a href="SkImage_Reference#SkImage_readPixels_2">[2]</a></sup> <a href="SkSurface_Reference#SkSurface_readPixels">SkSurface::readPixels</a><sup><a href="SkSurface_Reference#SkSurface_readPixels_2">[2]</a></sup><sup><a href="SkSurface_Reference#SkSurface_readPixels_3">[3]</a></sup> +<a href='#SkPixmap_erase'>erase</a><sup><a href='#SkPixmap_erase_2'>[2]</a></sup><sup><a href='#SkPixmap_erase_3'>[3]</a></sup> <a href='SkBitmap_Reference#SkBitmap_readPixels'>SkBitmap::readPixels</a><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_3'>[3]</a></sup><sup><a href='SkBitmap_Reference#SkBitmap_readPixels_4'>[4]</a></sup> <a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> <a href='SkCanvas_Reference#SkCanvas_readPixels'>SkCanvas::readPixels</a><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_2'>[2]</a></sup><sup><a href='SkCanvas_Reference#SkCanvas_readPixels_3'>[3]</a></sup> <a href='SkImage_Reference#SkImage_readPixels'>SkImage::readPixels</a><sup><a href='SkImage_Reference#SkImage_readPixels_2'>[2]</a></sup> <a href='SkSurface_Reference#SkSurface_readPixels'>SkSurface::readPixels</a><sup><a href='SkSurface_Reference#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='SkSurface_Reference#SkSurface_readPixels_3'>[3]</a></sup> --- -<a name="SkPixmap_scalePixels"></a> +<a name='SkPixmap_scalePixels'></a> ## scalePixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_scalePixels'>scalePixels</a>(const <a href='#SkPixmap'>SkPixmap</a>& dst, <a href='undocumented#SkFilterQuality'>SkFilterQuality</a> filterQuality) const </pre> -Copies <a href="SkBitmap_Reference#Bitmap">Bitmap</a> to <a href="#SkPixmap_scalePixels_dst">dst</a>, scaling pixels to fit <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_height">height</a>, and -converting pixels to match <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_colorType">colorType</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_alphaType">alphaType</a>. Returns true if -pixels are copied. Returns false if <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> is nullptr, or <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is -less than <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="SkImageInfo_Reference#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>. +Copies <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> to <a href='#SkPixmap_scalePixels_dst'>dst</a>, scaling pixels to fit <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_width'>width</a> and <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_height'>height</a>, and +converting pixels to match <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_colorType'>colorType</a> and <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_alphaType'>alphaType</a>. Returns true if +pixels are copied. Returns false if <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_addr'>addr</a> is nullptr, or <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_rowBytes'>rowBytes</a> is +less than <a href='#SkPixmap_scalePixels_dst'>dst</a> <a href='SkImageInfo_Reference#SkImageInfo_minRowBytes'>SkImageInfo::minRowBytes</a>. -<a href="#Pixels">Pixels</a> are copied only if pixel conversion is possible. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, or <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>; <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="SkImageInfo_Reference#Color_Type">Color Type</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. -If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_alphaType">alphaType</a> is <a href="SkImageInfo_Reference#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> must -match. If <a href="#Pixmap">Pixmap</a> <a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns +<a href='#Pixels'>Pixels</a> are copied only if pixel conversion is possible. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, or <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>; <a href='#SkPixmap_scalePixels_dst'>dst</a> <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='#SkPixmap_scalePixels_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. +If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_alphaType'>alphaType</a> is <a href='SkImageInfo_Reference#kOpaque_SkAlphaType'>kOpaque_SkAlphaType</a>, <a href='#SkPixmap_scalePixels_dst'>dst</a> <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> must +match. If <a href='#Pixmap'>Pixmap</a> <a href='#SkPixmap_colorSpace'>colorSpace</a> is nullptr, <a href='#SkPixmap_scalePixels_dst'>dst</a> <a href='undocumented#Color_Space'>Color Space</a> must match. Returns false if pixel conversion is not possible. -Returns false if <a href="SkBitmap_Reference#Bitmap">Bitmap</a> <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. +Returns false if <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> <a href='#SkPixmap_width'>width</a> or <a href='#SkPixmap_height'>height</a> is zero or negative. -Scales the image, with <a href="#SkPixmap_scalePixels_filterQuality">filterQuality</a>, to match <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_height">height</a>. -<a href="#SkPixmap_scalePixels_filterQuality">filterQuality</a> <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a> is fastest, typically implemented with -<a href="undocumented#Nearest_Neighbor">Filter Quality Nearest Neighbor</a>. <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a> is typically implemented with -<a href="undocumented#Bilerp">Filter Quality Bilerp</a>. <a href="undocumented#kMedium_SkFilterQuality">kMedium_SkFilterQuality</a> is typically implemented with -<a href="undocumented#Bilerp">Filter Quality Bilerp</a>, and <a href="undocumented#MipMap">Filter Quality MipMap</a> when size is reduced. -<a href="undocumented#kHigh_SkFilterQuality">kHigh_SkFilterQuality</a> is slowest, typically implemented with <a href="undocumented#BiCubic">Filter Quality BiCubic</a>. +Scales the image, with <a href='#SkPixmap_scalePixels_filterQuality'>filterQuality</a>, to match <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_width'>width</a> and <a href='#SkPixmap_scalePixels_dst'>dst</a>.<a href='#SkPixmap_height'>height</a>. +<a href='#SkPixmap_scalePixels_filterQuality'>filterQuality</a> <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a> is fastest, typically implemented with +<a href='undocumented#Nearest_Neighbor'>Filter Quality Nearest Neighbor</a>. <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a> is typically implemented with +<a href='undocumented#Bilerp'>Filter Quality Bilerp</a>. <a href='undocumented#kMedium_SkFilterQuality'>kMedium_SkFilterQuality</a> is typically implemented with +<a href='undocumented#Bilerp'>Filter Quality Bilerp</a>, and <a href='undocumented#MipMap'>Filter Quality MipMap</a> when size is reduced. +<a href='undocumented#kHigh_SkFilterQuality'>kHigh_SkFilterQuality</a> is slowest, typically implemented with <a href='undocumented#BiCubic'>Filter Quality BiCubic</a>. ### Parameters -<table> <tr> <td><a name="SkPixmap_scalePixels_dst"> <code><strong>dst </strong></code> </a></td> <td> -<a href="SkImageInfo_Reference#Image_Info">Image Info</a> and pixel address to write to</td> - </tr> <tr> <td><a name="SkPixmap_scalePixels_filterQuality"> <code><strong>filterQuality </strong></code> </a></td> <td> -one of: <a href="undocumented#kNone_SkFilterQuality">kNone_SkFilterQuality</a>, <a href="undocumented#kLow_SkFilterQuality">kLow_SkFilterQuality</a>, -<a href="undocumented#kMedium_SkFilterQuality">kMedium_SkFilterQuality</a>, <a href="undocumented#kHigh_SkFilterQuality">kHigh_SkFilterQuality</a></td> +<table> <tr> <td><a name='SkPixmap_scalePixels_dst'><code><strong>dst</strong></code></a></td> + <td><a href='SkImageInfo_Reference#Image_Info'>Image Info</a> and pixel address to write to</td> + </tr> + <tr> <td><a name='SkPixmap_scalePixels_filterQuality'><code><strong>filterQuality</strong></code></a></td> + <td>one of: <a href='undocumented#kNone_SkFilterQuality'>kNone_SkFilterQuality</a>, <a href='undocumented#kLow_SkFilterQuality'>kLow_SkFilterQuality</a>, +<a href='undocumented#kMedium_SkFilterQuality'>kMedium_SkFilterQuality</a>, <a href='undocumented#kHigh_SkFilterQuality'>kHigh_SkFilterQuality</a></td> </tr> </table> ### Return Value -true if pixels are scaled to fit <a href="#SkPixmap_scalePixels_dst">dst</a> +true if pixels are scaled to fit <a href='#SkPixmap_scalePixels_dst'>dst</a> ### Example @@ -1934,27 +2154,28 @@ true if pixels are scaled to fit <a href="#SkPixmap_scalePixels_dst">dst</a> ### See Also -<a href="SkCanvas_Reference#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="SkImage_Reference#SkImage_scalePixels">SkImage::scalePixels</a> +<a href='SkCanvas_Reference#SkCanvas_drawBitmap'>SkCanvas::drawBitmap</a> <a href='SkImage_Reference#SkImage_scalePixels'>SkImage::scalePixels</a> --- -<a name="SkPixmap_erase"></a> +<a name='SkPixmap_erase'></a> ## erase -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool erase(SkColor color, const SkIRect& subset) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_erase'>erase</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> color, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& subset) const </pre> -Writes <a href="#SkPixmap_erase_color">color</a> to pixels bounded by <a href="#SkPixmap_erase_subset">subset</a>; returns true on success. -Returns false if <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, or if <a href="#SkPixmap_erase_subset">subset</a> does -not intersect <a href="#SkPixmap_bounds">bounds</a>. +Writes <a href='#SkPixmap_erase_color'>color</a> to pixels bounded by <a href='#SkPixmap_erase_subset'>subset</a>; returns true on success. +Returns false if <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, or if <a href='#SkPixmap_erase_subset'>subset</a> does +not intersect <a href='#SkPixmap_bounds'>bounds</a>. ### Parameters -<table> <tr> <td><a name="SkPixmap_erase_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> to write</td> - </tr> <tr> <td><a name="SkPixmap_erase_subset"> <code><strong>subset </strong></code> </a></td> <td> -bounding integer <a href="SkRect_Reference#Rect">Rect</a> of written pixels</td> +<table> <tr> <td><a name='SkPixmap_erase_color'><code><strong>color</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a> to write</td> + </tr> + <tr> <td><a name='SkPixmap_erase_subset'><code><strong>subset</strong></code></a></td> + <td>bounding integer <a href='SkRect_Reference#Rect'>Rect</a> of written pixels</td> </tr> </table> @@ -1968,24 +2189,24 @@ true if pixels are changed ### See Also -<a href="SkBitmap_Reference#SkBitmap_erase">SkBitmap::erase</a> <a href="SkCanvas_Reference#SkCanvas_clear">SkCanvas::clear</a> <a href="SkCanvas_Reference#SkCanvas_drawColor">SkCanvas::drawColor</a> +<a href='SkBitmap_Reference#SkBitmap_erase'>SkBitmap::erase</a> <a href='SkCanvas_Reference#SkCanvas_clear'>SkCanvas::clear</a> <a href='SkCanvas_Reference#SkCanvas_drawColor'>SkCanvas::drawColor</a> --- -<a name="SkPixmap_erase_2"></a> +<a name='SkPixmap_erase_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool erase(SkColor color) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_erase'>erase</a>(<a href='SkColor_Reference#SkColor'>SkColor</a> color) const </pre> -Writes <a href="#SkPixmap_erase_2_color">color</a> to pixels inside <a href="#SkPixmap_bounds">bounds</a>; returns true on success. -Returns false if <a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, or if <a href="#SkPixmap_bounds">bounds</a> +Writes <a href='#SkPixmap_erase_2_color'>color</a> to pixels inside <a href='#SkPixmap_bounds'>bounds</a>; returns true on success. +Returns false if <a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, or if <a href='#SkPixmap_bounds'>bounds</a> is empty. ### Parameters -<table> <tr> <td><a name="SkPixmap_erase_2_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> to write</td> +<table> <tr> <td><a name='SkPixmap_erase_2_color'><code><strong>color</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a> to write</td> </tr> </table> @@ -1999,27 +2220,28 @@ true if pixels are changed ### See Also -<a href="SkBitmap_Reference#SkBitmap_erase">SkBitmap::erase</a> <a href="SkCanvas_Reference#SkCanvas_clear">SkCanvas::clear</a> <a href="SkCanvas_Reference#SkCanvas_drawColor">SkCanvas::drawColor</a> +<a href='SkBitmap_Reference#SkBitmap_erase'>SkBitmap::erase</a> <a href='SkCanvas_Reference#SkCanvas_clear'>SkCanvas::clear</a> <a href='SkCanvas_Reference#SkCanvas_drawColor'>SkCanvas::drawColor</a> --- -<a name="SkPixmap_erase_3"></a> +<a name='SkPixmap_erase_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixmap_erase'>erase</a>(const <a href='SkColor4f_Reference#SkColor4f'>SkColor4f</a>& color, const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>* subset = nullptr) const </pre> -Writes <a href="#SkPixmap_erase_3_color">color</a> to pixels bounded by <a href="#SkPixmap_erase_3_subset">subset</a>; returns true on success. -if <a href="#SkPixmap_erase_3_subset">subset</a> is nullptr, writes colors pixels inside <a href="#SkPixmap_bounds">bounds</a>. Returns false if -<a href="#SkPixmap_colorType">colorType</a> is <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, if <a href="#SkPixmap_erase_3_subset">subset</a> is not nullptr and does -not intersect <a href="#SkPixmap_bounds">bounds</a>, or if <a href="#SkPixmap_erase_3_subset">subset</a> is nullptr and <a href="#SkPixmap_bounds">bounds</a> is empty. +Writes <a href='#SkPixmap_erase_3_color'>color</a> to pixels bounded by <a href='#SkPixmap_erase_3_subset'>subset</a>; returns true on success. +if <a href='#SkPixmap_erase_3_subset'>subset</a> is nullptr, writes colors pixels inside <a href='#SkPixmap_bounds'>bounds</a>. Returns false if +<a href='#SkPixmap_colorType'>colorType</a> is <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, if <a href='#SkPixmap_erase_3_subset'>subset</a> is not nullptr and does +not intersect <a href='#SkPixmap_bounds'>bounds</a>, or if <a href='#SkPixmap_erase_3_subset'>subset</a> is nullptr and <a href='#SkPixmap_bounds'>bounds</a> is empty. ### Parameters -<table> <tr> <td><a name="SkPixmap_erase_3_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiply">Unpremultiplied</a> <a href="SkColor_Reference#Color">Color</a> to write</td> - </tr> <tr> <td><a name="SkPixmap_erase_3_subset"> <code><strong>subset </strong></code> </a></td> <td> -bounding integer <a href="SkRect_Reference#Rect">Rect</a> of pixels to write; may be nullptr</td> +<table> <tr> <td><a name='SkPixmap_erase_3_color'><code><strong>color</strong></code></a></td> + <td><a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a> to write</td> + </tr> + <tr> <td><a name='SkPixmap_erase_3_subset'><code><strong>subset</strong></code></a></td> + <td>bounding integer <a href='SkRect_Reference#Rect'>Rect</a> of pixels to write; may be nullptr</td> </tr> </table> @@ -2033,7 +2255,7 @@ true if pixels are changed ### See Also -<a href="SkBitmap_Reference#SkBitmap_erase">SkBitmap::erase</a> <a href="SkCanvas_Reference#SkCanvas_clear">SkCanvas::clear</a> <a href="SkCanvas_Reference#SkCanvas_drawColor">SkCanvas::drawColor</a> +<a href='SkBitmap_Reference#SkBitmap_erase'>SkBitmap::erase</a> <a href='SkCanvas_Reference#SkCanvas_clear'>SkCanvas::clear</a> <a href='SkCanvas_Reference#SkCanvas_drawColor'>SkCanvas::drawColor</a> --- diff --git a/site/user/api/SkPoint_Reference.md b/site/user/api/SkPoint_Reference.md index 7362d95d51..064bfd8068 100644 --- a/site/user/api/SkPoint_Reference.md +++ b/site/user/api/SkPoint_Reference.md @@ -1,105 +1,282 @@ SkPoint Reference === -# <a name="Point"></a> Point - -## <a name="Overview"></a> Overview - -## <a name="Overview_Subtopic"></a> Overview Subtopic - -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkPoint">SkPoint</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Member">Member</a> | member values | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | - -# <a name="SkPoint"></a> Struct SkPoint -<a href="#SkPoint">SkPoint</a> holds two 32 bit floating point coordinates. - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#SkPoint_Offset">Offset</a> | moves sides | -| <a href="#Property">Property</a> | member values | -| <a href="#Set">Set</a> | replaces all values | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkPoint_CrossProduct">CrossProduct</a> | returns cross product | -| <a href="#SkPoint_Distance">Distance</a> | returns straight-line distance between points | -| <a href="#SkPoint_DotProduct">DotProduct</a> | returns dot product | -| <a href="#SkPoint_Length">Length</a> | returns straight-line distance to origin | -| <a href="#SkPoint_Make">Make</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> inputs | -| <a href="#SkPoint_Normalize">Normalize</a> | sets length to one, and returns prior length | -| <a href="#SkPoint_Offset">Offset</a> | translates <a href="#Point">Point</a> array | -| <a href="#SkPoint_cross">cross</a> | returns cross product | -| <a href="#SkPoint_distanceToOrigin">distanceToOrigin</a> | returns straight-line distance to origin | -| <a href="#SkPoint_dot">dot</a> | returns dot product | -| <a href="#SkPoint_equals">equals</a> | returns true if <a href="#Point">Points</a> are equal | -| <a href="#SkPoint_isFinite">isFinite</a> | returns true if no member is infinite or NaN | -| <a href="#SkPoint_isZero">isZero</a> | returns true if both members equal zero | -| <a href="#SkPoint_iset">iset</a> | sets to integer input | -| <a href="#SkPoint_length">length</a> | returns straight-line distance to origin | -| <a href="#SkPoint_negate">negate</a> | reverses the sign of both members | -| <a href="#SkPoint_normalize">normalize</a> | sets length to one, preserving direction | -| <a href="#SkPoint_offset">offset</a> | translates <a href="#Point">Point</a> | -| <a href="#SkPoint_scale">scale</a> | multiplies <a href="#Point">Point</a> by scale factor | -| <a href="#SkPoint_set">set</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input | -| <a href="#SkPoint_setAbs">setAbs</a> | sets sign of both members to positive | -| <a href="#SkPoint_setLength">setLength</a> | sets straight-line distance to origin | -| <a href="#SkPoint_setNormalize">setNormalize</a> | sets length to one, in direction of (x, y) | -| <a href="#SkPoint_x">x</a> | returns <a href="#SkPoint_fX">fX</a> | -| <a href="#SkPoint_y">y</a> | returns <a href="#SkPoint_fY">fY</a> | - -## <a name="Member"></a> Member - -| name | description | -| --- | --- | -| <a href="#SkPoint_fX">fX</a> | x-axis value | -| <a href="#SkPoint_fY">fY</a> | y-axis value | - -<a name="SkPoint_fX"> <code><strong>SkScalar fX</strong></code> </a> - -x-axis value used by both <a href="#Point">Point</a> and <a href="#Vector">Vector</a>. May contain any value, including -infinities and NaN. +# <a name='Point'>Point</a> + +# <a name='SkPoint'>Struct SkPoint</a> + +## <a name='Typedef'>Typedef</a> + + +SkPoint <code>typedef</code> define a data type. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> +</table> +<a href='#SkPoint'>SkPoint</a> holds two 32-bit floating point coordinates. + +## Overview + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkPoint'>SkPoint</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkPoint global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves sides</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Vector'>Vector</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>alias for <a href='#Point'>Point</a></td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> -<a name="SkPoint_fY"> <code><strong>SkScalar fY</strong></code> </a> -y-axis value used by both <a href="#Point">Point</a> and <a href="#Vector">Vector</a>. May contain any value, including +SkPoint member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_CrossProduct'>CrossProduct</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Distance'>Distance</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance between points</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_DotProduct'>DotProduct</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Length'>Length</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> inputs</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Normalize'>Normalize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, and returns prior length</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_cross'>cross</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_dot'>dot</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_equals'>equals</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Points</a> are equal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no member is infinite or NaN</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isZero'>isZero</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset'>iset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_length'>length</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_negate'>negate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses the sign of both members</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_normalize'>normalize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, preserving direction</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale'>scale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Point'>Point</a> by scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setAbs'>setAbs</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets sign of both members to positive</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength'>setLength</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets straight-line distance to origin</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setNormalize'>setNormalize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, in direction of (x, y)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fY'>fY</a></td> + </tr> +</table> + + +## <a name='Member'>Member</a> + + + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fX'><code>fX</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fY'><code>fY</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td> + </tr> +</table> + + +SkPoint members may be read and written directly without using a member function. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_fX'>fX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>x-axis value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_fY'>fY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>y-axis value</td> + </tr> +</table> + + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPoint_fX'><code>fX</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +x-axis value used by both <a href='#Point'>Point</a> and <a href='#Vector'>Vector</a>. May contain any value, including +infinities and NaN. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPoint_fY'><code>fY</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +y-axis value used by both <a href='#Point'>Point</a> and <a href='#Vector'>Vector</a>. May contain any value, including infinities and NaN. +</td> + </tr> + -## <a name="Constructor"></a> Constructor +## <a name='Constructor'>Constructor</a> -| name | description | -| --- | --- | -| <a href="#SkPoint_Make">Make</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> inputs | -<a name="SkPoint_Make"></a> +SkPoint can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> inputs</td> + </tr> +</table> + + +<a name='SkPoint_Make'></a> ## Make -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkPoint Make(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkPoint'>SkPoint</a> <a href='#SkPoint_Make'>Make</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Sets <a href="#SkPoint_fX">fX</a> to x, <a href="#SkPoint_fY">fY</a> to y. Used both to set <a href="#Point">Point</a> and <a href="#Vector">Vector</a>. +Sets <a href='#SkPoint_fX'>fX</a> to x, <a href='#SkPoint_fY'>fY</a> to y. Used both to set <a href='#Point'>Point</a> and <a href='#Vector'>Vector</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_Make_x"> <code><strong>x </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> x-axis value of constructed <a href="#Point">Point</a> or <a href="#Vector">Vector</a></td> - </tr> <tr> <td><a name="SkPoint_Make_y"> <code><strong>y </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> y-axis value of constructed <a href="#Point">Point</a> or <a href="#Vector">Vector</a></td> +<table> <tr> <td><a name='SkPoint_Make_x'><code><strong>x</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> x-axis value of constructed <a href='#Point'>Point</a> or <a href='#Vector'>Vector</a></td> + </tr> + <tr> <td><a name='SkPoint_Make_y'><code><strong>y</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> y-axis value of constructed <a href='#Point'>Point</a> or <a href='#Vector'>Vector</a></td> </tr> </table> ### Return Value -<a href="#Point">Point</a> (x, y) +<a href='#Point'>Point</a> (x, y) ### Example @@ -115,35 +292,63 @@ all equal ### See Also -<a href="#SkPoint_set">set</a> <a href="#SkPoint_iset">iset</a><sup><a href="#SkPoint_iset_2">[2]</a></sup> <a href="SkIPoint_Reference#SkIPoint_Make">SkIPoint::Make</a> +<a href='#SkPoint_set'>set</a> <a href='#SkPoint_iset'>iset</a><sup><a href='#SkPoint_iset_2'>[2]</a></sup> <a href='SkIPoint_Reference#SkIPoint_Make'>SkIPoint::Make</a> --- -## <a name="Property"></a> Property +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Distance'>Distance</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance between points</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Length'>Length</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no member is infinite or NaN</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_isZero'>isZero</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if both members equal zero</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_length'>length</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns straight-line distance to origin</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkPoint_fY'>fY</a></td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkPoint_Distance">Distance</a> | returns straight-line distance between points | -| <a href="#SkPoint_Length">Length</a> | returns straight-line distance to origin | -| <a href="#SkPoint_distanceToOrigin">distanceToOrigin</a> | returns straight-line distance to origin | -| <a href="#SkPoint_isFinite">isFinite</a> | returns true if no member is infinite or NaN | -| <a href="#SkPoint_isZero">isZero</a> | returns true if both members equal zero | -| <a href="#SkPoint_length">length</a> | returns straight-line distance to origin | -| <a href="#SkPoint_x">x</a> | returns <a href="#SkPoint_fX">fX</a> | -| <a href="#SkPoint_y">y</a> | returns <a href="#SkPoint_fY">fY</a> | -<a name="SkPoint_x"></a> +<a name='SkPoint_x'></a> ## x -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar x() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_x'>x</a>() const </pre> -Returns x-axis value of <a href="#Point">Point</a> or <a href="#Vector">Vector</a>. +Returns x-axis value of <a href='#Point'>Point</a> or <a href='#Vector'>Vector</a>. ### Return Value -<a href="#SkPoint_fX">fX</a> +<a href='#SkPoint_fX'>fX</a> ### Example @@ -159,22 +364,22 @@ pt1.fX == pt1.x() ### See Also -<a href="#SkPoint_y">y</a> <a href="SkIPoint_Reference#SkIPoint_x">SkIPoint::x()</a> +<a href='#SkPoint_y'>y</a> <a href='SkIPoint_Reference#SkIPoint_x'>SkIPoint::x()</a> --- -<a name="SkPoint_y"></a> +<a name='SkPoint_y'></a> ## y -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar y() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_y'>y</a>() const </pre> -Returns y-axis value of <a href="#Point">Point</a> or <a href="#Vector">Vector</a>. +Returns y-axis value of <a href='#Point'>Point</a> or <a href='#Vector'>Vector</a>. ### Return Value -<a href="#SkPoint_fY">fY</a> +<a href='#SkPoint_fY'>fY</a> ### Example @@ -190,22 +395,22 @@ pt1.fY == pt1.y() ### See Also -<a href="#SkPoint_x">x</a> <a href="SkIPoint_Reference#SkIPoint_y">SkIPoint::y()</a> +<a href='#SkPoint_x'>x</a> <a href='SkIPoint_Reference#SkIPoint_y'>SkIPoint::y()</a> --- -<a name="SkPoint_isZero"></a> +<a name='SkPoint_isZero'></a> ## isZero -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isZero() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_isZero'>isZero</a>() const </pre> -Returns true if <a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_fY">fY</a> are both zero. +Returns true if <a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a> are both zero. ### Return Value -true if <a href="#SkPoint_fX">fX</a> is zero and <a href="#SkPoint_fY">fY</a> is zero +true if <a href='#SkPoint_fX'>fX</a> is zero and <a href='#SkPoint_fY'>fY</a> is zero ### Example @@ -222,40 +427,75 @@ pt.isZero() == true ### See Also -<a href="#SkPoint_isFinite">isFinite</a> <a href="SkIPoint_Reference#SkIPoint_isZero">SkIPoint::isZero</a> +<a href='#SkPoint_isFinite'>isFinite</a> <a href='SkIPoint_Reference#SkIPoint_isZero'>SkIPoint::isZero</a> --- -## <a name="Set"></a> Set - -| name | description | -| --- | --- | -| <a href="#SkPoint_iset">iset</a> | sets to integer input | -| | <a href="#SkPoint_iset">iset(int32 t x, int32 t y)</a> | -| | <a href="#SkPoint_iset_2">iset(const SkIPoint& p)</a> | -| <a href="#SkPoint_normalize">normalize</a> | sets length to one, preserving direction | -| <a href="#SkPoint_set">set</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input | -| <a href="#SkPoint_setAbs">setAbs</a> | sets sign of both members to positive | -| <a href="#SkPoint_setLength">setLength</a> | sets straight-line distance to origin | -| | <a href="#SkPoint_setLength">setLength(SkScalar length)</a> | -| | <a href="#SkPoint_setLength_2">setLength(SkScalar x, SkScalar y, SkScalar length)</a> | -| <a href="#SkPoint_setNormalize">setNormalize</a> | sets length to one, in direction of (x, y) | - -<a name="SkPoint_set"></a> +## <a name='Set'>Set</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset'>iset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to integer input</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset'>iset(int32 t x, int32 t y)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_iset_2'>iset(const SkIPoint& p)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_normalize'>normalize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, preserving direction</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setAbs'>setAbs</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets sign of both members to positive</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength'>setLength</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets straight-line distance to origin</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength'>setLength(SkScalar length)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setLength_2'>setLength(SkScalar x, SkScalar y, SkScalar length)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_setNormalize'>setNormalize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, in direction of (x, y)</td> + </tr> +</table> + + +<a name='SkPoint_set'></a> ## set -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_set'>set</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Sets <a href="#SkPoint_fX">fX</a> to x and <a href="#SkPoint_fY">fY</a> to y. +Sets <a href='#SkPoint_fX'>fX</a> to x and <a href='#SkPoint_fY'>fY</a> to y. ### Parameters -<table> <tr> <td><a name="SkPoint_set_x"> <code><strong>x </strong></code> </a></td> <td> -new value for <a href="#SkPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkPoint_set_y"> <code><strong>y </strong></code> </a></td> <td> -new value for <a href="#SkPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkPoint_set_x'><code><strong>x</strong></code></a></td> + <td>new value for <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkPoint_set_y'><code><strong>y</strong></code></a></td> + <td>new value for <a href='#SkPoint_fY'>fY</a></td> </tr> </table> @@ -273,29 +513,30 @@ pt1 == pt2 ### See Also -<a href="#SkPoint_iset">iset</a><sup><a href="#SkPoint_iset_2">[2]</a></sup> <a href="#SkPoint_Make">Make</a> +<a href='#SkPoint_iset'>iset</a><sup><a href='#SkPoint_iset_2'>[2]</a></sup> <a href='#SkPoint_Make'>Make</a> --- -<a name="SkPoint_iset"></a> +<a name='SkPoint_iset'></a> ## iset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void iset(int32_t x, int32_t y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_iset'>iset</a>(int32_t x, int32_t y) </pre> -Sets <a href="#SkPoint_fX">fX</a> to x and <a href="#SkPoint_fY">fY</a> to y, promoting integers to <a href="undocumented#SkScalar">SkScalar</a> values. +Sets <a href='#SkPoint_fX'>fX</a> to x and <a href='#SkPoint_fY'>fY</a> to y, promoting integers to <a href='undocumented#SkScalar'>SkScalar</a> values. -Assigning a large integer value directly to <a href="#SkPoint_fX">fX</a> or <a href="#SkPoint_fY">fY</a> may cause a compiler -error, triggered by narrowing conversion of int to <a href="undocumented#SkScalar">SkScalar</a>. This safely +Assigning a large integer value directly to <a href='#SkPoint_fX'>fX</a> or <a href='#SkPoint_fY'>fY</a> may cause a compiler +error, triggered by narrowing conversion of int to <a href='undocumented#SkScalar'>SkScalar</a>. This safely casts x and y to avoid the error. ### Parameters -<table> <tr> <td><a name="SkPoint_iset_x"> <code><strong>x </strong></code> </a></td> <td> -new value for <a href="#SkPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkPoint_iset_y"> <code><strong>y </strong></code> </a></td> <td> -new value for <a href="#SkPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkPoint_iset_x'><code><strong>x</strong></code></a></td> + <td>new value for <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkPoint_iset_y'><code><strong>y</strong></code></a></td> + <td>new value for <a href='#SkPoint_fY'>fY</a></td> </tr> </table> @@ -305,26 +546,26 @@ new value for <a href="#SkPoint_fY">fY</a></td> ### See Also -<a href="#SkPoint_set">set</a> <a href="#SkPoint_Make">Make</a> <a href="SkIPoint_Reference#SkIPoint_set">SkIPoint::set</a> +<a href='#SkPoint_set'>set</a> <a href='#SkPoint_Make'>Make</a> <a href='SkIPoint_Reference#SkIPoint_set'>SkIPoint::set</a> --- -<a name="SkPoint_iset_2"></a> +<a name='SkPoint_iset_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void iset(const SkIPoint& p) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_iset'>iset</a>(const <a href='SkIPoint_Reference#SkIPoint'>SkIPoint</a>& p) </pre> -Sets <a href="#SkPoint_fX">fX</a> to <a href="#SkPoint_iset_2_p">p</a>.<a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_fY">fY</a> to <a href="#SkPoint_iset_2_p">p</a>.<a href="#SkPoint_fY">fY</a>, promoting integers to <a href="undocumented#SkScalar">SkScalar</a> values. +Sets <a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_iset_2_p'>p</a>.<a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a> to <a href='#SkPoint_iset_2_p'>p</a>.<a href='#SkPoint_fY'>fY</a>, promoting integers to <a href='undocumented#SkScalar'>SkScalar</a> values. -Assigning an <a href="SkIPoint_Reference#IPoint">IPoint</a> containing a large integer value directly to <a href="#SkPoint_fX">fX</a> or <a href="#SkPoint_fY">fY</a> may -cause a compiler error, triggered by narrowing conversion of int to <a href="undocumented#SkScalar">SkScalar</a>. -This safely casts <a href="#SkPoint_iset_2_p">p</a>.<a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_iset_2_p">p</a>.<a href="#SkPoint_fY">fY</a> to avoid the error. +Assigning an <a href='SkIPoint_Reference#IPoint'>IPoint</a> containing a large integer value directly to <a href='#SkPoint_fX'>fX</a> or <a href='#SkPoint_fY'>fY</a> may +cause a compiler error, triggered by narrowing conversion of int to <a href='undocumented#SkScalar'>SkScalar</a>. +This safely casts <a href='#SkPoint_iset_2_p'>p</a>.<a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_iset_2_p'>p</a>.<a href='#SkPoint_fY'>fY</a> to avoid the error. ### Parameters -<table> <tr> <td><a name="SkPoint_iset_2_p"> <code><strong>p </strong></code> </a></td> <td> -<a href="SkIPoint_Reference#IPoint">IPoint</a> members promoted to <a href="undocumented#SkScalar">SkScalar</a></td> +<table> <tr> <td><a name='SkPoint_iset_2_p'><code><strong>p</strong></code></a></td> + <td><a href='SkIPoint_Reference#IPoint'>IPoint</a> members promoted to <a href='undocumented#SkScalar'>SkScalar</a></td> </tr> </table> @@ -343,23 +584,23 @@ fPt: -2.14748e+09, 2.14748e+09 ### See Also -<a href="#SkPoint_set">set</a> <a href="#SkPoint_Make">Make</a> <a href="SkIPoint_Reference#SkIPoint_set">SkIPoint::set</a> +<a href='#SkPoint_set'>set</a> <a href='#SkPoint_Make'>Make</a> <a href='SkIPoint_Reference#SkIPoint_set'>SkIPoint::set</a> --- -<a name="SkPoint_setAbs"></a> +<a name='SkPoint_setAbs'></a> ## setAbs -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setAbs(const SkPoint& pt) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_setAbs'>setAbs</a>(const <a href='#SkPoint'>SkPoint</a>& pt) </pre> -Sets <a href="#SkPoint_fX">fX</a> to absolute value of <a href="#SkPoint_setAbs_pt">pt</a>.<a href="#SkPoint_fX">fX</a>; and <a href="#SkPoint_fY">fY</a> to absolute value of <a href="#SkPoint_setAbs_pt">pt</a>.<a href="#SkPoint_fY">fY</a>. +Sets <a href='#SkPoint_fX'>fX</a> to absolute value of <a href='#SkPoint_setAbs_pt'>pt</a>.<a href='#SkPoint_fX'>fX</a>; and <a href='#SkPoint_fY'>fY</a> to absolute value of <a href='#SkPoint_setAbs_pt'>pt</a>.<a href='#SkPoint_fY'>fY</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_setAbs_pt"> <code><strong>pt </strong></code> </a></td> <td> -members providing magnitude for <a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkPoint_setAbs_pt'><code><strong>pt</strong></code></a></td> + <td>members providing magnitude for <a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a></td> </tr> </table> @@ -380,40 +621,70 @@ pt: nan, -nan abs: nan, nan ### See Also -<a href="#SkPoint_set">set</a> <a href="#SkPoint_Make">Make</a> <a href="#SkPoint_negate">negate</a> +<a href='#SkPoint_set'>set</a> <a href='#SkPoint_Make'>Make</a> <a href='#SkPoint_negate'>negate</a> --- -## <a name="Offset"></a> Offset +## <a name='Offset'>Offset</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Normalize'>Normalize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets length to one, and returns prior length</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset'>Offset(SkPoint points[], int count, const SkVector& offset)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_Offset_2'>Offset(SkPoint points[], int count, SkScalar dx, SkScalar dy)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates <a href='#Point'>Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale'>scale</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Point'>Point</a> by scale factor</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale'>scale(SkScalar scale, SkPoint* dst)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_scale_2'>scale(SkScalar value)</a></td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkPoint_Normalize">Normalize</a> | sets length to one, and returns prior length | -| <a href="#SkPoint_Offset">Offset</a> | translates <a href="#Point">Point</a> array | -| | <a href="#SkPoint_Offset">Offset(SkPoint points[], int count, const SkVector& offset)</a> | -| | <a href="#SkPoint_Offset_2">Offset(SkPoint points[], int count, SkScalar dx, SkScalar dy)</a> | -| <a href="#SkPoint_offset">offset</a> | translates <a href="#Point">Point</a> | -| <a href="#SkPoint_scale">scale</a> | multiplies <a href="#Point">Point</a> by scale factor | -| | <a href="#SkPoint_scale">scale(SkScalar scale, SkPoint* dst)</a> const | -| | <a href="#SkPoint_scale_2">scale(SkScalar value)</a> | -<a name="SkPoint_Offset"></a> +<a name='SkPoint_Offset'></a> ## Offset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static void Offset(SkPoint points[], int count, const SkVector& offset) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static void <a href='#SkPoint_Offset'>Offset</a>(<a href='#SkPoint'>SkPoint</a> points[], int count, const <a href='#SkVector'>SkVector</a>& offset) </pre> -Adds offset to each <a href="#Point">Point</a> in <a href="#SkPoint_Offset_points">points</a> array with <a href="#SkPoint_Offset_count">count</a> entries. +Adds offset to each <a href='#Point'>Point</a> in <a href='#SkPoint_Offset_points'>points</a> array with <a href='#SkPoint_Offset_count'>count</a> entries. ### Parameters -<table> <tr> <td><a name="SkPoint_Offset_points"> <code><strong>points </strong></code> </a></td> <td> -<a href="#Point">Point</a> array</td> - </tr> <tr> <td><a name="SkPoint_Offset_count"> <code><strong>count </strong></code> </a></td> <td> -entries in array</td> - </tr> <tr> <td><a name="SkPoint_Offset_offset"> <code><strong>offset </strong></code> </a></td> <td> -<a href="#Vector">Vector</a> added to <a href="#SkPoint_Offset_points">points</a></td> +<table> <tr> <td><a name='SkPoint_Offset_points'><code><strong>points</strong></code></a></td> + <td><a href='#Point'>Point</a> array</td> + </tr> + <tr> <td><a name='SkPoint_Offset_count'><code><strong>count</strong></code></a></td> + <td>entries in array</td> + </tr> + <tr> <td><a name='SkPoint_Offset_offset'><code><strong>offset</strong></code></a></td> + <td><a href='#Vector'>Vector</a> added to <a href='#SkPoint_Offset_points'>points</a></td> </tr> </table> @@ -423,28 +694,31 @@ entries in array</td> ### See Also -<a href="#SkPoint_offset">offset</a> <a href="#SkPoint_addto_operator">operator+=(const SkVector& v)</a> +<a href='#SkPoint_offset'>offset</a> <a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> --- -<a name="SkPoint_Offset_2"></a> +<a name='SkPoint_Offset_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static void Offset(SkPoint points[], int count, SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static void <a href='#SkPoint_Offset'>Offset</a>(<a href='#SkPoint'>SkPoint</a> points[], int count, <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Adds offset (<a href="#SkPoint_Offset_2_dx">dx</a>, <a href="#SkPoint_Offset_2_dy">dy</a>) to each <a href="#Point">Point</a> in <a href="#SkPoint_Offset_2_points">points</a> array of length <a href="#SkPoint_Offset_2_count">count</a>. +Adds offset (<a href='#SkPoint_Offset_2_dx'>dx</a>, <a href='#SkPoint_Offset_2_dy'>dy</a>) to each <a href='#Point'>Point</a> in <a href='#SkPoint_Offset_2_points'>points</a> array of length <a href='#SkPoint_Offset_2_count'>count</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_Offset_2_points"> <code><strong>points </strong></code> </a></td> <td> -<a href="#Point">Point</a> array</td> - </tr> <tr> <td><a name="SkPoint_Offset_2_count"> <code><strong>count </strong></code> </a></td> <td> -entries in array</td> - </tr> <tr> <td><a name="SkPoint_Offset_2_dx"> <code><strong>dx </strong></code> </a></td> <td> -added to <a href="#SkPoint_fX">fX</a> in <a href="#SkPoint_Offset_2_points">points</a></td> - </tr> <tr> <td><a name="SkPoint_Offset_2_dy"> <code><strong>dy </strong></code> </a></td> <td> -added to <a href="#SkPoint_fY">fY</a> in <a href="#SkPoint_Offset_2_points">points</a></td> +<table> <tr> <td><a name='SkPoint_Offset_2_points'><code><strong>points</strong></code></a></td> + <td><a href='#Point'>Point</a> array</td> + </tr> + <tr> <td><a name='SkPoint_Offset_2_count'><code><strong>count</strong></code></a></td> + <td>entries in array</td> + </tr> + <tr> <td><a name='SkPoint_Offset_2_dx'><code><strong>dx</strong></code></a></td> + <td>added to <a href='#SkPoint_fX'>fX</a> in <a href='#SkPoint_Offset_2_points'>points</a></td> + </tr> + <tr> <td><a name='SkPoint_Offset_2_dy'><code><strong>dy</strong></code></a></td> + <td>added to <a href='#SkPoint_fY'>fY</a> in <a href='#SkPoint_Offset_2_points'>points</a></td> </tr> </table> @@ -454,25 +728,26 @@ added to <a href="#SkPoint_fY">fY</a> in <a href="#SkPoint_Offset_2_points">poin ### See Also -<a href="#SkPoint_offset">offset</a> <a href="#SkPoint_addto_operator">operator+=(const SkVector& v)</a> +<a href='#SkPoint_offset'>offset</a> <a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> --- -<a name="SkPoint_offset"></a> +<a name='SkPoint_offset'></a> ## offset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Adds offset (<a href="#SkPoint_offset_dx">dx</a>, <a href="#SkPoint_offset_dy">dy</a>) to <a href="#Point">Point</a>. +Adds offset (<a href='#SkPoint_offset_dx'>dx</a>, <a href='#SkPoint_offset_dy'>dy</a>) to <a href='#Point'>Point</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_offset_dx"> <code><strong>dx </strong></code> </a></td> <td> -added to <a href="#SkPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkPoint_offset_dy"> <code><strong>dy </strong></code> </a></td> <td> -added to <a href="#SkPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkPoint_offset_dx'><code><strong>dx</strong></code></a></td> + <td>added to <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkPoint_offset_dy'><code><strong>dy</strong></code></a></td> + <td>added to <a href='#SkPoint_fY'>fY</a></td> </tr> </table> @@ -482,15 +757,15 @@ added to <a href="#SkPoint_fY">fY</a></td> ### See Also -<a href="#SkPoint_Offset">Offset</a><sup><a href="#SkPoint_Offset_2">[2]</a></sup> <a href="#SkPoint_addto_operator">operator+=(const SkVector& v)</a> +<a href='#SkPoint_Offset'>Offset</a><sup><a href='#SkPoint_Offset_2'>[2]</a></sup> <a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> --- -<a name="SkPoint_length"></a> +<a name='SkPoint_length'></a> ## length -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar length() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_length'>length</a>() const </pre> Returns the Euclidean_Distance from origin, computed as: @@ -511,15 +786,15 @@ straight-line distance to origin ### See Also -<a href="#SkPoint_distanceToOrigin">distanceToOrigin</a> <a href="#SkPoint_Length">Length</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> <a href="#SkPoint_Distance">Distance</a> +<a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a> <a href='#SkPoint_Length'>Length</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_Distance'>Distance</a> --- -<a name="SkPoint_distanceToOrigin"></a> +<a name='SkPoint_distanceToOrigin'></a> ## distanceToOrigin -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar distanceToOrigin() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a>() const </pre> Returns the Euclidean_Distance from origin, computed as: @@ -540,19 +815,19 @@ straight-line distance to origin ### See Also -<a href="#SkPoint_length">length</a> <a href="#SkPoint_Length">Length</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> <a href="#SkPoint_Distance">Distance</a> +<a href='#SkPoint_length'>length</a> <a href='#SkPoint_Length'>Length</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_Distance'>Distance</a> --- -<a name="SkPoint_normalize"></a> +<a name='SkPoint_normalize'></a> ## normalize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool normalize() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_normalize'>normalize</a>() </pre> -Scales (<a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_fY">fY</a>) so that <a href="#SkPoint_length">length</a> returns one, while preserving ratio of <a href="#SkPoint_fX">fX</a> to <a href="#SkPoint_fY">fY</a>, -if possible. If prior length is nearly zero, sets <a href="#Vector">Vector</a> to (0, 0) and returns +Scales (<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a>) so that <a href='#SkPoint_length'>length</a> returns one, while preserving ratio of <a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_fY'>fY</a>, +if possible. If prior length is nearly zero, sets <a href='#Vector'>Vector</a> to (0, 0) and returns false; otherwise returns true. ### Return Value @@ -565,27 +840,28 @@ true if former length is not zero or nearly zero ### See Also -<a href="#SkPoint_Normalize">Normalize</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> <a href="#SkPoint_length">length</a> <a href="#SkPoint_Length">Length</a> +<a href='#SkPoint_Normalize'>Normalize</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_length'>length</a> <a href='#SkPoint_Length'>Length</a> --- -<a name="SkPoint_setNormalize"></a> +<a name='SkPoint_setNormalize'></a> ## setNormalize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setNormalize(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_setNormalize'>setNormalize</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> -Sets <a href="#Vector">Vector</a> to (x, y) scaled so <a href="#SkPoint_length">length</a> returns one, and so that -(<a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_fY">fY</a>) is proportional to (x, y). If (x, y) length is nearly zero, -sets <a href="#Vector">Vector</a> to (0, 0) and returns false; otherwise returns true. +Sets <a href='#Vector'>Vector</a> to (x, y) scaled so <a href='#SkPoint_length'>length</a> returns one, and so that +(<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a>) is proportional to (x, y). If (x, y) length is nearly zero, +sets <a href='#Vector'>Vector</a> to (0, 0) and returns false; otherwise returns true. ### Parameters -<table> <tr> <td><a name="SkPoint_setNormalize_x"> <code><strong>x </strong></code> </a></td> <td> -proportional value for <a href="#SkPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkPoint_setNormalize_y"> <code><strong>y </strong></code> </a></td> <td> -proportional value for <a href="#SkPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkPoint_setNormalize_x'><code><strong>x</strong></code></a></td> + <td>proportional value for <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkPoint_setNormalize_y'><code><strong>y</strong></code></a></td> + <td>proportional value for <a href='#SkPoint_fY'>fY</a></td> </tr> </table> @@ -599,25 +875,25 @@ true if (x, y) length is not zero or nearly zero ### See Also -<a href="#SkPoint_normalize">normalize</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> +<a href='#SkPoint_normalize'>normalize</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> --- -<a name="SkPoint_setLength"></a> +<a name='SkPoint_setLength'></a> ## setLength -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setLength(SkScalar length) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_setLength'>setLength</a>(<a href='undocumented#SkScalar'>SkScalar</a> length) </pre> -Scales <a href="#Vector">Vector</a> so that <a href="#SkPoint_distanceToOrigin">distanceToOrigin</a> returns length, if possible. If former -length is nearly zero, sets <a href="#Vector">Vector</a> to (0, 0) and return false; otherwise returns +Scales <a href='#Vector'>Vector</a> so that <a href='#SkPoint_distanceToOrigin'>distanceToOrigin</a> returns length, if possible. If former +length is nearly zero, sets <a href='#Vector'>Vector</a> to (0, 0) and return false; otherwise returns true. ### Parameters -<table> <tr> <td><a name="SkPoint_setLength_length"> <code><strong>length </strong></code> </a></td> <td> -straight-line distance to origin</td> +<table> <tr> <td><a name='SkPoint_setLength_length'><code><strong>length</strong></code></a></td> + <td>straight-line distance to origin</td> </tr> </table> @@ -631,28 +907,30 @@ true if former length is not zero or nearly zero ### See Also -<a href="#SkPoint_length">length</a> <a href="#SkPoint_Length">Length</a> <a href="#SkPoint_setNormalize">setNormalize</a> <a href="#SkPoint_setAbs">setAbs</a> +<a href='#SkPoint_length'>length</a> <a href='#SkPoint_Length'>Length</a> <a href='#SkPoint_setNormalize'>setNormalize</a> <a href='#SkPoint_setAbs'>setAbs</a> --- -<a name="SkPoint_setLength_2"></a> +<a name='SkPoint_setLength_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setLength(SkScalar x, SkScalar y, SkScalar length) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_setLength'>setLength</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> length) </pre> -Sets <a href="#Vector">Vector</a> to (x, y) scaled to length, if possible. If former -length is nearly zero, sets <a href="#Vector">Vector</a> to (0, 0) and return false; otherwise returns +Sets <a href='#Vector'>Vector</a> to (x, y) scaled to length, if possible. If former +length is nearly zero, sets <a href='#Vector'>Vector</a> to (0, 0) and return false; otherwise returns true. ### Parameters -<table> <tr> <td><a name="SkPoint_setLength_2_x"> <code><strong>x </strong></code> </a></td> <td> -proportional value for <a href="#SkPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkPoint_setLength_2_y"> <code><strong>y </strong></code> </a></td> <td> -proportional value for <a href="#SkPoint_fY">fY</a></td> - </tr> <tr> <td><a name="SkPoint_setLength_2_length"> <code><strong>length </strong></code> </a></td> <td> -straight-line distance to origin</td> +<table> <tr> <td><a name='SkPoint_setLength_2_x'><code><strong>x</strong></code></a></td> + <td>proportional value for <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkPoint_setLength_2_y'><code><strong>y</strong></code></a></td> + <td>proportional value for <a href='#SkPoint_fY'>fY</a></td> + </tr> + <tr> <td><a name='SkPoint_setLength_2_length'><code><strong>length</strong></code></a></td> + <td>straight-line distance to origin</td> </tr> </table> @@ -666,45 +944,96 @@ true if (x, y) length is not zero or nearly zero ### See Also -<a href="#SkPoint_length">length</a> <a href="#SkPoint_Length">Length</a> <a href="#SkPoint_setNormalize">setNormalize</a> <a href="#SkPoint_setAbs">setAbs</a> +<a href='#SkPoint_length'>length</a> <a href='#SkPoint_Length'>Length</a> <a href='#SkPoint_setNormalize'>setNormalize</a> <a href='#SkPoint_setAbs'>setAbs</a> --- -## <a name="Operator"></a> Operator - -| name | description | -| --- | --- | -| <a href="#SkPoint_CrossProduct">CrossProduct</a> | returns cross product | -| <a href="#SkPoint_DotProduct">DotProduct</a> | returns dot product | -| <a href="#SkPoint_cross">cross</a> | returns cross product | -| <a href="#SkPoint_dot">dot</a> | returns dot product | -| <a href="#SkPoint_equals">equals</a> | returns true if <a href="#Point">Points</a> are equal | -| <a href="#SkPoint_negate">negate</a> | reverses the sign of both members | -| <a href="#SkPoint_notequal_operator">operator!=(const SkPoint& a, const SkPoint& b)</a> | returns true if <a href="#Point">Point</a> are unequal | -| <a href="#SkPoint_multiply_operator">operator*(SkScalar scale) const</a> | returns <a href="#Point">Point</a> multiplied by scale | -| <a href="#SkPoint_multiplyby_operator">operator*=(SkScalar scale)</a> | multiplies <a href="#Point">Point</a> by scale factor | -| <a href="#SkPoint_add_operator">operator+(const SkPoint& a, const SkVector& b)</a> | returns <a href="#Point">Point</a> offset by <a href="#Vector">Vector</a> | -| <a href="#SkPoint_addto_operator">operator+=(const SkVector& v)</a> | adds <a href="#Vector">Vector</a> to <a href="#Point">Point</a> | -| <a href="#SkPoint_minus_operator">operator-() const</a> | reverses sign of <a href="#Point">Point</a> | -| <a href="#SkPoint_subtract_operator">operator-(const SkPoint& a, const SkPoint& b)</a> | returns <a href="#Vector">Vector</a> between <a href="#Point">Points</a> | -| <a href="#SkPoint_subtractfrom_operator">operator-=(const SkVector& v)</a> | subtracts <a href="#Vector">Vector</a> from <a href="#Point">Point</a> | -| <a href="#SkPoint_equal_operator">operator==(const SkPoint& a, const SkPoint& b)</a> | returns true if <a href="#Point">Point</a> are equal | - -<a name="SkPoint_scale"></a> +## <a name='Operator'>Operator</a> + + +SkPoint operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_CrossProduct'>CrossProduct</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_DotProduct'>DotProduct</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_cross'>cross</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns cross product</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_dot'>dot</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns dot product</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_equals'>equals</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Points</a> are equal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_negate'>negate</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses the sign of both members</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Point</a> are unequal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Point'>Point</a> multiplied by scale</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>multiplies <a href='#Point'>Point</a> by scale factor</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Point'>Point</a> offset by <a href='#Vector'>Vector</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adds <a href='#Vector'>Vector</a> to <a href='#Point'>Point</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_minus_operator'>operator-() const</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reverses sign of <a href='#Point'>Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#Vector'>Vector</a> between <a href='#Point'>Points</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>subtracts <a href='#Vector'>Vector</a> from <a href='#Point'>Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='#Point'>Point</a> are equal</td> + </tr> +</table> + + +<a name='SkPoint_scale'></a> ## scale -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void scale(SkScalar scale, SkPoint* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_scale'>scale</a>(<a href='undocumented#SkScalar'>SkScalar</a> scale, <a href='#SkPoint'>SkPoint</a>* dst) const </pre> -Sets <a href="#SkPoint_scale_dst">dst</a> to <a href="#Point">Point</a> times scale. <a href="#SkPoint_scale_dst">dst</a> may be <a href="#Point">Point</a> to modify <a href="#Point">Point</a> in place. +Sets <a href='#SkPoint_scale_dst'>dst</a> to <a href='#Point'>Point</a> times scale. <a href='#SkPoint_scale_dst'>dst</a> may be <a href='#Point'>Point</a> to modify <a href='#Point'>Point</a> in place. ### Parameters -<table> <tr> <td><a name="SkPoint_scale_scale"> <code><strong>scale </strong></code> </a></td> <td> -factor to multiply <a href="#Point">Point</a> by</td> - </tr> <tr> <td><a name="SkPoint_scale_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for scaled <a href="#Point">Point</a></td> +<table> <tr> <td><a name='SkPoint_scale_scale'><code><strong>scale</strong></code></a></td> + <td>factor to multiply <a href='#Point'>Point</a> by</td> + </tr> + <tr> <td><a name='SkPoint_scale_dst'><code><strong>dst</strong></code></a></td> + <td>storage for scaled <a href='#Point'>Point</a></td> </tr> </table> @@ -714,22 +1043,22 @@ storage for scaled <a href="#Point">Point</a></td> ### See Also -<a href="#SkPoint_multiply_operator">operator*(SkScalar scale) const</a> <a href="#SkPoint_multiplyby_operator">operator*=(SkScalar scale)</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> +<a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a> <a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> --- -<a name="SkPoint_scale_2"></a> +<a name='SkPoint_scale_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void scale(SkScalar value) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_scale'>scale</a>(<a href='undocumented#SkScalar'>SkScalar</a> value) </pre> -Scales <a href="#Point">Point</a> in place by scale. +Scales <a href='#Point'>Point</a> in place by scale. ### Parameters -<table> <tr> <td><a name="SkPoint_scale_2_value"> <code><strong>value </strong></code> </a></td> <td> -factor to multiply <a href="#Point">Point</a> by</td> +<table> <tr> <td><a name='SkPoint_scale_2_value'><code><strong>value</strong></code></a></td> + <td>factor to multiply <a href='#Point'>Point</a> by</td> </tr> </table> @@ -739,18 +1068,18 @@ factor to multiply <a href="#Point">Point</a> by</td> ### See Also -<a href="#SkPoint_multiply_operator">operator*(SkScalar scale) const</a> <a href="#SkPoint_multiplyby_operator">operator*=(SkScalar scale)</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> +<a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a> <a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> --- -<a name="SkPoint_negate"></a> +<a name='SkPoint_negate'></a> ## negate -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void negate() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_negate'>negate</a>() </pre> -Changes the sign of <a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_fY">fY</a>. +Changes the sign of <a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a>. ### Example @@ -769,22 +1098,22 @@ pt: nan, -nan negate: -nan, nan ### See Also -<a href="#SkPoint_minus_operator">operator-() const</a> <a href="#SkPoint_setAbs">setAbs</a> +<a href='#SkPoint_minus_operator'>operator-() const</a> <a href='#SkPoint_setAbs'>setAbs</a> --- -<a name="SkPoint_minus_operator"></a> +<a name='SkPoint_minus_operator'></a> ## operator- -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPoint operator-() _const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPoint'>SkPoint</a> operator-() _const </pre> -Returns <a href="#Point">Point</a> changing the signs of <a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_fY">fY</a>. +Returns <a href='#Point'>Point</a> changing the signs of <a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a>. ### Return Value -<a href="#Point">Point</a> as (-<a href="#SkPoint_fX">fX</a>, -<a href="#SkPoint_fY">fY</a>) +<a href='#Point'>Point</a> as (-<a href='#SkPoint_fX'>fX</a>, -<a href='#SkPoint_fY'>fY</a>) ### Example @@ -803,25 +1132,25 @@ pt: nan, -nan negate: -nan, nan ### See Also -<a href="#SkPoint_negate">negate</a> <a href="#SkPoint_subtract_operator">operator-(const SkPoint& a, const SkPoint& b)</a> <a href="#SkPoint_subtractfrom_operator">operator-=(const SkVector& v)</a> <a href="SkIPoint_Reference#SkIPoint_minus_operator">SkIPoint::operator-() const</a> +<a href='#SkPoint_negate'>negate</a> <a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a> <a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a> <a href='SkIPoint_Reference#SkIPoint_minus_operator'>SkIPoint::operator-() const</a> --- -<a name="SkPoint_addto_operator"></a> +<a name='SkPoint_addto_operator'></a> ## operator+= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void operator+=(const SkVector& v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> </pre> -Adds <a href="#Vector">Vector</a> <a href="#SkPoint_addto_operator_v">v</a> to <a href="#Point">Point</a>. Sets <a href="#Point">Point</a> to: -(<a href="#SkPoint_fX">fX</a> + <a href="#SkPoint_addto_operator_v">v</a>.<a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_fY">fY</a> + <a href="#SkPoint_addto_operator_v">v</a>.<a href="#SkPoint_fY">fY</a>) +Adds <a href='#Vector'>Vector</a> <a href='#SkPoint_addto_operator_v'>v</a> to <a href='#Point'>Point</a>. Sets <a href='#Point'>Point</a> to: +(<a href='#SkPoint_fX'>fX</a> + <a href='#SkPoint_addto_operator_v'>v</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a> + <a href='#SkPoint_addto_operator_v'>v</a>.<a href='#SkPoint_fY'>fY</a>) . ### Parameters -<table> <tr> <td><a name="SkPoint_addto_operator_v"> <code><strong>v </strong></code> </a></td> <td> -<a href="#Vector">Vector</a> to add</td> +<table> <tr> <td><a name='SkPoint_addto_operator_v'><code><strong>v</strong></code></a></td> + <td><a href='#Vector'>Vector</a> to add</td> </tr> </table> @@ -831,25 +1160,25 @@ Adds <a href="#Vector">Vector</a> <a href="#SkPoint_addto_operator_v">v</a> to < ### See Also -<a href="#SkPoint_offset">offset</a> <a href="#SkPoint_add_operator">operator+(const SkPoint& a, const SkVector& b)</a> <a href="SkIPoint_Reference#SkIPoint_addto_operator">SkIPoint::operator+=(const SkIVector& v)</a> +<a href='#SkPoint_offset'>offset</a> <a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a> <a href='SkIPoint_Reference#SkIPoint_addto_operator'>SkIPoint::operator+=(const SkIVector& v)</a> --- -<a name="SkPoint_subtractfrom_operator"></a> +<a name='SkPoint_subtractfrom_operator'></a> ## operator-= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void operator-=(const SkVector& v) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a> </pre> -Subtracts <a href="#Vector">Vector</a> <a href="#SkPoint_subtractfrom_operator_v">v</a> from <a href="#Point">Point</a>. Sets <a href="#Point">Point</a> to: -(<a href="#SkPoint_fX">fX</a> - <a href="#SkPoint_subtractfrom_operator_v">v</a>.<a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_fY">fY</a> - <a href="#SkPoint_subtractfrom_operator_v">v</a>.<a href="#SkPoint_fY">fY</a>) +Subtracts <a href='#Vector'>Vector</a> <a href='#SkPoint_subtractfrom_operator_v'>v</a> from <a href='#Point'>Point</a>. Sets <a href='#Point'>Point</a> to: +(<a href='#SkPoint_fX'>fX</a> - <a href='#SkPoint_subtractfrom_operator_v'>v</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_fY'>fY</a> - <a href='#SkPoint_subtractfrom_operator_v'>v</a>.<a href='#SkPoint_fY'>fY</a>) . ### Parameters -<table> <tr> <td><a name="SkPoint_subtractfrom_operator_v"> <code><strong>v </strong></code> </a></td> <td> -<a href="#Vector">Vector</a> to subtract</td> +<table> <tr> <td><a name='SkPoint_subtractfrom_operator_v'><code><strong>v</strong></code></a></td> + <td><a href='#Vector'>Vector</a> to subtract</td> </tr> </table> @@ -859,29 +1188,29 @@ Subtracts <a href="#Vector">Vector</a> <a href="#SkPoint_subtractfrom_operator_v ### See Also -<a href="#SkPoint_offset">offset</a> <a href="#SkPoint_subtract_operator">operator-(const SkPoint& a, const SkPoint& b)</a> <a href="SkIPoint_Reference#SkIPoint_subtractfrom_operator">SkIPoint::operator-=(const SkIVector& v)</a> +<a href='#SkPoint_offset'>offset</a> <a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a> <a href='SkIPoint_Reference#SkIPoint_subtractfrom_operator'>SkIPoint::operator-=(const SkIVector& v)</a> --- -<a name="SkPoint_multiply_operator"></a> +<a name='SkPoint_multiply_operator'></a> ## operator* -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPoint operator*(SkScalar scale) _const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPoint'>SkPoint</a> operator*(SkScalar scale) _const </pre> -Returns <a href="#Point">Point</a> multiplied by scale. +Returns <a href='#Point'>Point</a> multiplied by scale. ### Parameters -<table> <tr> <td><a name="SkPoint_multiply_operator_scale"> <code><strong>scale </strong></code> </a></td> <td> -<a href="undocumented#Scalar">Scalar</a> to multiply by</td> +<table> <tr> <td><a name='SkPoint_multiply_operator_scale'><code><strong>scale</strong></code></a></td> + <td><a href='undocumented#Scalar'>Scalar</a> to multiply by</td> </tr> </table> ### Return Value -<a href="#Point">Point</a> as (<a href="#SkPoint_fX">fX</a> * scale, <a href="#SkPoint_fY">fY</a> * scale) +<a href='#Point'>Point</a> as (<a href='#SkPoint_fX'>fX</a> * scale, <a href='#SkPoint_fY'>fY</a> * scale) ### Example @@ -889,30 +1218,30 @@ Returns <a href="#Point">Point</a> multiplied by scale. ### See Also -<a href="#SkPoint_multiplyby_operator">operator*=(SkScalar scale)</a> <a href="#SkPoint_scale">scale</a><sup><a href="#SkPoint_scale_2">[2]</a></sup> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> <a href="#SkPoint_setNormalize">setNormalize</a> +<a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a> <a href='#SkPoint_scale'>scale</a><sup><a href='#SkPoint_scale_2'>[2]</a></sup> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_setNormalize'>setNormalize</a> --- -<a name="SkPoint_multiplyby_operator"></a> +<a name='SkPoint_multiplyby_operator'></a> ## operator*= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPoint& operator*=(SkScalar scale) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPoint'>SkPoint</a>& <a href='#SkPoint_multiplyby_operator'>operator*=(SkScalar scale)</a> </pre> -Multiplies <a href="#Point">Point</a> by scale. Sets <a href="#Point">Point</a> to: -(<a href="#SkPoint_fX">fX</a> * scale, <a href="#SkPoint_fY">fY</a> * scale) +Multiplies <a href='#Point'>Point</a> by scale. Sets <a href='#Point'>Point</a> to: +(<a href='#SkPoint_fX'>fX</a> * scale, <a href='#SkPoint_fY'>fY</a> * scale) ### Parameters -<table> <tr> <td><a name="SkPoint_multiplyby_operator_scale"> <code><strong>scale </strong></code> </a></td> <td> -<a href="undocumented#Scalar">Scalar</a> to multiply by</td> +<table> <tr> <td><a name='SkPoint_multiplyby_operator_scale'><code><strong>scale</strong></code></a></td> + <td><a href='undocumented#Scalar'>Scalar</a> to multiply by</td> </tr> </table> ### Return Value -reference to <a href="#Point">Point</a> +reference to <a href='#Point'>Point</a> ### Example @@ -920,18 +1249,18 @@ reference to <a href="#Point">Point</a> ### See Also -<a href="#SkPoint_multiply_operator">operator*(SkScalar scale) const</a> <a href="#SkPoint_scale">scale</a><sup><a href="#SkPoint_scale_2">[2]</a></sup> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> <a href="#SkPoint_setNormalize">setNormalize</a> +<a href='#SkPoint_multiply_operator'>operator*(SkScalar scale) const</a> <a href='#SkPoint_scale'>scale</a><sup><a href='#SkPoint_scale_2'>[2]</a></sup> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_setNormalize'>setNormalize</a> --- -<a name="SkPoint_isFinite"></a> +<a name='SkPoint_isFinite'></a> ## isFinite -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isFinite() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_isFinite'>isFinite</a>() const </pre> -Returns true if both <a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_fY">fY</a> are measurable values. +Returns true if both <a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_fY'>fY</a> are measurable values. ### Return Value @@ -954,31 +1283,32 @@ pt: nan, -1 finite: false ### See Also -<a href="SkRect_Reference#SkRect_isFinite">SkRect::isFinite</a> <a href="SkPath_Reference#SkPath_isFinite">SkPath::isFinite</a> +<a href='SkRect_Reference#SkRect_isFinite'>SkRect::isFinite</a> <a href='SkPath_Reference#SkPath_isFinite'>SkPath::isFinite</a> --- -<a name="SkPoint_equals"></a> +<a name='SkPoint_equals'></a> ## equals -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool equals(SkScalar x, SkScalar y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_equals'>equals</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const </pre> -Returns true if <a href="#Point">Point</a> is equivalent to <a href="#Point">Point</a> constructed from (x, y). +Returns true if <a href='#Point'>Point</a> is equivalent to <a href='#Point'>Point</a> constructed from (x, y). ### Parameters -<table> <tr> <td><a name="SkPoint_equals_x"> <code><strong>x </strong></code> </a></td> <td> -value compared with <a href="#SkPoint_fX">fX</a></td> - </tr> <tr> <td><a name="SkPoint_equals_y"> <code><strong>y </strong></code> </a></td> <td> -value compared with <a href="#SkPoint_fY">fY</a></td> +<table> <tr> <td><a name='SkPoint_equals_x'><code><strong>x</strong></code></a></td> + <td>value compared with <a href='#SkPoint_fX'>fX</a></td> + </tr> + <tr> <td><a name='SkPoint_equals_y'><code><strong>y</strong></code></a></td> + <td>value compared with <a href='#SkPoint_fY'>fY</a></td> </tr> </table> ### Return Value -true if <a href="#Point">Point</a> equals (x, y) +true if <a href='#Point'>Point</a> equals (x, y) ### Example @@ -997,31 +1327,32 @@ pt: nan, -1 != pt ### See Also -<a href="#SkPoint_equal_operator">operator==(const SkPoint& a, const SkPoint& b)</a> +<a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a> --- -<a name="SkPoint_equal_operator"></a> +<a name='SkPoint_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkPoint& a, const SkPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a> </pre> -Returns true if <a href="#SkPoint_equal_operator_a">a</a> is equivalent to <a href="#SkPoint_equal_operator_b">b</a>. +Returns true if <a href='#SkPoint_equal_operator_a'>a</a> is equivalent to <a href='#SkPoint_equal_operator_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Point">Point</a> to compare</td> - </tr> <tr> <td><a name="SkPoint_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Point">Point</a> to compare</td> +<table> <tr> <td><a name='SkPoint_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Point'>Point</a> to compare</td> + </tr> + <tr> <td><a name='SkPoint_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Point'>Point</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#SkPoint_equal_operator_a">a</a>.<a href="#SkPoint_fX">fX</a> == <a href="#SkPoint_equal_operator_b">b</a>.<a href="#SkPoint_fX">fX</a> and <a href="#SkPoint_equal_operator_a">a</a>.<a href="#SkPoint_fY">fY</a> == <a href="#SkPoint_equal_operator_b">b</a>.<a href="#SkPoint_fY">fY</a> +true if <a href='#SkPoint_equal_operator_a'>a</a>.<a href='#SkPoint_fX'>fX</a> == <a href='#SkPoint_equal_operator_b'>b</a>.<a href='#SkPoint_fX'>fX</a> and <a href='#SkPoint_equal_operator_a'>a</a>.<a href='#SkPoint_fY'>fY</a> == <a href='#SkPoint_equal_operator_b'>b</a>.<a href='#SkPoint_fY'>fY</a> ### Example @@ -1040,31 +1371,32 @@ pt: nan, -1 != pt ### See Also -<a href="#SkPoint_equals">equals</a> <a href="#SkPoint_notequal_operator">operator!=(const SkPoint& a, const SkPoint& b)</a> +<a href='#SkPoint_equals'>equals</a> <a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a> --- -<a name="SkPoint_notequal_operator"></a> +<a name='SkPoint_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkPoint& a, const SkPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPoint_notequal_operator'>operator!=(const SkPoint& a, const SkPoint& b)</a> </pre> -Returns true if <a href="#SkPoint_notequal_operator_a">a</a> is not equivalent to <a href="#SkPoint_notequal_operator_b">b</a>. +Returns true if <a href='#SkPoint_notequal_operator_a'>a</a> is not equivalent to <a href='#SkPoint_notequal_operator_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Point">Point</a> to compare</td> - </tr> <tr> <td><a name="SkPoint_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Point">Point</a> to compare</td> +<table> <tr> <td><a name='SkPoint_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Point'>Point</a> to compare</td> + </tr> + <tr> <td><a name='SkPoint_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Point'>Point</a> to compare</td> </tr> </table> ### Return Value -true if <a href="#SkPoint_notequal_operator_a">a</a>.<a href="#SkPoint_fX">fX</a> != <a href="#SkPoint_notequal_operator_b">b</a>.<a href="#SkPoint_fX">fX</a> or <a href="#SkPoint_notequal_operator_a">a</a>.<a href="#SkPoint_fY">fY</a> != <a href="#SkPoint_notequal_operator_b">b</a>.<a href="#SkPoint_fY">fY</a> +true if <a href='#SkPoint_notequal_operator_a'>a</a>.<a href='#SkPoint_fX'>fX</a> != <a href='#SkPoint_notequal_operator_b'>b</a>.<a href='#SkPoint_fX'>fX</a> or <a href='#SkPoint_notequal_operator_a'>a</a>.<a href='#SkPoint_fY'>fY</a> != <a href='#SkPoint_notequal_operator_b'>b</a>.<a href='#SkPoint_fY'>fY</a> ### Example @@ -1083,35 +1415,36 @@ pt: nan, -1 != pt ### See Also -<a href="#SkPoint_equal_operator">operator==(const SkPoint& a, const SkPoint& b)</a> <a href="#SkPoint_equals">equals</a> +<a href='#SkPoint_equal_operator'>operator==(const SkPoint& a, const SkPoint& b)</a> <a href='#SkPoint_equals'>equals</a> --- -<a name="SkPoint_subtract_operator"></a> +<a name='SkPoint_subtract_operator'></a> ## operator- -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkVector operator-(const SkPoint& a, const SkPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkVector'>SkVector</a> <a href='#SkPoint_subtract_operator'>operator-(const SkPoint& a, const SkPoint& b)</a> </pre> -Returns <a href="#Vector">Vector</a> from <a href="#SkPoint_subtract_operator_b">b</a> to <a href="#SkPoint_subtract_operator_a">a</a>, computed as(<a href="#SkPoint_subtract_operator_a">a</a>.<a href="#SkPoint_fX">fX</a> - <a href="#SkPoint_subtract_operator_b">b</a>.<a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_subtract_operator_a">a</a>.<a href="#SkPoint_fY">fY</a> - <a href="#SkPoint_subtract_operator_b">b</a>.<a href="#SkPoint_fY">fY</a>) +Returns <a href='#Vector'>Vector</a> from <a href='#SkPoint_subtract_operator_b'>b</a> to <a href='#SkPoint_subtract_operator_a'>a</a>, computed as(<a href='#SkPoint_subtract_operator_a'>a</a>.<a href='#SkPoint_fX'>fX</a> - <a href='#SkPoint_subtract_operator_b'>b</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_subtract_operator_a'>a</a>.<a href='#SkPoint_fY'>fY</a> - <a href='#SkPoint_subtract_operator_b'>b</a>.<a href='#SkPoint_fY'>fY</a>) . -Can also be used to subtract <a href="#Vector">Vector</a> from <a href="#Point">Point</a>, returning <a href="#Point">Point</a>. -Can also be used to subtract <a href="#Vector">Vector</a> from <a href="#Vector">Vector</a>, returning <a href="#Vector">Vector</a>. +Can also be used to subtract <a href='#Vector'>Vector</a> from <a href='#Point'>Point</a>, returning <a href='#Point'>Point</a>. +Can also be used to subtract <a href='#Vector'>Vector</a> from <a href='#Vector'>Vector</a>, returning <a href='#Vector'>Vector</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_subtract_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Point">Point</a> to subtract from</td> - </tr> <tr> <td><a name="SkPoint_subtract_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Point">Point</a> to subtract</td> +<table> <tr> <td><a name='SkPoint_subtract_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Point'>Point</a> to subtract from</td> + </tr> + <tr> <td><a name='SkPoint_subtract_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Point'>Point</a> to subtract</td> </tr> </table> ### Return Value -<a href="#Vector">Vector</a> from <a href="#SkPoint_subtract_operator_b">b</a> to <a href="#SkPoint_subtract_operator_a">a</a> +<a href='#Vector'>Vector</a> from <a href='#SkPoint_subtract_operator_b'>b</a> to <a href='#SkPoint_subtract_operator_a'>a</a> ### Example @@ -1119,36 +1452,37 @@ Can also be used to subtract <a href="#Vector">Vector</a> from <a href="#Vector" ### See Also -<a href="#SkPoint_subtractfrom_operator">operator-=(const SkVector& v)</a> <a href="#SkPoint_offset">offset</a> +<a href='#SkPoint_subtractfrom_operator'>operator-=(const SkVector& v)</a> <a href='#SkPoint_offset'>offset</a> --- -<a name="SkPoint_add_operator"></a> +<a name='SkPoint_add_operator'></a> ## operator+ -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkPoint operator+(const SkPoint& a, const SkVector& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkPoint'>SkPoint</a> <a href='#SkPoint_add_operator'>operator+(const SkPoint& a, const SkVector& b)</a> </pre> -Returns <a href="#Point">Point</a> resulting from <a href="#Point">Point</a> <a href="#SkPoint_add_operator_a">a</a> offset by <a href="#Vector">Vector</a> <a href="#SkPoint_add_operator_b">b</a>, computed as: -(<a href="#SkPoint_add_operator_a">a</a>.<a href="#SkPoint_fX">fX</a> + <a href="#SkPoint_add_operator_b">b</a>.<a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_add_operator_a">a</a>.<a href="#SkPoint_fY">fY</a> + <a href="#SkPoint_add_operator_b">b</a>.<a href="#SkPoint_fY">fY</a>) +Returns <a href='#Point'>Point</a> resulting from <a href='#Point'>Point</a> <a href='#SkPoint_add_operator_a'>a</a> offset by <a href='#Vector'>Vector</a> <a href='#SkPoint_add_operator_b'>b</a>, computed as: +(<a href='#SkPoint_add_operator_a'>a</a>.<a href='#SkPoint_fX'>fX</a> + <a href='#SkPoint_add_operator_b'>b</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_add_operator_a'>a</a>.<a href='#SkPoint_fY'>fY</a> + <a href='#SkPoint_add_operator_b'>b</a>.<a href='#SkPoint_fY'>fY</a>) . -Can also be used to offset <a href="#Point">Point</a> <a href="#SkPoint_add_operator_b">b</a> by <a href="#Vector">Vector</a> <a href="#SkPoint_add_operator_a">a</a>, returning <a href="#Point">Point</a>. -Can also be used to add <a href="#Vector">Vector</a> to <a href="#Vector">Vector</a>, returning <a href="#Vector">Vector</a>. +Can also be used to offset <a href='#Point'>Point</a> <a href='#SkPoint_add_operator_b'>b</a> by <a href='#Vector'>Vector</a> <a href='#SkPoint_add_operator_a'>a</a>, returning <a href='#Point'>Point</a>. +Can also be used to add <a href='#Vector'>Vector</a> to <a href='#Vector'>Vector</a>, returning <a href='#Vector'>Vector</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_add_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Point">Point</a> or <a href="#Vector">Vector</a> to add to</td> - </tr> <tr> <td><a name="SkPoint_add_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Point">Point</a> or <a href="#Vector">Vector</a> to add</td> +<table> <tr> <td><a name='SkPoint_add_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Point'>Point</a> or <a href='#Vector'>Vector</a> to add to</td> + </tr> + <tr> <td><a name='SkPoint_add_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Point'>Point</a> or <a href='#Vector'>Vector</a> to add</td> </tr> </table> ### Return Value -<a href="#Point">Point</a> equal to <a href="#SkPoint_add_operator_a">a</a> offset by <a href="#SkPoint_add_operator_b">b</a> +<a href='#Point'>Point</a> equal to <a href='#SkPoint_add_operator_a'>a</a> offset by <a href='#SkPoint_add_operator_b'>b</a> ### Example @@ -1156,15 +1490,15 @@ Can also be used to add <a href="#Vector">Vector</a> to <a href="#Vector">Vector ### See Also -<a href="#SkPoint_addto_operator">operator+=(const SkVector& v)</a> <a href="#SkPoint_offset">offset</a> +<a href='#SkPoint_addto_operator'>operator+=(const SkVector& v)</a> <a href='#SkPoint_offset'>offset</a> --- -<a name="SkPoint_Length"></a> +<a name='SkPoint_Length'></a> ## Length -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkScalar Length(SkScalar x, SkScalar y) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Length'>Length</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) </pre> Returns the Euclidean_Distance from origin, computed as: @@ -1177,10 +1511,11 @@ sqrt(x * x + y * y) ### Parameters -<table> <tr> <td><a name="SkPoint_Length_x"> <code><strong>x </strong></code> </a></td> <td> -component of length</td> - </tr> <tr> <td><a name="SkPoint_Length_y"> <code><strong>y </strong></code> </a></td> <td> -component of length</td> +<table> <tr> <td><a name='SkPoint_Length_x'><code><strong>x</strong></code></a></td> + <td>component of length</td> + </tr> + <tr> <td><a name='SkPoint_Length_y'><code><strong>y</strong></code></a></td> + <td>component of length</td> </tr> </table> @@ -1194,35 +1529,35 @@ straight-line distance to origin ### See Also -<a href="#SkPoint_length">length</a> <a href="#SkPoint_Distance">Distance</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> +<a href='#SkPoint_length'>length</a> <a href='#SkPoint_Distance'>Distance</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> --- -<a name="SkPoint_Normalize"></a> +<a name='SkPoint_Normalize'></a> ## Normalize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkScalar Normalize(SkVector* vec) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Normalize'>Normalize</a>(<a href='#SkVector'>SkVector</a>* vec) </pre> -Scales (<a href="#SkPoint_Normalize_vec">vec</a>-><a href="#SkPoint_fX">fX</a>, <a href="#SkPoint_Normalize_vec">vec</a>-><a href="#SkPoint_fY">fY</a>) so that <a href="#SkPoint_length">length</a> returns one, while preserving ratio of <a href="#SkPoint_Normalize_vec">vec</a>-><a href="#SkPoint_fX">fX</a> to <a href="#SkPoint_Normalize_vec">vec</a>-><a href="#SkPoint_fY">fY</a>, -if possible. If original length is nearly zero, sets <a href="#SkPoint_Normalize_vec">vec</a> to (0, 0) and returns zero; -otherwise, returns length of <a href="#SkPoint_Normalize_vec">vec</a> before <a href="#SkPoint_Normalize_vec">vec</a> is scaled. +Scales (<a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fX'>fX</a>, <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fY'>fY</a>) so that <a href='#SkPoint_length'>length</a> returns one, while preserving ratio of <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fX'>fX</a> to <a href='#SkPoint_Normalize_vec'>vec</a>-><a href='#SkPoint_fY'>fY</a>, +if possible. If original length is nearly zero, sets <a href='#SkPoint_Normalize_vec'>vec</a> to (0, 0) and returns zero; +otherwise, returns length of <a href='#SkPoint_Normalize_vec'>vec</a> before <a href='#SkPoint_Normalize_vec'>vec</a> is scaled. -Returned prior length may be <a href="undocumented#SK_ScalarInfinity">SK ScalarInfinity</a> if it can not be represented by <a href="undocumented#SkScalar">SkScalar</a>. +Returned prior length may be <a href='undocumented#SK_ScalarInfinity'>SK ScalarInfinity</a> if it can not be represented by <a href='undocumented#SkScalar'>SkScalar</a>. -Note that <a href="#SkPoint_normalize">normalize</a> is faster if prior length is not required. +Note that <a href='#SkPoint_normalize'>normalize</a> is faster if prior length is not required. ### Parameters -<table> <tr> <td><a name="SkPoint_Normalize_vec"> <code><strong>vec </strong></code> </a></td> <td> -normalized to unit length</td> +<table> <tr> <td><a name='SkPoint_Normalize_vec'><code><strong>vec</strong></code></a></td> + <td>normalized to unit length</td> </tr> </table> ### Return Value -original <a href="#SkPoint_Normalize_vec">vec</a> length +original <a href='#SkPoint_Normalize_vec'>vec</a> length ### Example @@ -1230,31 +1565,32 @@ original <a href="#SkPoint_Normalize_vec">vec</a> length ### See Also -<a href="#SkPoint_normalize">normalize</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> <a href="#SkPoint_Length">Length</a> +<a href='#SkPoint_normalize'>normalize</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> <a href='#SkPoint_Length'>Length</a> --- -<a name="SkPoint_Distance"></a> +<a name='SkPoint_Distance'></a> ## Distance -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkScalar Distance(const SkPoint& a, const SkPoint& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_Distance'>Distance</a>(const <a href='#SkPoint'>SkPoint</a>& a, const <a href='#SkPoint'>SkPoint</a>& b) </pre> -Returns the Euclidean_Distance between <a href="#SkPoint_Distance_a">a</a> and <a href="#SkPoint_Distance_b">b</a>. +Returns the Euclidean_Distance between <a href='#SkPoint_Distance_a'>a</a> and <a href='#SkPoint_Distance_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_Distance_a"> <code><strong>a </strong></code> </a></td> <td> -line end point</td> - </tr> <tr> <td><a name="SkPoint_Distance_b"> <code><strong>b </strong></code> </a></td> <td> -line end point</td> +<table> <tr> <td><a name='SkPoint_Distance_a'><code><strong>a</strong></code></a></td> + <td>line end point</td> + </tr> + <tr> <td><a name='SkPoint_Distance_b'><code><strong>b</strong></code></a></td> + <td>line end point</td> </tr> </table> ### Return Value -straight-line distance from <a href="#SkPoint_Distance_a">a</a> to <a href="#SkPoint_Distance_b">b</a> +straight-line distance from <a href='#SkPoint_Distance_a'>a</a> to <a href='#SkPoint_Distance_b'>b</a> ### Example @@ -1262,25 +1598,26 @@ straight-line distance from <a href="#SkPoint_Distance_a">a</a> to <a href="#SkP ### See Also -<a href="#SkPoint_length">length</a> <a href="#SkPoint_setLength">setLength</a><sup><a href="#SkPoint_setLength_2">[2]</a></sup> +<a href='#SkPoint_length'>length</a> <a href='#SkPoint_setLength'>setLength</a><sup><a href='#SkPoint_setLength_2'>[2]</a></sup> --- -<a name="SkPoint_DotProduct"></a> +<a name='SkPoint_DotProduct'></a> ## DotProduct -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkScalar DotProduct(const SkVector& a, const SkVector& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_DotProduct'>DotProduct</a>(const <a href='#SkVector'>SkVector</a>& a, const <a href='#SkVector'>SkVector</a>& b) </pre> -Returns the dot product of <a href="#Vector">Vector</a> <a href="#SkPoint_DotProduct_a">a</a> and <a href="#Vector">Vector</a> <a href="#SkPoint_DotProduct_b">b</a>. +Returns the dot product of <a href='#Vector'>Vector</a> <a href='#SkPoint_DotProduct_a'>a</a> and <a href='#Vector'>Vector</a> <a href='#SkPoint_DotProduct_b'>b</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_DotProduct_a"> <code><strong>a </strong></code> </a></td> <td> -left side of dot product</td> - </tr> <tr> <td><a name="SkPoint_DotProduct_b"> <code><strong>b </strong></code> </a></td> <td> -right side of dot product</td> +<table> <tr> <td><a name='SkPoint_DotProduct_a'><code><strong>a</strong></code></a></td> + <td>left side of dot product</td> + </tr> + <tr> <td><a name='SkPoint_DotProduct_b'><code><strong>b</strong></code></a></td> + <td>right side of dot product</td> </tr> </table> @@ -1294,35 +1631,36 @@ product of input magnitudes and cosine of the angle between them ### See Also -<a href="#SkPoint_dot">dot</a> <a href="#SkPoint_CrossProduct">CrossProduct</a> +<a href='#SkPoint_dot'>dot</a> <a href='#SkPoint_CrossProduct'>CrossProduct</a> --- -<a name="SkPoint_CrossProduct"></a> +<a name='SkPoint_CrossProduct'></a> ## CrossProduct -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkScalar CrossProduct(const SkVector& a, const SkVector& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_CrossProduct'>CrossProduct</a>(const <a href='#SkVector'>SkVector</a>& a, const <a href='#SkVector'>SkVector</a>& b) </pre> -Returns the cross product of <a href="#Vector">Vector</a> <a href="#SkPoint_CrossProduct_a">a</a> and <a href="#Vector">Vector</a> <a href="#SkPoint_CrossProduct_b">b</a>. +Returns the cross product of <a href='#Vector'>Vector</a> <a href='#SkPoint_CrossProduct_a'>a</a> and <a href='#Vector'>Vector</a> <a href='#SkPoint_CrossProduct_b'>b</a>. -<a href="#SkPoint_CrossProduct_a">a</a> and <a href="#SkPoint_CrossProduct_b">b</a> form three-dimensional vectors with z-axis value equal to zero. The -cross product is <a href="#SkPoint_CrossProduct_a">a</a> three-dimensional vector with x-axis and y-axis values equal +<a href='#SkPoint_CrossProduct_a'>a</a> and <a href='#SkPoint_CrossProduct_b'>b</a> form three-dimensional vectors with z-axis value equal to zero. The +cross product is <a href='#SkPoint_CrossProduct_a'>a</a> three-dimensional vector with x-axis and y-axis values equal to zero. The cross product z-axis component is returned. ### Parameters -<table> <tr> <td><a name="SkPoint_CrossProduct_a"> <code><strong>a </strong></code> </a></td> <td> -left side of cross product</td> - </tr> <tr> <td><a name="SkPoint_CrossProduct_b"> <code><strong>b </strong></code> </a></td> <td> -right side of cross product</td> +<table> <tr> <td><a name='SkPoint_CrossProduct_a'><code><strong>a</strong></code></a></td> + <td>left side of cross product</td> + </tr> + <tr> <td><a name='SkPoint_CrossProduct_b'><code><strong>b</strong></code></a></td> + <td>right side of cross product</td> </tr> </table> ### Return Value -area spanned by <a href="#Vector">Vectors</a> signed by angle direction +area spanned by <a href='#Vector'>Vectors</a> signed by angle direction ### Example @@ -1330,33 +1668,33 @@ area spanned by <a href="#Vector">Vectors</a> signed by angle direction ### See Also -<a href="#SkPoint_cross">cross</a> <a href="#SkPoint_DotProduct">DotProduct</a> +<a href='#SkPoint_cross'>cross</a> <a href='#SkPoint_DotProduct'>DotProduct</a> --- -<a name="SkPoint_cross"></a> +<a name='SkPoint_cross'></a> ## cross -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar cross(const SkVector& vec) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_cross'>cross</a>(const <a href='#SkVector'>SkVector</a>& vec) const </pre> -Returns the cross product of <a href="#Vector">Vector</a> and <a href="#SkPoint_cross_vec">vec</a>. +Returns the cross product of <a href='#Vector'>Vector</a> and <a href='#SkPoint_cross_vec'>vec</a>. -<a href="#Vector">Vector</a> and <a href="#SkPoint_cross_vec">vec</a> form three-dimensional vectors with z-axis value equal to zero. +<a href='#Vector'>Vector</a> and <a href='#SkPoint_cross_vec'>vec</a> form three-dimensional vectors with z-axis value equal to zero. The cross product is a three-dimensional vector with x-axis and y-axis values equal to zero. The cross product z-axis component is returned. ### Parameters -<table> <tr> <td><a name="SkPoint_cross_vec"> <code><strong>vec </strong></code> </a></td> <td> -right side of cross product</td> +<table> <tr> <td><a name='SkPoint_cross_vec'><code><strong>vec</strong></code></a></td> + <td>right side of cross product</td> </tr> </table> ### Return Value -area spanned by <a href="#Vector">Vectors</a> signed by angle direction +area spanned by <a href='#Vector'>Vectors</a> signed by angle direction ### Example @@ -1364,23 +1702,23 @@ area spanned by <a href="#Vector">Vectors</a> signed by angle direction ### See Also -<a href="#SkPoint_CrossProduct">CrossProduct</a> <a href="#SkPoint_dot">dot</a> +<a href='#SkPoint_CrossProduct'>CrossProduct</a> <a href='#SkPoint_dot'>dot</a> --- -<a name="SkPoint_dot"></a> +<a name='SkPoint_dot'></a> ## dot -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar dot(const SkVector& vec) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPoint_dot'>dot</a>(const <a href='#SkVector'>SkVector</a>& vec) const </pre> -Returns the dot product of <a href="#Vector">Vector</a> and <a href="#Vector">Vector</a> <a href="#SkPoint_dot_vec">vec</a>. +Returns the dot product of <a href='#Vector'>Vector</a> and <a href='#Vector'>Vector</a> <a href='#SkPoint_dot_vec'>vec</a>. ### Parameters -<table> <tr> <td><a name="SkPoint_dot_vec"> <code><strong>vec </strong></code> </a></td> <td> -right side of dot product</td> +<table> <tr> <td><a name='SkPoint_dot_vec'><code><strong>vec</strong></code></a></td> + <td>right side of dot product</td> </tr> </table> @@ -1394,8 +1732,17 @@ product of input magnitudes and cosine of the angle between them ### See Also -<a href="#SkPoint_DotProduct">DotProduct</a> <a href="#SkPoint_cross">cross</a> +<a href='#SkPoint_DotProduct'>DotProduct</a> <a href='#SkPoint_cross'>cross</a> --- -# <a name="Vector"></a> Vector +## <a name='Vector'>Vector</a> + +# <a name='SkVector'>Typedef SkVector</a> + +<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> + typedef <a href='#SkPoint'>SkPoint</a> <a href='#SkVector'>SkVector</a>; +</pre> + +<a href='#SkVector'>SkVector</a> provides an alternative name for <a href='#SkPoint'>SkPoint</a>. <a href='#SkVector'>SkVector</a> and <a href='#SkPoint'>SkPoint</a> can +be used interchangably for all purposes.
\ No newline at end of file diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md index de3ab22dd9..d2b36304f3 100644 --- a/site/user/api/SkRect_Reference.md +++ b/site/user/api/SkRect_Reference.md @@ -1,154 +1,468 @@ SkRect Reference === -# <a name="Rect"></a> Rect +# <a name='Rect'>Rect</a> -## <a name="Overview"></a> Overview +# <a name='SkRect'>Struct SkRect</a> +<a href='#SkRect'>SkRect</a> holds four <a href='undocumented#SkScalar'>SkScalar</a> coordinates describing the upper and +lower bounds of a rectangle. <a href='#SkRect'>SkRect</a> may be created from outer bounds or +from position, width, and height. <a href='#SkRect'>SkRect</a> 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. -## <a name="Overview_Subtopic"></a> Overview Subtopic +<a href='#SkRect'>SkRect</a> can be constructed from int values to avoid compiler warnings that +integer input cannot convert to <a href='undocumented#SkScalar'>SkScalar</a> without loss of precision. -| name | description | -| --- | --- | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkRect">SkRect</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Member">Member</a> | member values | -| <a href="#Operator">Operator</a> | operator overloading methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | +## Overview -# <a name="SkRect"></a> Struct SkRect -<a href="#SkRect">SkRect</a> holds four <a href="undocumented#SkScalar">SkScalar</a> coordinates describing the upper and -lower bounds of a rectangle. <a href="#SkRect">SkRect</a> may be created from outer bounds or -from position, width, and height. <a href="#SkRect">SkRect</a> 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. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkRect'>SkRect</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member'>Members</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Operator'>Operators</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>operator overloading methods</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> -<a href="#SkRect">SkRect</a> can be constructed from int values to avoid compiler warnings that -integer input cannot convert to <a href="undocumented#SkScalar">SkScalar</a> without loss of precision. - -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#As_Points">As Points</a> | conversion to and from <a href="SkPoint_Reference#Point">Points</a> | -| <a href="#From_Integers">From Integers</a> | set <a href="undocumented#Scalar">Scalar</a> values from integer input | -| <a href="#Inset_Outset_Offset">Inset Outset Offset</a> | moves sides | -| <a href="#Intersection">Intersection</a> | set to shared bounds | -| <a href="#Join">Join</a> | set to union of bounds | -| <a href="#Property">Property</a> | member values, center, validity | -| <a href="#Rounding">Rounding</a> | adjust to integer bounds | -| <a href="#Set">Set</a> | replaces all values | -| <a href="#Sorting">Sorting</a> | orders sides | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkRect_Intersects">Intersects</a> | returns true if areas overlap | -| <a href="#SkRect_Make">Make</a> | constructs from <a href="undocumented#ISize">ISize</a> returning (0, 0, width, height) | -| <a href="#SkRect_MakeEmpty">MakeEmpty</a> | constructs from bounds of (0, 0, 0, 0) | -| <a href="#SkRect_MakeIWH">MakeIWH</a> | constructs from int input returning (0, 0, width, height) | -| <a href="#SkRect_MakeLTRB">MakeLTRB</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> left, top, right, bottom | -| <a href="#SkRect_MakeSize">MakeSize</a> | constructs from <a href="undocumented#Size">Size</a> returning (0, 0, width, height) | -| <a href="#SkRect_MakeWH">MakeWH</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> input returning (0, 0, width, height) | -| <a href="#SkRect_MakeXYWH">MakeXYWH</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> input returning (x, y, width, height) | -| <a href="#SkRect_asScalars">asScalars</a> | returns pointer to members as array | -| <a href="#SkRect_bottom">bottom</a> | returns larger bounds in y, if sorted | -| <a href="#SkRect_centerX">centerX</a> | returns midpoint in x | -| <a href="#SkRect_centerY">centerY</a> | returns midpoint in y | -| <a href="#SkRect_contains">contains</a> | returns true if points are equal or inside | -| <a href="#SkRect_dump_2">dump</a> | sends text representation to standard output using floats | -| <a href="#SkRect_dumpHex">dumpHex</a> | sends text representation to standard output using hexadecimal | -| <a href="#SkRect_height">height</a> | returns span in y | -| <a href="#SkRect_inset">inset</a> | moves the sides symmetrically about the center | -| <a href="#SkRect_intersect">intersect</a> | sets to shared area; returns true if not empty | -| <a href="#SkRect_intersects">intersects</a> | returns true if areas overlap | -| <a href="#SkRect_isEmpty">isEmpty</a> | returns true if width or height are zero or negative | -| <a href="#SkRect_isFinite">isFinite</a> | returns true if no member is infinite or NaN | -| <a href="#SkRect_isSorted">isSorted</a> | returns true if width or height are zero or positive | -| <a href="#SkRect_iset">iset</a> | sets to int input (left, top, right, bottom) | -| <a href="#SkRect_isetWH">isetWH</a> | sets to int input (0, 0, width, height) | -| <a href="#SkRect_join">join</a> | sets to union of bounds | -| <a href="#SkRect_joinNonEmptyArg">joinNonEmptyArg</a> | sets to union of bounds, asserting that argument is not empty | -| <a href="#SkRect_joinPossiblyEmptyRect">joinPossiblyEmptyRect</a> | sets to union of bounds. Skips empty check for both | -| <a href="#SkRect_left">left</a> | returns smaller bounds in x, if sorted | -| <a href="#SkRect_makeInset">makeInset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkRect_makeOffset">makeOffset</a> | constructs from translated sides | -| <a href="#SkRect_makeOutset">makeOutset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkRect_makeSorted">makeSorted</a> | constructs, ordering sides from smaller to larger | -| <a href="#SkRect_offset">offset</a> | translates sides without changing width and height | -| <a href="#SkRect_offsetTo">offsetTo</a> | translates to (x, y) without changing width and height | -| <a href="#SkRect_outset">outset</a> | moves the sides symmetrically about the center | -| <a href="#SkRect_right">right</a> | returns larger bounds in x, if sorted | -| <a href="#SkRect_round_2">round</a> | sets members to nearest integer value | -| <a href="#SkRect_roundIn">roundIn</a> | sets members to nearest integer value towards opposite | -| <a href="#SkRect_roundOut">roundOut</a> | sets members to nearest integer value away from opposite | -| <a href="#SkRect_set">set</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (left, top, right, bottom) and others | -| <a href="#SkRect_setBounds">setBounds</a> | sets to upper and lower limits of <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkRect_setBoundsCheck">setBoundsCheck</a> | sets to upper and lower limits of <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkRect_setEmpty">setEmpty</a> | sets to (0, 0, 0, 0) | -| <a href="#SkRect_setLTRB">setLTRB</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (left, top, right, bottom) | -| <a href="#SkRect_setWH">setWH</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (0, 0, width, height) | -| <a href="#SkRect_setXYWH">setXYWH</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (x, y, width, height) | -| <a href="#SkRect_sort">sort</a> | orders sides from smaller to larger | -| <a href="#SkRect_toQuad">toQuad</a> | returns four corners as <a href="SkPoint_Reference#Point">Point</a> | -| <a href="#SkRect_top">top</a> | returns smaller bounds in y, if sorted | -| <a href="#SkRect_width">width</a> | returns span in x | -| <a href="#SkRect_x">x</a> | returns bounds left | -| <a href="#SkRect_y">y</a> | returns bounds top | - -## <a name="Member"></a> Member - -| name | description | -| --- | --- | -| <a href="#SkRect_fBottom">fBottom</a> | larger y-axis bounds | -| <a href="#SkRect_fLeft">fLeft</a> | smaller x-axis bounds | -| <a href="#SkRect_fRight">fRight</a> | larger x-axis bounds | -| <a href="#SkRect_fTop">fTop</a> | smaller y-axis bounds | - -<a name="SkRect_fLeft"> <code><strong>SkScalar fLeft</strong></code> </a> -May contain any value, including infinities and NaN. The smaller of the -horizontal values when sorted. When equal to or greater than <a href="#SkRect_fRight">fRight</a>, <a href="#Rect">Rect</a> is empty. +## <a name='Related_Function'>Related Function</a> -<a name="SkRect_fTop"> <code><strong>SkScalar fTop</strong></code> </a> -May contain any value, including infinities and NaN. The smaller of the -vertical values when sorted. When equal to or greater than <a href="#SkRect_fBottom">fBottom</a>, <a href="#Rect">Rect</a> is empty. +SkRect global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#As_Points'>As Points</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>conversion to and from <a href='SkPoint_Reference#Point'>Points</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#From_Integers'>From Integers</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Scalar'>Scalar</a> values from integer input</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Inset_Outset_Offset'>Inset Outset Offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves sides</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Intersection'>Intersection</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Join'>Join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values, center, validity</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Rounding'>Rounding</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>adjust to integer bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Set'>Set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>replaces all values</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Sorting'>Sorting</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides</td> + </tr> +</table> -<a name="SkRect_fRight"> <code><strong>SkScalar fRight</strong></code> </a> -May contain any value, including infinities and NaN. The larger of the -horizontal values when sorted. When equal to or less than <a href="#SkRect_fLeft">fLeft</a>, <a href="#Rect">Rect</a> is empty. +## <a name='Member_Function'>Member Function</a> + + +SkRect member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_Intersects'>Intersects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#ISize'>ISize</a> returning (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeEmpty'>MakeEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from bounds of (0, 0, 0, 0)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeIWH'>MakeIWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeLTRB'>MakeLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> left, top, right, bottom</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeSize'>MakeSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#Size'>Size</a> returning (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeWH'>MakeWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> input returning (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeXYWH'>MakeXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> input returning (x, y, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_asScalars'>asScalars</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pointer to members as array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_bottom'>bottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in y, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_centerX'>centerX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns midpoint in x</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_centerY'>centerY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns midpoint in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_contains'>contains</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if points are equal or inside</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_dump_2'>dump</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output using floats</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_dumpHex'>dumpHex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output using hexadecimal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_inset'>inset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_intersect'>intersect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_intersects'>intersects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no member is infinite or NaN</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isSorted'>isSorted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or positive</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_iset'>iset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to int input (left, top, right, bottom)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isetWH'>isetWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to int input (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_join'>join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_joinNonEmptyArg'>joinNonEmptyArg</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds, asserting that argument is not empty</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_joinPossiblyEmptyRect'>joinPossiblyEmptyRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds; skips empty check for both</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_left'>left</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in x, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeInset'>makeInset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeOffset'>makeOffset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translated sides</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeOutset'>makeOutset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeSorted'>makeSorted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Rect'>Rect</a>, ordering sides from smaller to larger</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates sides without changing width and height</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_offsetTo'>offsetTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates to (x, y) without changing width and height</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_outset'>outset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_right'>right</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in x, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_round_2'>round</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets members to nearest integer value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_roundIn'>roundIn</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets members to nearest integer value towards opposite</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_roundOut'>roundOut</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets members to nearest integer value away from opposite</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom) and others</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setBounds'>setBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to upper and lower limits of <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setBoundsCheck'>setBoundsCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to upper and lower limits of <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setEmpty'>setEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (0, 0, 0, 0)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setLTRB'>setLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setWH'>setWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setXYWH'>setXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (x, y, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_sort'>sort</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides from smaller to larger</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_toQuad'>toQuad</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns four corners as <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_top'>top</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in y, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds left</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds top</td> + </tr> +</table> + + +## <a name='Member'>Member</a> + + + +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fLeft'><code>fLeft</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller x-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fTop'><code>fTop</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller y-axis bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fRight'><code>fRight</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger x-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#fBottom'><code>fBottom</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger y-axis bounds</td> + </tr> +</table> + + +SkRect members may be read and written directly without using a member function. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_fBottom'>fBottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger y-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_fLeft'>fLeft</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller x-axis bounds</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_fRight'>fRight</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>larger x-axis bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_fTop'>fTop</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>smaller y-axis bounds</td> + </tr> +</table> -<a name="SkRect_fBottom"> <code><strong>SkScalar fBottom</strong></code> </a> +### Members + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Type</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Name</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRect_fLeft'><code>fLeft</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May contain any value, including infinities and NaN. The smaller of the +horizontal values when sorted. When equal to or greater than <a href='#SkRect_fRight'>fRight</a>, <a href='#Rect'>Rect</a> is empty. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRect_fTop'><code>fTop</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May contain any value, including infinities and NaN. The smaller of the +vertical values when sorted. When equal to or greater than <a href='#SkRect_fBottom'>fBottom</a>, <a href='#Rect'>Rect</a> is empty. +</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRect_fRight'><code>fRight</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +May contain any value, including infinities and NaN. The larger of the +horizontal values when sorted. When equal to or less than <a href='#SkRect_fLeft'>fLeft</a>, <a href='#Rect'>Rect</a> is empty. +</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>SkScalar</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRect_fBottom'><code>fBottom</code></a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> May contain any value, including infinities and NaN. The larger of the -vertical values when sorted. When equal to or less than <a href="#SkRect_fTop">fTop</a>, <a href="#Rect">Rect</a> is empty. - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkRect_Make">Make</a> | constructs from <a href="undocumented#ISize">ISize</a> returning (0, 0, width, height) | -| <a href="#SkRect_MakeEmpty">MakeEmpty</a> | constructs from bounds of (0, 0, 0, 0) | -| <a href="#SkRect_MakeIWH">MakeIWH</a> | constructs from int input returning (0, 0, width, height) | -| <a href="#SkRect_MakeLTRB">MakeLTRB</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> left, top, right, bottom | -| <a href="#SkRect_MakeSize">MakeSize</a> | constructs from <a href="undocumented#Size">Size</a> returning (0, 0, width, height) | -| <a href="#SkRect_MakeWH">MakeWH</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> input returning (0, 0, width, height) | -| <a href="#SkRect_MakeXYWH">MakeXYWH</a> | constructs from <a href="undocumented#SkScalar">SkScalar</a> input returning (x, y, width, height) | -| <a href="#SkRect_makeInset">makeInset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkRect_makeOffset">makeOffset</a> | constructs from translated sides | -| <a href="#SkRect_makeOutset">makeOutset</a> | constructs from sides moved symmetrically about the center | -| <a href="#SkRect_makeSorted">makeSorted</a> | constructs, ordering sides from smaller to larger | - -<a name="SkRect_MakeEmpty"></a> +vertical values when sorted. When equal to or less than <a href='#SkRect_fTop'>fTop</a>, <a href='#Rect'>Rect</a> is empty. +</td> + </tr> + + +## <a name='Constructor'>Constructor</a> + + +SkRect can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_Make'>Make</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#ISize'>ISize</a> returning (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeEmpty'>MakeEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from bounds of (0, 0, 0, 0)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeIWH'>MakeIWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from int input returning (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeLTRB'>MakeLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> left, top, right, bottom</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeSize'>MakeSize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#Size'>Size</a> returning (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeWH'>MakeWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> input returning (0, 0, width, height)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_MakeXYWH'>MakeXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from <a href='undocumented#SkScalar'>SkScalar</a> input returning (x, y, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeInset'>makeInset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeOffset'>makeOffset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from translated sides</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeOutset'>makeOutset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs from sides moved symmetrically about the center</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_makeSorted'>makeSorted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>constructs <a href='#Rect'>Rect</a>, ordering sides from smaller to larger</td> + </tr> +</table> + + +<a name='SkRect_MakeEmpty'></a> ## MakeEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeEmpty'>MakeEmpty</a>() </pre> -Returns constructed <a href="#Rect">Rect</a> set to (0, 0, 0, 0). +Returns constructed <a href='#Rect'>Rect</a> 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. @@ -174,35 +488,36 @@ outset rect isEmpty: false ### See Also -<a href="#SkRect_isEmpty">isEmpty</a> <a href="#SkRect_setEmpty">setEmpty</a> <a href="SkIRect_Reference#SkIRect_MakeEmpty">SkIRect::MakeEmpty</a> +<a href='#SkRect_isEmpty'>isEmpty</a> <a href='#SkRect_setEmpty'>setEmpty</a> <a href='SkIRect_Reference#SkIRect_MakeEmpty'>SkIRect::MakeEmpty</a> --- -<a name="SkRect_MakeWH"></a> +<a name='SkRect_MakeWH'></a> ## MakeWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeWH'>MakeWH</a>(<a href='undocumented#SkScalar'>SkScalar</a> w, <a href='undocumented#SkScalar'>SkScalar</a> h) </pre> -Returns constructed <a href="#Rect">Rect</a> set to <a href="undocumented#SkScalar">SkScalar</a> values (0, 0, <a href="#SkRect_MakeWH_w">w</a>, <a href="#SkRect_MakeWH_h">h</a>). Does not -validate input; <a href="#SkRect_MakeWH_w">w</a> or <a href="#SkRect_MakeWH_h">h</a> may be negative. +Returns constructed <a href='#Rect'>Rect</a> set to <a href='undocumented#SkScalar'>SkScalar</a> values (0, 0, <a href='#SkRect_MakeWH_w'>w</a>, <a href='#SkRect_MakeWH_h'>h</a>). Does not +validate input; <a href='#SkRect_MakeWH_w'>w</a> or <a href='#SkRect_MakeWH_h'>h</a> may be negative. -Passing integer values may generate a compiler warning since <a href="#Rect">Rect</a> cannot -represent 32-bit integers exactly. Use <a href="SkIRect_Reference#SkIRect">SkIRect</a> for an exact integer rectangle. +Passing integer values may generate a compiler warning since <a href='#Rect'>Rect</a> cannot +represent 32-bit integers exactly. Use <a href='SkIRect_Reference#SkIRect'>SkIRect</a> for an exact integer rectangle. ### Parameters -<table> <tr> <td><a name="SkRect_MakeWH_w"> <code><strong>w </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> width of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_MakeWH_h"> <code><strong>h </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> height of constructed <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_MakeWH_w'><code><strong>w</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> width of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_MakeWH_h'><code><strong>h</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> height of constructed <a href='#Rect'>Rect</a></td> </tr> </table> ### Return Value -bounds (0, 0, <a href="#SkRect_MakeWH_w">w</a>, <a href="#SkRect_MakeWH_h">h</a>) +bounds (0, 0, <a href='#SkRect_MakeWH_w'>w</a>, <a href='#SkRect_MakeWH_h'>h</a>) ### Example @@ -218,35 +533,36 @@ all equal ### See Also -<a href="#SkRect_MakeSize">MakeSize</a> <a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="#SkRect_MakeIWH">MakeIWH</a> <a href="#SkRect_setWH">setWH</a> <a href="SkIRect_Reference#SkIRect_MakeWH">SkIRect::MakeWH</a> +<a href='#SkRect_MakeSize'>MakeSize</a> <a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='#SkRect_MakeIWH'>MakeIWH</a> <a href='#SkRect_setWH'>setWH</a> <a href='SkIRect_Reference#SkIRect_MakeWH'>SkIRect::MakeWH</a> --- -<a name="SkRect_MakeIWH"></a> +<a name='SkRect_MakeIWH'></a> ## MakeIWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeIWH'>MakeIWH</a>(int w, int h) </pre> -Returns constructed <a href="#Rect">Rect</a> set to integer values (0, 0, <a href="#SkRect_MakeIWH_w">w</a>, <a href="#SkRect_MakeIWH_h">h</a>). Does not validate -input; <a href="#SkRect_MakeIWH_w">w</a> or <a href="#SkRect_MakeIWH_h">h</a> may be negative. +Returns constructed <a href='#Rect'>Rect</a> set to integer values (0, 0, <a href='#SkRect_MakeIWH_w'>w</a>, <a href='#SkRect_MakeIWH_h'>h</a>). Does not validate +input; <a href='#SkRect_MakeIWH_w'>w</a> or <a href='#SkRect_MakeIWH_h'>h</a> may be negative. Use to avoid a compiler warning that input may lose precision when stored. -Use <a href="SkIRect_Reference#SkIRect">SkIRect</a> for an exact integer rectangle. +Use <a href='SkIRect_Reference#SkIRect'>SkIRect</a> for an exact integer rectangle. ### Parameters -<table> <tr> <td><a name="SkRect_MakeIWH_w"> <code><strong>w </strong></code> </a></td> <td> -integer width of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_MakeIWH_h"> <code><strong>h </strong></code> </a></td> <td> -integer height of constructed <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_MakeIWH_w'><code><strong>w</strong></code></a></td> + <td>integer width of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_MakeIWH_h'><code><strong>h</strong></code></a></td> + <td>integer height of constructed <a href='#Rect'>Rect</a></td> </tr> </table> ### Return Value -bounds (0, 0, <a href="#SkRect_MakeIWH_w">w</a>, <a href="#SkRect_MakeIWH_h">h</a>) +bounds (0, 0, <a href='#SkRect_MakeIWH_w'>w</a>, <a href='#SkRect_MakeIWH_h'>h</a>) ### Example @@ -263,30 +579,30 @@ i_rect width: 125000111 f_rect width:125000112 ### See Also -<a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="#SkRect_MakeWH">MakeWH</a> <a href="#SkRect_isetWH">isetWH</a> <a href="SkIRect_Reference#SkIRect_MakeWH">SkIRect::MakeWH</a> +<a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='#SkRect_MakeWH'>MakeWH</a> <a href='#SkRect_isetWH'>isetWH</a> <a href='SkIRect_Reference#SkIRect_MakeWH'>SkIRect::MakeWH</a> --- -<a name="SkRect_MakeSize"></a> +<a name='SkRect_MakeSize'></a> ## MakeSize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeSize'>MakeSize</a>(const <a href='undocumented#SkSize'>SkSize</a>& size) </pre> -Returns constructed <a href="#Rect">Rect</a> set to (0, 0, <a href="#SkRect_MakeSize_size">size</a>.<a href="#SkRect_width">width</a>, <a href="#SkRect_MakeSize_size">size</a>.<a href="#SkRect_height">height</a>). Does not -validate input; <a href="#SkRect_MakeSize_size">size</a>.<a href="#SkRect_width">width</a> or <a href="#SkRect_MakeSize_size">size</a>.<a href="#SkRect_height">height</a> may be negative. +Returns constructed <a href='#Rect'>Rect</a> set to (0, 0, <a href='#SkRect_MakeSize_size'>size</a>.<a href='#SkRect_width'>width</a>, <a href='#SkRect_MakeSize_size'>size</a>.<a href='#SkRect_height'>height</a>). Does not +validate input; <a href='#SkRect_MakeSize_size'>size</a>.<a href='#SkRect_width'>width</a> or <a href='#SkRect_MakeSize_size'>size</a>.<a href='#SkRect_height'>height</a> may be negative. ### Parameters -<table> <tr> <td><a name="SkRect_MakeSize_size"> <code><strong>size </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> values for <a href="#Rect">Rect</a> width and height</td> +<table> <tr> <td><a name='SkRect_MakeSize_size'><code><strong>size</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> values for <a href='#Rect'>Rect</a> width and height</td> </tr> </table> ### Return Value -bounds (0, 0, <a href="#SkRect_MakeSize_size">size</a>.<a href="#SkRect_width">width</a>, <a href="#SkRect_MakeSize_size">size</a>.<a href="#SkRect_height">height</a>) +bounds (0, 0, <a href='#SkRect_MakeSize_size'>size</a>.<a href='#SkRect_width'>width</a>, <a href='#SkRect_MakeSize_size'>size</a>.<a href='#SkRect_height'>height</a>) ### Example @@ -303,36 +619,39 @@ floor width: 25 height: 35 ### See Also -<a href="#SkRect_MakeWH">MakeWH</a> <a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="#SkRect_MakeIWH">MakeIWH</a> <a href="#SkRect_setWH">setWH</a> <a href="SkIRect_Reference#SkIRect_MakeWH">SkIRect::MakeWH</a> +<a href='#SkRect_MakeWH'>MakeWH</a> <a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='#SkRect_MakeIWH'>MakeIWH</a> <a href='#SkRect_setWH'>setWH</a> <a href='SkIRect_Reference#SkIRect_MakeWH'>SkIRect::MakeWH</a> --- -<a name="SkRect_MakeLTRB"></a> +<a name='SkRect_MakeLTRB'></a> ## MakeLTRB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScalar r, SkScalar b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeLTRB'>MakeLTRB</a>(<a href='undocumented#SkScalar'>SkScalar</a> l, <a href='undocumented#SkScalar'>SkScalar</a> t, <a href='undocumented#SkScalar'>SkScalar</a> r, <a href='undocumented#SkScalar'>SkScalar</a> b) </pre> -Returns constructed <a href="#Rect">Rect</a> set to (<a href="#SkRect_MakeLTRB_l">l</a>, <a href="#SkRect_MakeLTRB_t">t</a>, <a href="#SkRect_MakeLTRB_r">r</a>, <a href="#SkRect_MakeLTRB_b">b</a>). Does not sort input; <a href="#Rect">Rect</a> may -result in <a href="#SkRect_fLeft">fLeft</a> greater than <a href="#SkRect_fRight">fRight</a>, or <a href="#SkRect_fTop">fTop</a> greater than <a href="#SkRect_fBottom">fBottom</a>. +Returns constructed <a href='#Rect'>Rect</a> set to (<a href='#SkRect_MakeLTRB_l'>l</a>, <a href='#SkRect_MakeLTRB_t'>t</a>, <a href='#SkRect_MakeLTRB_r'>r</a>, <a href='#SkRect_MakeLTRB_b'>b</a>). Does not sort input; <a href='#Rect'>Rect</a> may +result in <a href='#SkRect_fLeft'>fLeft</a> greater than <a href='#SkRect_fRight'>fRight</a>, or <a href='#SkRect_fTop'>fTop</a> greater than <a href='#SkRect_fBottom'>fBottom</a>. ### Parameters -<table> <tr> <td><a name="SkRect_MakeLTRB_l"> <code><strong>l </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> stored in <a href="#SkRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkRect_MakeLTRB_t"> <code><strong>t </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> stored in <a href="#SkRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkRect_MakeLTRB_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_MakeLTRB_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="undocumented#SkScalar">SkScalar</a> stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_MakeLTRB_l'><code><strong>l</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> stored in <a href='#SkRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkRect_MakeLTRB_t'><code><strong>t</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> stored in <a href='#SkRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkRect_MakeLTRB_r'><code><strong>r</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_MakeLTRB_b'><code><strong>b</strong></code></a></td> + <td><a href='undocumented#SkScalar'>SkScalar</a> stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -bounds (<a href="#SkRect_MakeLTRB_l">l</a>, <a href="#SkRect_MakeLTRB_t">t</a>, <a href="#SkRect_MakeLTRB_r">r</a>, <a href="#SkRect_MakeLTRB_b">b</a>) +bounds (<a href='#SkRect_MakeLTRB_l'>l</a>, <a href='#SkRect_MakeLTRB_t'>t</a>, <a href='#SkRect_MakeLTRB_r'>r</a>, <a href='#SkRect_MakeLTRB_b'>b</a>) ### Example @@ -349,38 +668,41 @@ rect: 5, 25, 15, 35 isEmpty: false ### See Also -<a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="SkIRect_Reference#SkIRect_MakeLTRB">SkIRect::MakeLTRB</a> +<a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='SkIRect_Reference#SkIRect_MakeLTRB'>SkIRect::MakeLTRB</a> --- -<a name="SkRect_MakeXYWH"></a> +<a name='SkRect_MakeXYWH'></a> ## MakeXYWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static constexpr SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static constexpr <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeXYWH'>MakeXYWH</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> w, <a href='undocumented#SkScalar'>SkScalar</a> h) </pre> -Returns constructed <a href="#Rect">Rect</a> set to(x, y, x + <a href="#SkRect_MakeXYWH_w">w</a>, y + <a href="#SkRect_MakeXYWH_h">h</a>) +Returns constructed <a href='#Rect'>Rect</a> set to(x, y, x + <a href='#SkRect_MakeXYWH_w'>w</a>, y + <a href='#SkRect_MakeXYWH_h'>h</a>) . Does not validate input; -<a href="#SkRect_MakeXYWH_w">w</a> or <a href="#SkRect_MakeXYWH_h">h</a> may be negative. +<a href='#SkRect_MakeXYWH_w'>w</a> or <a href='#SkRect_MakeXYWH_h'>h</a> may be negative. ### Parameters -<table> <tr> <td><a name="SkRect_MakeXYWH_x"> <code><strong>x </strong></code> </a></td> <td> -stored in <a href="#SkRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkRect_MakeXYWH_y"> <code><strong>y </strong></code> </a></td> <td> -stored in <a href="#SkRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkRect_MakeXYWH_w"> <code><strong>w </strong></code> </a></td> <td> -added to x and stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_MakeXYWH_h"> <code><strong>h </strong></code> </a></td> <td> -added to y and stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_MakeXYWH_x'><code><strong>x</strong></code></a></td> + <td>stored in <a href='#SkRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkRect_MakeXYWH_y'><code><strong>y</strong></code></a></td> + <td>stored in <a href='#SkRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkRect_MakeXYWH_w'><code><strong>w</strong></code></a></td> + <td>added to x and stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_MakeXYWH_h'><code><strong>h</strong></code></a></td> + <td>added to y and stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -bounds at (x, y) with width <a href="#SkRect_MakeXYWH_w">w</a> and height <a href="#SkRect_MakeXYWH_h">h</a> +bounds at (x, y) with width <a href='#SkRect_MakeXYWH_w'>w</a> and height <a href='#SkRect_MakeXYWH_h'>h</a> ### Example @@ -397,39 +719,41 @@ rect: -10, 35, 5, 60 isEmpty: false ### See Also -<a href="#SkRect_MakeLTRB">MakeLTRB</a> <a href="SkIRect_Reference#SkIRect_MakeXYWH">SkIRect::MakeXYWH</a> +<a href='#SkRect_MakeLTRB'>MakeLTRB</a> <a href='SkIRect_Reference#SkIRect_MakeXYWH'>SkIRect::MakeXYWH</a> --- -<a name="SkRect_MakeFromIRect"></a> +<a name='SkRect_MakeFromIRect'></a> ## MakeFromIRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeFromIRect'>MakeFromIRect</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& irect) </pre> +Deprecated. + --- -<a name="SkRect_Make"></a> +<a name='SkRect_Make'></a> ## Make -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkRect Make(const SkISize& size) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkRect'>SkRect</a> <a href='#SkRect_Make'>Make</a>(const <a href='undocumented#SkISize'>SkISize</a>& size) </pre> -Returns constructed <a href="SkIRect_Reference#IRect">IRect</a> set to (0, 0, <a href="#SkRect_Make_size">size</a>.<a href="#SkRect_width">width</a>, <a href="#SkRect_Make_size">size</a>.<a href="#SkRect_height">height</a>). -Does not validate input; <a href="#SkRect_Make_size">size</a>.<a href="#SkRect_width">width</a> or <a href="#SkRect_Make_size">size</a>.<a href="#SkRect_height">height</a> may be negative. +Returns constructed <a href='SkIRect_Reference#IRect'>IRect</a> set to (0, 0, <a href='#SkRect_Make_size'>size</a>.<a href='#SkRect_width'>width</a>, <a href='#SkRect_Make_size'>size</a>.<a href='#SkRect_height'>height</a>). +Does not validate input; <a href='#SkRect_Make_size'>size</a>.<a href='#SkRect_width'>width</a> or <a href='#SkRect_Make_size'>size</a>.<a href='#SkRect_height'>height</a> may be negative. ### Parameters -<table> <tr> <td><a name="SkRect_Make_size"> <code><strong>size </strong></code> </a></td> <td> -integer values for <a href="#Rect">Rect</a> width and height</td> +<table> <tr> <td><a name='SkRect_Make_size'><code><strong>size</strong></code></a></td> + <td>integer values for <a href='#Rect'>Rect</a> width and height</td> </tr> </table> ### Return Value -bounds (0, 0, <a href="#SkRect_Make_size">size</a>.<a href="#SkRect_width">width</a>, <a href="#SkRect_Make_size">size</a>.<a href="#SkRect_height">height</a>) +bounds (0, 0, <a href='#SkRect_Make_size'>size</a>.<a href='#SkRect_width'>width</a>, <a href='#SkRect_Make_size'>size</a>.<a href='#SkRect_height'>height</a>) ### Example @@ -445,30 +769,30 @@ rect1 == rect2 ### See Also -<a href="#SkRect_MakeWH">MakeWH</a> <a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="#SkRect_MakeIWH">SkRect::MakeIWH</a> <a href="SkIRect_Reference#SkIRect_MakeSize">SkIRect::MakeSize</a> +<a href='#SkRect_MakeWH'>MakeWH</a> <a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='#SkRect_MakeIWH'>SkRect::MakeIWH</a> <a href='SkIRect_Reference#SkIRect_MakeSize'>SkIRect::MakeSize</a> --- -<a name="SkRect_Make_2"></a> +<a name='SkRect_Make_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_Make'>Make</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& irect) </pre> -Returns constructed <a href="SkIRect_Reference#IRect">IRect</a> set to <a href="#SkRect_Make_2_irect">irect</a>, promoting integers to <a href="undocumented#Scalar">Scalar</a>. -Does not validate input; <a href="#SkRect_fLeft">fLeft</a> may be greater than <a href="#SkRect_fRight">fRight</a>, <a href="#SkRect_fTop">fTop</a> may be greater -than <a href="#SkRect_fBottom">fBottom</a>. +Returns constructed <a href='SkIRect_Reference#IRect'>IRect</a> set to <a href='#SkRect_Make_2_irect'>irect</a>, promoting integers to <a href='undocumented#Scalar'>Scalar</a>. +Does not validate input; <a href='#SkRect_fLeft'>fLeft</a> may be greater than <a href='#SkRect_fRight'>fRight</a>, <a href='#SkRect_fTop'>fTop</a> may be greater +than <a href='#SkRect_fBottom'>fBottom</a>. ### Parameters -<table> <tr> <td><a name="SkRect_Make_2_irect"> <code><strong>irect </strong></code> </a></td> <td> -integer unsorted bounds</td> +<table> <tr> <td><a name='SkRect_Make_2_irect'><code><strong>irect</strong></code></a></td> + <td>integer unsorted bounds</td> </tr> </table> ### Return Value -<a href="#SkRect_Make_2_irect">irect</a> members converted to <a href="undocumented#SkScalar">SkScalar</a> +<a href='#SkRect_Make_2_irect'>irect</a> members converted to <a href='undocumented#SkScalar'>SkScalar</a> ### Example @@ -476,47 +800,105 @@ integer unsorted bounds</td> ### See Also -<a href="#SkRect_MakeLTRB">MakeLTRB</a> +<a href='#SkRect_MakeLTRB'>MakeLTRB</a> --- -## <a name="Property"></a> Property +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_asScalars'>asScalars</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pointer to members as array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_bottom'>bottom</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in y, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_centerX'>centerX</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns midpoint in x</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_centerY'>centerY</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns midpoint in y</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_dump_2'>dump</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output using floats</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_dump'>dump(bool asHex)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_dump_2'>dump</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_dumpHex'>dumpHex</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output using hexadecimal</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in y</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isEmpty'>isEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or negative</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isFinite'>isFinite</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if no member is infinite or NaN</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isSorted'>isSorted</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if width or height are zero or positive</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_left'>left</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in x, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_right'>right</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns larger bounds in x, if sorted</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_top'>top</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns smaller bounds in y, if sorted</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns span in x</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_x'>x</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds left</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_y'>y</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds top</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkRect_asScalars">asScalars</a> | returns pointer to members as array | -| <a href="#SkRect_bottom">bottom</a> | returns larger bounds in y, if sorted | -| <a href="#SkRect_centerX">centerX</a> | returns midpoint in x | -| <a href="#SkRect_centerY">centerY</a> | returns midpoint in y | -| <a href="#SkRect_dump_2">dump</a> | sends text representation to standard output using floats | -| | <a href="#SkRect_dump">dump(bool asHex)</a> const | -| | <a href="#SkRect_dump_2">dump</a> const | -| <a href="#SkRect_dumpHex">dumpHex</a> | sends text representation to standard output using hexadecimal | -| <a href="#SkRect_height">height</a> | returns span in y | -| <a href="#SkRect_isEmpty">isEmpty</a> | returns true if width or height are zero or negative | -| <a href="#SkRect_isFinite">isFinite</a> | returns true if no member is infinite or NaN | -| <a href="#SkRect_isSorted">isSorted</a> | returns true if width or height are zero or positive | -| <a href="#SkRect_left">left</a> | returns smaller bounds in x, if sorted | -| <a href="#SkRect_right">right</a> | returns larger bounds in x, if sorted | -| <a href="#SkRect_top">top</a> | returns smaller bounds in y, if sorted | -| <a href="#SkRect_width">width</a> | returns span in x | -| <a href="#SkRect_x">x</a> | returns bounds left | -| <a href="#SkRect_y">y</a> | returns bounds top | -<a name="SkRect_isEmpty"></a> +<a name='SkRect_isEmpty'></a> ## isEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isEmpty() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_isEmpty'>isEmpty</a>() const </pre> -Returns true if <a href="#SkRect_fLeft">fLeft</a> is equal to or greater than <a href="#SkRect_fRight">fRight</a>, or if <a href="#SkRect_fTop">fTop</a> is equal -to or greater than <a href="#SkRect_fBottom">fBottom</a>. Call <a href="#SkRect_sort">sort</a> to reverse rectangles with negative -<a href="#SkRect_width">width</a> or <a href="#SkRect_height">height</a>. +Returns true if <a href='#SkRect_fLeft'>fLeft</a> is equal to or greater than <a href='#SkRect_fRight'>fRight</a>, or if <a href='#SkRect_fTop'>fTop</a> is equal +to or greater than <a href='#SkRect_fBottom'>fBottom</a>. Call <a href='#SkRect_sort'>sort</a> to reverse rectangles with negative +<a href='#SkRect_width'>width</a> or <a href='#SkRect_height'>height</a>. ### Return Value -true if <a href="#SkRect_width">width</a> or <a href="#SkRect_height">height</a> are zero or negative +true if <a href='#SkRect_width'>width</a> or <a href='#SkRect_height'>height</a> are zero or negative ### Example @@ -535,24 +917,24 @@ sorted: {20, 40, 20, 50} is empty ### See Also -<a href="#SkRect_MakeEmpty">MakeEmpty</a> <a href="#SkRect_sort">sort</a> <a href="SkIRect_Reference#SkIRect_isEmpty">SkIRect::isEmpty</a> +<a href='#SkRect_MakeEmpty'>MakeEmpty</a> <a href='#SkRect_sort'>sort</a> <a href='SkIRect_Reference#SkIRect_isEmpty'>SkIRect::isEmpty</a> --- -<a name="SkRect_isSorted"></a> +<a name='SkRect_isSorted'></a> ## isSorted -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isSorted() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_isSorted'>isSorted</a>() const </pre> -Returns true if <a href="#SkRect_fLeft">fLeft</a> is equal to or less than <a href="#SkRect_fRight">fRight</a>, or if <a href="#SkRect_fTop">fTop</a> is equal -to or less than <a href="#SkRect_fBottom">fBottom</a>. Call <a href="#SkRect_sort">sort</a> to reverse rectangles with negative -<a href="#SkRect_width">width</a> or <a href="#SkRect_height">height</a>. +Returns true if <a href='#SkRect_fLeft'>fLeft</a> is equal to or less than <a href='#SkRect_fRight'>fRight</a>, or if <a href='#SkRect_fTop'>fTop</a> is equal +to or less than <a href='#SkRect_fBottom'>fBottom</a>. Call <a href='#SkRect_sort'>sort</a> to reverse rectangles with negative +<a href='#SkRect_width'>width</a> or <a href='#SkRect_height'>height</a>. ### Return Value -true if <a href="#SkRect_width">width</a> or <a href="#SkRect_height">height</a> are zero or positive +true if <a href='#SkRect_width'>width</a> or <a href='#SkRect_height'>height</a> are zero or positive ### Example @@ -571,19 +953,19 @@ sorted: {20, 40, 20, 50} is sorted ### See Also -<a href="#SkRect_sort">sort</a> <a href="#SkRect_makeSorted">makeSorted</a> <a href="#SkRect_isEmpty">isEmpty</a> +<a href='#SkRect_sort'>sort</a> <a href='#SkRect_makeSorted'>makeSorted</a> <a href='#SkRect_isEmpty'>isEmpty</a> --- -<a name="SkRect_isFinite"></a> +<a name='SkRect_isFinite'></a> ## isFinite -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isFinite() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_isFinite'>isFinite</a>() const </pre> -Returns true if all values in the rectangle are finite: <a href="undocumented#SK_ScalarMin">SK ScalarMin</a> or larger, -and <a href="undocumented#SK_ScalarMax">SK ScalarMax</a> or smaller. +Returns true if all values in the rectangle are finite: <a href='undocumented#SK_ScalarMin'>SK ScalarMin</a> or larger, +and <a href='undocumented#SK_ScalarMax'>SK ScalarMax</a> or smaller. ### Return Value @@ -605,23 +987,23 @@ widest is finite: false ### See Also -<a href="undocumented#SkScalarIsFinite">SkScalarIsFinite</a> <a href="undocumented#SkScalarIsNaN">SkScalarIsNaN</a> +<a href='undocumented#SkScalarIsFinite'>SkScalarIsFinite</a> <a href='undocumented#SkScalarIsNaN'>SkScalarIsNaN</a> --- -<a name="SkRect_x"></a> +<a name='SkRect_x'></a> ## x -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar x() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_x'>x</a>() const </pre> -Returns left edge of <a href="#Rect">Rect</a>, if sorted. Call <a href="#SkRect_isSorted">isSorted</a> to see if <a href="#Rect">Rect</a> is valid. -Call <a href="#SkRect_sort">sort</a> to reverse <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a> if needed. +Returns left edge of <a href='#Rect'>Rect</a>, if sorted. Call <a href='#SkRect_isSorted'>isSorted</a> to see if <a href='#Rect'>Rect</a> is valid. +Call <a href='#SkRect_sort'>sort</a> to reverse <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a> if needed. ### Return Value -<a href="#SkRect_fLeft">fLeft</a> +<a href='#SkRect_fLeft'>fLeft</a> ### Example @@ -638,23 +1020,23 @@ sorted.fLeft: 10 sorted.x(): 10 ### See Also -<a href="#SkRect_fLeft">fLeft</a> <a href="#SkRect_left">left</a> <a href="#SkRect_y">y</a> <a href="SkIRect_Reference#SkIRect_x">SkIRect::x()</a> +<a href='#SkRect_fLeft'>fLeft</a> <a href='#SkRect_left'>left</a> <a href='#SkRect_y'>y</a> <a href='SkIRect_Reference#SkIRect_x'>SkIRect::x()</a> --- -<a name="SkRect_y"></a> +<a name='SkRect_y'></a> ## y -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar y() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_y'>y</a>() const </pre> -Returns top edge of <a href="#Rect">Rect</a>, if sorted. Call <a href="#SkRect_isEmpty">isEmpty</a> to see if <a href="#Rect">Rect</a> may be invalid, -and <a href="#SkRect_sort">sort</a> to reverse <a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a> if needed. +Returns top edge of <a href='#Rect'>Rect</a>, if sorted. Call <a href='#SkRect_isEmpty'>isEmpty</a> to see if <a href='#Rect'>Rect</a> may be invalid, +and <a href='#SkRect_sort'>sort</a> to reverse <a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a> if needed. ### Return Value -<a href="#SkRect_fTop">fTop</a> +<a href='#SkRect_fTop'>fTop</a> ### Example @@ -671,23 +1053,23 @@ sorted.fTop: 5 sorted.y(): 5 ### See Also -<a href="#SkRect_fTop">fTop</a> <a href="#SkRect_top">top</a> <a href="#SkRect_x">x</a> <a href="SkIRect_Reference#SkIRect_y">SkIRect::y()</a> +<a href='#SkRect_fTop'>fTop</a> <a href='#SkRect_top'>top</a> <a href='#SkRect_x'>x</a> <a href='SkIRect_Reference#SkIRect_y'>SkIRect::y()</a> --- -<a name="SkRect_left"></a> +<a name='SkRect_left'></a> ## left -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar left() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_left'>left</a>() const </pre> -Returns left edge of <a href="#Rect">Rect</a>, if sorted. Call <a href="#SkRect_isSorted">isSorted</a> to see if <a href="#Rect">Rect</a> is valid. -Call <a href="#SkRect_sort">sort</a> to reverse <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a> if needed. +Returns left edge of <a href='#Rect'>Rect</a>, if sorted. Call <a href='#SkRect_isSorted'>isSorted</a> to see if <a href='#Rect'>Rect</a> is valid. +Call <a href='#SkRect_sort'>sort</a> to reverse <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a> if needed. ### Return Value -<a href="#SkRect_fLeft">fLeft</a> +<a href='#SkRect_fLeft'>fLeft</a> ### Example @@ -704,23 +1086,23 @@ sorted.fLeft: 10 sorted.left(): 10 ### See Also -<a href="#SkRect_fLeft">fLeft</a> <a href="#SkRect_x">x</a> <a href="SkIRect_Reference#SkIRect_left">SkIRect::left()</a> +<a href='#SkRect_fLeft'>fLeft</a> <a href='#SkRect_x'>x</a> <a href='SkIRect_Reference#SkIRect_left'>SkIRect::left()</a> --- -<a name="SkRect_top"></a> +<a name='SkRect_top'></a> ## top -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar top() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_top'>top</a>() const </pre> -Returns top edge of <a href="#Rect">Rect</a>, if sorted. Call <a href="#SkRect_isEmpty">isEmpty</a> to see if <a href="#Rect">Rect</a> may be invalid, -and <a href="#SkRect_sort">sort</a> to reverse <a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a> if needed. +Returns top edge of <a href='#Rect'>Rect</a>, if sorted. Call <a href='#SkRect_isEmpty'>isEmpty</a> to see if <a href='#Rect'>Rect</a> may be invalid, +and <a href='#SkRect_sort'>sort</a> to reverse <a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a> if needed. ### Return Value -<a href="#SkRect_fTop">fTop</a> +<a href='#SkRect_fTop'>fTop</a> ### Example @@ -737,23 +1119,23 @@ sorted.fTop: 5 sorted.top(): 5 ### See Also -<a href="#SkRect_fTop">fTop</a> <a href="#SkRect_y">y</a> <a href="SkIRect_Reference#SkIRect_top">SkIRect::top()</a> +<a href='#SkRect_fTop'>fTop</a> <a href='#SkRect_y'>y</a> <a href='SkIRect_Reference#SkIRect_top'>SkIRect::top()</a> --- -<a name="SkRect_right"></a> +<a name='SkRect_right'></a> ## right -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar right() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_right'>right</a>() const </pre> -Returns right edge of <a href="#Rect">Rect</a>, if sorted. Call <a href="#SkRect_isSorted">isSorted</a> to see if <a href="#Rect">Rect</a> is valid. -Call <a href="#SkRect_sort">sort</a> to reverse <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a> if needed. +Returns right edge of <a href='#Rect'>Rect</a>, if sorted. Call <a href='#SkRect_isSorted'>isSorted</a> to see if <a href='#Rect'>Rect</a> is valid. +Call <a href='#SkRect_sort'>sort</a> to reverse <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a> if needed. ### Return Value -<a href="#SkRect_fRight">fRight</a> +<a href='#SkRect_fRight'>fRight</a> ### Example @@ -770,23 +1152,23 @@ sorted.fRight: 15 sorted.right(): 15 ### See Also -<a href="#SkRect_fRight">fRight</a> <a href="SkIRect_Reference#SkIRect_right">SkIRect::right()</a> +<a href='#SkRect_fRight'>fRight</a> <a href='SkIRect_Reference#SkIRect_right'>SkIRect::right()</a> --- -<a name="SkRect_bottom"></a> +<a name='SkRect_bottom'></a> ## bottom -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar bottom() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_bottom'>bottom</a>() const </pre> -Returns bottom edge of <a href="#Rect">Rect</a>, if sorted. Call <a href="#SkRect_isEmpty">isEmpty</a> to see if <a href="#Rect">Rect</a> may be invalid, -and <a href="#SkRect_sort">sort</a> to reverse <a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a> if needed. +Returns bottom edge of <a href='#Rect'>Rect</a>, if sorted. Call <a href='#SkRect_isEmpty'>isEmpty</a> to see if <a href='#Rect'>Rect</a> may be invalid, +and <a href='#SkRect_sort'>sort</a> to reverse <a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a> if needed. ### Return Value -<a href="#SkRect_fBottom">fBottom</a> +<a href='#SkRect_fBottom'>fBottom</a> ### Example @@ -803,27 +1185,27 @@ sorted.fBottom: 25 sorted.bottom(): 25 ### See Also -<a href="#SkRect_fBottom">fBottom</a> <a href="SkIRect_Reference#SkIRect_bottom">SkIRect::bottom()</a> +<a href='#SkRect_fBottom'>fBottom</a> <a href='SkIRect_Reference#SkIRect_bottom'>SkIRect::bottom()</a> --- -<a name="SkRect_width"></a> +<a name='SkRect_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_width'>width</a>() const </pre> -Returns span on the x-axis. This does not check if <a href="#Rect">Rect</a> is sorted, or if +Returns span on the x-axis. This does not check if <a href='#Rect'>Rect</a> is sorted, or if result fits in 32-bit float; result may be negative or infinity. ### Return Value -<a href="#SkRect_fRight">fRight</a> minus <a href="#SkRect_fLeft">fLeft</a> +<a href='#SkRect_fRight'>fRight</a> minus <a href='#SkRect_fLeft'>fLeft</a> ### Example -<div><fiddle-embed name="11f8f0efe6291019fee0ac17844f6c1a"><div>Compare with <a href="SkIRect_Reference#SkIRect_width">SkIRect::width()</a> example. +<div><fiddle-embed name="11f8f0efe6291019fee0ac17844f6c1a"><div>Compare with <a href='SkIRect_Reference#SkIRect_width'>SkIRect::width()</a> example. </div> #### Example Output @@ -837,27 +1219,27 @@ large width: 4294967296 ### See Also -<a href="#SkRect_height">height</a> <a href="SkIRect_Reference#SkIRect_width">SkIRect::width()</a> +<a href='#SkRect_height'>height</a> <a href='SkIRect_Reference#SkIRect_width'>SkIRect::width()</a> --- -<a name="SkRect_height"></a> +<a name='SkRect_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_height'>height</a>() const </pre> -Returns span on the y-axis. This does not check if <a href="SkIRect_Reference#IRect">IRect</a> is sorted, or if +Returns span on the y-axis. This does not check if <a href='SkIRect_Reference#IRect'>IRect</a> is sorted, or if result fits in 32-bit float; result may be negative or infinity. ### Return Value -<a href="#SkRect_fBottom">fBottom</a> minus <a href="#SkRect_fTop">fTop</a> +<a href='#SkRect_fBottom'>fBottom</a> minus <a href='#SkRect_fTop'>fTop</a> ### Example -<div><fiddle-embed name="39429e45f05240218ecd511443ab3e44"><div>Compare with <a href="SkIRect_Reference#SkIRect_height">SkIRect::height()</a> example. +<div><fiddle-embed name="39429e45f05240218ecd511443ab3e44"><div>Compare with <a href='SkIRect_Reference#SkIRect_height'>SkIRect::height()</a> example. </div> #### Example Output @@ -871,19 +1253,19 @@ large height: 4294967296 ### See Also -<a href="#SkRect_width">width</a> <a href="SkIRect_Reference#SkIRect_height">SkIRect::height()</a> +<a href='#SkRect_width'>width</a> <a href='SkIRect_Reference#SkIRect_height'>SkIRect::height()</a> --- -<a name="SkRect_centerX"></a> +<a name='SkRect_centerX'></a> ## centerX -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar centerX() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_centerX'>centerX</a>() const </pre> -Returns average of left edge and right edge. Result does not change if <a href="#Rect">Rect</a> -is sorted. Result may overflow to infinity if <a href="#Rect">Rect</a> is far from the origin. +Returns average of left edge and right edge. Result does not change if <a href='#Rect'>Rect</a> +is sorted. Result may overflow to infinity if <a href='#Rect'>Rect</a> is far from the origin. ### Return Value @@ -906,19 +1288,19 @@ left: -41 right: -20 centerX: -30.5 ### See Also -<a href="#SkRect_centerY">centerY</a> +<a href='#SkRect_centerY'>centerY</a> --- -<a name="SkRect_centerY"></a> +<a name='SkRect_centerY'></a> ## centerY -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalar centerY() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkRect_centerY'>centerY</a>() const </pre> -Returns average of top edge and bottom edge. Result does not change if <a href="#Rect">Rect</a> -is sorted. Result may overflow to infinity if <a href="#Rect">Rect</a> is far from the origin. +Returns average of top edge and bottom edge. Result does not change if <a href='#Rect'>Rect</a> +is sorted. Result may overflow to infinity if <a href='#Rect'>Rect</a> is far from the origin. ### Return Value @@ -938,36 +1320,48 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38 ### See Also -<a href="#SkRect_centerX">centerX</a> +<a href='#SkRect_centerX'>centerX</a> --- -## <a name="Operator"></a> Operator +## <a name='Operator'>Operator</a> -| name | description | -| --- | --- | -| <a href="#SkRect_notequal_operator">operator!=(const SkRect& a, const SkRect& b)</a> | returns true if members are unequal | -| <a href="#SkRect_equal_operator">operator==(const SkRect& a, const SkRect& b)</a> | returns true if members are equal | -<a name="SkRect_equal_operator"></a> +SkRect operators inline class member functions with arithmetic equivalents. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_notequal_operator'>operator!=(const SkRect& a, const SkRect& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_equal_operator'>operator==(const SkRect& a, const SkRect& b)</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td> + </tr> +</table> + + +<a name='SkRect_equal_operator'></a> ## operator== -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator==(const SkRect& a, const SkRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_equal_operator'>operator==(const SkRect& a, const SkRect& b)</a> </pre> -Returns true if all members in <a href="#SkRect_equal_operator_a">a</a>: <a href="#SkRect_fLeft">fLeft</a>, <a href="#SkRect_fTop">fTop</a>, <a href="#SkRect_fRight">fRight</a>, and <a href="#SkRect_fBottom">fBottom</a>; are -equal to the corresponding members in <a href="#SkRect_equal_operator_b">b</a>. +Returns true if all members in <a href='#SkRect_equal_operator_a'>a</a>: <a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkRect_fTop'>fTop</a>, <a href='#SkRect_fRight'>fRight</a>, and <a href='#SkRect_fBottom'>fBottom</a>; are +equal to the corresponding members in <a href='#SkRect_equal_operator_b'>b</a>. -<a href="#SkRect_equal_operator_a">a</a> and <a href="#SkRect_equal_operator_b">b</a> are not equal if either contain NaN. <a href="#SkRect_equal_operator_a">a</a> and <a href="#SkRect_equal_operator_b">b</a> are equal if members +<a href='#SkRect_equal_operator_a'>a</a> and <a href='#SkRect_equal_operator_b'>b</a> are not equal if either contain NaN. <a href='#SkRect_equal_operator_a'>a</a> and <a href='#SkRect_equal_operator_b'>b</a> are equal if members contain zeroes width different signs. ### Parameters -<table> <tr> <td><a name="SkRect_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to compare</td> - </tr> <tr> <td><a name="SkRect_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to compare</td> +<table> <tr> <td><a name='SkRect_equal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to compare</td> + </tr> + <tr> <td><a name='SkRect_equal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to compare</td> </tr> </table> @@ -992,29 +1386,30 @@ tests are equal ### See Also -<a href="#SkRect_notequal_operator">operator!=(const SkRect& a, const SkRect& b)</a> +<a href='#SkRect_notequal_operator'>operator!=(const SkRect& a, const SkRect& b)</a> --- -<a name="SkRect_notequal_operator"></a> +<a name='SkRect_notequal_operator'></a> ## operator!= -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool operator!=(const SkRect& a, const SkRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_notequal_operator'>operator!=(const SkRect& a, const SkRect& b)</a> </pre> -Returns true if any in <a href="#SkRect_notequal_operator_a">a</a>: <a href="#SkRect_fLeft">fLeft</a>, <a href="#SkRect_fTop">fTop</a>, <a href="#SkRect_fRight">fRight</a>, and <a href="#SkRect_fBottom">fBottom</a>; does not -equal the corresponding members in <a href="#SkRect_notequal_operator_b">b</a>. +Returns true if any in <a href='#SkRect_notequal_operator_a'>a</a>: <a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkRect_fTop'>fTop</a>, <a href='#SkRect_fRight'>fRight</a>, and <a href='#SkRect_fBottom'>fBottom</a>; does not +equal the corresponding members in <a href='#SkRect_notequal_operator_b'>b</a>. -<a href="#SkRect_notequal_operator_a">a</a> and <a href="#SkRect_notequal_operator_b">b</a> are not equal if either contain NaN. <a href="#SkRect_notequal_operator_a">a</a> and <a href="#SkRect_notequal_operator_b">b</a> are equal if members +<a href='#SkRect_notequal_operator_a'>a</a> and <a href='#SkRect_notequal_operator_b'>b</a> are not equal if either contain NaN. <a href='#SkRect_notequal_operator_a'>a</a> and <a href='#SkRect_notequal_operator_b'>b</a> are equal if members contain zeroes width different signs. ### Parameters -<table> <tr> <td><a name="SkRect_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to compare</td> - </tr> <tr> <td><a name="SkRect_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to compare</td> +<table> <tr> <td><a name='SkRect_notequal_operator_a'><code><strong>a</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to compare</td> + </tr> + <tr> <td><a name='SkRect_notequal_operator_b'><code><strong>b</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to compare</td> </tr> </table> @@ -1036,32 +1431,47 @@ test with NaN is not equal to itself ### See Also -<a href="#SkRect_equal_operator">operator==(const SkRect& a, const SkRect& b)</a> +<a href='#SkRect_equal_operator'>operator==(const SkRect& a, const SkRect& b)</a> --- -## <a name="As_Points"></a> As Points +## <a name='As_Points'>As Points</a> + -| name | description | -| --- | --- | -| <a href="#SkRect_setBounds">setBounds</a> | sets to upper and lower limits of <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkRect_setBoundsCheck">setBoundsCheck</a> | sets to upper and lower limits of <a href="SkPoint_Reference#Point">Point</a> array | -| <a href="#SkRect_toQuad">toQuad</a> | returns four corners as <a href="SkPoint_Reference#Point">Point</a> | +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setBounds'>setBounds</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to upper and lower limits of <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setBoundsCheck'>setBoundsCheck</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to upper and lower limits of <a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_toQuad'>toQuad</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns four corners as <a href='SkPoint_Reference#Point'>Point</a></td> + </tr> +</table> -<a name="SkRect_toQuad"></a> + +<a name='SkRect_toQuad'></a> ## toQuad -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toQuad(SkPoint quad[4]) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_toQuad'>toQuad</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> quad[4]) const </pre> -Returns four points in <a href="#SkRect_toQuad_quad">quad</a> that enclose <a href="#Rect">Rect</a> ordered as: top-left, top-right, +Returns four points in <a href='#SkRect_toQuad_quad'>quad</a> that enclose <a href='#Rect'>Rect</a> ordered as: top-left, top-right, bottom-right, bottom-left. +Consider adding param to control whether <a href='#SkRect_toQuad_quad'>quad</a> is clockwise or counterclockwise. + ### Parameters -<table> <tr> <td><a name="SkRect_toQuad_quad"> <code><strong>quad </strong></code> </a></td> <td> -storage for corners of <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_toQuad_quad'><code><strong>quad</strong></code></a></td> + <td>storage for corners of <a href='#Rect'>Rect</a></td> </tr> </table> @@ -1080,29 +1490,30 @@ corners: {1, 2} {3, 2} {3, 4} {1, 4} ### See Also -<a href="SkPath_Reference#SkPath_addRect">SkPath::addRect</a><sup><a href="SkPath_Reference#SkPath_addRect_2">[2]</a></sup><sup><a href="SkPath_Reference#SkPath_addRect_3">[3]</a></sup> +<a href='SkPath_Reference#SkPath_addRect'>SkPath::addRect</a><sup><a href='SkPath_Reference#SkPath_addRect_2'>[2]</a></sup><sup><a href='SkPath_Reference#SkPath_addRect_3'>[3]</a></sup> --- -<a name="SkRect_setBounds"></a> +<a name='SkRect_setBounds'></a> ## setBounds -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setBounds(const SkPoint pts[], int count) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_setBounds'>setBounds</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count) </pre> -Sets to bounds of <a href="SkPoint_Reference#Point">Point</a> array with <a href="#SkRect_setBounds_count">count</a> entries. If <a href="#SkRect_setBounds_count">count</a> is zero or smaller, -or if <a href="SkPoint_Reference#Point">Point</a> array contains an infinity or NaN, sets to (0, 0, 0, 0). +Sets to bounds of <a href='SkPoint_Reference#Point'>Point</a> array with <a href='#SkRect_setBounds_count'>count</a> entries. If <a href='#SkRect_setBounds_count'>count</a> is zero or smaller, +or if <a href='SkPoint_Reference#Point'>Point</a> array contains an infinity or NaN, sets to (0, 0, 0, 0). -Result is either empty or sorted: <a href="#SkRect_fLeft">fLeft</a> is less than or equal to <a href="#SkRect_fRight">fRight</a>, and -<a href="#SkRect_fTop">fTop</a> is less than or equal to <a href="#SkRect_fBottom">fBottom</a>. +Result is either empty or sorted: <a href='#SkRect_fLeft'>fLeft</a> is less than or equal to <a href='#SkRect_fRight'>fRight</a>, and +<a href='#SkRect_fTop'>fTop</a> is less than or equal to <a href='#SkRect_fBottom'>fBottom</a>. ### Parameters -<table> <tr> <td><a name="SkRect_setBounds_pts"> <code><strong>pts </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> array</td> - </tr> <tr> <td><a name="SkRect_setBounds_count"> <code><strong>count </strong></code> </a></td> <td> -entries in array</td> +<table> <tr> <td><a name='SkRect_setBounds_pts'><code><strong>pts</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr> <td><a name='SkRect_setBounds_count'><code><strong>count</strong></code></a></td> + <td>entries in array</td> </tr> </table> @@ -1124,36 +1535,37 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 ### See Also -<a href="#SkRect_set">set</a><sup><a href="#SkRect_set_2">[2]</a></sup><sup><a href="#SkRect_set_3">[3]</a></sup><sup><a href="#SkRect_set_4">[4]</a></sup> <a href="#SkRect_setBoundsCheck">setBoundsCheck</a> <a href="SkPath_Reference#SkPath_addPoly">SkPath::addPoly</a> +<a href='#SkRect_set'>set</a><sup><a href='#SkRect_set_2'>[2]</a></sup><sup><a href='#SkRect_set_3'>[3]</a></sup><sup><a href='#SkRect_set_4'>[4]</a></sup> <a href='#SkRect_setBoundsCheck'>setBoundsCheck</a> <a href='SkPath_Reference#SkPath_addPoly'>SkPath::addPoly</a> --- -<a name="SkRect_setBoundsCheck"></a> +<a name='SkRect_setBoundsCheck'></a> ## setBoundsCheck -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool setBoundsCheck(const SkPoint pts[], int count) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_setBoundsCheck'>setBoundsCheck</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count) </pre> -Sets to bounds of <a href="SkPoint_Reference#Point">Point</a> array with <a href="#SkRect_setBoundsCheck_count">count</a> entries. Returns false if <a href="#SkRect_setBoundsCheck_count">count</a> is -zero or smaller, or if <a href="SkPoint_Reference#Point">Point</a> array contains an infinity or NaN; in these cases -sets <a href="#Rect">Rect</a> to (0, 0, 0, 0). +Sets to bounds of <a href='SkPoint_Reference#Point'>Point</a> array with <a href='#SkRect_setBoundsCheck_count'>count</a> entries. Returns false if <a href='#SkRect_setBoundsCheck_count'>count</a> is +zero or smaller, or if <a href='SkPoint_Reference#Point'>Point</a> array contains an infinity or NaN; in these cases +sets <a href='#Rect'>Rect</a> to (0, 0, 0, 0). -Result is either empty or sorted: <a href="#SkRect_fLeft">fLeft</a> is less than or equal to <a href="#SkRect_fRight">fRight</a>, and -<a href="#SkRect_fTop">fTop</a> is less than or equal to <a href="#SkRect_fBottom">fBottom</a>. +Result is either empty or sorted: <a href='#SkRect_fLeft'>fLeft</a> is less than or equal to <a href='#SkRect_fRight'>fRight</a>, and +<a href='#SkRect_fTop'>fTop</a> is less than or equal to <a href='#SkRect_fBottom'>fBottom</a>. ### Parameters -<table> <tr> <td><a name="SkRect_setBoundsCheck_pts"> <code><strong>pts </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> array</td> - </tr> <tr> <td><a name="SkRect_setBoundsCheck_count"> <code><strong>count </strong></code> </a></td> <td> -entries in array</td> +<table> <tr> <td><a name='SkRect_setBoundsCheck_pts'><code><strong>pts</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr> <td><a name='SkRect_setBoundsCheck_count'><code><strong>count</strong></code></a></td> + <td>entries in array</td> </tr> </table> ### Return Value -true if all <a href="SkPoint_Reference#Point">Point</a> values are finite +true if all <a href='SkPoint_Reference#Point'>Point</a> values are finite ### Example @@ -1173,29 +1585,51 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false ### See Also -<a href="#SkRect_set">set</a><sup><a href="#SkRect_set_2">[2]</a></sup><sup><a href="#SkRect_set_3">[3]</a></sup><sup><a href="#SkRect_set_4">[4]</a></sup> <a href="#SkRect_setBounds">setBounds</a> <a href="SkPath_Reference#SkPath_addPoly">SkPath::addPoly</a> +<a href='#SkRect_set'>set</a><sup><a href='#SkRect_set_2'>[2]</a></sup><sup><a href='#SkRect_set_3'>[3]</a></sup><sup><a href='#SkRect_set_4'>[4]</a></sup> <a href='#SkRect_setBounds'>setBounds</a> <a href='SkPath_Reference#SkPath_addPoly'>SkPath::addPoly</a> --- -## <a name="Set"></a> Set +## <a name='Set'>Set</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_set'>set</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom) and others</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_set'>set(const SkIRect& src)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setEmpty'>setEmpty</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to (0, 0, 0, 0)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setLTRB'>setLTRB</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (left, top, right, bottom)</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setWH'>setWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (0, 0, width, height)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_setXYWH'>setXYWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to <a href='undocumented#SkScalar'>SkScalar</a> input (x, y, width, height)</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkRect_set">set</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (left, top, right, bottom) and others | -| | <a href="#SkRect_set">set(const SkIRect& src)</a> | -| <a href="#SkRect_setEmpty">setEmpty</a> | sets to (0, 0, 0, 0) | -| <a href="#SkRect_setLTRB">setLTRB</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (left, top, right, bottom) | -| <a href="#SkRect_setWH">setWH</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (0, 0, width, height) | -| <a href="#SkRect_setXYWH">setXYWH</a> | sets to <a href="undocumented#SkScalar">SkScalar</a> input (x, y, width, height) | -<a name="SkRect_setEmpty"></a> +<a name='SkRect_setEmpty'></a> ## setEmpty -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setEmpty() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_setEmpty'>setEmpty</a>() </pre> -Sets <a href="#Rect">Rect</a> to (0, 0, 0, 0). +Sets <a href='#Rect'>Rect</a> 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 @@ -1216,24 +1650,24 @@ rect: {0, 0, 0, 0} is empty ### See Also -<a href="#SkRect_MakeEmpty">MakeEmpty</a> <a href="SkIRect_Reference#SkIRect_setEmpty">SkIRect::setEmpty</a> +<a href='#SkRect_MakeEmpty'>MakeEmpty</a> <a href='SkIRect_Reference#SkIRect_setEmpty'>SkIRect::setEmpty</a> --- -<a name="SkRect_set"></a> +<a name='SkRect_set'></a> ## set -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(const SkIRect& src) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_set'>set</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& src) </pre> -Sets <a href="#Rect">Rect</a> to <a href="#SkRect_set_src">src</a>, promoting <a href="#SkRect_set_src">src</a> members from integer to <a href="undocumented#Scalar">Scalar</a>. -Very large values in <a href="#SkRect_set_src">src</a> may lose precision. +Sets <a href='#Rect'>Rect</a> to <a href='#SkRect_set_src'>src</a>, promoting <a href='#SkRect_set_src'>src</a> members from integer to <a href='undocumented#Scalar'>Scalar</a>. +Very large values in <a href='#SkRect_set_src'>src</a> may lose precision. ### Parameters -<table> <tr> <td><a name="SkRect_set_src"> <code><strong>src </strong></code> </a></td> <td> -integer <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_set_src'><code><strong>src</strong></code></a></td> + <td>integer <a href='#Rect'>Rect</a></td> </tr> </table> @@ -1252,30 +1686,33 @@ f_rect: {3, 4, 1, 2} ### See Also -<a href="#SkRect_setLTRB">setLTRB</a> <a href="undocumented#SkIntToScalar">SkIntToScalar</a> +<a href='#SkRect_setLTRB'>setLTRB</a> <a href='undocumented#SkIntToScalar'>SkIntToScalar</a> --- -<a name="SkRect_set_2"></a> +<a name='SkRect_set_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_set'>set</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom) </pre> -Sets <a href="#Rect">Rect</a> to (left, top, right, bottom). +Sets <a href='#Rect'>Rect</a> to (left, top, right, bottom). left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom. ### Parameters -<table> <tr> <td><a name="SkRect_set_2_left"> <code><strong>left </strong></code> </a></td> <td> -stored in <a href="#SkRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkRect_set_2_top"> <code><strong>top </strong></code> </a></td> <td> -stored in <a href="#SkRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkRect_set_2_right"> <code><strong>right </strong></code> </a></td> <td> -stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_set_2_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_set_2_left'><code><strong>left</strong></code></a></td> + <td>stored in <a href='#SkRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkRect_set_2_top'><code><strong>top</strong></code></a></td> + <td>stored in <a href='#SkRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkRect_set_2_right'><code><strong>right</strong></code></a></td> + <td>stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_set_2_bottom'><code><strong>bottom</strong></code></a></td> + <td>stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1294,31 +1731,34 @@ rect2: {3, 4, 1, 2} ### See Also -<a href="#SkRect_setLTRB">setLTRB</a> <a href="#SkRect_setXYWH">setXYWH</a> <a href="SkIRect_Reference#SkIRect_set">SkIRect::set</a> +<a href='#SkRect_setLTRB'>setLTRB</a> <a href='#SkRect_setXYWH'>setXYWH</a> <a href='SkIRect_Reference#SkIRect_set'>SkIRect::set</a> --- -<a name="SkRect_setLTRB"></a> +<a name='SkRect_setLTRB'></a> ## setLTRB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setLTRB(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_setLTRB'>setLTRB</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom) </pre> -Sets <a href="#Rect">Rect</a> to (left, top, right, bottom). +Sets <a href='#Rect'>Rect</a> to (left, top, right, bottom). left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom. ### Parameters -<table> <tr> <td><a name="SkRect_setLTRB_left"> <code><strong>left </strong></code> </a></td> <td> -stored in <a href="#SkRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkRect_setLTRB_top"> <code><strong>top </strong></code> </a></td> <td> -stored in <a href="#SkRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkRect_setLTRB_right"> <code><strong>right </strong></code> </a></td> <td> -stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_setLTRB_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_setLTRB_left'><code><strong>left</strong></code></a></td> + <td>stored in <a href='#SkRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkRect_setLTRB_top'><code><strong>top</strong></code></a></td> + <td>stored in <a href='#SkRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkRect_setLTRB_right'><code><strong>right</strong></code></a></td> + <td>stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_setLTRB_bottom'><code><strong>bottom</strong></code></a></td> + <td>stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1337,28 +1777,29 @@ rect2: {3, 4, 1, 2} ### See Also -<a href="#SkRect_set">set</a><sup><a href="#SkRect_set_2">[2]</a></sup><sup><a href="#SkRect_set_3">[3]</a></sup><sup><a href="#SkRect_set_4">[4]</a></sup> <a href="#SkRect_setXYWH">setXYWH</a> <a href="SkIRect_Reference#SkIRect_set">SkIRect::set</a> +<a href='#SkRect_set'>set</a><sup><a href='#SkRect_set_2'>[2]</a></sup><sup><a href='#SkRect_set_3'>[3]</a></sup><sup><a href='#SkRect_set_4'>[4]</a></sup> <a href='#SkRect_setXYWH'>setXYWH</a> <a href='SkIRect_Reference#SkIRect_set'>SkIRect::set</a> --- -<a name="SkRect_set_3"></a> +<a name='SkRect_set_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(const SkPoint pts[], int count) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_set'>set</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count) </pre> -Sets to bounds of <a href="SkPoint_Reference#Point">Point</a> array with <a href="#SkRect_set_3_count">count</a> entries. If <a href="#SkRect_set_3_count">count</a> is zero or smaller, -or if <a href="SkPoint_Reference#Point">Point</a> array contains an infinity or NaN, sets <a href="#Rect">Rect</a> to (0, 0, 0, 0). +Sets to bounds of <a href='SkPoint_Reference#Point'>Point</a> array with <a href='#SkRect_set_3_count'>count</a> entries. If <a href='#SkRect_set_3_count'>count</a> is zero or smaller, +or if <a href='SkPoint_Reference#Point'>Point</a> array contains an infinity or NaN, sets <a href='#Rect'>Rect</a> to (0, 0, 0, 0). -Result is either empty or sorted: <a href="#SkRect_fLeft">fLeft</a> is less than or equal to <a href="#SkRect_fRight">fRight</a>, and -<a href="#SkRect_fTop">fTop</a> is less than or equal to <a href="#SkRect_fBottom">fBottom</a>. +Result is either empty or sorted: <a href='#SkRect_fLeft'>fLeft</a> is less than or equal to <a href='#SkRect_fRight'>fRight</a>, and +<a href='#SkRect_fTop'>fTop</a> is less than or equal to <a href='#SkRect_fBottom'>fBottom</a>. ### Parameters -<table> <tr> <td><a name="SkRect_set_3_pts"> <code><strong>pts </strong></code> </a></td> <td> -<a href="SkPoint_Reference#Point">Point</a> array</td> - </tr> <tr> <td><a name="SkRect_set_3_count"> <code><strong>count </strong></code> </a></td> <td> -entries in array</td> +<table> <tr> <td><a name='SkRect_set_3_pts'><code><strong>pts</strong></code></a></td> + <td><a href='SkPoint_Reference#Point'>Point</a> array</td> + </tr> + <tr> <td><a name='SkRect_set_3_count'><code><strong>count</strong></code></a></td> + <td>entries in array</td> </tr> </table> @@ -1380,61 +1821,65 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 ### See Also -<a href="#SkRect_setBounds">setBounds</a> <a href="#SkRect_setBoundsCheck">setBoundsCheck</a> <a href="SkPath_Reference#SkPath_addPoly">SkPath::addPoly</a> +<a href='#SkRect_setBounds'>setBounds</a> <a href='#SkRect_setBoundsCheck'>setBoundsCheck</a> <a href='SkPath_Reference#SkPath_addPoly'>SkPath::addPoly</a> --- -<a name="SkRect_set_4"></a> +<a name='SkRect_set_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void set(const SkPoint& p0, const SkPoint& p1) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_set'>set</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p0, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1) </pre> -Sets bounds to the smallest <a href="#Rect">Rect</a> enclosing <a href="SkPoint_Reference#Point">Points</a> <a href="#SkRect_set_4_p0">p0</a> and <a href="#SkRect_set_4_p1">p1</a>. The result is +Sets bounds to the smallest <a href='#Rect'>Rect</a> enclosing <a href='SkPoint_Reference#Point'>Points</a> <a href='#SkRect_set_4_p0'>p0</a> and <a href='#SkRect_set_4_p1'>p1</a>. The result is sorted and may be empty. Does not check to see if values are finite. ### Parameters -<table> <tr> <td><a name="SkRect_set_4_p0"> <code><strong>p0 </strong></code> </a></td> <td> -corner to include</td> - </tr> <tr> <td><a name="SkRect_set_4_p1"> <code><strong>p1 </strong></code> </a></td> <td> -corner to include</td> +<table> <tr> <td><a name='SkRect_set_4_p0'><code><strong>p0</strong></code></a></td> + <td>corner to include</td> + </tr> + <tr> <td><a name='SkRect_set_4_p1'><code><strong>p1</strong></code></a></td> + <td>corner to include</td> </tr> </table> ### Example -<div><fiddle-embed name="ee72450381f768f3869153cdbeccdc3e"><div><a href="#SkRect_set_4_p0">p0</a> and <a href="#SkRect_set_4_p1">p1</a> may be swapped and have the same effect unless one contains NaN. +<div><fiddle-embed name="ee72450381f768f3869153cdbeccdc3e"><div><a href='#SkRect_set_4_p0'>p0</a> and <a href='#SkRect_set_4_p1'>p1</a> may be swapped and have the same effect unless one contains NaN. </div></fiddle-embed></div> ### See Also -<a href="#SkRect_setBounds">setBounds</a> <a href="#SkRect_setBoundsCheck">setBoundsCheck</a> +<a href='#SkRect_setBounds'>setBounds</a> <a href='#SkRect_setBoundsCheck'>setBoundsCheck</a> --- -<a name="SkRect_setXYWH"></a> +<a name='SkRect_setXYWH'></a> ## setXYWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_setXYWH'>setXYWH</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> width, <a href='undocumented#SkScalar'>SkScalar</a> height) </pre> -Sets <a href="#Rect">Rect</a> to(x, y, x + width, y + height) +Sets <a href='#Rect'>Rect</a> to(x, y, x + width, y + height) . Does not validate input; width or height may be negative. ### Parameters -<table> <tr> <td><a name="SkRect_setXYWH_x"> <code><strong>x </strong></code> </a></td> <td> -stored in <a href="#SkRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkRect_setXYWH_y"> <code><strong>y </strong></code> </a></td> <td> -stored in <a href="#SkRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkRect_setXYWH_width"> <code><strong>width </strong></code> </a></td> <td> -added to x and stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_setXYWH_height"> <code><strong>height </strong></code> </a></td> <td> -added to y and stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_setXYWH_x'><code><strong>x</strong></code></a></td> + <td>stored in <a href='#SkRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkRect_setXYWH_y'><code><strong>y</strong></code></a></td> + <td>stored in <a href='#SkRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkRect_setXYWH_width'><code><strong>width</strong></code></a></td> + <td>added to x and stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_setXYWH_height'><code><strong>height</strong></code></a></td> + <td>added to y and stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1453,26 +1898,27 @@ rect: -10, 35, 5, 60 isEmpty: false ### See Also -<a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="#SkRect_setLTRB">setLTRB</a> <a href="#SkRect_set">set</a><sup><a href="#SkRect_set_2">[2]</a></sup><sup><a href="#SkRect_set_3">[3]</a></sup><sup><a href="#SkRect_set_4">[4]</a></sup> <a href="SkIRect_Reference#SkIRect_setXYWH">SkIRect::setXYWH</a> +<a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='#SkRect_setLTRB'>setLTRB</a> <a href='#SkRect_set'>set</a><sup><a href='#SkRect_set_2'>[2]</a></sup><sup><a href='#SkRect_set_3'>[3]</a></sup><sup><a href='#SkRect_set_4'>[4]</a></sup> <a href='SkIRect_Reference#SkIRect_setXYWH'>SkIRect::setXYWH</a> --- -<a name="SkRect_setWH"></a> +<a name='SkRect_setWH'></a> ## setWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setWH(SkScalar width, SkScalar height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_setWH'>setWH</a>(<a href='undocumented#SkScalar'>SkScalar</a> width, <a href='undocumented#SkScalar'>SkScalar</a> height) </pre> -Sets <a href="#Rect">Rect</a> to (0, 0, width, height). Does not validate input; +Sets <a href='#Rect'>Rect</a> to (0, 0, width, height). Does not validate input; width or height may be negative. ### Parameters -<table> <tr> <td><a name="SkRect_setWH_width"> <code><strong>width </strong></code> </a></td> <td> -stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_setWH_height"> <code><strong>height </strong></code> </a></td> <td> -stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_setWH_width'><code><strong>width</strong></code></a></td> + <td>stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_setWH_height'><code><strong>height</strong></code></a></td> + <td>stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1491,39 +1937,52 @@ rect: -15, 0, 0, 25 isEmpty: false ### See Also -<a href="#SkRect_MakeWH">MakeWH</a> <a href="#SkRect_setXYWH">setXYWH</a> <a href="#SkRect_isetWH">isetWH</a> +<a href='#SkRect_MakeWH'>MakeWH</a> <a href='#SkRect_setXYWH'>setXYWH</a> <a href='#SkRect_isetWH'>isetWH</a> --- -## <a name="From_Integers"></a> From Integers +## <a name='From_Integers'>From Integers</a> -| name | description | -| --- | --- | -| <a href="#SkRect_iset">iset</a> | sets to int input (left, top, right, bottom) | -| <a href="#SkRect_isetWH">isetWH</a> | sets to int input (0, 0, width, height) | -<a name="SkRect_iset"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_iset'>iset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to int input (left, top, right, bottom)</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_isetWH'>isetWH</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to int input (0, 0, width, height)</td> + </tr> +</table> + + +<a name='SkRect_iset'></a> ## iset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void iset(int left, int top, int right, int bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_iset'>iset</a>(int left, int top, int right, int bottom) </pre> -Sets <a href="#Rect">Rect</a> to (left, top, right, bottom). -All parameters are promoted from integer to <a href="undocumented#Scalar">Scalar</a>. +Sets <a href='#Rect'>Rect</a> to (left, top, right, bottom). +All parameters are promoted from integer to <a href='undocumented#Scalar'>Scalar</a>. left and right are not sorted; left is not necessarily less than right. top and bottom are not sorted; top is not necessarily less than bottom. ### Parameters -<table> <tr> <td><a name="SkRect_iset_left"> <code><strong>left </strong></code> </a></td> <td> -promoted to <a href="undocumented#SkScalar">SkScalar</a> and stored in <a href="#SkRect_fLeft">fLeft</a></td> - </tr> <tr> <td><a name="SkRect_iset_top"> <code><strong>top </strong></code> </a></td> <td> -promoted to <a href="undocumented#SkScalar">SkScalar</a> and stored in <a href="#SkRect_fTop">fTop</a></td> - </tr> <tr> <td><a name="SkRect_iset_right"> <code><strong>right </strong></code> </a></td> <td> -promoted to <a href="undocumented#SkScalar">SkScalar</a> and stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_iset_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -promoted to <a href="undocumented#SkScalar">SkScalar</a> and stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_iset_left'><code><strong>left</strong></code></a></td> + <td>promoted to <a href='undocumented#SkScalar'>SkScalar</a> and stored in <a href='#SkRect_fLeft'>fLeft</a></td> + </tr> + <tr> <td><a name='SkRect_iset_top'><code><strong>top</strong></code></a></td> + <td>promoted to <a href='undocumented#SkScalar'>SkScalar</a> and stored in <a href='#SkRect_fTop'>fTop</a></td> + </tr> + <tr> <td><a name='SkRect_iset_right'><code><strong>right</strong></code></a></td> + <td>promoted to <a href='undocumented#SkScalar'>SkScalar</a> and stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_iset_bottom'><code><strong>bottom</strong></code></a></td> + <td>promoted to <a href='undocumented#SkScalar'>SkScalar</a> and stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1542,27 +2001,28 @@ rect2: {3, 4, 1, 2} ### See Also -<a href="#SkRect_set">set</a><sup><a href="#SkRect_set_2">[2]</a></sup><sup><a href="#SkRect_set_3">[3]</a></sup><sup><a href="#SkRect_set_4">[4]</a></sup> <a href="#SkRect_setLTRB">setLTRB</a> <a href="SkIRect_Reference#SkIRect_set">SkIRect::set</a> <a href="undocumented#SkIntToScalar">SkIntToScalar</a> +<a href='#SkRect_set'>set</a><sup><a href='#SkRect_set_2'>[2]</a></sup><sup><a href='#SkRect_set_3'>[3]</a></sup><sup><a href='#SkRect_set_4'>[4]</a></sup> <a href='#SkRect_setLTRB'>setLTRB</a> <a href='SkIRect_Reference#SkIRect_set'>SkIRect::set</a> <a href='undocumented#SkIntToScalar'>SkIntToScalar</a> --- -<a name="SkRect_isetWH"></a> +<a name='SkRect_isetWH'></a> ## isetWH -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void isetWH(int width, int height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_isetWH'>isetWH</a>(int width, int height) </pre> -Sets <a href="#Rect">Rect</a> to (0, 0, width, height). +Sets <a href='#Rect'>Rect</a> to (0, 0, width, height). width and height may be zero or negative. width and height are promoted from -integer to <a href="undocumented#SkScalar">SkScalar</a>, large values may lose precision. +integer to <a href='undocumented#SkScalar'>SkScalar</a>, large values may lose precision. ### Parameters -<table> <tr> <td><a name="SkRect_isetWH_width"> <code><strong>width </strong></code> </a></td> <td> -promoted to <a href="undocumented#SkScalar">SkScalar</a> and stored in <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_isetWH_height"> <code><strong>height </strong></code> </a></td> <td> -promoted to <a href="undocumented#SkScalar">SkScalar</a> and stored in <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_isetWH_width'><code><strong>width</strong></code></a></td> + <td>promoted to <a href='undocumented#SkScalar'>SkScalar</a> and stored in <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_isetWH_height'><code><strong>height</strong></code></a></td> + <td>promoted to <a href='undocumented#SkScalar'>SkScalar</a> and stored in <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1581,46 +2041,66 @@ rect2: {0, 0, 1, 2} ### See Also -<a href="#SkRect_MakeWH">MakeWH</a> <a href="#SkRect_MakeXYWH">MakeXYWH</a> <a href="#SkRect_iset">iset</a> <a href="SkIRect_Reference#SkIRect">SkIRect</a>:<a href="#SkRect_MakeWH">MakeWH</a> +<a href='#SkRect_MakeWH'>MakeWH</a> <a href='#SkRect_MakeXYWH'>MakeXYWH</a> <a href='#SkRect_iset'>iset</a> <a href='SkIRect_Reference#SkIRect'>SkIRect</a>:<a href='#SkRect_MakeWH'>MakeWH</a> --- -## <a name="Inset_Outset_Offset"></a> Inset Outset Offset +## <a name='Inset_Outset_Offset'>Inset Outset Offset</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_inset'>inset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_offset'>offset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates sides without changing width and height</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_offset'>offset(SkScalar dx, SkScalar dy)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_offsetTo'>offsetTo</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>translates to (x, y) without changing width and height</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_outset'>outset</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>moves the sides symmetrically about the center</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkRect_inset">inset</a> | moves the sides symmetrically about the center | -| <a href="#SkRect_offset">offset</a> | translates sides without changing width and height | -| | <a href="#SkRect_offset">offset(SkScalar dx, SkScalar dy)</a> | -| <a href="#SkRect_offsetTo">offsetTo</a> | translates to (x, y) without changing width and height | -| <a href="#SkRect_outset">outset</a> | moves the sides symmetrically about the center | -<a name="SkRect_makeOffset"></a> +<a name='SkRect_makeOffset'></a> ## makeOffset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect makeOffset(SkScalar dx, SkScalar dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkRect'>SkRect</a> <a href='#SkRect_makeOffset'>makeOffset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const </pre> -Returns <a href="#Rect">Rect</a> offset by (<a href="#SkRect_makeOffset_dx">dx</a>, <a href="#SkRect_makeOffset_dy">dy</a>). +Returns <a href='#Rect'>Rect</a> offset by (<a href='#SkRect_makeOffset_dx'>dx</a>, <a href='#SkRect_makeOffset_dy'>dy</a>). -If <a href="#SkRect_makeOffset_dx">dx</a> is negative, <a href="#Rect">Rect</a> returned is moved to the left. -If <a href="#SkRect_makeOffset_dx">dx</a> is positive, <a href="#Rect">Rect</a> returned is moved to the right. -If <a href="#SkRect_makeOffset_dy">dy</a> is negative, <a href="#Rect">Rect</a> returned is moved upward. -If <a href="#SkRect_makeOffset_dy">dy</a> is positive, <a href="#Rect">Rect</a> returned is moved downward. +If <a href='#SkRect_makeOffset_dx'>dx</a> is negative, <a href='#Rect'>Rect</a> returned is moved to the left. +If <a href='#SkRect_makeOffset_dx'>dx</a> is positive, <a href='#Rect'>Rect</a> returned is moved to the right. +If <a href='#SkRect_makeOffset_dy'>dy</a> is negative, <a href='#Rect'>Rect</a> returned is moved upward. +If <a href='#SkRect_makeOffset_dy'>dy</a> is positive, <a href='#Rect'>Rect</a> returned is moved downward. ### Parameters -<table> <tr> <td><a name="SkRect_makeOffset_dx"> <code><strong>dx </strong></code> </a></td> <td> -added to <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_makeOffset_dy"> <code><strong>dy </strong></code> </a></td> <td> -added to <a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_makeOffset_dx'><code><strong>dx</strong></code></a></td> + <td>added to <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_makeOffset_dy'><code><strong>dy</strong></code></a></td> + <td>added to <a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -<a href="#Rect">Rect</a> offset in x or y, with original width and height +<a href='#Rect'>Rect</a> offset in x or y, with original width and height ### Example @@ -1637,36 +2117,37 @@ rect: 25, 82, 35, 92 isEmpty: false ### See Also -<a href="#SkRect_offset">offset</a><sup><a href="#SkRect_offset_2">[2]</a></sup> <a href="#SkRect_makeInset">makeInset</a> <a href="#SkRect_makeOutset">makeOutset</a> <a href="SkIRect_Reference#SkIRect_makeOffset">SkIRect::makeOffset</a> +<a href='#SkRect_offset'>offset</a><sup><a href='#SkRect_offset_2'>[2]</a></sup> <a href='#SkRect_makeInset'>makeInset</a> <a href='#SkRect_makeOutset'>makeOutset</a> <a href='SkIRect_Reference#SkIRect_makeOffset'>SkIRect::makeOffset</a> --- -<a name="SkRect_makeInset"></a> +<a name='SkRect_makeInset'></a> ## makeInset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect makeInset(SkScalar dx, SkScalar dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkRect'>SkRect</a> <a href='#SkRect_makeInset'>makeInset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const </pre> -Returns <a href="#Rect">Rect</a>, inset by (<a href="#SkRect_makeInset_dx">dx</a>, <a href="#SkRect_makeInset_dy">dy</a>). +Returns <a href='#Rect'>Rect</a>, inset by (<a href='#SkRect_makeInset_dx'>dx</a>, <a href='#SkRect_makeInset_dy'>dy</a>). -If <a href="#SkRect_makeInset_dx">dx</a> is negative, <a href="#Rect">Rect</a> returned is wider. -If <a href="#SkRect_makeInset_dx">dx</a> is positive, <a href="#Rect">Rect</a> returned is narrower. -If <a href="#SkRect_makeInset_dy">dy</a> is negative, <a href="#Rect">Rect</a> returned is taller. -If <a href="#SkRect_makeInset_dy">dy</a> is positive, <a href="#Rect">Rect</a> returned is shorter. +If <a href='#SkRect_makeInset_dx'>dx</a> is negative, <a href='#Rect'>Rect</a> returned is wider. +If <a href='#SkRect_makeInset_dx'>dx</a> is positive, <a href='#Rect'>Rect</a> returned is narrower. +If <a href='#SkRect_makeInset_dy'>dy</a> is negative, <a href='#Rect'>Rect</a> returned is taller. +If <a href='#SkRect_makeInset_dy'>dy</a> is positive, <a href='#Rect'>Rect</a> returned is shorter. ### Parameters -<table> <tr> <td><a name="SkRect_makeInset_dx"> <code><strong>dx </strong></code> </a></td> <td> -added to <a href="#SkRect_fLeft">fLeft</a> and subtracted from <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_makeInset_dy"> <code><strong>dy </strong></code> </a></td> <td> -added to <a href="#SkRect_fTop">fTop</a> and subtracted from <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_makeInset_dx'><code><strong>dx</strong></code></a></td> + <td>added to <a href='#SkRect_fLeft'>fLeft</a> and subtracted from <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_makeInset_dy'><code><strong>dy</strong></code></a></td> + <td>added to <a href='#SkRect_fTop'>fTop</a> and subtracted from <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -<a href="#Rect">Rect</a> inset symmetrically left and right, top and bottom +<a href='#Rect'>Rect</a> inset symmetrically left and right, top and bottom ### Example @@ -1683,36 +2164,37 @@ rect: 25, 82, 5, 28 isEmpty: true ### See Also -<a href="#SkRect_inset">inset</a> <a href="#SkRect_makeOffset">makeOffset</a> <a href="#SkRect_makeOutset">makeOutset</a> <a href="SkIRect_Reference#SkIRect_makeInset">SkIRect::makeInset</a> +<a href='#SkRect_inset'>inset</a> <a href='#SkRect_makeOffset'>makeOffset</a> <a href='#SkRect_makeOutset'>makeOutset</a> <a href='SkIRect_Reference#SkIRect_makeInset'>SkIRect::makeInset</a> --- -<a name="SkRect_makeOutset"></a> +<a name='SkRect_makeOutset'></a> ## makeOutset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect makeOutset(SkScalar dx, SkScalar dy) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkRect'>SkRect</a> <a href='#SkRect_makeOutset'>makeOutset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const </pre> -Returns <a href="#Rect">Rect</a>, outset by (<a href="#SkRect_makeOutset_dx">dx</a>, <a href="#SkRect_makeOutset_dy">dy</a>). +Returns <a href='#Rect'>Rect</a>, outset by (<a href='#SkRect_makeOutset_dx'>dx</a>, <a href='#SkRect_makeOutset_dy'>dy</a>). -If <a href="#SkRect_makeOutset_dx">dx</a> is negative, <a href="#Rect">Rect</a> returned is narrower. -If <a href="#SkRect_makeOutset_dx">dx</a> is positive, <a href="#Rect">Rect</a> returned is wider. -If <a href="#SkRect_makeOutset_dy">dy</a> is negative, <a href="#Rect">Rect</a> returned is shorter. -If <a href="#SkRect_makeOutset_dy">dy</a> is positive, <a href="#Rect">Rect</a> returned is taller. +If <a href='#SkRect_makeOutset_dx'>dx</a> is negative, <a href='#Rect'>Rect</a> returned is narrower. +If <a href='#SkRect_makeOutset_dx'>dx</a> is positive, <a href='#Rect'>Rect</a> returned is wider. +If <a href='#SkRect_makeOutset_dy'>dy</a> is negative, <a href='#Rect'>Rect</a> returned is shorter. +If <a href='#SkRect_makeOutset_dy'>dy</a> is positive, <a href='#Rect'>Rect</a> returned is taller. ### Parameters -<table> <tr> <td><a name="SkRect_makeOutset_dx"> <code><strong>dx </strong></code> </a></td> <td> -subtracted to <a href="#SkRect_fLeft">fLeft</a> and added from <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_makeOutset_dy"> <code><strong>dy </strong></code> </a></td> <td> -subtracted to <a href="#SkRect_fTop">fTop</a> and added from <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_makeOutset_dx'><code><strong>dx</strong></code></a></td> + <td>subtracted to <a href='#SkRect_fLeft'>fLeft</a> and added from <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_makeOutset_dy'><code><strong>dy</strong></code></a></td> + <td>subtracted to <a href='#SkRect_fTop'>fTop</a> and added from <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> ### Return Value -<a href="#Rect">Rect</a> outset symmetrically left and right, top and bottom +<a href='#Rect'>Rect</a> outset symmetrically left and right, top and bottom ### Example @@ -1729,30 +2211,31 @@ rect: -5, 18, 35, 92 isEmpty: false ### See Also -<a href="#SkRect_outset">outset</a> <a href="#SkRect_makeOffset">makeOffset</a> <a href="#SkRect_makeInset">makeInset</a> <a href="SkIRect_Reference#SkIRect_makeOutset">SkIRect::makeOutset</a> +<a href='#SkRect_outset'>outset</a> <a href='#SkRect_makeOffset'>makeOffset</a> <a href='#SkRect_makeInset'>makeInset</a> <a href='SkIRect_Reference#SkIRect_makeOutset'>SkIRect::makeOutset</a> --- -<a name="SkRect_offset"></a> +<a name='SkRect_offset'></a> ## offset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Offsets <a href="#Rect">Rect</a> by adding <a href="#SkRect_offset_dx">dx</a> to <a href="#SkRect_fLeft">fLeft</a>, <a href="#SkRect_fRight">fRight</a>; and by adding <a href="#SkRect_offset_dy">dy</a> to <a href="#SkRect_fTop">fTop</a>, <a href="#SkRect_fBottom">fBottom</a>. +Offsets <a href='#Rect'>Rect</a> by adding <a href='#SkRect_offset_dx'>dx</a> to <a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkRect_fRight'>fRight</a>; and by adding <a href='#SkRect_offset_dy'>dy</a> to <a href='#SkRect_fTop'>fTop</a>, <a href='#SkRect_fBottom'>fBottom</a>. -If <a href="#SkRect_offset_dx">dx</a> is negative, moves <a href="#Rect">Rect</a> to the left. -If <a href="#SkRect_offset_dx">dx</a> is positive, moves <a href="#Rect">Rect</a> to the right. -If <a href="#SkRect_offset_dy">dy</a> is negative, moves <a href="#Rect">Rect</a> upward. -If <a href="#SkRect_offset_dy">dy</a> is positive, moves <a href="#Rect">Rect</a> downward. +If <a href='#SkRect_offset_dx'>dx</a> is negative, moves <a href='#Rect'>Rect</a> to the left. +If <a href='#SkRect_offset_dx'>dx</a> is positive, moves <a href='#Rect'>Rect</a> to the right. +If <a href='#SkRect_offset_dy'>dy</a> is negative, moves <a href='#Rect'>Rect</a> upward. +If <a href='#SkRect_offset_dy'>dy</a> is positive, moves <a href='#Rect'>Rect</a> downward. ### Parameters -<table> <tr> <td><a name="SkRect_offset_dx"> <code><strong>dx </strong></code> </a></td> <td> -offset added to <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_offset_dy"> <code><strong>dy </strong></code> </a></td> <td> -offset added to <a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_offset_dx'><code><strong>dx</strong></code></a></td> + <td>offset added to <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_offset_dy'><code><strong>dy</strong></code></a></td> + <td>offset added to <a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1770,28 +2253,28 @@ rect: 15, 27, 55, 86 ### See Also -<a href="#SkRect_offsetTo">offsetTo</a> <a href="#SkRect_makeOffset">makeOffset</a> <a href="SkIRect_Reference#SkIRect_offset">SkIRect::offset</a><sup><a href="SkIRect_Reference#SkIRect_offset_2">[2]</a></sup> +<a href='#SkRect_offsetTo'>offsetTo</a> <a href='#SkRect_makeOffset'>makeOffset</a> <a href='SkIRect_Reference#SkIRect_offset'>SkIRect::offset</a><sup><a href='SkIRect_Reference#SkIRect_offset_2'>[2]</a></sup> --- -<a name="SkRect_offset_2"></a> +<a name='SkRect_offset_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offset(const SkPoint& delta) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_offset'>offset</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& delta) </pre> -Offsets <a href="#Rect">Rect</a> by adding <a href="#SkRect_offset_2_delta">delta</a>.fX to <a href="#SkRect_fLeft">fLeft</a>, <a href="#SkRect_fRight">fRight</a>; and by adding <a href="#SkRect_offset_2_delta">delta</a>.fY to -<a href="#SkRect_fTop">fTop</a>, <a href="#SkRect_fBottom">fBottom</a>. +Offsets <a href='#Rect'>Rect</a> by adding <a href='#SkRect_offset_2_delta'>delta</a>.fX to <a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkRect_fRight'>fRight</a>; and by adding <a href='#SkRect_offset_2_delta'>delta</a>.fY to +<a href='#SkRect_fTop'>fTop</a>, <a href='#SkRect_fBottom'>fBottom</a>. -If <a href="#SkRect_offset_2_delta">delta</a>.fX is negative, moves <a href="#Rect">Rect</a> to the left. -If <a href="#SkRect_offset_2_delta">delta</a>.fX is positive, moves <a href="#Rect">Rect</a> to the right. -If <a href="#SkRect_offset_2_delta">delta</a>.fY is negative, moves <a href="#Rect">Rect</a> upward. -If <a href="#SkRect_offset_2_delta">delta</a>.fY is positive, moves <a href="#Rect">Rect</a> downward. +If <a href='#SkRect_offset_2_delta'>delta</a>.fX is negative, moves <a href='#Rect'>Rect</a> to the left. +If <a href='#SkRect_offset_2_delta'>delta</a>.fX is positive, moves <a href='#Rect'>Rect</a> to the right. +If <a href='#SkRect_offset_2_delta'>delta</a>.fY is negative, moves <a href='#Rect'>Rect</a> upward. +If <a href='#SkRect_offset_2_delta'>delta</a>.fY is positive, moves <a href='#Rect'>Rect</a> downward. ### Parameters -<table> <tr> <td><a name="SkRect_offset_2_delta"> <code><strong>delta </strong></code> </a></td> <td> -added to <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_offset_2_delta'><code><strong>delta</strong></code></a></td> + <td>added to <a href='#Rect'>Rect</a></td> </tr> </table> @@ -1809,26 +2292,27 @@ rect: 15, 27, 55, 86 ### See Also -<a href="#SkRect_offsetTo">offsetTo</a> <a href="#SkRect_makeOffset">makeOffset</a> <a href="SkIRect_Reference#SkIRect_offset">SkIRect::offset</a><sup><a href="SkIRect_Reference#SkIRect_offset_2">[2]</a></sup> +<a href='#SkRect_offsetTo'>offsetTo</a> <a href='#SkRect_makeOffset'>makeOffset</a> <a href='SkIRect_Reference#SkIRect_offset'>SkIRect::offset</a><sup><a href='SkIRect_Reference#SkIRect_offset_2'>[2]</a></sup> --- -<a name="SkRect_offsetTo"></a> +<a name='SkRect_offsetTo'></a> ## offsetTo -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void offsetTo(SkScalar newX, SkScalar newY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_offsetTo'>offsetTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> newX, <a href='undocumented#SkScalar'>SkScalar</a> newY) </pre> -Offsets <a href="#Rect">Rect</a> so that <a href="#SkRect_fLeft">fLeft</a> equals <a href="#SkRect_offsetTo_newX">newX</a>, and <a href="#SkRect_fTop">fTop</a> equals <a href="#SkRect_offsetTo_newY">newY</a>. width and height +Offsets <a href='#Rect'>Rect</a> so that <a href='#SkRect_fLeft'>fLeft</a> equals <a href='#SkRect_offsetTo_newX'>newX</a>, and <a href='#SkRect_fTop'>fTop</a> equals <a href='#SkRect_offsetTo_newY'>newY</a>. width and height are unchanged. ### Parameters -<table> <tr> <td><a name="SkRect_offsetTo_newX"> <code><strong>newX </strong></code> </a></td> <td> -stored in <a href="#SkRect_fLeft">fLeft</a>, preserving <a href="#SkRect_width">width</a></td> - </tr> <tr> <td><a name="SkRect_offsetTo_newY"> <code><strong>newY </strong></code> </a></td> <td> -stored in <a href="#SkRect_fTop">fTop</a>, preserving <a href="#SkRect_height">height</a></td> +<table> <tr> <td><a name='SkRect_offsetTo_newX'><code><strong>newX</strong></code></a></td> + <td>stored in <a href='#SkRect_fLeft'>fLeft</a>, preserving <a href='#SkRect_width'>width</a></td> + </tr> + <tr> <td><a name='SkRect_offsetTo_newY'><code><strong>newY</strong></code></a></td> + <td>stored in <a href='#SkRect_fTop'>fTop</a>, preserving <a href='#SkRect_height'>height</a></td> </tr> </table> @@ -1846,30 +2330,31 @@ rect: 15, 27, 55, 86 ### See Also -<a href="#SkRect_offset">offset</a><sup><a href="#SkRect_offset_2">[2]</a></sup> <a href="#SkRect_makeOffset">makeOffset</a> <a href="#SkRect_setXYWH">setXYWH</a> <a href="SkIRect_Reference#SkIRect_offsetTo">SkIRect::offsetTo</a> +<a href='#SkRect_offset'>offset</a><sup><a href='#SkRect_offset_2'>[2]</a></sup> <a href='#SkRect_makeOffset'>makeOffset</a> <a href='#SkRect_setXYWH'>setXYWH</a> <a href='SkIRect_Reference#SkIRect_offsetTo'>SkIRect::offsetTo</a> --- -<a name="SkRect_inset"></a> +<a name='SkRect_inset'></a> ## inset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void inset(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_inset'>inset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Insets <a href="#Rect">Rect</a> by (<a href="#SkRect_inset_dx">dx</a>, <a href="#SkRect_inset_dy">dy</a>). +Insets <a href='#Rect'>Rect</a> by (<a href='#SkRect_inset_dx'>dx</a>, <a href='#SkRect_inset_dy'>dy</a>). -If <a href="#SkRect_inset_dx">dx</a> is positive, makes <a href="#Rect">Rect</a> narrower. -If <a href="#SkRect_inset_dx">dx</a> is negative, makes <a href="#Rect">Rect</a> wider. -If <a href="#SkRect_inset_dy">dy</a> is positive, makes <a href="#Rect">Rect</a> shorter. -If <a href="#SkRect_inset_dy">dy</a> is negative, makes <a href="#Rect">Rect</a> taller. +If <a href='#SkRect_inset_dx'>dx</a> is positive, makes <a href='#Rect'>Rect</a> narrower. +If <a href='#SkRect_inset_dx'>dx</a> is negative, makes <a href='#Rect'>Rect</a> wider. +If <a href='#SkRect_inset_dy'>dy</a> is positive, makes <a href='#Rect'>Rect</a> shorter. +If <a href='#SkRect_inset_dy'>dy</a> is negative, makes <a href='#Rect'>Rect</a> taller. ### Parameters -<table> <tr> <td><a name="SkRect_inset_dx"> <code><strong>dx </strong></code> </a></td> <td> -added to <a href="#SkRect_fLeft">fLeft</a> and subtracted from <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_inset_dy"> <code><strong>dy </strong></code> </a></td> <td> -added to <a href="#SkRect_fTop">fTop</a> and subtracted from <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_inset_dx'><code><strong>dx</strong></code></a></td> + <td>added to <a href='#SkRect_fLeft'>fLeft</a> and subtracted from <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_inset_dy'><code><strong>dy</strong></code></a></td> + <td>added to <a href='#SkRect_fTop'>fTop</a> and subtracted from <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1887,30 +2372,31 @@ rect: 15, 27, 45, 60 ### See Also -<a href="#SkRect_outset">outset</a> <a href="#SkRect_makeInset">makeInset</a> <a href="SkIRect_Reference#SkIRect_inset">SkIRect::inset</a> +<a href='#SkRect_outset'>outset</a> <a href='#SkRect_makeInset'>makeInset</a> <a href='SkIRect_Reference#SkIRect_inset'>SkIRect::inset</a> --- -<a name="SkRect_outset"></a> +<a name='SkRect_outset'></a> ## outset -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void outset(SkScalar dx, SkScalar dy) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_outset'>outset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Outsets <a href="#Rect">Rect</a> by (<a href="#SkRect_outset_dx">dx</a>, <a href="#SkRect_outset_dy">dy</a>). +Outsets <a href='#Rect'>Rect</a> by (<a href='#SkRect_outset_dx'>dx</a>, <a href='#SkRect_outset_dy'>dy</a>). -If <a href="#SkRect_outset_dx">dx</a> is positive, makes <a href="#Rect">Rect</a> wider. -If <a href="#SkRect_outset_dx">dx</a> is negative, makes <a href="#Rect">Rect</a> narrower. -If <a href="#SkRect_outset_dy">dy</a> is positive, makes <a href="#Rect">Rect</a> taller. -If <a href="#SkRect_outset_dy">dy</a> is negative, makes <a href="#Rect">Rect</a> shorter. +If <a href='#SkRect_outset_dx'>dx</a> is positive, makes <a href='#Rect'>Rect</a> wider. +If <a href='#SkRect_outset_dx'>dx</a> is negative, makes <a href='#Rect'>Rect</a> narrower. +If <a href='#SkRect_outset_dy'>dy</a> is positive, makes <a href='#Rect'>Rect</a> taller. +If <a href='#SkRect_outset_dy'>dy</a> is negative, makes <a href='#Rect'>Rect</a> shorter. ### Parameters -<table> <tr> <td><a name="SkRect_outset_dx"> <code><strong>dx </strong></code> </a></td> <td> -subtracted to <a href="#SkRect_fLeft">fLeft</a> and added from <a href="#SkRect_fRight">fRight</a></td> - </tr> <tr> <td><a name="SkRect_outset_dy"> <code><strong>dy </strong></code> </a></td> <td> -subtracted to <a href="#SkRect_fTop">fTop</a> and added from <a href="#SkRect_fBottom">fBottom</a></td> +<table> <tr> <td><a name='SkRect_outset_dx'><code><strong>dx</strong></code></a></td> + <td>subtracted to <a href='#SkRect_fLeft'>fLeft</a> and added from <a href='#SkRect_fRight'>fRight</a></td> + </tr> + <tr> <td><a name='SkRect_outset_dy'><code><strong>dy</strong></code></a></td> + <td>subtracted to <a href='#SkRect_fTop'>fTop</a> and added from <a href='#SkRect_fBottom'>fBottom</a></td> </tr> </table> @@ -1928,55 +2414,81 @@ rect: 5, 1, 55, 86 ### See Also -<a href="#SkRect_inset">inset</a> <a href="#SkRect_makeOutset">makeOutset</a> <a href="SkIRect_Reference#SkIRect_outset">SkIRect::outset</a> +<a href='#SkRect_inset'>inset</a> <a href='#SkRect_makeOutset'>makeOutset</a> <a href='SkIRect_Reference#SkIRect_outset'>SkIRect::outset</a> --- -## <a name="Intersection"></a> Intersection +## <a name='Intersection'>Intersection</a> -<a href="#Rect">Rects</a> intersect when they enclose a common area. To intersect, each of the pair -must describe area; <a href="#SkRect_fLeft">fLeft</a> is less than <a href="#SkRect_fRight">fRight</a>, and <a href="#SkRect_fTop">fTop</a> is less than <a href="#SkRect_fBottom">fBottom</a>; -empty() returns false. The intersection of <a href="#Rect">Rect</a> pair can be described by: +<a href='#Rect'>Rects</a> intersect when they enclose a common area. To intersect, each of the pair +must describe area; <a href='#SkRect_fLeft'>fLeft</a> is less than <a href='#SkRect_fRight'>fRight</a>, and <a href='#SkRect_fTop'>fTop</a> is less than <a href='#SkRect_fBottom'>fBottom</a>; +empty() returns false. The intersection of <a href='#Rect'>Rect</a> pair can be described by: (max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)) . -The intersection is only meaningful if the resulting <a href="#Rect">Rect</a> is not empty and -describes an area: <a href="#SkRect_fLeft">fLeft</a> is less than <a href="#SkRect_fRight">fRight</a>, and <a href="#SkRect_fTop">fTop</a> is less than <a href="#SkRect_fBottom">fBottom</a>. +The intersection is only meaningful if the resulting <a href='#Rect'>Rect</a> is not empty and +describes an area: <a href='#SkRect_fLeft'>fLeft</a> is less than <a href='#SkRect_fRight'>fRight</a>, and <a href='#SkRect_fTop'>fTop</a> is less than <a href='#SkRect_fBottom'>fBottom</a>. + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_Intersects'>Intersects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_contains'>contains</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if points are equal or inside</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_contains'>contains(SkScalar x, SkScalar y)</a> const</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_intersect'>intersect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to shared area; returns true if not empty</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_intersect'>intersect(const SkRect& r)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_intersects'>intersects</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if areas overlap</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_intersects'>intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)</a> const</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkRect_Intersects">Intersects</a> | returns true if areas overlap | -| <a href="#SkRect_contains">contains</a> | returns true if points are equal or inside | -| | <a href="#SkRect_contains">contains(SkScalar x, SkScalar y)</a> const | -| <a href="#SkRect_intersect">intersect</a> | sets to shared area; returns true if not empty | -| | <a href="#SkRect_intersect">intersect(const SkRect& r)</a> | -| <a href="#SkRect_intersects">intersects</a> | returns true if areas overlap | -| | <a href="#SkRect_intersects">intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)</a> const | -<a name="SkRect_contains"></a> +<a name='SkRect_contains'></a> ## contains -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(SkScalar x, SkScalar y) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_contains'>contains</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const </pre> -Returns true if: <a href="#SkRect_fLeft">fLeft</a> <= x < <a href="#SkRect_fRight">fRight</a> && <a href="#SkRect_fTop">fTop</a> <= y < <a href="#SkRect_fBottom">fBottom</a>. -Returns false if <a href="#SkRect">SkRect</a> is empty. +Returns true if: <a href='#SkRect_fLeft'>fLeft</a> <= x < <a href='#SkRect_fRight'>fRight</a> && <a href='#SkRect_fTop'>fTop</a> <= y < <a href='#SkRect_fBottom'>fBottom</a>. +Returns false if <a href='#SkRect'>SkRect</a> is empty. ### Parameters -<table> <tr> <td><a name="SkRect_contains_x"> <code><strong>x </strong></code> </a></td> <td> -test <a href="SkPoint_Reference#SkPoint">SkPoint</a> x-coordinate</td> - </tr> <tr> <td><a name="SkRect_contains_y"> <code><strong>y </strong></code> </a></td> <td> -test <a href="SkPoint_Reference#SkPoint">SkPoint</a> y-coordinate</td> +<table> <tr> <td><a name='SkRect_contains_x'><code><strong>x</strong></code></a></td> + <td>test <a href='SkPoint_Reference#SkPoint'>SkPoint</a> x-coordinate</td> + </tr> + <tr> <td><a name='SkRect_contains_y'><code><strong>y</strong></code></a></td> + <td>test <a href='SkPoint_Reference#SkPoint'>SkPoint</a> y-coordinate</td> </tr> </table> ### Return Value -true if (x, y) is inside <a href="#SkRect">SkRect</a> +true if (x, y) is inside <a href='#SkRect'>SkRect</a> ### Example @@ -1994,31 +2506,31 @@ rect: (30, 50, 40, 60) does not contain (29, 59) ### See Also -<a href="SkIRect_Reference#SkIRect_contains">SkIRect::contains</a><sup><a href="SkIRect_Reference#SkIRect_contains_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_3">[3]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_4">[4]</a></sup> +<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup> --- -<a name="SkRect_contains_2"></a> +<a name='SkRect_contains_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(const SkRect& r) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_contains'>contains</a>(const <a href='#SkRect'>SkRect</a>& r) const </pre> -Returns true if <a href="#Rect">Rect</a> contains <a href="#SkRect_contains_2_r">r</a>. -Returns false if <a href="#Rect">Rect</a> is empty or <a href="#SkRect_contains_2_r">r</a> is empty. +Returns true if <a href='#Rect'>Rect</a> contains <a href='#SkRect_contains_2_r'>r</a>. +Returns false if <a href='#Rect'>Rect</a> is empty or <a href='#SkRect_contains_2_r'>r</a> is empty. -<a href="#Rect">Rect</a> contains <a href="#SkRect_contains_2_r">r</a> when <a href="#Rect">Rect</a> area completely includes <a href="#SkRect_contains_2_r">r</a> area. +<a href='#Rect'>Rect</a> contains <a href='#SkRect_contains_2_r'>r</a> when <a href='#Rect'>Rect</a> area completely includes <a href='#SkRect_contains_2_r'>r</a> area. ### Parameters -<table> <tr> <td><a name="SkRect_contains_2_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> contained</td> +<table> <tr> <td><a name='SkRect_contains_2_r'><code><strong>r</strong></code></a></td> + <td><a href='#Rect'>Rect</a> contained</td> </tr> </table> ### Return Value -true if all sides of <a href="#Rect">Rect</a> are outside <a href="#SkRect_contains_2_r">r</a> +true if all sides of <a href='#Rect'>Rect</a> are outside <a href='#SkRect_contains_2_r'>r</a> ### Example @@ -2036,31 +2548,31 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="SkIRect_Reference#SkIRect_contains">SkIRect::contains</a><sup><a href="SkIRect_Reference#SkIRect_contains_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_3">[3]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_4">[4]</a></sup> +<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup> --- -<a name="SkRect_contains_3"></a> +<a name='SkRect_contains_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool contains(const SkIRect& r) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_contains'>contains</a>(const <a href='SkIRect_Reference#SkIRect'>SkIRect</a>& r) const </pre> -Returns true if <a href="#Rect">Rect</a> contains <a href="#SkRect_contains_3_r">r</a>. -Returns false if <a href="#Rect">Rect</a> is empty or <a href="#SkRect_contains_3_r">r</a> is empty. +Returns true if <a href='#Rect'>Rect</a> contains <a href='#SkRect_contains_3_r'>r</a>. +Returns false if <a href='#Rect'>Rect</a> is empty or <a href='#SkRect_contains_3_r'>r</a> is empty. -<a href="#Rect">Rect</a> contains <a href="#SkRect_contains_3_r">r</a> when <a href="#Rect">Rect</a> area completely includes <a href="#SkRect_contains_3_r">r</a> area. +<a href='#Rect'>Rect</a> contains <a href='#SkRect_contains_3_r'>r</a> when <a href='#Rect'>Rect</a> area completely includes <a href='#SkRect_contains_3_r'>r</a> area. ### Parameters -<table> <tr> <td><a name="SkRect_contains_3_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="SkIRect_Reference#IRect">IRect</a> contained</td> +<table> <tr> <td><a name='SkRect_contains_3_r'><code><strong>r</strong></code></a></td> + <td><a href='SkIRect_Reference#IRect'>IRect</a> contained</td> </tr> </table> ### Return Value -true if all sides of <a href="#Rect">Rect</a> are outside <a href="#SkRect_contains_3_r">r</a> +true if all sides of <a href='#Rect'>Rect</a> are outside <a href='#SkRect_contains_3_r'>r</a> ### Example @@ -2078,36 +2590,36 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60) ### See Also -<a href="SkIRect_Reference#SkIRect_contains">SkIRect::contains</a><sup><a href="SkIRect_Reference#SkIRect_contains_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_3">[3]</a></sup><sup><a href="SkIRect_Reference#SkIRect_contains_4">[4]</a></sup> +<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup> --- -<a name="SkRect_intersect"></a> +<a name='SkRect_intersect'></a> ## intersect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool intersect(const SkRect& r) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_intersect'>intersect</a>(const <a href='#SkRect'>SkRect</a>& r) </pre> -Returns true if <a href="#Rect">Rect</a> intersects <a href="#SkRect_intersect_r">r</a>, and sets <a href="#Rect">Rect</a> to intersection. -Returns false if <a href="#Rect">Rect</a> does not intersect <a href="#SkRect_intersect_r">r</a>, and leaves <a href="#Rect">Rect</a> unchanged. +Returns true if <a href='#Rect'>Rect</a> intersects <a href='#SkRect_intersect_r'>r</a>, and sets <a href='#Rect'>Rect</a> to intersection. +Returns false if <a href='#Rect'>Rect</a> does not intersect <a href='#SkRect_intersect_r'>r</a>, and leaves <a href='#Rect'>Rect</a> unchanged. -Returns false if either <a href="#SkRect_intersect_r">r</a> or <a href="#Rect">Rect</a> is empty, leaving <a href="#Rect">Rect</a> unchanged. +Returns false if either <a href='#SkRect_intersect_r'>r</a> or <a href='#Rect'>Rect</a> is empty, leaving <a href='#Rect'>Rect</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkRect_intersect_r"> <code><strong>r </strong></code> </a></td> <td> -limit of result</td> +<table> <tr> <td><a name='SkRect_intersect_r'><code><strong>r</strong></code></a></td> + <td>limit of result</td> </tr> </table> ### Return Value -true if <a href="#SkRect_intersect_r">r</a> and <a href="#Rect">Rect</a> have area in common +true if <a href='#SkRect_intersect_r'>r</a> and <a href='#Rect'>Rect</a> have area in common ### Example -<div><fiddle-embed name="70e5b3979fc8a31eda070cfed91bc271"><div>Two <a href="undocumented#SkDebugf">SkDebugf</a> calls are required. If the calls are combined, their arguments +<div><fiddle-embed name="5d0b12e0ef6f1c181dddded4274230ca"><div>Two <a href='undocumented#SkDebugf'>SkDebugf</a> calls are required. If the calls are combined, their arguments may not be evaluated in left to right order: the printed intersection may be before or after the call to intersect. </div> @@ -2122,44 +2634,47 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkRect_intersects">intersects</a><sup><a href="#SkRect_intersects_2">[2]</a></sup> <a href="#SkRect_Intersects">Intersects</a> <a href="#SkRect_join">join</a><sup><a href="#SkRect_join_2">[2]</a></sup> <a href="SkIRect_Reference#SkIRect_intersect">SkIRect::intersect</a><sup><a href="SkIRect_Reference#SkIRect_intersect_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_intersect_3">[3]</a></sup> +<a href='#SkRect_intersects'>intersects</a><sup><a href='#SkRect_intersects_2'>[2]</a></sup> <a href='#SkRect_Intersects'>Intersects</a> <a href='#SkRect_join'>join</a><sup><a href='#SkRect_join_2'>[2]</a></sup> <a href='SkIRect_Reference#SkIRect_intersect'>SkIRect::intersect</a><sup><a href='SkIRect_Reference#SkIRect_intersect_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_intersect_3'>[3]</a></sup> --- -<a name="SkRect_intersect_2"></a> +<a name='SkRect_intersect_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool intersect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_intersect'>intersect</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom) </pre> -Constructs <a href="#Rect">Rect</a> to intersect from (left, top, right, bottom). Does not sort +Constructs <a href='#Rect'>Rect</a> to intersect from (left, top, right, bottom). Does not sort construction. -Returns true if <a href="#Rect">Rect</a> intersects construction, and sets <a href="#Rect">Rect</a> to intersection. -Returns false if <a href="#Rect">Rect</a> does not intersect construction, and leaves <a href="#Rect">Rect</a> unchanged. +Returns true if <a href='#Rect'>Rect</a> intersects construction, and sets <a href='#Rect'>Rect</a> to intersection. +Returns false if <a href='#Rect'>Rect</a> does not intersect construction, and leaves <a href='#Rect'>Rect</a> unchanged. -Returns false if either construction or <a href="#Rect">Rect</a> is empty, leaving <a href="#Rect">Rect</a> unchanged. +Returns false if either construction or <a href='#Rect'>Rect</a> is empty, leaving <a href='#Rect'>Rect</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkRect_intersect_2_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_intersect_2_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_intersect_2_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_intersect_2_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_intersect_2_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_intersect_2_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_intersect_2_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_intersect_2_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#Rect'>Rect</a></td> </tr> </table> ### Return Value -true if construction and <a href="#Rect">Rect</a> have area in common +true if construction and <a href='#Rect'>Rect</a> have area in common ### Example -<div><fiddle-embed name="9f06dad5e6c712f7a2c149d075e816d2"><div>Two <a href="undocumented#SkDebugf">SkDebugf</a> calls are required. If the calls are combined, their arguments +<div><fiddle-embed name="5002f65a72def2787086a33131933e70"><div>Two <a href='undocumented#SkDebugf'>SkDebugf</a> calls are required. If the calls are combined, their arguments may not be evaluated in left to right order: the printed intersection may be before or after the call to intersect. </div> @@ -2174,33 +2689,34 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkRect_intersects">intersects</a><sup><a href="#SkRect_intersects_2">[2]</a></sup> <a href="#SkRect_Intersects">Intersects</a> <a href="#SkRect_join">join</a><sup><a href="#SkRect_join_2">[2]</a></sup> <a href="SkIRect_Reference#SkIRect_intersect">SkIRect::intersect</a><sup><a href="SkIRect_Reference#SkIRect_intersect_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_intersect_3">[3]</a></sup> +<a href='#SkRect_intersects'>intersects</a><sup><a href='#SkRect_intersects_2'>[2]</a></sup> <a href='#SkRect_Intersects'>Intersects</a> <a href='#SkRect_join'>join</a><sup><a href='#SkRect_join_2'>[2]</a></sup> <a href='SkIRect_Reference#SkIRect_intersect'>SkIRect::intersect</a><sup><a href='SkIRect_Reference#SkIRect_intersect_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_intersect_3'>[3]</a></sup> --- -<a name="SkRect_intersect_3"></a> +<a name='SkRect_intersect_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_WARN_UNUSED_RESULT intersect(const SkRect& a, const SkRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_WARN_UNUSED_RESULT <a href='#SkRect_intersect'>intersect</a>(const <a href='#SkRect'>SkRect</a>& a, const <a href='#SkRect'>SkRect</a>& b) </pre> -Returns true if <a href="#SkRect_intersect_3_a">a</a> intersects <a href="#SkRect_intersect_3_b">b</a>, and sets <a href="#Rect">Rect</a> to intersection. -Returns false if <a href="#SkRect_intersect_3_a">a</a> does not intersect <a href="#SkRect_intersect_3_b">b</a>, and leaves <a href="#Rect">Rect</a> unchanged. +Returns true if <a href='#SkRect_intersect_3_a'>a</a> intersects <a href='#SkRect_intersect_3_b'>b</a>, and sets <a href='#Rect'>Rect</a> to intersection. +Returns false if <a href='#SkRect_intersect_3_a'>a</a> does not intersect <a href='#SkRect_intersect_3_b'>b</a>, and leaves <a href='#Rect'>Rect</a> unchanged. -Returns false if either <a href="#SkRect_intersect_3_a">a</a> or <a href="#SkRect_intersect_3_b">b</a> is empty, leaving <a href="#Rect">Rect</a> unchanged. +Returns false if either <a href='#SkRect_intersect_3_a'>a</a> or <a href='#SkRect_intersect_3_b'>b</a> is empty, leaving <a href='#Rect'>Rect</a> unchanged. ### Parameters -<table> <tr> <td><a name="SkRect_intersect_3_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to intersect</td> - </tr> <tr> <td><a name="SkRect_intersect_3_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to intersect</td> +<table> <tr> <td><a name='SkRect_intersect_3_a'><code><strong>a</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to intersect</td> + </tr> + <tr> <td><a name='SkRect_intersect_3_b'><code><strong>b</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkRect_intersect_3_a">a</a> and <a href="#SkRect_intersect_3_b">b</a> have area in common +true if <a href='#SkRect_intersect_3_a'>a</a> and <a href='#SkRect_intersect_3_b'>b</a> have area in common ### Example @@ -2216,39 +2732,42 @@ intersection: 30, 60, 50, 80 ### See Also -<a href="#SkRect_intersects">intersects</a><sup><a href="#SkRect_intersects_2">[2]</a></sup> <a href="#SkRect_Intersects">Intersects</a> <a href="#SkRect_join">join</a><sup><a href="#SkRect_join_2">[2]</a></sup> <a href="SkIRect_Reference#SkIRect_intersect">SkIRect::intersect</a><sup><a href="SkIRect_Reference#SkIRect_intersect_2">[2]</a></sup><sup><a href="SkIRect_Reference#SkIRect_intersect_3">[3]</a></sup> +<a href='#SkRect_intersects'>intersects</a><sup><a href='#SkRect_intersects_2'>[2]</a></sup> <a href='#SkRect_Intersects'>Intersects</a> <a href='#SkRect_join'>join</a><sup><a href='#SkRect_join_2'>[2]</a></sup> <a href='SkIRect_Reference#SkIRect_intersect'>SkIRect::intersect</a><sup><a href='SkIRect_Reference#SkIRect_intersect_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_intersect_3'>[3]</a></sup> --- -<a name="SkRect_intersects"></a> +<a name='SkRect_intersects'></a> ## intersects -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_intersects'>intersects</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom) const </pre> -Constructs <a href="#Rect">Rect</a> to intersect from (left, top, right, bottom). Does not sort +Constructs <a href='#Rect'>Rect</a> to intersect from (left, top, right, bottom). Does not sort construction. -Returns true if <a href="#Rect">Rect</a> intersects construction. -Returns false if either construction or <a href="#Rect">Rect</a> is empty, or do not intersect. +Returns true if <a href='#Rect'>Rect</a> intersects construction. +Returns false if either construction or <a href='#Rect'>Rect</a> is empty, or do not intersect. ### Parameters -<table> <tr> <td><a name="SkRect_intersects_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_intersects_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_intersects_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_intersects_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_intersects_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_intersects_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_intersects_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_intersects_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#Rect'>Rect</a></td> </tr> </table> ### Return Value -true if construction and <a href="#Rect">Rect</a> have area in common +true if construction and <a href='#Rect'>Rect</a> have area in common ### Example @@ -2264,29 +2783,29 @@ intersection ### See Also -<a href="#SkRect_intersect">intersect</a><sup><a href="#SkRect_intersect_2">[2]</a></sup><sup><a href="#SkRect_intersect_3">[3]</a></sup> <a href="#SkRect_Intersects">Intersects</a> <a href="SkIRect_Reference#SkIRect_Intersects">SkIRect::Intersects</a> +<a href='#SkRect_intersect'>intersect</a><sup><a href='#SkRect_intersect_2'>[2]</a></sup><sup><a href='#SkRect_intersect_3'>[3]</a></sup> <a href='#SkRect_Intersects'>Intersects</a> <a href='SkIRect_Reference#SkIRect_Intersects'>SkIRect::Intersects</a> --- -<a name="SkRect_intersects_2"></a> +<a name='SkRect_intersects_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool intersects(const SkRect& r) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkRect_intersects'>intersects</a>(const <a href='#SkRect'>SkRect</a>& r) const </pre> -Returns true if <a href="#Rect">Rect</a> intersects <a href="#SkRect_intersects_2_r">r</a>. -Returns false if either <a href="#SkRect_intersects_2_r">r</a> or <a href="#Rect">Rect</a> is empty, or do not intersect. +Returns true if <a href='#Rect'>Rect</a> intersects <a href='#SkRect_intersects_2_r'>r</a>. +Returns false if either <a href='#SkRect_intersects_2_r'>r</a> or <a href='#Rect'>Rect</a> is empty, or do not intersect. ### Parameters -<table> <tr> <td><a name="SkRect_intersects_2_r"> <code><strong>r </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to intersect</td> +<table> <tr> <td><a name='SkRect_intersects_2_r'><code><strong>r</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkRect_intersects_2_r">r</a> and <a href="#Rect">Rect</a> have area in common +true if <a href='#SkRect_intersects_2_r'>r</a> and <a href='#Rect'>Rect</a> have area in common ### Example @@ -2302,32 +2821,33 @@ intersection ### See Also -<a href="#SkRect_intersect">intersect</a><sup><a href="#SkRect_intersect_2">[2]</a></sup><sup><a href="#SkRect_intersect_3">[3]</a></sup> <a href="#SkRect_Intersects">Intersects</a> <a href="SkIRect_Reference#SkIRect_Intersects">SkIRect::Intersects</a> +<a href='#SkRect_intersect'>intersect</a><sup><a href='#SkRect_intersect_2'>[2]</a></sup><sup><a href='#SkRect_intersect_3'>[3]</a></sup> <a href='#SkRect_Intersects'>Intersects</a> <a href='SkIRect_Reference#SkIRect_Intersects'>SkIRect::Intersects</a> --- -<a name="SkRect_Intersects"></a> +<a name='SkRect_Intersects'></a> ## Intersects -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool Intersects(const SkRect& a, const SkRect& b) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkRect_Intersects'>Intersects</a>(const <a href='#SkRect'>SkRect</a>& a, const <a href='#SkRect'>SkRect</a>& b) </pre> -Returns true if <a href="#SkRect_Intersects_a">a</a> intersects <a href="#SkRect_Intersects_b">b</a>. -Returns false if either <a href="#SkRect_Intersects_a">a</a> or <a href="#SkRect_Intersects_b">b</a> is empty, or do not intersect. +Returns true if <a href='#SkRect_Intersects_a'>a</a> intersects <a href='#SkRect_Intersects_b'>b</a>. +Returns false if either <a href='#SkRect_Intersects_a'>a</a> or <a href='#SkRect_Intersects_b'>b</a> is empty, or do not intersect. ### Parameters -<table> <tr> <td><a name="SkRect_Intersects_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to intersect</td> - </tr> <tr> <td><a name="SkRect_Intersects_b"> <code><strong>b </strong></code> </a></td> <td> -<a href="#Rect">Rect</a> to intersect</td> +<table> <tr> <td><a name='SkRect_Intersects_a'><code><strong>a</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to intersect</td> + </tr> + <tr> <td><a name='SkRect_Intersects_b'><code><strong>b</strong></code></a></td> + <td><a href='#Rect'>Rect</a> to intersect</td> </tr> </table> ### Return Value -true if <a href="#SkRect_Intersects_a">a</a> and <a href="#SkRect_Intersects_b">b</a> have area in common +true if <a href='#SkRect_Intersects_a'>a</a> and <a href='#SkRect_Intersects_b'>b</a> have area in common ### Example @@ -2343,44 +2863,63 @@ intersection ### See Also -<a href="#SkRect_intersect">intersect</a><sup><a href="#SkRect_intersect_2">[2]</a></sup><sup><a href="#SkRect_intersect_3">[3]</a></sup> <a href="#SkRect_intersects">intersects</a><sup><a href="#SkRect_intersects_2">[2]</a></sup> <a href="SkIRect_Reference#SkIRect_Intersects">SkIRect::Intersects</a> +<a href='#SkRect_intersect'>intersect</a><sup><a href='#SkRect_intersect_2'>[2]</a></sup><sup><a href='#SkRect_intersect_3'>[3]</a></sup> <a href='#SkRect_intersects'>intersects</a><sup><a href='#SkRect_intersects_2'>[2]</a></sup> <a href='SkIRect_Reference#SkIRect_Intersects'>SkIRect::Intersects</a> --- -## <a name="Join"></a> Join +## <a name='Join'>Join</a> -| name | description | -| --- | --- | -| <a href="#SkRect_join">join</a> | sets to union of bounds | -| | <a href="#SkRect_join">join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)</a> | -| <a href="#SkRect_joinNonEmptyArg">joinNonEmptyArg</a> | sets to union of bounds, asserting that argument is not empty | -| <a href="#SkRect_joinPossiblyEmptyRect">joinPossiblyEmptyRect</a> | sets to union of bounds. Skips empty check for both | -<a name="SkRect_join"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_join'>join</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_join'>join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_joinNonEmptyArg'>joinNonEmptyArg</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds, asserting that argument is not empty</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_joinPossiblyEmptyRect'>joinPossiblyEmptyRect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to union of bounds; skips empty check for both</td> + </tr> +</table> + + +<a name='SkRect_join'></a> ## join -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_join'>join</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom) </pre> -Constructs <a href="#Rect">Rect</a> to intersect from (left, top, right, bottom). Does not sort +Constructs <a href='#Rect'>Rect</a> to intersect from (left, top, right, bottom). Does not sort construction. -Sets <a href="#Rect">Rect</a> to the union of itself and the construction. +Sets <a href='#Rect'>Rect</a> to the union of itself and the construction. -Has no effect if construction is empty. Otherwise, if <a href="#Rect">Rect</a> is empty, sets -<a href="#Rect">Rect</a> to construction. +Has no effect if construction is empty. Otherwise, if <a href='#Rect'>Rect</a> is empty, sets +<a href='#Rect'>Rect</a> to construction. ### Parameters -<table> <tr> <td><a name="SkRect_join_left"> <code><strong>left </strong></code> </a></td> <td> -x minimum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_join_top"> <code><strong>top </strong></code> </a></td> <td> -y minimum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_join_right"> <code><strong>right </strong></code> </a></td> <td> -x maximum of constructed <a href="#Rect">Rect</a></td> - </tr> <tr> <td><a name="SkRect_join_bottom"> <code><strong>bottom </strong></code> </a></td> <td> -y maximum of constructed <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_join_left'><code><strong>left</strong></code></a></td> + <td>x minimum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_join_top'><code><strong>top</strong></code></a></td> + <td>y minimum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_join_right'><code><strong>right</strong></code></a></td> + <td>x maximum of constructed <a href='#Rect'>Rect</a></td> + </tr> + <tr> <td><a name='SkRect_join_bottom'><code><strong>bottom</strong></code></a></td> + <td>y maximum of constructed <a href='#Rect'>Rect</a></td> </tr> </table> @@ -2398,25 +2937,25 @@ join: 10, 20, 55, 65 ### See Also -<a href="#SkRect_joinNonEmptyArg">joinNonEmptyArg</a> <a href="#SkRect_joinPossiblyEmptyRect">joinPossiblyEmptyRect</a> <a href="SkIRect_Reference#SkIRect_join">SkIRect::join</a><sup><a href="SkIRect_Reference#SkIRect_join_2">[2]</a></sup> +<a href='#SkRect_joinNonEmptyArg'>joinNonEmptyArg</a> <a href='#SkRect_joinPossiblyEmptyRect'>joinPossiblyEmptyRect</a> <a href='SkIRect_Reference#SkIRect_join'>SkIRect::join</a><sup><a href='SkIRect_Reference#SkIRect_join_2'>[2]</a></sup> --- -<a name="SkRect_join_2"></a> +<a name='SkRect_join_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void join(const SkRect& r) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_join'>join</a>(const <a href='#SkRect'>SkRect</a>& r) </pre> -Sets <a href="#Rect">Rect</a> to the union of itself and <a href="#SkRect_join_2_r">r</a>. +Sets <a href='#Rect'>Rect</a> to the union of itself and <a href='#SkRect_join_2_r'>r</a>. -Has no effect if <a href="#SkRect_join_2_r">r</a> is empty. Otherwise, if <a href="#Rect">Rect</a> is empty, sets -<a href="#Rect">Rect</a> to <a href="#SkRect_join_2_r">r</a>. +Has no effect if <a href='#SkRect_join_2_r'>r</a> is empty. Otherwise, if <a href='#Rect'>Rect</a> is empty, sets +<a href='#Rect'>Rect</a> to <a href='#SkRect_join_2_r'>r</a>. ### Parameters -<table> <tr> <td><a name="SkRect_join_2_r"> <code><strong>r </strong></code> </a></td> <td> -expansion <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_join_2_r'><code><strong>r</strong></code></a></td> + <td>expansion <a href='#Rect'>Rect</a></td> </tr> </table> @@ -2434,34 +2973,34 @@ join: 10, 20, 55, 65 ### See Also -<a href="#SkRect_joinNonEmptyArg">joinNonEmptyArg</a> <a href="#SkRect_joinPossiblyEmptyRect">joinPossiblyEmptyRect</a> <a href="SkIRect_Reference#SkIRect_join">SkIRect::join</a><sup><a href="SkIRect_Reference#SkIRect_join_2">[2]</a></sup> +<a href='#SkRect_joinNonEmptyArg'>joinNonEmptyArg</a> <a href='#SkRect_joinPossiblyEmptyRect'>joinPossiblyEmptyRect</a> <a href='SkIRect_Reference#SkIRect_join'>SkIRect::join</a><sup><a href='SkIRect_Reference#SkIRect_join_2'>[2]</a></sup> --- -<a name="SkRect_joinNonEmptyArg"></a> +<a name='SkRect_joinNonEmptyArg'></a> ## joinNonEmptyArg -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void joinNonEmptyArg(const SkRect& r) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_joinNonEmptyArg'>joinNonEmptyArg</a>(const <a href='#SkRect'>SkRect</a>& r) </pre> -Sets <a href="#Rect">Rect</a> to the union of itself and <a href="#SkRect_joinNonEmptyArg_r">r</a>. +Sets <a href='#Rect'>Rect</a> to the union of itself and <a href='#SkRect_joinNonEmptyArg_r'>r</a>. -Asserts if <a href="#SkRect_joinNonEmptyArg_r">r</a> is empty and SK_DEBUG is defined. -If <a href="#Rect">Rect</a> is empty, sets <a href="#Rect">Rect</a> to <a href="#SkRect_joinNonEmptyArg_r">r</a>. +Asserts if <a href='#SkRect_joinNonEmptyArg_r'>r</a> is empty and SK_DEBUG is defined. +If <a href='#Rect'>Rect</a> is empty, sets <a href='#Rect'>Rect</a> to <a href='#SkRect_joinNonEmptyArg_r'>r</a>. -May produce incorrect results if <a href="#SkRect_joinNonEmptyArg_r">r</a> is empty. +May produce incorrect results if <a href='#SkRect_joinNonEmptyArg_r'>r</a> is empty. ### Parameters -<table> <tr> <td><a name="SkRect_joinNonEmptyArg_r"> <code><strong>r </strong></code> </a></td> <td> -expansion <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_joinNonEmptyArg_r'><code><strong>r</strong></code></a></td> + <td>expansion <a href='#Rect'>Rect</a></td> </tr> </table> ### Example -<div><fiddle-embed name="88439de2aa0911262c60c0eb506396cb"><div>Since <a href="#Rect">Rect</a> is not sorted, first result is copy of toJoin. +<div><fiddle-embed name="88439de2aa0911262c60c0eb506396cb"><div>Since <a href='#Rect'>Rect</a> is not sorted, first result is copy of toJoin. </div> #### Example Output @@ -2475,31 +3014,31 @@ sorted: 10, 0, 55, 100 ### See Also -<a href="#SkRect_join">join</a><sup><a href="#SkRect_join_2">[2]</a></sup> <a href="#SkRect_joinPossiblyEmptyRect">joinPossiblyEmptyRect</a> <a href="SkIRect_Reference#SkIRect_join">SkIRect::join</a><sup><a href="SkIRect_Reference#SkIRect_join_2">[2]</a></sup> +<a href='#SkRect_join'>join</a><sup><a href='#SkRect_join_2'>[2]</a></sup> <a href='#SkRect_joinPossiblyEmptyRect'>joinPossiblyEmptyRect</a> <a href='SkIRect_Reference#SkIRect_join'>SkIRect::join</a><sup><a href='SkIRect_Reference#SkIRect_join_2'>[2]</a></sup> --- -<a name="SkRect_joinPossiblyEmptyRect"></a> +<a name='SkRect_joinPossiblyEmptyRect'></a> ## joinPossiblyEmptyRect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void joinPossiblyEmptyRect(const SkRect& r) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_joinPossiblyEmptyRect'>joinPossiblyEmptyRect</a>(const <a href='#SkRect'>SkRect</a>& r) </pre> -Sets <a href="#Rect">Rect</a> to the union of itself and the construction. +Sets <a href='#Rect'>Rect</a> to the union of itself and the construction. -May produce incorrect results if <a href="#Rect">Rect</a> or <a href="#SkRect_joinPossiblyEmptyRect_r">r</a> is empty. +May produce incorrect results if <a href='#Rect'>Rect</a> or <a href='#SkRect_joinPossiblyEmptyRect_r'>r</a> is empty. ### Parameters -<table> <tr> <td><a name="SkRect_joinPossiblyEmptyRect_r"> <code><strong>r </strong></code> </a></td> <td> -expansion <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_joinPossiblyEmptyRect_r'><code><strong>r</strong></code></a></td> + <td>expansion <a href='#Rect'>Rect</a></td> </tr> </table> ### Example -<div><fiddle-embed name="a476548d0001296afd8e58c1eba1b70b"><div>Since <a href="#Rect">Rect</a> is not sorted, first result is not useful. +<div><fiddle-embed name="a476548d0001296afd8e58c1eba1b70b"><div>Since <a href='#Rect'>Rect</a> is not sorted, first result is not useful. </div> #### Example Output @@ -2513,36 +3052,55 @@ sorted: 10, 0, 55, 100 ### See Also -<a href="#SkRect_joinNonEmptyArg">joinNonEmptyArg</a> <a href="#SkRect_join">join</a><sup><a href="#SkRect_join_2">[2]</a></sup> <a href="SkIRect_Reference#SkIRect_join">SkIRect::join</a><sup><a href="SkIRect_Reference#SkIRect_join_2">[2]</a></sup> +<a href='#SkRect_joinNonEmptyArg'>joinNonEmptyArg</a> <a href='#SkRect_join'>join</a><sup><a href='#SkRect_join_2'>[2]</a></sup> <a href='SkIRect_Reference#SkIRect_join'>SkIRect::join</a><sup><a href='SkIRect_Reference#SkIRect_join_2'>[2]</a></sup> --- -## <a name="Rounding"></a> Rounding +## <a name='Rounding'>Rounding</a> -| name | description | -| --- | --- | -| <a href="#SkRect_round_2">round</a> | sets members to nearest integer value | -| | <a href="#SkRect_round">round(SkIRect* dst)</a> const | -| <a href="#SkRect_roundIn">roundIn</a> | sets members to nearest integer value towards opposite | -| <a href="#SkRect_roundOut">roundOut</a> | sets members to nearest integer value away from opposite | -| | <a href="#SkRect_roundOut">roundOut(SkIRect* dst)</a> const | -<a name="SkRect_round"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_round_2'>round</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets members to nearest integer value</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_round'>round(SkIRect* dst)</a> const</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_roundIn'>roundIn</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets members to nearest integer value towards opposite</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_roundOut'>roundOut</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets members to nearest integer value away from opposite</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_roundOut'>roundOut(SkIRect* dst)</a> const</td> + </tr> +</table> + + +<a name='SkRect_round'></a> ## round -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void round(SkIRect* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_round'>round</a>(<a href='SkIRect_Reference#SkIRect'>SkIRect</a>* dst) const </pre> -Sets <a href="SkIRect_Reference#IRect">IRect</a> by adding 0.5 and discarding the fractional portion of <a href="#Rect">Rect</a> -members, using(<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fLeft)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fTop)</a>, -<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fRight)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fBottom)</a>) +Sets <a href='SkIRect_Reference#IRect'>IRect</a> by adding 0.5 and discarding the fractional portion of <a href='#Rect'>Rect</a> +members, using(<a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fLeft)</a>, <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fTop)</a>, +<a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fRight)</a>, <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fBottom)</a>) . ### Parameters -<table> <tr> <td><a name="SkRect_round_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for <a href="SkIRect_Reference#IRect">IRect</a></td> +<table> <tr> <td><a name='SkRect_round_dst'><code><strong>dst</strong></code></a></td> + <td>storage for <a href='SkIRect_Reference#IRect'>IRect</a></td> </tr> </table> @@ -2560,26 +3118,26 @@ round: 31, 51, 41, 61 ### See Also -<a href="#SkRect_roundIn">roundIn</a> <a href="#SkRect_roundOut">roundOut</a><sup><a href="#SkRect_roundOut_2">[2]</a></sup><sup><a href="#SkRect_roundOut_3">[3]</a></sup> <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt</a> +<a href='#SkRect_roundIn'>roundIn</a> <a href='#SkRect_roundOut'>roundOut</a><sup><a href='#SkRect_roundOut_2'>[2]</a></sup><sup><a href='#SkRect_roundOut_3'>[3]</a></sup> <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt</a> --- -<a name="SkRect_roundOut"></a> +<a name='SkRect_roundOut'></a> ## roundOut -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void roundOut(SkIRect* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_roundOut'>roundOut</a>(<a href='SkIRect_Reference#SkIRect'>SkIRect</a>* dst) const </pre> -Sets <a href="SkIRect_Reference#IRect">IRect</a> by discarding the fractional portion of <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and -rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fLeft)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fTop)</a>, -<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fRight)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fBottom)</a>) +Sets <a href='SkIRect_Reference#IRect'>IRect</a> by discarding the fractional portion of <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fTop'>fTop</a>; and +rounding up <a href='#SkRect_fRight'>fRight</a> and <a href='#SkRect_fBottom'>fBottom</a>, using(<a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fLeft)</a>, <a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fTop)</a>, +<a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fRight)</a>, <a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fBottom)</a>) . ### Parameters -<table> <tr> <td><a name="SkRect_roundOut_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for <a href="SkIRect_Reference#IRect">IRect</a></td> +<table> <tr> <td><a name='SkRect_roundOut_dst'><code><strong>dst</strong></code></a></td> + <td>storage for <a href='SkIRect_Reference#IRect'>IRect</a></td> </tr> </table> @@ -2597,25 +3155,25 @@ round: 30, 50, 41, 61 ### See Also -<a href="#SkRect_roundIn">roundIn</a> <a href="#SkRect_round">round</a><sup><a href="#SkRect_round_2">[2]</a></sup> <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt</a> +<a href='#SkRect_roundIn'>roundIn</a> <a href='#SkRect_round'>round</a><sup><a href='#SkRect_round_2'>[2]</a></sup> <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt</a> --- -<a name="SkRect_roundOut_2"></a> +<a name='SkRect_roundOut_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void roundOut(SkRect* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_roundOut'>roundOut</a>(<a href='#SkRect'>SkRect</a>* dst) const </pre> -Sets <a href="#Rect">Rect</a> by discarding the fractional portion of <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and -rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fLeft)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fTop)</a>, -<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fRight)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fBottom)</a>) +Sets <a href='#Rect'>Rect</a> by discarding the fractional portion of <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fTop'>fTop</a>; and +rounding up <a href='#SkRect_fRight'>fRight</a> and <a href='#SkRect_fBottom'>fBottom</a>, using(<a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fLeft)</a>, <a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fTop)</a>, +<a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fRight)</a>, <a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fBottom)</a>) . ### Parameters -<table> <tr> <td><a name="SkRect_roundOut_2_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for <a href="#Rect">Rect</a></td> +<table> <tr> <td><a name='SkRect_roundOut_2_dst'><code><strong>dst</strong></code></a></td> + <td>storage for <a href='#Rect'>Rect</a></td> </tr> </table> @@ -2633,26 +3191,26 @@ round: 30, 50, 41, 61 ### See Also -<a href="#SkRect_roundIn">roundIn</a> <a href="#SkRect_round">round</a><sup><a href="#SkRect_round_2">[2]</a></sup> <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt</a> +<a href='#SkRect_roundIn'>roundIn</a> <a href='#SkRect_round'>round</a><sup><a href='#SkRect_round_2'>[2]</a></sup> <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt</a> --- -<a name="SkRect_roundIn"></a> +<a name='SkRect_roundIn'></a> ## roundIn -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void roundIn(SkIRect* dst) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_roundIn'>roundIn</a>(<a href='SkIRect_Reference#SkIRect'>SkIRect</a>* dst) const </pre> -Sets <a href="#Rect">Rect</a> by rounding up <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and -discarding the fractional portion of <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fLeft)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fTop)</a>, -<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fRight)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fBottom)</a>) +Sets <a href='#Rect'>Rect</a> by rounding up <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fTop'>fTop</a>; and +discarding the fractional portion of <a href='#SkRect_fRight'>fRight</a> and <a href='#SkRect_fBottom'>fBottom</a>, using(<a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fLeft)</a>, <a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fTop)</a>, +<a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fRight)</a>, <a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fBottom)</a>) . ### Parameters -<table> <tr> <td><a name="SkRect_roundIn_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for <a href="SkIRect_Reference#IRect">IRect</a></td> +<table> <tr> <td><a name='SkRect_roundIn_dst'><code><strong>dst</strong></code></a></td> + <td>storage for <a href='SkIRect_Reference#IRect'>IRect</a></td> </tr> </table> @@ -2670,24 +3228,24 @@ round: 31, 51, 40, 60 ### See Also -<a href="#SkRect_roundOut">roundOut</a><sup><a href="#SkRect_roundOut_2">[2]</a></sup><sup><a href="#SkRect_roundOut_3">[3]</a></sup> <a href="#SkRect_round">round</a><sup><a href="#SkRect_round_2">[2]</a></sup> <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt</a> +<a href='#SkRect_roundOut'>roundOut</a><sup><a href='#SkRect_roundOut_2'>[2]</a></sup><sup><a href='#SkRect_roundOut_3'>[3]</a></sup> <a href='#SkRect_round'>round</a><sup><a href='#SkRect_round_2'>[2]</a></sup> <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt</a> --- -<a name="SkRect_round_2"></a> +<a name='SkRect_round_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect round() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkRect_round'>round</a>() const </pre> -Returns <a href="SkIRect_Reference#IRect">IRect</a> by adding 0.5 and discarding the fractional portion of <a href="#Rect">Rect</a> -members, using(<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fLeft)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fTop)</a>, -<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fRight)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fBottom)</a>) +Returns <a href='SkIRect_Reference#IRect'>IRect</a> by adding 0.5 and discarding the fractional portion of <a href='#Rect'>Rect</a> +members, using(<a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fLeft)</a>, <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fTop)</a>, +<a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fRight)</a>, <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt(fBottom)</a>) . ### Return Value -rounded <a href="SkIRect_Reference#IRect">IRect</a> +rounded <a href='SkIRect_Reference#IRect'>IRect</a> ### Example @@ -2703,24 +3261,24 @@ round: 31, 51, 41, 61 ### See Also -<a href="#SkRect_roundOut">roundOut</a><sup><a href="#SkRect_roundOut_2">[2]</a></sup><sup><a href="#SkRect_roundOut_3">[3]</a></sup> <a href="#SkRect_roundIn">roundIn</a> <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt</a> +<a href='#SkRect_roundOut'>roundOut</a><sup><a href='#SkRect_roundOut_2'>[2]</a></sup><sup><a href='#SkRect_roundOut_3'>[3]</a></sup> <a href='#SkRect_roundIn'>roundIn</a> <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt</a> --- -<a name="SkRect_roundOut_3"></a> +<a name='SkRect_roundOut_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIRect roundOut() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkIRect_Reference#SkIRect'>SkIRect</a> <a href='#SkRect_roundOut'>roundOut</a>() const </pre> -Sets <a href="SkIRect_Reference#IRect">IRect</a> by discarding the fractional portion of <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and -rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fLeft)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fTop)</a>, -<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fRight)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fBottom)</a>) +Sets <a href='SkIRect_Reference#IRect'>IRect</a> by discarding the fractional portion of <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fTop'>fTop</a>; and +rounding up <a href='#SkRect_fRight'>fRight</a> and <a href='#SkRect_fBottom'>fBottom</a>, using(<a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fLeft)</a>, <a href='undocumented#SkScalarFloorToInt'>SkScalarFloorToInt(fTop)</a>, +<a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fRight)</a>, <a href='undocumented#SkScalarCeilToInt'>SkScalarCeilToInt(fBottom)</a>) . ### Return Value -rounded <a href="SkIRect_Reference#IRect">IRect</a> +rounded <a href='SkIRect_Reference#IRect'>IRect</a> ### Example @@ -2736,26 +3294,33 @@ round: 30, 50, 41, 61 ### See Also -<a href="#SkRect_round">round</a><sup><a href="#SkRect_round_2">[2]</a></sup> <a href="#SkRect_roundIn">roundIn</a> <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt</a> +<a href='#SkRect_round'>round</a><sup><a href='#SkRect_round_2'>[2]</a></sup> <a href='#SkRect_roundIn'>roundIn</a> <a href='undocumented#SkScalarRoundToInt'>SkScalarRoundToInt</a> --- -## <a name="Sorting"></a> Sorting +## <a name='Sorting'>Sorting</a> -| name | description | -| --- | --- | -| <a href="#SkRect_sort">sort</a> | orders sides from smaller to larger | -<a name="SkRect_sort"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRect_sort'>sort</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>orders sides from smaller to larger</td> + </tr> +</table> + + +<a name='SkRect_sort'></a> ## sort -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void sort() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_sort'>sort</a>() </pre> -Swaps <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a> if <a href="#SkRect_fLeft">fLeft</a> is greater than <a href="#SkRect_fRight">fRight</a>; and swaps -<a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a> if <a href="#SkRect_fTop">fTop</a> is greater than <a href="#SkRect_fBottom">fBottom</a>. Result may be empty; -and <a href="#SkRect_width">width</a> and <a href="#SkRect_height">height</a> will be zero or positive. +Swaps <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a> if <a href='#SkRect_fLeft'>fLeft</a> is greater than <a href='#SkRect_fRight'>fRight</a>; and swaps +<a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a> if <a href='#SkRect_fTop'>fTop</a> is greater than <a href='#SkRect_fBottom'>fBottom</a>. Result may be empty; +and <a href='#SkRect_width'>width</a> and <a href='#SkRect_height'>height</a> will be zero or positive. ### Example @@ -2772,24 +3337,24 @@ sorted: 20.5, 10.5, 30.5, 50.5 ### See Also -<a href="#SkRect_makeSorted">makeSorted</a> <a href="SkIRect_Reference#SkIRect_sort">SkIRect::sort</a> <a href="#SkRect_isSorted">isSorted</a> +<a href='#SkRect_makeSorted'>makeSorted</a> <a href='SkIRect_Reference#SkIRect_sort'>SkIRect::sort</a> <a href='#SkRect_isSorted'>isSorted</a> --- -<a name="SkRect_makeSorted"></a> +<a name='SkRect_makeSorted'></a> ## makeSorted -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkRect makeSorted() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='#SkRect'>SkRect</a> <a href='#SkRect_makeSorted'>makeSorted</a>() const </pre> -Returns <a href="#Rect">Rect</a> with <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fRight">fRight</a> swapped if <a href="#SkRect_fLeft">fLeft</a> is greater than <a href="#SkRect_fRight">fRight</a>; and -with <a href="#SkRect_fTop">fTop</a> and <a href="#SkRect_fBottom">fBottom</a> swapped if <a href="#SkRect_fTop">fTop</a> is greater than <a href="#SkRect_fBottom">fBottom</a>. Result may be empty; -and <a href="#SkRect_width">width</a> and <a href="#SkRect_height">height</a> will be zero or positive. +Returns <a href='#Rect'>Rect</a> with <a href='#SkRect_fLeft'>fLeft</a> and <a href='#SkRect_fRight'>fRight</a> swapped if <a href='#SkRect_fLeft'>fLeft</a> is greater than <a href='#SkRect_fRight'>fRight</a>; and +with <a href='#SkRect_fTop'>fTop</a> and <a href='#SkRect_fBottom'>fBottom</a> swapped if <a href='#SkRect_fTop'>fTop</a> is greater than <a href='#SkRect_fBottom'>fBottom</a>. Result may be empty; +and <a href='#SkRect_width'>width</a> and <a href='#SkRect_height'>height</a> will be zero or positive. ### Return Value -sorted <a href="#Rect">Rect</a> +sorted <a href='#Rect'>Rect</a> ### Example @@ -2806,23 +3371,23 @@ sorted: 20.5, 10.5, 30.5, 50.5 ### See Also -<a href="#SkRect_sort">sort</a> <a href="SkIRect_Reference#SkIRect_makeSorted">SkIRect::makeSorted</a> <a href="#SkRect_isSorted">isSorted</a> +<a href='#SkRect_sort'>sort</a> <a href='SkIRect_Reference#SkIRect_makeSorted'>SkIRect::makeSorted</a> <a href='#SkRect_isSorted'>isSorted</a> --- -<a name="SkRect_asScalars"></a> +<a name='SkRect_asScalars'></a> ## asScalars -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkScalar* asScalars() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='undocumented#SkScalar'>SkScalar</a>* <a href='#SkRect_asScalars'>asScalars</a>() const </pre> -Returns pointer to first <a href="undocumented#Scalar">Scalar</a> in <a href="#Rect">Rect</a>, to treat it as an array with four +Returns pointer to first <a href='undocumented#Scalar'>Scalar</a> in <a href='#Rect'>Rect</a>, to treat it as an array with four entries. ### Return Value -pointer to <a href="#SkRect_fLeft">fLeft</a> +pointer to <a href='#SkRect_fLeft'>fLeft</a> ### Example @@ -2838,24 +3403,24 @@ rect.asScalars() == &rect.fLeft ### See Also -<a href="#SkRect_toQuad">toQuad</a> +<a href='#SkRect_toQuad'>toQuad</a> --- -<a name="SkRect_dump"></a> +<a name='SkRect_dump'></a> ## dump -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump(bool asHex) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_dump'>dump</a>(bool asHex) const </pre> -Writes text representation of <a href="#Rect">Rect</a> to standard output. <a href="#Set">Set</a> <a href="#SkRect_dump_asHex">asHex</a> to true to +Writes text representation of <a href='#Rect'>Rect</a> to standard output. <a href='#Set'>Set</a> <a href='#SkRect_dump_asHex'>asHex</a> to true to generate exact binary representations of floating point numbers. ### Parameters -<table> <tr> <td><a name="SkRect_dump_asHex"> <code><strong>asHex </strong></code> </a></td> <td> -true if <a href="undocumented#SkScalar">SkScalar</a> values are written as hexadecimal</td> +<table> <tr> <td><a name='SkRect_dump_asHex'><code><strong>asHex</strong></code></a></td> + <td>true if <a href='undocumented#SkScalar'>SkScalar</a> values are written as hexadecimal</td> </tr> </table> @@ -2877,19 +3442,19 @@ SkBits2Float(0x42480000) /* 50.000000 */); ### See Also -<a href="#SkRect_dumpHex">dumpHex</a> +<a href='#SkRect_dumpHex'>dumpHex</a> --- -<a name="SkRect_dump_2"></a> +<a name='SkRect_dump_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_dump'>dump</a>() const </pre> -Writes text representation of <a href="#Rect">Rect</a> to standard output. The representation may be +Writes text representation of <a href='#Rect'>Rect</a> to standard output. The representation may be directly compiled as C++ code. Floating point values are written -with limited precision; it may not be possible to reconstruct original <a href="#Rect">Rect</a> +with limited precision; it may not be possible to reconstruct original <a href='#Rect'>Rect</a> from output. ### Example @@ -2907,23 +3472,23 @@ rect is not equal to copy ### See Also -<a href="#SkRect_dumpHex">dumpHex</a> +<a href='#SkRect_dumpHex'>dumpHex</a> --- -<a name="SkRect_dumpHex"></a> +<a name='SkRect_dumpHex'></a> ## dumpHex -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dumpHex() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRect_dumpHex'>dumpHex</a>() const </pre> -Writes text representation of <a href="#Rect">Rect</a> to standard output. The representation may be +Writes text representation of <a href='#Rect'>Rect</a> to standard output. The representation may be directly compiled as C++ code. Floating point values are written in hexadecimal to preserve their exact bit pattern. The output reconstructs the -original <a href="#Rect">Rect</a>. +original <a href='#Rect'>Rect</a>. -Use instead of <a href="#SkRect_dump_2">dump</a> when submitting <a href="http://bug.skia.org">bug reports against Skia</a> . +Use instead of <a href='#SkRect_dump_2'>dump</a> when submitting <a href='https://bug.skia.org'>bug reports against Skia</a></a> . ### Example @@ -2943,16 +3508,18 @@ rect is equal to copy ### See Also -<a href="#SkRect_dump">dump</a><sup><a href="#SkRect_dump_2">[2]</a></sup> +<a href='#SkRect_dump'>dump</a><sup><a href='#SkRect_dump_2'>[2]</a></sup> --- -<a name="SkRect_MakeLargest"></a> +<a name='SkRect_MakeLargest'></a> ## MakeLargest -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static SkRect SK_WARN_UNUSED_RESULT MakeLargest() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#SkRect'>SkRect</a> SK_WARN_UNUSED_RESULT <a href='#SkRect_MakeLargest'>MakeLargest</a>() </pre> +Deprecated. + --- diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md index 9d81ab2949..0f38d735cf 100644 --- a/site/user/api/SkSurface_Reference.md +++ b/site/user/api/SkSurface_Reference.md @@ -1,123 +1,318 @@ SkSurface Reference === -# <a name="Surface"></a> Surface +# <a name='Surface'>Surface</a> + +# <a name='SkSurface'>Class SkSurface</a> +<a href='#SkSurface'>SkSurface</a> is responsible for managing the pixels that a canvas draws into. The pixels can be +allocated either in CPU memory (a raster surface) or on the GPU (a <a href='undocumented#GrRenderTarget'>GrRenderTarget</a> surface). +<a href='#SkSurface'>SkSurface</a> takes care of allocating a <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a> that will draw into the surface. Call +surface-><a href='#SkSurface_getCanvas'>getCanvas</a> to use that canvas (but don't delete it, it is owned by the surface). +<a href='#SkSurface'>SkSurface</a> 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. -## <a name="Overview"></a> Overview +## Overview -## <a name="Overview_Subtopic"></a> Overview Subtopic +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constant'>Constants</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>enum and enum class, and their const values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Constructor'>Constructors</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions that construct <a href='#SkSurface'>SkSurface</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Member_Function'>Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>global and class member functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Related_Function'>Related Functions</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>similar member functions grouped together</td> + </tr> +</table> -| name | description | -| --- | --- | -| Constant | enum and enum class, const values | -| <a href="#Constructor">Constructor</a> | functions that construct <a href="#SkSurface">SkSurface</a> | -| <a href="#Member_Function">Member Function</a> | static functions and member methods | -| <a href="#Related_Function">Related Function</a> | similar methods grouped together | -# <a name="SkSurface"></a> Class SkSurface -<a href="#SkSurface">SkSurface</a> is responsible for managing the pixels that a canvas draws into. The pixels can be -allocated either in CPU memory (a raster surface) or on the GPU (a <a href="undocumented#GrRenderTarget">GrRenderTarget</a> surface). -<a href="#SkSurface">SkSurface</a> takes care of allocating a <a href="SkCanvas_Reference#SkCanvas">SkCanvas</a> that will draw into the surface. Call -surface-><a href="#SkSurface_getCanvas">getCanvas</a> to use that canvas (but don't delete it, it is owned by the surface). -<a href="#SkSurface">SkSurface</a> 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. +## <a name='Constant'>Constant</a> + + +SkSurface related constants are defined by <code>enum</code>, <code>enum class</code>, <code>#define</code>, <code>const</code>, and <code>constexpr</code>. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>options to read and write back-end object</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>parameter options for <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>back-end object must be overwritten</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard ContentChangeMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>discards surface on change</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>back-end object is readable</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>back-end object is writable</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>preserves surface on change</td> + </tr> +</table> + + +## <a name='Related_Function'>Related Function</a> + + +SkSurface global, <code>struct</code>, and <code>class</code> related member functions share a topic. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Miscellaneous'>Miscellaneous</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>other functions</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Pixels'>Pixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>functions with pixel access</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Property'>Property</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>member values</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#Utility'>Utility</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>rarely called management functions</td> + </tr> +</table> + + +## <a name='Member_Function'>Member Function</a> + + +SkSurface member functions read and modify the structure properties. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU render target</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU texture</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU back-end render target</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeNull'>MakeNull</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> without backing pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRaster'>MakeRaster</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from width, height matching output</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> pointing to new GPU memory buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_characterize'>characterize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Surface_Characterization'>Surface Characterization</a> for threaded GPU processing</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw'>draw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='#Surface'>Surface</a> contents to canvas</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flush'>flush</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O, and signal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_generationID'>generationID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to render target</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendTexture'>getBackendTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to texture</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getCanvas'>getCanvas</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkCanvas_Reference#Canvas'>Canvas</a> that draws into <a href='#Surface'>Surface</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='SkImage_Reference#Image'>Image</a> capturing <a href='#Surface'>Surface</a> contents</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeSurface'>makeSurface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates a compatible <a href='#Surface'>Surface</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>notifies that contents will be changed outside of Skia</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='#Surface'>Surface</a> parameters to <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_props'>props</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Surface_Properties'>Surface Properties</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_wait'>wait</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pauses commands until signaled</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels'>writePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td> + </tr> +</table> + + +## <a name='Constructor'>Constructor</a> + + +SkSurface can be constructed or initialized by these functions, including C++ class constructors. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU render target</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU texture</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from GPU back-end render target</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeNull'>MakeNull</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> without backing pixels</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRaster'>MakeRaster</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a> and <a href='undocumented#Storage'>Pixel Storage</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> from width, height matching output</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='#Surface'>Surface</a> pointing to new GPU memory buffer</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='SkImage_Reference#Image'>Image</a> capturing <a href='#Surface'>Surface</a> contents</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_makeSurface'>makeSurface</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates a compatible <a href='#Surface'>Surface</a></td> + </tr> +</table> -## <a name="Related_Function"></a> Related Function - -| name | description | -| --- | --- | -| <a href="#Miscellaneous">Miscellaneous</a> | other functions | -| <a href="#Pixels">Pixels</a> | functions with pixel access | -| <a href="#Property">Property</a> | member values | -| <a href="#Utility">Utility</a> | rarely called management functions | - -## <a name="Member_Function"></a> Member Function - -| name | description | -| --- | --- | -| <a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> | creates <a href="#Surface">Surface</a> from GPU render target | -| <a href="#SkSurface_MakeFromBackendTexture">MakeFromBackendTexture</a> | creates <a href="#Surface">Surface</a> from GPU texture | -| <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget">MakeFromBackendTextureAsRenderTarget</a> | creates <a href="#Surface">Surface</a> from GPU back-end render target | -| <a href="#SkSurface_MakeNull">MakeNull</a> | creates <a href="#Surface">Surface</a> without backing pixels | -| <a href="#SkSurface_MakeRaster">MakeRaster</a> | creates <a href="#Surface">Surface</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> | -| <a href="#SkSurface_MakeRasterDirect">MakeRasterDirect</a> | creates <a href="#Surface">Surface</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkSurface_MakeRasterDirectReleaseProc">MakeRasterDirectReleaseProc</a> | creates <a href="#Surface">Surface</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> | creates <a href="#Surface">Surface</a> from width, height matching output | -| <a href="#SkSurface_MakeRenderTarget">MakeRenderTarget</a> | creates <a href="#Surface">Surface</a> pointing to new GPU memory buffer | -| <a href="#SkSurface_characterize">characterize</a> | sets <a href="undocumented#Surface_Characterization">Surface Characterization</a> for threaded GPU processing | -| <a href="#SkSurface_draw">draw</a> | draws <a href="#Surface">Surface</a> contents to canvas | -| <a href="#SkSurface_flush">flush</a> | resolve pending I/O | -| <a href="#SkSurface_flushAndSignalSemaphores">flushAndSignalSemaphores</a> | resolve pending I/O, and signal | -| <a href="#SkSurface_generationID">generationID</a> | returns unique ID | -| <a href="#SkSurface_getBackendRenderTarget">getBackendRenderTarget</a> | returns the GPU reference to render target | -| <a href="#SkSurface_getBackendTexture">getBackendTexture</a> | returns the GPU reference to texture | -| <a href="#SkSurface_getCanvas">getCanvas</a> | returns <a href="SkCanvas_Reference#Canvas">Canvas</a> that draws into <a href="#Surface">Surface</a> | -| <a href="#SkSurface_height">height</a> | returns pixel row count | -| <a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> | creates <a href="SkImage_Reference#Image">Image</a> capturing <a href="#Surface">Surface</a> contents | -| <a href="#SkSurface_makeSurface">makeSurface</a> | creates a compatible <a href="#Surface">Surface</a> | -| <a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a> | notifies that contents will be changed outside of Skia | -| <a href="#SkSurface_peekPixels">peekPixels</a> | copies <a href="#Surface">Surface</a> parameters to <a href="SkPixmap_Reference#Pixmap">Pixmap</a> | -| <a href="#SkSurface_props">props</a> | returns <a href="undocumented#Surface_Properties">Surface Properties</a> | -| <a href="#SkSurface_readPixels">readPixels</a> | copies <a href="SkRect_Reference#Rect">Rect</a> of pixels | -| <a href="#SkSurface_wait">wait</a> | rause commands until signaled | -| <a href="#SkSurface_width">width</a> | returns pixel column count | -| <a href="#SkSurface_writePixels">writePixels</a> | copies <a href="SkRect_Reference#Rect">Rect</a> of pixels | - -## <a name="Constructor"></a> Constructor - -| name | description | -| --- | --- | -| <a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> | creates <a href="#Surface">Surface</a> from GPU render target | -| <a href="#SkSurface_MakeFromBackendTexture">MakeFromBackendTexture</a> | creates <a href="#Surface">Surface</a> from GPU texture | -| <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget">MakeFromBackendTextureAsRenderTarget</a> | creates <a href="#Surface">Surface</a> from GPU back-end render target | -| <a href="#SkSurface_MakeNull">MakeNull</a> | creates <a href="#Surface">Surface</a> without backing pixels | -| <a href="#SkSurface_MakeRaster">MakeRaster</a> | creates <a href="#Surface">Surface</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> | -| <a href="#SkSurface_MakeRasterDirect">MakeRasterDirect</a> | creates <a href="#Surface">Surface</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkSurface_MakeRasterDirectReleaseProc">MakeRasterDirectReleaseProc</a> | creates <a href="#Surface">Surface</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="undocumented#Storage">Pixel Storage</a> | -| <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> | creates <a href="#Surface">Surface</a> from width, height matching output | -| <a href="#SkSurface_MakeRenderTarget">MakeRenderTarget</a> | creates <a href="#Surface">Surface</a> pointing to new GPU memory buffer | -| <a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> | creates <a href="SkImage_Reference#Image">Image</a> capturing <a href="#Surface">Surface</a> contents | -| <a href="#SkSurface_makeSurface">makeSurface</a> | creates a compatible <a href="#Surface">Surface</a> | - -<a name="SkSurface_MakeRasterDirect"></a> + +<a name='SkSurface_MakeRasterDirect'></a> ## MakeRasterDirect -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo& imageInfo, void* pixels, size_t rowBytes, - const SkSurfaceProps* surfaceProps = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, void* pixels, size_t rowBytes, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps = nullptr) </pre> -Allocates raster <a href="#Surface">Surface</a>. <a href="SkCanvas_Reference#Canvas">Canvas</a> returned by <a href="#Surface">Surface</a> draws directly into <a href="#SkSurface_MakeRasterDirect_pixels">pixels</a>. +Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into <a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a>. -<a href="#Surface">Surface</a> is returned if all parameters are valid. +<a href='#Surface'>Surface</a> is returned if all parameters are valid. Valid parameters include: info dimensions are greater than zero; -info contains <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> supported by <a href="undocumented#Raster_Surface">Raster Surface</a>; -<a href="#SkSurface_MakeRasterDirect_pixels">pixels</a> is not nullptr; -<a href="#SkSurface_MakeRasterDirect_rowBytes">rowBytes</a> is large enough to contain info width <a href="#SkSurface_MakeRasterDirect_pixels">pixels</a> of <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +info contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> supported by <a href='undocumented#Raster_Surface'>Raster Surface</a>; +<a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a> is not nullptr; +<a href='#SkSurface_MakeRasterDirect_rowBytes'>rowBytes</a> is large enough to contain info width <a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a> of <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -<a href="undocumented#Pixel">Pixel</a> buffer size should be info height times computed <a href="#SkSurface_MakeRasterDirect_rowBytes">rowBytes</a>. -<a href="#Pixels">Pixels</a> are not initialized. -To access <a href="#SkSurface_MakeRasterDirect_pixels">pixels</a> after drawing, call <a href="#SkSurface_flush">flush</a> or <a href="#SkSurface_peekPixels">peekPixels</a>. +<a href='undocumented#Pixel'>Pixel</a> buffer size should be info height times computed <a href='#SkSurface_MakeRasterDirect_rowBytes'>rowBytes</a>. +<a href='#Pixels'>Pixels</a> are not initialized. +To access <a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a> after drawing, call <a href='#SkSurface_flush'>flush</a> or <a href='#SkSurface_peekPixels'>peekPixels</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRasterDirect_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="undocumented#Raster_Surface">Raster Surface</a>; width and height must be greater than zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirect_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -pointer to destination <a href="#SkSurface_MakeRasterDirect_pixels">pixels</a> buffer</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirect_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -interval from one <a href="#Surface">Surface</a> row to the next</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirect_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent fonts; +<table> <tr> <td><a name='SkSurface_MakeRasterDirect_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width and height must be greater than zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirect_pixels'><code><strong>pixels</strong></code></a></td> + <td>pointer to destination <a href='#SkSurface_MakeRasterDirect_pixels'>pixels</a> buffer</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirect_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>interval from one <a href='#Surface'>Surface</a> row to the next</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirect_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -135,56 +330,61 @@ may be nullptr</td> ### See Also -<a href="#SkSurface_MakeRasterDirectReleaseProc">MakeRasterDirectReleaseProc</a> <a href="#SkSurface_MakeRaster">MakeRaster</a><sup><a href="#SkSurface_MakeRaster_2">[2]</a></sup> <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> <a href="SkCanvas_Reference#SkCanvas_MakeRasterDirect">SkCanvas::MakeRasterDirect</a> +<a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a> <a href='#SkSurface_MakeRaster'>MakeRaster</a><sup><a href='#SkSurface_MakeRaster_2'>[2]</a></sup> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a> <a href='SkCanvas_Reference#SkCanvas_MakeRasterDirect'>SkCanvas::MakeRasterDirect</a> --- -<a name="SkSurface_MakeRasterDirectReleaseProc"></a> +<a name='SkSurface_MakeRasterDirectReleaseProc'></a> ## MakeRasterDirectReleaseProc -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRasterDirectReleaseProc(const SkImageInfo& imageInfo, void* pixels, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, void* pixels, size_t rowBytes, void (*releaseProc) (void* pixels, void* context) , void* context, - const SkSurfaceProps* surfaceProps = nullptr) + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps = nullptr) </pre> -Allocates raster <a href="#Surface">Surface</a>. <a href="SkCanvas_Reference#Canvas">Canvas</a> returned by <a href="#Surface">Surface</a> draws directly into <a href="#SkSurface_MakeRasterDirectReleaseProc_pixels">pixels</a>. -<a href="#SkSurface_MakeRasterDirectReleaseProc_releaseProc">releaseProc</a> is called with <a href="#SkSurface_MakeRasterDirectReleaseProc_pixels">pixels</a> and <a href="#SkSurface_MakeRasterDirectReleaseProc_context">context</a> when <a href="#Surface">Surface</a> is deleted. +Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a>. +<a href='#SkSurface_MakeRasterDirectReleaseProc_releaseProc'>releaseProc</a> is called with <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> and <a href='#SkSurface_MakeRasterDirectReleaseProc_context'>context</a> when <a href='#Surface'>Surface</a> is deleted. -<a href="#Surface">Surface</a> is returned if all parameters are valid. +<a href='#Surface'>Surface</a> is returned if all parameters are valid. Valid parameters include: info dimensions are greater than zero; -info contains <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> supported by <a href="undocumented#Raster_Surface">Raster Surface</a>; -<a href="#SkSurface_MakeRasterDirectReleaseProc_pixels">pixels</a> is not nullptr; -<a href="#SkSurface_MakeRasterDirectReleaseProc_rowBytes">rowBytes</a> is large enough to contain info width <a href="#SkSurface_MakeRasterDirectReleaseProc_pixels">pixels</a> of <a href="SkImageInfo_Reference#Color_Type">Color Type</a>. +info contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> supported by <a href='undocumented#Raster_Surface'>Raster Surface</a>; +<a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> is not nullptr; +<a href='#SkSurface_MakeRasterDirectReleaseProc_rowBytes'>rowBytes</a> is large enough to contain info width <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> of <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>. -<a href="undocumented#Pixel">Pixel</a> buffer size should be info height times computed <a href="#SkSurface_MakeRasterDirectReleaseProc_rowBytes">rowBytes</a>. -<a href="#Pixels">Pixels</a> are not initialized. -To access <a href="#SkSurface_MakeRasterDirectReleaseProc_pixels">pixels</a> after drawing, call <a href="#SkSurface_flush">flush</a> or <a href="#SkSurface_peekPixels">peekPixels</a>. +<a href='undocumented#Pixel'>Pixel</a> buffer size should be info height times computed <a href='#SkSurface_MakeRasterDirectReleaseProc_rowBytes'>rowBytes</a>. +<a href='#Pixels'>Pixels</a> are not initialized. +To access <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> after drawing, call <a href='#SkSurface_flush'>flush</a> or <a href='#SkSurface_peekPixels'>peekPixels</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRasterDirectReleaseProc_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="undocumented#Raster_Surface">Raster Surface</a>; width and height must be greater than zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirectReleaseProc_pixels"> <code><strong>pixels </strong></code> </a></td> <td> -pointer to destination <a href="#SkSurface_MakeRasterDirectReleaseProc_pixels">pixels</a> buffer</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirectReleaseProc_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -interval from one <a href="#Surface">Surface</a> row to the next</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirectReleaseProc_releaseProc"> <code><strong>releaseProc </strong></code> </a></td> <td> -called when <a href="#Surface">Surface</a> is deleted; may be nullptr</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirectReleaseProc_context"> <code><strong>context </strong></code> </a></td> <td> -passed to <a href="#SkSurface_MakeRasterDirectReleaseProc_releaseProc">releaseProc</a>; may be nullptr</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterDirectReleaseProc_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent fonts; +<table> <tr> <td><a name='SkSurface_MakeRasterDirectReleaseProc_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width and height must be greater than zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirectReleaseProc_pixels'><code><strong>pixels</strong></code></a></td> + <td>pointer to destination <a href='#SkSurface_MakeRasterDirectReleaseProc_pixels'>pixels</a> buffer</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirectReleaseProc_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>interval from one <a href='#Surface'>Surface</a> row to the next</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirectReleaseProc_releaseProc'><code><strong>releaseProc</strong></code></a></td> + <td>called when <a href='#Surface'>Surface</a> is deleted; may be nullptr</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirectReleaseProc_context'><code><strong>context</strong></code></a></td> + <td>passed to <a href='#SkSurface_MakeRasterDirectReleaseProc_releaseProc'>releaseProc</a>; may be nullptr</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterDirectReleaseProc_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -203,48 +403,50 @@ expected release context ### See Also -<a href="#SkSurface_MakeRasterDirect">MakeRasterDirect</a> <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> <a href="#SkSurface_MakeRaster">MakeRaster</a><sup><a href="#SkSurface_MakeRaster_2">[2]</a></sup> +<a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a> <a href='#SkSurface_MakeRaster'>MakeRaster</a><sup><a href='#SkSurface_MakeRaster_2'>[2]</a></sup> --- -<a name="SkSurface_MakeRaster"></a> +<a name='SkSurface_MakeRaster'></a> ## MakeRaster -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo, size_t rowBytes, - const SkSurfaceProps* surfaceProps) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRaster'>MakeRaster</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, size_t rowBytes, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps) </pre> -Allocates raster <a href="#Surface">Surface</a>. <a href="SkCanvas_Reference#Canvas">Canvas</a> returned by <a href="#Surface">Surface</a> draws directly into pixels. -Allocates and zeroes pixel memory. <a href="undocumented#Pixel">Pixel</a> memory size is <a href="#SkSurface_MakeRaster_imageInfo">imageInfo</a>.<a href="#SkSurface_height">height</a> times -<a href="#SkSurface_MakeRaster_rowBytes">rowBytes</a>, or times <a href="#SkSurface_MakeRaster_imageInfo">imageInfo</a>.minRowBytes() if <a href="#SkSurface_MakeRaster_rowBytes">rowBytes</a> is zero. -<a href="undocumented#Pixel">Pixel</a> memory is deleted when <a href="#Surface">Surface</a> is deleted. +Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into pixels. +Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is <a href='#SkSurface_MakeRaster_imageInfo'>imageInfo</a>.<a href='#SkSurface_height'>height</a> times +<a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a>, or times <a href='#SkSurface_MakeRaster_imageInfo'>imageInfo</a>.minRowBytes() if <a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a> is zero. +<a href='undocumented#Pixel'>Pixel</a> memory is deleted when <a href='#Surface'>Surface</a> is deleted. -<a href="#Surface">Surface</a> is returned if all parameters are valid. +<a href='#Surface'>Surface</a> is returned if all parameters are valid. Valid parameters include: info dimensions are greater than zero; -info contains <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> supported by <a href="undocumented#Raster_Surface">Raster Surface</a>; -<a href="#SkSurface_MakeRaster_rowBytes">rowBytes</a> is large enough to contain info width pixels of <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, or is zero. +info contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> supported by <a href='undocumented#Raster_Surface'>Raster Surface</a>; +<a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a> is large enough to contain info width pixels of <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, or is zero. -If <a href="#SkSurface_MakeRaster_rowBytes">rowBytes</a> is not zero, subsequent images returned by <a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> -have the same <a href="#SkSurface_MakeRaster_rowBytes">rowBytes</a>. +If <a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a> is not zero, subsequent images returned by <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> +have the same <a href='#SkSurface_MakeRaster_rowBytes'>rowBytes</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRaster_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="undocumented#Raster_Surface">Raster Surface</a>; width and height must be greater than zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRaster_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> -interval from one <a href="#Surface">Surface</a> row to the next; may be zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRaster_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent fonts; +<table> <tr> <td><a name='SkSurface_MakeRaster_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width and height must be greater than zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRaster_rowBytes'><code><strong>rowBytes</strong></code></a></td> + <td>interval from one <a href='#Surface'>Surface</a> row to the next; may be zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRaster_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -262,41 +464,42 @@ may be nullptr</td> ### See Also -<a href="#SkSurface_MakeRasterDirect">MakeRasterDirect</a> <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> <a href="#SkSurface_MakeRasterDirectReleaseProc">MakeRasterDirectReleaseProc</a> +<a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a> <a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a> --- -<a name="SkSurface_MakeRaster_2"></a> +<a name='SkSurface_MakeRaster_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo, - const SkSurfaceProps* props = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRaster'>MakeRaster</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props = nullptr) </pre> -Allocates raster <a href="#Surface">Surface</a>. <a href="SkCanvas_Reference#Canvas">Canvas</a> returned by <a href="#Surface">Surface</a> draws directly into pixels. -Allocates and zeroes pixel memory. <a href="undocumented#Pixel">Pixel</a> memory size is <a href="#SkSurface_MakeRaster_2_imageInfo">imageInfo</a>.<a href="#SkSurface_height">height</a> times -<a href="#SkSurface_MakeRaster_2_imageInfo">imageInfo</a>.minRowBytes(). -<a href="undocumented#Pixel">Pixel</a> memory is deleted when <a href="#Surface">Surface</a> is deleted. +Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into pixels. +Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is <a href='#SkSurface_MakeRaster_2_imageInfo'>imageInfo</a>.<a href='#SkSurface_height'>height</a> times +<a href='#SkSurface_MakeRaster_2_imageInfo'>imageInfo</a>.minRowBytes(). +<a href='undocumented#Pixel'>Pixel</a> memory is deleted when <a href='#Surface'>Surface</a> is deleted. -<a href="#Surface">Surface</a> is returned if all parameters are valid. +<a href='#Surface'>Surface</a> is returned if all parameters are valid. Valid parameters include: info dimensions are greater than zero; -info contains <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> supported by <a href="undocumented#Raster_Surface">Raster Surface</a>. +info contains <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> supported by <a href='undocumented#Raster_Surface'>Raster Surface</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRaster_2_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="undocumented#Raster_Surface">Raster Surface</a>; width and height must be greater than zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRaster_2_props"> <code><strong>props </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent fonts; +<table> <tr> <td><a name='SkSurface_MakeRaster_2_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width and height must be greater than zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRaster_2_props'><code><strong>props</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -304,45 +507,47 @@ may be nullptr</td> ### See Also -<a href="#SkSurface_MakeRasterDirect">MakeRasterDirect</a> <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> <a href="#SkSurface_MakeRasterDirectReleaseProc">MakeRasterDirectReleaseProc</a> +<a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a> <a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a> --- -<a name="SkSurface_MakeRasterN32Premul"></a> +<a name='SkSurface_MakeRasterN32Premul'></a> ## MakeRasterN32Premul -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height, - const SkSurfaceProps* surfaceProps = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a>(int width, int height, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps = nullptr) </pre> -Allocates raster <a href="#Surface">Surface</a>. <a href="SkCanvas_Reference#Canvas">Canvas</a> returned by <a href="#Surface">Surface</a> draws directly into pixels. -Allocates and zeroes pixel memory. <a href="undocumented#Pixel">Pixel</a> memory size is height times width times -four. <a href="undocumented#Pixel">Pixel</a> memory is deleted when <a href="#Surface">Surface</a> is deleted. +Allocates raster <a href='#Surface'>Surface</a>. <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned by <a href='#Surface'>Surface</a> draws directly into pixels. +Allocates and zeroes pixel memory. <a href='undocumented#Pixel'>Pixel</a> memory size is height times width times +four. <a href='undocumented#Pixel'>Pixel</a> memory is deleted when <a href='#Surface'>Surface</a> is deleted. -Internally, sets <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to width, height, <a href="SkImageInfo_Reference#Color_Type_Native">Native Color Type</a>, and -<a href="SkImageInfo_Reference#kPremul_SkAlphaType">kPremul_SkAlphaType</a>. +Internally, sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to width, height, <a href='SkImageInfo_Reference#kN32_SkColorType'>Native_Color_Type</a>, and +<a href='SkImageInfo_Reference#kPremul_SkAlphaType'>kPremul_SkAlphaType</a>. -<a href="#Surface">Surface</a> is returned if width and height are greater than zero. +<a href='#Surface'>Surface</a> is returned if width and height are greater than zero. -Use to create <a href="#Surface">Surface</a> that matches <a href="SkColor_Reference#SkPMColor">SkPMColor</a>, the native pixel arrangement on -the platform. <a href="#Surface">Surface</a> drawn to output device skips converting its pixel format. +Use to create <a href='#Surface'>Surface</a> that matches <a href='SkColor_Reference#SkPMColor'>SkPMColor</a>, the native pixel arrangement on +the platform. <a href='#Surface'>Surface</a> drawn to output device skips converting its pixel format. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRasterN32Premul_width"> <code><strong>width </strong></code> </a></td> <td> -pixel column count; must be greater than zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterN32Premul_height"> <code><strong>height </strong></code> </a></td> <td> -pixel row count; must be greater than zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRasterN32Premul_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent +<table> <tr> <td><a name='SkSurface_MakeRasterN32Premul_width'><code><strong>width</strong></code></a></td> + <td>pixel column count; must be greater than zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterN32Premul_height'><code><strong>height</strong></code></a></td> + <td>pixel row count; must be greater than zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRasterN32Premul_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -360,61 +565,67 @@ fonts; may be nullptr</td> ### See Also -<a href="#SkSurface_MakeRasterDirect">MakeRasterDirect</a> <a href="#SkSurface_MakeRasterN32Premul">MakeRasterN32Premul</a> <a href="#SkSurface_MakeRasterDirectReleaseProc">MakeRasterDirectReleaseProc</a> +<a href='#SkSurface_MakeRasterDirect'>MakeRasterDirect</a> <a href='#SkSurface_MakeRasterN32Premul'>MakeRasterN32Premul</a> <a href='#SkSurface_MakeRasterDirectReleaseProc'>MakeRasterDirectReleaseProc</a> --- -<a name="SkSurface_MakeFromBackendTexture"></a> +<a name='SkSurface_MakeFromBackendTexture'></a> ## MakeFromBackendTexture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeFromBackendTexture(GrContext* context, - const GrBackendTexture& backendTexture, - GrSurfaceOrigin origin, int sampleCnt, - SkColorType colorType, - sk_sp<SkColorSpace> colorSpace, - const SkSurfaceProps* surfaceProps) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a>(<a href='undocumented#GrContext'>GrContext</a>* context, + const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin, int sampleCnt, + <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> colorType, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> colorSpace, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps) </pre> -Wraps a GPU-backed texture into <a href="#Surface">Surface</a>. Caller must ensure the texture is -valid for the lifetime of returned <a href="#Surface">Surface</a>. If <a href="#SkSurface_MakeFromBackendTexture_sampleCnt">sampleCnt</a> greater than zero, -creates an intermediate MSAA <a href="#Surface">Surface</a> which is used for drawing <a href="#SkSurface_MakeFromBackendTexture_backendTexture">backendTexture</a>. +Wraps a GPU-backed texture into <a href='#Surface'>Surface</a>. Caller must ensure the texture is +valid for the lifetime of returned <a href='#Surface'>Surface</a>. If <a href='#SkSurface_MakeFromBackendTexture_sampleCnt'>sampleCnt</a> greater than zero, +creates an intermediate MSAA <a href='#Surface'>Surface</a> which is used for drawing <a href='#SkSurface_MakeFromBackendTexture_backendTexture'>backendTexture</a>. -<a href="#Surface">Surface</a> is returned if all parameters are valid. <a href="#SkSurface_MakeFromBackendTexture_backendTexture">backendTexture</a> is valid if -its pixel configuration agrees with <a href="#SkSurface_MakeFromBackendTexture_colorSpace">colorSpace</a> and <a href="#SkSurface_MakeFromBackendTexture_context">context</a>; for instance, if -<a href="#SkSurface_MakeFromBackendTexture_backendTexture">backendTexture</a> has an sRGB configuration, then <a href="#SkSurface_MakeFromBackendTexture_context">context</a> must support sRGB, -and <a href="#SkSurface_MakeFromBackendTexture_colorSpace">colorSpace</a> must be present. Further, <a href="#SkSurface_MakeFromBackendTexture_backendTexture">backendTexture</a> width and height must -not exceed <a href="#SkSurface_MakeFromBackendTexture_context">context</a> capabilities, and the <a href="#SkSurface_MakeFromBackendTexture_context">context</a> must be able to support +<a href='#Surface'>Surface</a> is returned if all parameters are valid. <a href='#SkSurface_MakeFromBackendTexture_backendTexture'>backendTexture</a> is valid if +its pixel configuration agrees with <a href='#SkSurface_MakeFromBackendTexture_colorSpace'>colorSpace</a> and <a href='#SkSurface_MakeFromBackendTexture_context'>context</a>; for instance, if +<a href='#SkSurface_MakeFromBackendTexture_backendTexture'>backendTexture</a> has an sRGB configuration, then <a href='#SkSurface_MakeFromBackendTexture_context'>context</a> must support sRGB, +and <a href='#SkSurface_MakeFromBackendTexture_colorSpace'>colorSpace</a> must be present. Further, <a href='#SkSurface_MakeFromBackendTexture_backendTexture'>backendTexture</a> width and height must +not exceed <a href='#SkSurface_MakeFromBackendTexture_context'>context</a> capabilities, and the <a href='#SkSurface_MakeFromBackendTexture_context'>context</a> must be able to support back-end textures. If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeFromBackendTexture_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTexture_backendTexture"> <code><strong>backendTexture </strong></code> </a></td> <td> -texture residing on GPU</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTexture_origin"> <code><strong>origin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTexture_sampleCnt"> <code><strong>sampleCnt </strong></code> </a></td> <td> -samples per pixel, or 0 to disable full scene anti-aliasing</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTexture_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTexture_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTexture_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent +<table> <tr> <td><a name='SkSurface_MakeFromBackendTexture_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTexture_backendTexture'><code><strong>backendTexture</strong></code></a></td> + <td>texture residing on GPU</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTexture_origin'><code><strong>origin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTexture_sampleCnt'><code><strong>sampleCnt</strong></code></a></td> + <td>samples per pixel, or 0 to disable full scene anti-aliasing</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTexture_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTexture_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTexture_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -422,57 +633,62 @@ fonts; may be nullptr</td> ### See Also -<a href="undocumented#GrBackendTexture">GrBackendTexture</a> <a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> <a href="#SkSurface_MakeRenderTarget">MakeRenderTarget</a><sup><a href="#SkSurface_MakeRenderTarget_2">[2]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_3">[3]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_4">[4]</a></sup> +<a href='undocumented#GrBackendTexture'>GrBackendTexture</a> <a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a><sup><a href='#SkSurface_MakeRenderTarget_2'>[2]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_3'>[3]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_4'>[4]</a></sup> --- -<a name="SkSurface_MakeFromBackendRenderTarget"></a> +<a name='SkSurface_MakeFromBackendRenderTarget'></a> ## MakeFromBackendRenderTarget -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeFromBackendRenderTarget(GrContext* context, - const GrBackendRenderTarget& backendRenderTarget, - GrSurfaceOrigin origin, SkColorType colorType, - sk_sp<SkColorSpace> colorSpace, - const SkSurfaceProps* surfaceProps) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, + const <a href='undocumented#GrBackendRenderTarget'>GrBackendRenderTarget</a>& backendRenderTarget, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin, <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> colorType, + <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> colorSpace, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps) </pre> -Wraps a GPU-backed buffer into <a href="#Surface">Surface</a>. Caller must ensure <a href="#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget">backendRenderTarget</a> -is valid for the lifetime of returned <a href="#Surface">Surface</a>. +Wraps a GPU-backed buffer into <a href='#Surface'>Surface</a>. Caller must ensure <a href='#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget'>backendRenderTarget</a> +is valid for the lifetime of returned <a href='#Surface'>Surface</a>. -<a href="#Surface">Surface</a> is returned if all parameters are valid. <a href="#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget">backendRenderTarget</a> is valid if -its pixel configuration agrees with <a href="#SkSurface_MakeFromBackendRenderTarget_colorSpace">colorSpace</a> and <a href="#SkSurface_MakeFromBackendRenderTarget_context">context</a>; for instance, if -<a href="#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget">backendRenderTarget</a> has an sRGB configuration, then <a href="#SkSurface_MakeFromBackendRenderTarget_context">context</a> must support sRGB, -and <a href="#SkSurface_MakeFromBackendRenderTarget_colorSpace">colorSpace</a> must be present. Further, <a href="#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget">backendRenderTarget</a> width and height must -not exceed <a href="#SkSurface_MakeFromBackendRenderTarget_context">context</a> capabilities, and the <a href="#SkSurface_MakeFromBackendRenderTarget_context">context</a> must be able to support +<a href='#Surface'>Surface</a> is returned if all parameters are valid. <a href='#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget'>backendRenderTarget</a> is valid if +its pixel configuration agrees with <a href='#SkSurface_MakeFromBackendRenderTarget_colorSpace'>colorSpace</a> and <a href='#SkSurface_MakeFromBackendRenderTarget_context'>context</a>; for instance, if +<a href='#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget'>backendRenderTarget</a> has an sRGB configuration, then <a href='#SkSurface_MakeFromBackendRenderTarget_context'>context</a> must support sRGB, +and <a href='#SkSurface_MakeFromBackendRenderTarget_colorSpace'>colorSpace</a> must be present. Further, <a href='#SkSurface_MakeFromBackendRenderTarget_backendRenderTarget'>backendRenderTarget</a> width and height must +not exceed <a href='#SkSurface_MakeFromBackendRenderTarget_context'>context</a> capabilities, and the <a href='#SkSurface_MakeFromBackendRenderTarget_context'>context</a> must be able to support back-end render targets. If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeFromBackendRenderTarget_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendRenderTarget_backendRenderTarget"> <code><strong>backendRenderTarget </strong></code> </a></td> <td> -GPU intermediate memory buffer</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendRenderTarget_origin"> <code><strong>origin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendRenderTarget_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendRenderTarget_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendRenderTarget_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent +<table> <tr> <td><a name='SkSurface_MakeFromBackendRenderTarget_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendRenderTarget_backendRenderTarget'><code><strong>backendRenderTarget</strong></code></a></td> + <td>GPU intermediate memory buffer</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendRenderTarget_origin'><code><strong>origin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendRenderTarget_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendRenderTarget_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendRenderTarget_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -497,62 +713,68 @@ fonts; may be nullptr</td> ### See Also -<a href="#SkSurface_MakeFromBackendTexture">MakeFromBackendTexture</a> <a href="#SkSurface_MakeRenderTarget">MakeRenderTarget</a><sup><a href="#SkSurface_MakeRenderTarget_2">[2]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_3">[3]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_4">[4]</a></sup> +<a href='#SkSurface_MakeFromBackendTexture'>MakeFromBackendTexture</a> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a><sup><a href='#SkSurface_MakeRenderTarget_2'>[2]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_3'>[3]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_4'>[4]</a></sup> --- -<a name="SkSurface_MakeFromBackendTextureAsRenderTarget"></a> +<a name='SkSurface_MakeFromBackendTextureAsRenderTarget'></a> ## MakeFromBackendTextureAsRenderTarget -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeFromBackendTextureAsRenderTarget(GrContext* context, - const GrBackendTexture& backendTexture, - GrSurfaceOrigin origin, int sampleCnt, - SkColorType colorType, sk_sp<SkColorSpace> colorSpace, - const SkSurfaceProps* surfaceProps) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, + const <a href='undocumented#GrBackendTexture'>GrBackendTexture</a>& backendTexture, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> origin, int sampleCnt, + <a href='SkImageInfo_Reference#SkColorType'>SkColorType</a> colorType, <a href='undocumented#sk_sp'>sk sp</a><<a href='undocumented#SkColorSpace'>SkColorSpace</a>> colorSpace, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps) </pre> -Wraps a GPU-backed texture into <a href="#Surface">Surface</a>. Caller must ensure <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture">backendTexture</a> is -valid for the lifetime of returned <a href="#Surface">Surface</a>. If <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_sampleCnt">sampleCnt</a> greater than zero, -creates an intermediate MSAA <a href="#Surface">Surface</a> which is used for drawing <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture">backendTexture</a>. +Wraps a GPU-backed texture into <a href='#Surface'>Surface</a>. Caller must ensure <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture'>backendTexture</a> is +valid for the lifetime of returned <a href='#Surface'>Surface</a>. If <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_sampleCnt'>sampleCnt</a> greater than zero, +creates an intermediate MSAA <a href='#Surface'>Surface</a> which is used for drawing <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture'>backendTexture</a>. -<a href="#Surface">Surface</a> is returned if all parameters are valid. <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture">backendTexture</a> is valid if -its pixel configuration agrees with <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_colorSpace">colorSpace</a> and <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_context">context</a>; for instance, if -<a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture">backendTexture</a> has an sRGB configuration, then <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_context">context</a> must support sRGB, -and <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_colorSpace">colorSpace</a> must be present. Further, <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture">backendTexture</a> width and height must -not exceed <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget_context">context</a> capabilities. +<a href='#Surface'>Surface</a> is returned if all parameters are valid. <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture'>backendTexture</a> is valid if +its pixel configuration agrees with <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_colorSpace'>colorSpace</a> and <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_context'>context</a>; for instance, if +<a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture'>backendTexture</a> has an sRGB configuration, then <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_context'>context</a> must support sRGB, +and <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_colorSpace'>colorSpace</a> must be present. Further, <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture'>backendTexture</a> width and height must +not exceed <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget_context'>context</a> capabilities. -Returned <a href="#Surface">Surface</a> is available only for drawing into, and cannot generate an -<a href="SkImage_Reference#Image">Image</a>. +Returned <a href='#Surface'>Surface</a> is available only for drawing into, and cannot generate an +<a href='SkImage_Reference#Image'>Image</a>. If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture"> <code><strong>backendTexture </strong></code> </a></td> <td> -texture residing on GPU</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_origin"> <code><strong>origin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_sampleCnt"> <code><strong>sampleCnt </strong></code> </a></td> <td> -samples per pixel, or 0 to disable full scene anti-aliasing</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_colorType"> <code><strong>colorType </strong></code> </a></td> <td> -one of: <a href="SkImageInfo_Reference#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="SkImageInfo_Reference#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_565_SkColorType">kRGB_565_SkColorType</a>, -<a href="SkImageInfo_Reference#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>, -<a href="SkImageInfo_Reference#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="SkImageInfo_Reference#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>, -<a href="SkImageInfo_Reference#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="SkImageInfo_Reference#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a> </td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td> -range of colors; may be nullptr</td> - </tr> <tr> <td><a name="SkSurface_MakeFromBackendTextureAsRenderTarget_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent +<table> <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_backendTexture'><code><strong>backendTexture</strong></code></a></td> + <td>texture residing on GPU</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_origin'><code><strong>origin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_sampleCnt'><code><strong>sampleCnt</strong></code></a></td> + <td>samples per pixel, or 0 to disable full scene anti-aliasing</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_colorType'><code><strong>colorType</strong></code></a></td> + <td>one of: <a href='SkImageInfo_Reference#kUnknown_SkColorType'>kUnknown_SkColorType</a>, <a href='SkImageInfo_Reference#kAlpha_8_SkColorType'>kAlpha_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_565_SkColorType'>kRGB_565_SkColorType</a>, +<a href='SkImageInfo_Reference#kARGB_4444_SkColorType'>kARGB_4444_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_8888_SkColorType'>kRGBA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_888x_SkColorType'>kRGB_888x_SkColorType</a>, +<a href='SkImageInfo_Reference#kBGRA_8888_SkColorType'>kBGRA_8888_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_1010102_SkColorType'>kRGBA_1010102_SkColorType</a>, <a href='SkImageInfo_Reference#kRGB_101010x_SkColorType'>kRGB_101010x_SkColorType</a>, +<a href='SkImageInfo_Reference#kGray_8_SkColorType'>kGray_8_SkColorType</a>, <a href='SkImageInfo_Reference#kRGBA_F16_SkColorType'>kRGBA_F16_SkColorType</a> </td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_colorSpace'><code><strong>colorSpace</strong></code></a></td> + <td>range of colors; may be nullptr</td> + </tr> + <tr> <td><a name='SkSurface_MakeFromBackendTextureAsRenderTarget_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -560,62 +782,68 @@ fonts; may be nullptr</td> ### See Also -<a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> <a href="#SkSurface_MakeRenderTarget">MakeRenderTarget</a><sup><a href="#SkSurface_MakeRenderTarget_2">[2]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_3">[3]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_4">[4]</a></sup> +<a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a><sup><a href='#SkSurface_MakeRenderTarget_2'>[2]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_3'>[3]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_4'>[4]</a></sup> --- -<a name="SkSurface_MakeRenderTarget"></a> +<a name='SkSurface_MakeRenderTarget'></a> ## MakeRenderTarget -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRenderTarget(GrContext* context, SkBudgeted budgeted, - const SkImageInfo& imageInfo, int sampleCount, - GrSurfaceOrigin surfaceOrigin, - const SkSurfaceProps* surfaceProps, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted, + const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, int sampleCount, + <a href='undocumented#GrSurfaceOrigin'>GrSurfaceOrigin</a> surfaceOrigin, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* surfaceProps, bool shouldCreateWithMips = false) </pre> -Returns <a href="#Surface">Surface</a> on GPU indicated by <a href="#SkSurface_MakeRenderTarget_context">context</a>. Allocates memory for -pixels, based on the width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> in ImageInfo. <a href="#SkSurface_MakeRenderTarget_budgeted">budgeted</a> -selects whether allocation for pixels is tracked by <a href="#SkSurface_MakeRenderTarget_context">context</a>. <a href="#SkSurface_MakeRenderTarget_imageInfo">imageInfo</a> -describes the pixel format in <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and transparency in -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and color matching in <a href="undocumented#Color_Space">Color Space</a>. +Returns <a href='#Surface'>Surface</a> on GPU indicated by <a href='#SkSurface_MakeRenderTarget_context'>context</a>. Allocates memory for +pixels, based on the width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> in ImageInfo. <a href='#SkSurface_MakeRenderTarget_budgeted'>budgeted</a> +selects whether allocation for pixels is tracked by <a href='#SkSurface_MakeRenderTarget_context'>context</a>. <a href='#SkSurface_MakeRenderTarget_imageInfo'>imageInfo</a> +describes the pixel format in <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and transparency in +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and color matching in <a href='undocumented#Color_Space'>Color Space</a>. -<a href="#SkSurface_MakeRenderTarget_sampleCount">sampleCount</a> requests the number of samples per pixel. +<a href='#SkSurface_MakeRenderTarget_sampleCount'>sampleCount</a> 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. -<a href="#SkSurface_MakeRenderTarget_surfaceOrigin">surfaceOrigin</a> pins either the top-left or the bottom-left corner to the origin. +<a href='#SkSurface_MakeRenderTarget_surfaceOrigin'>surfaceOrigin</a> pins either the top-left or the bottom-left corner to the origin. -<a href="#SkSurface_MakeRenderTarget_shouldCreateWithMips">shouldCreateWithMips</a> hints that <a href="SkImage_Reference#Image">Image</a> returned by <a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> is Mip_Map. +<a href='#SkSurface_MakeRenderTarget_shouldCreateWithMips'>shouldCreateWithMips</a> hints that <a href='SkImage_Reference#Image'>Image</a> returned by <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> is Mip_Map. If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRenderTarget_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_budgeted"> <code><strong>budgeted </strong></code> </a></td> <td> -one of: <a href="undocumented#SkBudgeted_kNo">SkBudgeted::kNo</a>, <a href="undocumented#SkBudgeted_kYes">SkBudgeted::kYes</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>; +<table> <tr> <td><a name='SkSurface_MakeRenderTarget_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_budgeted'><code><strong>budgeted</strong></code></a></td> + <td>one of: <a href='undocumented#SkBudgeted_kNo'>SkBudgeted::kNo</a>, <a href='undocumented#SkBudgeted_kYes'>SkBudgeted::kYes</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>; width, or height, or both, may be zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_sampleCount"> <code><strong>sampleCount </strong></code> </a></td> <td> -samples per pixel, or 0 to disable full scene anti-aliasing</td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_surfaceOrigin"> <code><strong>surfaceOrigin </strong></code> </a></td> <td> -one of: <a href="undocumented#kBottomLeft_GrSurfaceOrigin">kBottomLeft GrSurfaceOrigin</a>, <a href="undocumented#kTopLeft_GrSurfaceOrigin">kTopLeft GrSurfaceOrigin</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_surfaceProps"> <code><strong>surfaceProps </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_sampleCount'><code><strong>sampleCount</strong></code></a></td> + <td>samples per pixel, or 0 to disable full scene anti-aliasing</td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_surfaceOrigin'><code><strong>surfaceOrigin</strong></code></a></td> + <td>one of: <a href='undocumented#kBottomLeft_GrSurfaceOrigin'>kBottomLeft GrSurfaceOrigin</a>, <a href='undocumented#kTopLeft_GrSurfaceOrigin'>kTopLeft GrSurfaceOrigin</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_surfaceProps'><code><strong>surfaceProps</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_shouldCreateWithMips"> <code><strong>shouldCreateWithMips </strong></code> </a></td> <td> -hint that <a href="#Surface">Surface</a> will host Mip_Map images</td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_shouldCreateWithMips'><code><strong>shouldCreateWithMips</strong></code></a></td> + <td>hint that <a href='#Surface'>Surface</a> will host Mip_Map images</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -623,51 +851,55 @@ hint that <a href="#Surface">Surface</a> will host Mip_Map images</td> ### See Also -<a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget">MakeFromBackendTextureAsRenderTarget</a> +<a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a> <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a> --- -<a name="SkSurface_MakeRenderTarget_2"></a> +<a name='SkSurface_MakeRenderTarget_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRenderTarget(GrContext* context, SkBudgeted budgeted, - const SkImageInfo& imageInfo, int sampleCount, - const SkSurfaceProps* props) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted, + const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo, int sampleCount, + const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>* props) </pre> -Returns <a href="#Surface">Surface</a> on GPU indicated by <a href="#SkSurface_MakeRenderTarget_2_context">context</a>. Allocates memory for -pixels, based on the width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> in ImageInfo. <a href="#SkSurface_MakeRenderTarget_2_budgeted">budgeted</a> -selects whether allocation for pixels is tracked by <a href="#SkSurface_MakeRenderTarget_2_context">context</a>. <a href="#SkSurface_MakeRenderTarget_2_imageInfo">imageInfo</a> -describes the pixel format in <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and transparency in -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and color matching in <a href="undocumented#Color_Space">Color Space</a>. +Returns <a href='#Surface'>Surface</a> on GPU indicated by <a href='#SkSurface_MakeRenderTarget_2_context'>context</a>. Allocates memory for +pixels, based on the width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> in ImageInfo. <a href='#SkSurface_MakeRenderTarget_2_budgeted'>budgeted</a> +selects whether allocation for pixels is tracked by <a href='#SkSurface_MakeRenderTarget_2_context'>context</a>. <a href='#SkSurface_MakeRenderTarget_2_imageInfo'>imageInfo</a> +describes the pixel format in <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and transparency in +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and color matching in <a href='undocumented#Color_Space'>Color Space</a>. -<a href="#SkSurface_MakeRenderTarget_2_sampleCount">sampleCount</a> requests the number of samples per pixel. +<a href='#SkSurface_MakeRenderTarget_2_sampleCount'>sampleCount</a> 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. -<a href="#Surface">Surface</a> bottom-left corner is pinned to the origin. +<a href='#Surface'>Surface</a> bottom-left corner is pinned to the origin. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRenderTarget_2_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_2_budgeted"> <code><strong>budgeted </strong></code> </a></td> <td> -one of: <a href="undocumented#SkBudgeted_kNo">SkBudgeted::kNo</a>, <a href="undocumented#SkBudgeted_kYes">SkBudgeted::kYes</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_2_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="undocumented#Raster_Surface">Raster Surface</a>; width, or height, or both, may be zero</td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_2_sampleCount"> <code><strong>sampleCount </strong></code> </a></td> <td> -samples per pixel, or 0 to disable Multi_Sample_Anti_Aliasing</td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_2_props"> <code><strong>props </strong></code> </a></td> <td> -LCD striping orientation and setting for device independent +<table> <tr> <td><a name='SkSurface_MakeRenderTarget_2_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_2_budgeted'><code><strong>budgeted</strong></code></a></td> + <td>one of: <a href='undocumented#SkBudgeted_kNo'>SkBudgeted::kNo</a>, <a href='undocumented#SkBudgeted_kYes'>SkBudgeted::kYes</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_2_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width, or height, or both, may be zero</td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_2_sampleCount'><code><strong>sampleCount</strong></code></a></td> + <td>samples per pixel, or 0 to disable Multi_Sample_Anti_Aliasing</td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_2_props'><code><strong>props</strong></code></a></td> + <td>LCD striping orientation and setting for device independent fonts; may be nullptr</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -679,40 +911,42 @@ or red green blue. ### See Also -<a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget">MakeFromBackendTextureAsRenderTarget</a> +<a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a> <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a> --- -<a name="SkSurface_MakeRenderTarget_3"></a> +<a name='SkSurface_MakeRenderTarget_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRenderTarget(GrContext* context, SkBudgeted budgeted, - const SkImageInfo& imageInfo) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted, + const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo) </pre> -Returns <a href="#Surface">Surface</a> on GPU indicated by <a href="#SkSurface_MakeRenderTarget_3_context">context</a>. Allocates memory for -pixels, based on the width, height, and <a href="SkImageInfo_Reference#Color_Type">Color Type</a> in ImageInfo. <a href="#SkSurface_MakeRenderTarget_3_budgeted">budgeted</a> -selects whether allocation for pixels is tracked by <a href="#SkSurface_MakeRenderTarget_3_context">context</a>. <a href="#SkSurface_MakeRenderTarget_3_imageInfo">imageInfo</a> -describes the pixel format in <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and transparency in -<a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, and color matching in <a href="undocumented#Color_Space">Color Space</a>. +Returns <a href='#Surface'>Surface</a> on GPU indicated by <a href='#SkSurface_MakeRenderTarget_3_context'>context</a>. Allocates memory for +pixels, based on the width, height, and <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> in ImageInfo. <a href='#SkSurface_MakeRenderTarget_3_budgeted'>budgeted</a> +selects whether allocation for pixels is tracked by <a href='#SkSurface_MakeRenderTarget_3_context'>context</a>. <a href='#SkSurface_MakeRenderTarget_3_imageInfo'>imageInfo</a> +describes the pixel format in <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and transparency in +<a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, and color matching in <a href='undocumented#Color_Space'>Color Space</a>. -<a href="#Surface">Surface</a> bottom-left corner is pinned to the origin. +<a href='#Surface'>Surface</a> bottom-left corner is pinned to the origin. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRenderTarget_3_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_3_budgeted"> <code><strong>budgeted </strong></code> </a></td> <td> -one of: <a href="undocumented#SkBudgeted_kNo">SkBudgeted::kNo</a>, <a href="undocumented#SkBudgeted_kYes">SkBudgeted::kYes</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_3_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="undocumented#Raster_Surface">Raster Surface</a>; width, or height, or both, may be zero</td> +<table> <tr> <td><a name='SkSurface_MakeRenderTarget_3_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_3_budgeted'><code><strong>budgeted</strong></code></a></td> + <td>one of: <a href='undocumented#SkBudgeted_kNo'>SkBudgeted::kNo</a>, <a href='undocumented#SkBudgeted_kYes'>SkBudgeted::kYes</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_3_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='undocumented#Raster_Surface'>Raster Surface</a>; width, or height, or both, may be zero</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### Example @@ -720,64 +954,67 @@ of <a href="undocumented#Raster_Surface">Raster Surface</a>; width, or height, o ### See Also -<a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget">MakeFromBackendTextureAsRenderTarget</a> +<a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a> <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a> --- -<a name="SkSurface_MakeRenderTarget_4"></a> +<a name='SkSurface_MakeRenderTarget_4'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeRenderTarget(GrContext* context, - const SkSurfaceCharacterization& characterization, - SkBudgeted budgeted) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a>(<a href='undocumented#GrContext'>GrContext</a>* context, + const <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a>& characterization, + <a href='undocumented#SkBudgeted'>SkBudgeted</a> budgeted) </pre> -Returns <a href="#SkSurface">SkSurface</a> on GPU indicated by <a href="#SkSurface_MakeRenderTarget_4_context">context</a> that is compatible with the provided -<a href="#SkSurface_MakeRenderTarget_4_characterization">characterization</a>. <a href="#SkSurface_MakeRenderTarget_4_budgeted">budgeted</a> selects whether allocation for pixels is tracked by <a href="#SkSurface_MakeRenderTarget_4_context">context</a>. +Returns <a href='#SkSurface'>SkSurface</a> on GPU indicated by <a href='#SkSurface_MakeRenderTarget_4_context'>context</a> that is compatible with the provided +<a href='#SkSurface_MakeRenderTarget_4_characterization'>characterization</a>. <a href='#SkSurface_MakeRenderTarget_4_budgeted'>budgeted</a> selects whether allocation for pixels is tracked by <a href='#SkSurface_MakeRenderTarget_4_context'>context</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeRenderTarget_4_context"> <code><strong>context </strong></code> </a></td> <td> -<a href="undocumented#GPU_Context">GPU Context</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_4_characterization"> <code><strong>characterization </strong></code> </a></td> <td> -description of the desired <a href="#SkSurface">SkSurface</a></td> - </tr> <tr> <td><a name="SkSurface_MakeRenderTarget_4_budgeted"> <code><strong>budgeted </strong></code> </a></td> <td> -one of: <a href="undocumented#SkBudgeted_kNo">SkBudgeted::kNo</a>, <a href="undocumented#SkBudgeted_kYes">SkBudgeted::kYes</a></td> +<table> <tr> <td><a name='SkSurface_MakeRenderTarget_4_context'><code><strong>context</strong></code></a></td> + <td><a href='undocumented#GPU_Context'>GPU Context</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_4_characterization'><code><strong>characterization</strong></code></a></td> + <td>description of the desired <a href='#SkSurface'>SkSurface</a></td> + </tr> + <tr> <td><a name='SkSurface_MakeRenderTarget_4_budgeted'><code><strong>budgeted</strong></code></a></td> + <td>one of: <a href='undocumented#SkBudgeted_kNo'>SkBudgeted::kNo</a>, <a href='undocumented#SkBudgeted_kYes'>SkBudgeted::kYes</a></td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if all parameters are valid; otherwise, nullptr +<a href='#Surface'>Surface</a> if all parameters are valid; otherwise, nullptr ### See Also -<a href="#SkSurface_MakeFromBackendRenderTarget">MakeFromBackendRenderTarget</a> <a href="#SkSurface_MakeFromBackendTextureAsRenderTarget">MakeFromBackendTextureAsRenderTarget</a> +<a href='#SkSurface_MakeFromBackendRenderTarget'>MakeFromBackendRenderTarget</a> <a href='#SkSurface_MakeFromBackendTextureAsRenderTarget'>MakeFromBackendTextureAsRenderTarget</a> --- -<a name="SkSurface_MakeNull"></a> +<a name='SkSurface_MakeNull'></a> ## MakeNull -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkSurface> MakeNull(int width, int height) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_MakeNull'>MakeNull</a>(int width, int height) </pre> -Returns <a href="#Surface">Surface</a> without backing pixels. Drawing to <a href="SkCanvas_Reference#Canvas">Canvas</a> returned from <a href="#Surface">Surface</a> -has no effect. Calling <a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> on returned <a href="#Surface">Surface</a> returns nullptr. +Returns <a href='#Surface'>Surface</a> without backing pixels. Drawing to <a href='SkCanvas_Reference#Canvas'>Canvas</a> returned from <a href='#Surface'>Surface</a> +has no effect. Calling <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> on returned <a href='#Surface'>Surface</a> returns nullptr. ### Parameters -<table> <tr> <td><a name="SkSurface_MakeNull_width"> <code><strong>width </strong></code> </a></td> <td> -one or greater</td> - </tr> <tr> <td><a name="SkSurface_MakeNull_height"> <code><strong>height </strong></code> </a></td> <td> -one or greater</td> +<table> <tr> <td><a name='SkSurface_MakeNull_width'><code><strong>width</strong></code></a></td> + <td>one or greater</td> + </tr> + <tr> <td><a name='SkSurface_MakeNull_height'><code><strong>height</strong></code></a></td> + <td>one or greater</td> </tr> </table> ### Return Value -<a href="#Surface">Surface</a> if width and height are positive; otherwise, nullptr +<a href='#Surface'>Surface</a> if width and height are positive; otherwise, nullptr ### Example @@ -794,27 +1031,52 @@ surf->makeImageSnapshot() == nullptr ### See Also -<a href="#SkSurface_MakeRaster">MakeRaster</a><sup><a href="#SkSurface_MakeRaster_2">[2]</a></sup> <a href="#SkSurface_MakeRenderTarget">MakeRenderTarget</a><sup><a href="#SkSurface_MakeRenderTarget_2">[2]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_3">[3]</a></sup><sup><a href="#SkSurface_MakeRenderTarget_4">[4]</a></sup> +<a href='#SkSurface_MakeRaster'>MakeRaster</a><sup><a href='#SkSurface_MakeRaster_2'>[2]</a></sup> <a href='#SkSurface_MakeRenderTarget'>MakeRenderTarget</a><sup><a href='#SkSurface_MakeRenderTarget_2'>[2]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_3'>[3]</a></sup><sup><a href='#SkSurface_MakeRenderTarget_4'>[4]</a></sup> --- -## <a name="Property"></a> Property +## <a name='Property'>Property</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_generationID'>generationID</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to render target</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getBackendTexture'>getBackendTexture</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns the GPU reference to texture</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_getCanvas'>getCanvas</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkCanvas_Reference#Canvas'>Canvas</a> that draws into <a href='#Surface'>Surface</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_height'>height</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_props'>props</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Surface_Properties'>Surface Properties</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_width'>width</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkSurface_generationID">generationID</a> | returns unique ID | -| <a href="#SkSurface_getBackendRenderTarget">getBackendRenderTarget</a> | returns the GPU reference to render target | -| <a href="#SkSurface_getBackendTexture">getBackendTexture</a> | returns the GPU reference to texture | -| <a href="#SkSurface_getCanvas">getCanvas</a> | returns <a href="SkCanvas_Reference#Canvas">Canvas</a> that draws into <a href="#Surface">Surface</a> | -| <a href="#SkSurface_height">height</a> | returns pixel row count | -| <a href="#SkSurface_props">props</a> | returns <a href="undocumented#Surface_Properties">Surface Properties</a> | -| <a href="#SkSurface_width">width</a> | returns pixel column count | -<a name="SkSurface_width"></a> +<a name='SkSurface_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkSurface_width'>width</a>() const </pre> Returns pixel count in each row; may be zero or greater. @@ -837,15 +1099,15 @@ surface width=37 canvas width=37 ### See Also -<a href="#SkSurface_height">height</a> +<a href='#SkSurface_height'>height</a> --- -<a name="SkSurface_height"></a> +<a name='SkSurface_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkSurface_height'>height</a>() const </pre> Returns pixel row count; may be zero or greater. @@ -868,20 +1130,20 @@ surface height=1000 canvas height=1000 ### See Also -<a href="#SkSurface_width">width</a> +<a href='#SkSurface_width'>width</a> --- -<a name="SkSurface_generationID"></a> +<a name='SkSurface_generationID'></a> ## generationID -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -uint32_t generationID() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +uint32_t <a href='#SkSurface_generationID'>generationID</a>() </pre> -Returns unique value identifying the content of <a href="#Surface">Surface</a>. Returned value changes +Returns unique value identifying the content of <a href='#Surface'>Surface</a>. Returned value changes each time the content changes. Content is changed by drawing, or by calling -<a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a>. +<a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a>. ### Return Value @@ -903,62 +1165,80 @@ surface generationID: 3 ### See Also -<a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a> <a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> <a href="#SkSurface_getCanvas">getCanvas</a> +<a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a> <a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> <a href='#SkSurface_getCanvas'>getCanvas</a> --- -## <a name="SkSurface_ContentChangeMode"></a> Enum SkSurface::ContentChangeMode +## <a name='SkSurface_ContentChangeMode'>Enum SkSurface::ContentChangeMode</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> { - <a href="#SkSurface_kDiscard_ContentChangeMode">kDiscard ContentChangeMode</a>, - <a href="#SkSurface_kRetain_ContentChangeMode">kRetain ContentChangeMode</a>, + enum <a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> { + <a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard ContentChangeMode</a>, + <a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a>, }; </pre> -<a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> members are parameters to <a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a>. +<a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> members are parameters to <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a>. ### Constants -<table> - <tr> - <td><a name="SkSurface_kDiscard_ContentChangeMode"> <code><strong>SkSurface::kDiscard_ContentChangeMode </strong></code> </a></td><td>Pass to notifyContentWillChange to discard surface contents when</td><td>the surface is cleared or overwritten. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kDiscard_ContentChangeMode'><code>SkSurface::kDiscard_ContentChangeMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # discards surface on change ##</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Pass to <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a> to discard surface contents when +the surface is cleared or overwritten. </td> </tr> <tr> - <td><a name="SkSurface_kRetain_ContentChangeMode"> <code><strong>SkSurface::kRetain_ContentChangeMode </strong></code> </a></td><td>Pass to notifyContentWillChange when to preserve surface contents.</td><td>If a snapshot has been generated, this copies the <a href="#Surface">Surface</a> contents. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kRetain_ContentChangeMode'><code>SkSurface::kRetain_ContentChangeMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # preserves surface on change ##</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Pass to <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a> when to preserve surface contents. +If a snapshot has been generated, this copies the <a href='#Surface'>Surface</a> contents. </td> </tr> </table> ### See Also -<a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a> <a href="#SkSurface_generationID">generationID</a> +<a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a> <a href='#SkSurface_generationID'>generationID</a> +## <a name='Miscellaneous'>Miscellaneous</a> -## <a name="Miscellaneous"></a> Miscellaneous +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>notifies that contents will be changed outside of Skia</td> + </tr> +</table> -| name | description | -| --- | --- | -| <a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a> | notifies that contents will be changed outside of Skia | -<a name="SkSurface_notifyContentWillChange"></a> +<a name='SkSurface_notifyContentWillChange'></a> ## notifyContentWillChange -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void notifyContentWillChange(ContentChangeMode mode) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkSurface_notifyContentWillChange'>notifyContentWillChange</a>(<a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> mode) </pre> -Notifies that <a href="#Surface">Surface</a> contents will be changed by code outside of Skia. -Subsequent calls to <a href="#SkSurface_generationID">generationID</a> return a different value. +Notifies that <a href='#Surface'>Surface</a> contents will be changed by code outside of Skia. +Subsequent calls to <a href='#SkSurface_generationID'>generationID</a> return a different value. -<a href="#SkSurface_notifyContentWillChange_mode">mode</a> is normally passed as <a href="#SkSurface_kRetain_ContentChangeMode">kRetain ContentChangeMode</a>. +<a href='#SkSurface_notifyContentWillChange_mode'>mode</a> is normally passed as <a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a>. + +Can we deprecate this? ### Parameters -<table> <tr> <td><a name="SkSurface_notifyContentWillChange_mode"> <code><strong>mode </strong></code> </a></td> <td> -one of: <a href="#SkSurface_kDiscard_ContentChangeMode">kDiscard ContentChangeMode</a>, <a href="#SkSurface_kRetain_ContentChangeMode">kRetain ContentChangeMode</a></td> +<table> <tr> <td><a name='SkSurface_notifyContentWillChange_mode'><code><strong>mode</strong></code></a></td> + <td>one of: <a href='#SkSurface_kDiscard_ContentChangeMode'>kDiscard ContentChangeMode</a>, <a href='#SkSurface_kRetain_ContentChangeMode'>kRetain ContentChangeMode</a></td> </tr> </table> @@ -968,95 +1248,124 @@ one of: <a href="#SkSurface_kDiscard_ContentChangeMode">kDiscard ContentChangeMo ### See Also -<a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> <a href="#SkSurface_generationID">generationID</a> +<a href='#SkSurface_ContentChangeMode'>ContentChangeMode</a> <a href='#SkSurface_generationID'>generationID</a> --- -## <a name="SkSurface_BackendHandleAccess"></a> Enum SkSurface::BackendHandleAccess +## <a name='SkSurface_BackendHandleAccess'>Enum SkSurface::BackendHandleAccess</a> <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> - enum <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> { - <a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>, - <a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>, - <a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a>, + enum <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> { + <a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a>, + <a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a>, + <a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a>, }; - static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kFlushRead_TextureHandleAccess">kFlushRead TextureHandleAccess</a> = - <a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>; - static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kFlushWrite_TextureHandleAccess">kFlushWrite TextureHandleAccess</a> = - <a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>; - static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kDiscardWrite_TextureHandleAccess">kDiscardWrite TextureHandleAccess</a> = - <a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a>; + static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushRead_TextureHandleAccess'>kFlushRead TextureHandleAccess</a> = + <a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a>; + static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kFlushWrite_TextureHandleAccess'>kFlushWrite TextureHandleAccess</a> = + <a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a>; + static const <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_kDiscardWrite_TextureHandleAccess'>kDiscardWrite TextureHandleAccess</a> = + <a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a>; </pre> ### Constants -<table> - <tr> - <td><a name="SkSurface_kFlushRead_BackendHandleAccess"> <code><strong>SkSurface::kFlushRead_BackendHandleAccess </strong></code> </a></td><td>0</td><td>Caller may read from the back-end object. +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kFlushRead_BackendHandleAccess'><code>SkSurface::kFlushRead_BackendHandleAccess</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Caller may read from the back-end object. </td> </tr> <tr> - <td><a name="SkSurface_kFlushWrite_BackendHandleAccess"> <code><strong>SkSurface::kFlushWrite_BackendHandleAccess </strong></code> </a></td><td>1</td><td>Caller may write to the back-end object. + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kFlushWrite_BackendHandleAccess'><code>SkSurface::kFlushWrite_BackendHandleAccess</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Caller may write to the back-end object. </td> </tr> - <tr> - <td><a name="SkSurface_kDiscardWrite_BackendHandleAccess"> <code><strong>SkSurface::kDiscardWrite_BackendHandleAccess </strong></code> </a></td><td>2</td><td>Caller must overwrite the entire back-end object. + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kDiscardWrite_BackendHandleAccess'><code>SkSurface::kDiscardWrite_BackendHandleAccess</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Caller must overwrite the entire back-end object. </td> </tr> <tr> - <td><a name="SkSurface_kFlushRead_TextureHandleAccess"> <code><strong>SkSurface::kFlushRead_TextureHandleAccess </strong></code> </a></td><td>0</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kFlushRead_TextureHandleAccess'><code>SkSurface::kFlushRead_TextureHandleAccess</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Deprecated. + +</td> </tr> - <tr> - <td><a name="SkSurface_kFlushWrite_TextureHandleAccess"> <code><strong>SkSurface::kFlushWrite_TextureHandleAccess </strong></code> </a></td><td>1</td><td></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kFlushWrite_TextureHandleAccess'><code>SkSurface::kFlushWrite_TextureHandleAccess</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Deprecated. + +</td> </tr> <tr> - <td><a name="SkSurface_kDiscardWrite_TextureHandleAccess"> <code><strong>SkSurface::kDiscardWrite_TextureHandleAccess </strong></code> </a></td><td>2</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurface_kDiscardWrite_TextureHandleAccess'><code>SkSurface::kDiscardWrite_TextureHandleAccess</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +Deprecated. + +</td> </tr> </table> ### See Also -<a href="#SkSurface_getBackendTexture">getBackendTexture</a> <a href="#SkSurface_getBackendRenderTarget">getBackendRenderTarget</a> - - +<a href='#SkSurface_getBackendTexture'>getBackendTexture</a> <a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a> -<a name="SkSurface_getTextureHandle"></a> +<a name='SkSurface_getTextureHandle'></a> ## getTextureHandle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrBackendObject getTextureHandle(BackendHandleAccess backendHandleAccess) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#GrBackendObject'>GrBackendObject</a> <a href='#SkSurface_getTextureHandle'>getTextureHandle</a>(<a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> backendHandleAccess) </pre> +Deprecated. + --- -<a name="SkSurface_getRenderTargetHandle"></a> +<a name='SkSurface_getRenderTargetHandle'></a> ## getRenderTargetHandle -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool getRenderTargetHandle(GrBackendObject* backendObject, BackendHandleAccess backendHandleAccess) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_getRenderTargetHandle'>getRenderTargetHandle</a>(<a href='undocumented#GrBackendObject'>GrBackendObject</a>* backendObject, <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> backendHandleAccess) </pre> +Deprecated. + --- -<a name="SkSurface_getBackendTexture"></a> +<a name='SkSurface_getBackendTexture'></a> ## getBackendTexture -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrBackendTexture getBackendTexture(BackendHandleAccess backendHandleAccess) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#GrBackendTexture'>GrBackendTexture</a> <a href='#SkSurface_getBackendTexture'>getBackendTexture</a>(<a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> backendHandleAccess) </pre> -Retrieves the backend texture. If <a href="#Surface">Surface</a> has no backend texture, an invalid -object is returned. Call <a href="undocumented#GrBackendTexture_isValid">GrBackendTexture::isValid</a> to determine if the result +Retrieves the back-end texture. If <a href='#Surface'>Surface</a> has no back-end texture, an invalid +object is returned. Call <a href='undocumented#GrBackendTexture_isValid'>GrBackendTexture::isValid</a> to determine if the result is valid. -The returned <a href="undocumented#GrBackendTexture">GrBackendTexture</a> should be discarded if the <a href="#Surface">Surface</a> is drawn to or deleted. +The returned <a href='undocumented#GrBackendTexture'>GrBackendTexture</a> should be discarded if the <a href='#Surface'>Surface</a> is drawn to or deleted. ### Parameters -<table> <tr> <td><a name="SkSurface_getBackendTexture_backendHandleAccess"> <code><strong>backendHandleAccess </strong></code> </a></td> <td> -one of: <a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>, -<a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>, <a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a></td> +<table> <tr> <td><a name='SkSurface_getBackendTexture_backendHandleAccess'><code><strong>backendHandleAccess</strong></code></a></td> + <td>one of: <a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a>, +<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a>, <a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a></td> </tr> </table> @@ -1066,29 +1375,29 @@ GPU texture reference; invalid on failure ### See Also -<a href="undocumented#GrBackendTexture">GrBackendTexture</a> <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_getBackendRenderTarget">getBackendRenderTarget</a> +<a href='undocumented#GrBackendTexture'>GrBackendTexture</a> <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a> --- -<a name="SkSurface_getBackendRenderTarget"></a> +<a name='SkSurface_getBackendRenderTarget'></a> ## getBackendRenderTarget -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrBackendRenderTarget getBackendRenderTarget(BackendHandleAccess backendHandleAccess) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#GrBackendRenderTarget'>GrBackendRenderTarget</a> <a href='#SkSurface_getBackendRenderTarget'>getBackendRenderTarget</a>(<a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> backendHandleAccess) </pre> -Retrieves the backend render target. If <a href="#Surface">Surface</a> has no backend render target, an invalid -object is returned. Call <a href="undocumented#GrBackendRenderTarget_isValid">GrBackendRenderTarget::isValid</a> to determine if the result +Retrieves the back-end render target. If <a href='#Surface'>Surface</a> has no back-end render target, an invalid +object is returned. Call <a href='undocumented#GrBackendRenderTarget_isValid'>GrBackendRenderTarget::isValid</a> to determine if the result is valid. -The returned <a href="undocumented#GrBackendRenderTarget">GrBackendRenderTarget</a> should be discarded if the <a href="#Surface">Surface</a> is drawn to +The returned <a href='undocumented#GrBackendRenderTarget'>GrBackendRenderTarget</a> should be discarded if the <a href='#Surface'>Surface</a> is drawn to or deleted. ### Parameters -<table> <tr> <td><a name="SkSurface_getBackendRenderTarget_backendHandleAccess"> <code><strong>backendHandleAccess </strong></code> </a></td> <td> -one of: <a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>, -<a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>, <a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a></td> +<table> <tr> <td><a name='SkSurface_getBackendRenderTarget_backendHandleAccess'><code><strong>backendHandleAccess</strong></code></a></td> + <td>one of: <a href='#SkSurface_kFlushRead_BackendHandleAccess'>kFlushRead BackendHandleAccess</a>, +<a href='#SkSurface_kFlushWrite_BackendHandleAccess'>kFlushWrite BackendHandleAccess</a>, <a href='#SkSurface_kDiscardWrite_BackendHandleAccess'>kDiscardWrite BackendHandleAccess</a></td> </tr> </table> @@ -1098,24 +1407,24 @@ GPU render target reference; invalid on failure ### See Also -<a href="undocumented#GrBackendRenderTarget">GrBackendRenderTarget</a> <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_getBackendTexture">getBackendTexture</a> +<a href='undocumented#GrBackendRenderTarget'>GrBackendRenderTarget</a> <a href='#SkSurface_BackendHandleAccess'>BackendHandleAccess</a> <a href='#SkSurface_getBackendTexture'>getBackendTexture</a> --- -<a name="SkSurface_getCanvas"></a> +<a name='SkSurface_getCanvas'></a> ## getCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas* getCanvas() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* <a href='#SkSurface_getCanvas'>getCanvas</a>() </pre> -Returns <a href="SkCanvas_Reference#Canvas">Canvas</a> that draws into <a href="#Surface">Surface</a>. Subsequent calls return the same <a href="SkCanvas_Reference#Canvas">Canvas</a>. -<a href="SkCanvas_Reference#Canvas">Canvas</a> returned is managed and owned by <a href="#Surface">Surface</a>, and is deleted when <a href="#Surface">Surface</a> +Returns <a href='SkCanvas_Reference#Canvas'>Canvas</a> that draws into <a href='#Surface'>Surface</a>. Subsequent calls return the same <a href='SkCanvas_Reference#Canvas'>Canvas</a>. +<a href='SkCanvas_Reference#Canvas'>Canvas</a> returned is managed and owned by <a href='#Surface'>Surface</a>, and is deleted when <a href='#Surface'>Surface</a> is deleted. ### Return Value -drawing <a href="SkCanvas_Reference#Canvas">Canvas</a> for <a href="#Surface">Surface</a> +drawing <a href='SkCanvas_Reference#Canvas'>Canvas</a> for <a href='#Surface'>Surface</a> ### Example @@ -1123,35 +1432,35 @@ drawing <a href="SkCanvas_Reference#Canvas">Canvas</a> for <a href="#Surface">Su ### See Also -<a href="#SkSurface_makeSurface">makeSurface</a> <a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> <a href="#SkSurface_draw">draw</a><sup><a href="#SkSurface_draw_2">[2]</a></sup> +<a href='#SkSurface_makeSurface'>makeSurface</a> <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> <a href='#SkSurface_draw'>draw</a><sup><a href='#SkSurface_draw_2'>[2]</a></sup> --- -<a name="SkSurface_makeSurface"></a> +<a name='SkSurface_makeSurface'></a> ## makeSurface -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkSurface> makeSurface(const SkImageInfo& imageInfo) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='#SkSurface'>SkSurface</a>> <a href='#SkSurface_makeSurface'>makeSurface</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& imageInfo) </pre> -Returns a compatible <a href="#Surface">Surface</a>, or nullptr. Returned <a href="#Surface">Surface</a> contains -the same raster, GPU, or null properties as the original. Returned <a href="#Surface">Surface</a> +Returns a compatible <a href='#Surface'>Surface</a>, or nullptr. Returned <a href='#Surface'>Surface</a> contains +the same raster, GPU, or null properties as the original. Returned <a href='#Surface'>Surface</a> does not share the same pixels. -Returns nullptr if <a href="#SkSurface_makeSurface_imageInfo">imageInfo</a> width or height are zero, or if <a href="#SkSurface_makeSurface_imageInfo">imageInfo</a> -is incompatible with <a href="#Surface">Surface</a>. +Returns nullptr if <a href='#SkSurface_makeSurface_imageInfo'>imageInfo</a> width or height are zero, or if <a href='#SkSurface_makeSurface_imageInfo'>imageInfo</a> +is incompatible with <a href='#Surface'>Surface</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_makeSurface_imageInfo"> <code><strong>imageInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>, <a href="undocumented#Color_Space">Color Space</a>, -of <a href="#Surface">Surface</a>; width and height must be greater than zero</td> +<table> <tr> <td><a name='SkSurface_makeSurface_imageInfo'><code><strong>imageInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a>, <a href='undocumented#Color_Space'>Color Space</a>, +of <a href='#Surface'>Surface</a>; width and height must be greater than zero</td> </tr> </table> ### Return Value -compatible <a href="#Surface">Surface</a> or nullptr +compatible <a href='#Surface'>Surface</a> or nullptr ### Example @@ -1159,24 +1468,24 @@ compatible <a href="#Surface">Surface</a> or nullptr ### See Also -<a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> <a href="#SkSurface_getCanvas">getCanvas</a> <a href="#SkSurface_draw">draw</a><sup><a href="#SkSurface_draw_2">[2]</a></sup> +<a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> <a href='#SkSurface_getCanvas'>getCanvas</a> <a href='#SkSurface_draw'>draw</a><sup><a href='#SkSurface_draw_2'>[2]</a></sup> --- -<a name="SkSurface_makeImageSnapshot"></a> +<a name='SkSurface_makeImageSnapshot'></a> ## makeImageSnapshot -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -sk_sp<SkImage> makeImageSnapshot() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#sk_sp'>sk sp</a><<a href='SkImage_Reference#SkImage'>SkImage</a>> <a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a>() </pre> -Returns <a href="SkImage_Reference#Image">Image</a> capturing <a href="#Surface">Surface</a> contents. Subsequent drawing to <a href="#Surface">Surface</a> contents -are not captured. <a href="SkImage_Reference#Image">Image</a> allocation is accounted for if <a href="#Surface">Surface</a> was created with -<a href="undocumented#SkBudgeted_kYes">SkBudgeted::kYes</a>. +Returns <a href='SkImage_Reference#Image'>Image</a> capturing <a href='#Surface'>Surface</a> contents. Subsequent drawing to <a href='#Surface'>Surface</a> contents +are not captured. <a href='SkImage_Reference#Image'>Image</a> allocation is accounted for if <a href='#Surface'>Surface</a> was created with +<a href='undocumented#SkBudgeted_kYes'>SkBudgeted::kYes</a>. ### Return Value -<a href="SkImage_Reference#Image">Image</a> initialized with <a href="#Surface">Surface</a> contents +<a href='SkImage_Reference#Image'>Image</a> initialized with <a href='#Surface'>Surface</a> contents ### Example @@ -1184,48 +1493,88 @@ are not captured. <a href="SkImage_Reference#Image">Image</a> allocation is acco ### See Also -<a href="#SkSurface_draw">draw</a><sup><a href="#SkSurface_draw_2">[2]</a></sup> <a href="#SkSurface_getCanvas">getCanvas</a> +<a href='#SkSurface_draw'>draw</a><sup><a href='#SkSurface_draw_2'>[2]</a></sup> <a href='#SkSurface_getCanvas'>getCanvas</a> --- -## <a name="Pixels"></a> Pixels - -| name | description | -| --- | --- | -| <a href="#SkSurface_draw">draw</a> | draws <a href="#Surface">Surface</a> contents to canvas | -| | <a href="#SkSurface_draw">draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint)</a> | -| | <a href="#SkSurface_draw_2">draw(SkDeferredDisplayList* deferredDisplayList)</a> | -| <a href="#SkSurface_peekPixels">peekPixels</a> | copies <a href="#Surface">Surface</a> parameters to <a href="SkPixmap_Reference#Pixmap">Pixmap</a> | -| <a href="#SkSurface_readPixels">readPixels</a> | copies <a href="SkRect_Reference#Rect">Rect</a> of pixels | -| | <a href="#SkSurface_readPixels">readPixels(const SkPixmap& dst, int srcX, int srcY)</a> | -| | <a href="#SkSurface_readPixels_2">readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a> | -| | <a href="#SkSurface_readPixels_3">readPixels(const SkBitmap& dst, int srcX, int srcY)</a> | -| <a href="#SkSurface_writePixels">writePixels</a> | copies <a href="SkRect_Reference#Rect">Rect</a> of pixels | -| | <a href="#SkSurface_writePixels">writePixels(const SkPixmap& src, int dstX, int dstY)</a> | -| | <a href="#SkSurface_writePixels_2">writePixels(const SkBitmap& src, int dstX, int dstY)</a> | - -<a name="SkSurface_draw"></a> +## <a name='Pixels'>Pixels</a> + + +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw'>draw</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>draws <a href='#Surface'>Surface</a> contents to canvas</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw'>draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_draw_2'>draw(SkDeferredDisplayList* deferredDisplayList)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_peekPixels'>peekPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='#Surface'>Surface</a> parameters to <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels'>readPixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels'>readPixels(const SkPixmap& dst, int srcX, int srcY)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels_2'>readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY)</a></td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_readPixels_3'>readPixels(const SkBitmap& dst, int srcX, int srcY)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels'>writePixels</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels'>writePixels(const SkPixmap& src, int dstX, int dstY)</a></td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_writePixels_2'>writePixels(const SkBitmap& src, int dstX, int dstY)</a></td> + </tr> +</table> + + +<a name='SkSurface_draw'></a> ## draw -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkSurface_draw'>draw</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* canvas, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, const <a href='SkPaint_Reference#SkPaint'>SkPaint</a>* paint) </pre> -Draws <a href="#Surface">Surface</a> contents to <a href="#SkSurface_draw_canvas">canvas</a>, with its top-left corner at (<a href="#SkSurface_draw_x">x</a>, <a href="#SkSurface_draw_y">y</a>). +Draws <a href='#Surface'>Surface</a> contents to <a href='#SkSurface_draw_canvas'>canvas</a>, with its top-left corner at (<a href='#SkSurface_draw_x'>x</a>, <a href='#SkSurface_draw_y'>y</a>). -If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkSurface_draw_paint">paint</a> is not nullptr, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="SkColor_Reference#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, -<a href="undocumented#Blend_Mode">Blend Mode</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>. +If <a href='SkPaint_Reference#Paint'>Paint</a> <a href='#SkSurface_draw_paint'>paint</a> is not nullptr, apply <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='SkColor_Reference#Alpha'>Color Alpha</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, +<a href='undocumented#Blend_Mode'>Blend Mode</a>, and <a href='undocumented#Draw_Looper'>Draw Looper</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_draw_canvas"> <code><strong>canvas </strong></code> </a></td> <td> -<a href="SkCanvas_Reference#Canvas">Canvas</a> drawn into</td> - </tr> <tr> <td><a name="SkSurface_draw_x"> <code><strong>x </strong></code> </a></td> <td> -horizontal offset in <a href="SkCanvas_Reference#Canvas">Canvas</a></td> - </tr> <tr> <td><a name="SkSurface_draw_y"> <code><strong>y </strong></code> </a></td> <td> -vertical offset in <a href="SkCanvas_Reference#Canvas">Canvas</a></td> - </tr> <tr> <td><a name="SkSurface_draw_paint"> <code><strong>paint </strong></code> </a></td> <td> -<a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, +<table> <tr> <td><a name='SkSurface_draw_canvas'><code><strong>canvas</strong></code></a></td> + <td><a href='SkCanvas_Reference#Canvas'>Canvas</a> drawn into</td> + </tr> + <tr> <td><a name='SkSurface_draw_x'><code><strong>x</strong></code></a></td> + <td>horizontal offset in <a href='SkCanvas_Reference#Canvas'>Canvas</a></td> + </tr> + <tr> <td><a name='SkSurface_draw_y'><code><strong>y</strong></code></a></td> + <td>vertical offset in <a href='SkCanvas_Reference#Canvas'>Canvas</a></td> + </tr> + <tr> <td><a name='SkSurface_draw_paint'><code><strong>paint</strong></code></a></td> + <td><a href='SkPaint_Reference#Paint'>Paint</a> containing <a href='undocumented#Blend_Mode'>Blend Mode</a>, <a href='undocumented#Color_Filter'>Color Filter</a>, <a href='undocumented#Image_Filter'>Image Filter</a>, and so on; or nullptr</td> </tr> </table> @@ -1236,33 +1585,33 @@ and so on; or nullptr</td> ### See Also -<a href="#SkSurface_makeImageSnapshot">makeImageSnapshot</a> <a href="#SkSurface_getCanvas">getCanvas</a> +<a href='#SkSurface_makeImageSnapshot'>makeImageSnapshot</a> <a href='#SkSurface_getCanvas'>getCanvas</a> --- -<a name="SkSurface_peekPixels"></a> +<a name='SkSurface_peekPixels'></a> ## peekPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool peekPixels(SkPixmap* pixmap) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_peekPixels'>peekPixels</a>(<a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>* pixmap) </pre> -Copies <a href="#Surface">Surface</a> pixel address, row bytes, and <a href="SkImageInfo_Reference#Image_Info">Image Info</a> to <a href="SkPixmap_Reference#Pixmap">Pixmap</a>, if address +Copies <a href='#Surface'>Surface</a> pixel address, row bytes, and <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> to <a href='SkPixmap_Reference#Pixmap'>Pixmap</a>, if address is available, and returns true. If pixel address is not available, return -false and leave <a href="SkPixmap_Reference#Pixmap">Pixmap</a> unchanged. +false and leave <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> unchanged. -<a href="#SkSurface_peekPixels_pixmap">pixmap</a> contents become invalid on any future change to <a href="#Surface">Surface</a>. +<a href='#SkSurface_peekPixels_pixmap'>pixmap</a> contents become invalid on any future change to <a href='#Surface'>Surface</a>. ### Parameters -<table> <tr> <td><a name="SkSurface_peekPixels_pixmap"> <code><strong>pixmap </strong></code> </a></td> <td> -storage for pixel state if pixels are readable; otherwise, ignored</td> +<table> <tr> <td><a name='SkSurface_peekPixels_pixmap'><code><strong>pixmap</strong></code></a></td> + <td>storage for pixel state if pixels are readable; otherwise, ignored</td> </tr> </table> ### Return Value -true if <a href="#Surface">Surface</a> has direct access to pixels +true if <a href='#Surface'>Surface</a> has direct access to pixels ### Example @@ -1270,50 +1619,55 @@ true if <a href="#Surface">Surface</a> has direct access to pixels ### See Also -<a href="#SkSurface_readPixels">readPixels</a><sup><a href="#SkSurface_readPixels_2">[2]</a></sup><sup><a href="#SkSurface_readPixels_3">[3]</a></sup> <a href="#SkSurface_writePixels">writePixels</a><sup><a href="#SkSurface_writePixels_2">[2]</a></sup> +<a href='#SkSurface_readPixels'>readPixels</a><sup><a href='#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='#SkSurface_readPixels_3'>[3]</a></sup> <a href='#SkSurface_writePixels'>writePixels</a><sup><a href='#SkSurface_writePixels_2'>[2]</a></sup> --- -<a name="SkSurface_readPixels"></a> +<a name='SkSurface_readPixels'></a> ## readPixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkPixmap& dst, int srcX, int srcY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& dst, int srcX, int srcY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkSurface_readPixels_dst">dst</a>. +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels to <a href='#SkSurface_readPixels_dst'>dst</a>. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkSurface_readPixels_srcX">srcX</a>, <a href="#SkSurface_readPixels_srcY">srcY</a>) and <a href="#Surface">Surface</a> (<a href="#SkSurface_width">width</a>, <a href="#SkSurface_height">height</a>). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkSurface_readPixels_dst">dst</a>.<a href="#SkSurface_width">width</a>, <a href="#SkSurface_readPixels_dst">dst</a>.<a href="#SkSurface_height">height</a>). +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_srcX'>srcX</a>, <a href='#SkSurface_readPixels_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_height'>height</a>). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_readPixels_dst'>dst</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_readPixels_dst'>dst</a>.<a href='#SkSurface_height'>height</a>). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkSurface_readPixels_dst">dst</a>.colorType() and <a href="#SkSurface_readPixels_dst">dst</a>.alphaType() if required. +converting to <a href='#SkSurface_readPixels_dst'>dst</a>.colorType() and <a href='#SkSurface_readPixels_dst'>dst</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are readable when <a href="#Surface">Surface</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are readable when <a href='#Surface'>Surface</a> is raster, or backed by a GPU. The destination pixel storage must be allocated by the caller. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> do not match. Only pixels within both source and destination rectangles -are copied. <a href="#SkSurface_readPixels_dst">dst</a> contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +are copied. <a href='#SkSurface_readPixels_dst'>dst</a> contents outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkSurface_readPixels_srcX">srcX</a> or <a href="#SkSurface_readPixels_srcY">srcY</a> to offset pixels across or down destination. +Pass negative values for <a href='#SkSurface_readPixels_srcX'>srcX</a> or <a href='#SkSurface_readPixels_srcY'>srcY</a> to offset pixels across or down destination. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="SkPixmap_Reference#Pixmap">Pixmap</a> pixels could not be allocated.</td> </tr> <tr> - <td><a href="#SkSurface_readPixels_dst">dst</a>.rowBytes() is too small to contain one row of pixels.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='SkPixmap_Reference#Pixmap'>Pixmap</a> pixels could not be allocated.</td> + </tr> <tr> + <td><a href='#SkSurface_readPixels_dst'>dst</a>.rowBytes() is too small to contain one row of pixels.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkSurface_readPixels_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for pixels copied from <a href="#Surface">Surface</a></td> - </tr> <tr> <td><a name="SkSurface_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -offset into readable pixels in x; may be negative</td> - </tr> <tr> <td><a name="SkSurface_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -offset into readable pixels in y; may be negative</td> +<table> <tr> <td><a name='SkSurface_readPixels_dst'><code><strong>dst</strong></code></a></td> + <td>storage for pixels copied from <a href='#Surface'>Surface</a></td> + </tr> + <tr> <td><a name='SkSurface_readPixels_srcX'><code><strong>srcX</strong></code></a></td> + <td>offset into readable pixels in x; may be negative</td> + </tr> + <tr> <td><a name='SkSurface_readPixels_srcY'><code><strong>srcY</strong></code></a></td> + <td>offset into readable pixels in y; may be negative</td> </tr> </table> @@ -1327,53 +1681,60 @@ true if pixels were copied ### See Also -<a href="#SkSurface_peekPixels">peekPixels</a> <a href="#SkSurface_writePixels">writePixels</a><sup><a href="#SkSurface_writePixels_2">[2]</a></sup> +<a href='#SkSurface_peekPixels'>peekPixels</a> <a href='#SkSurface_writePixels'>writePixels</a><sup><a href='#SkSurface_writePixels_2'>[2]</a></sup> --- -<a name="SkSurface_readPixels_2"></a> +<a name='SkSurface_readPixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="SkCanvas_Reference#Canvas">Canvas</a> into <a href="#SkSurface_readPixels_2_dstPixels">dstPixels</a>. +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='SkCanvas_Reference#Canvas'>Canvas</a> into <a href='#SkSurface_readPixels_2_dstPixels'>dstPixels</a>. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkSurface_readPixels_2_srcX">srcX</a>, <a href="#SkSurface_readPixels_2_srcY">srcY</a>) and <a href="#Surface">Surface</a> (<a href="#SkSurface_width">width</a>, <a href="#SkSurface_height">height</a>). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkSurface_width">width</a>, <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkSurface_height">height</a>). +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_2_srcX'>srcX</a>, <a href='#SkSurface_readPixels_2_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_height'>height</a>). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_height'>height</a>). Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.colorType() and <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.alphaType() if required. +converting to <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.colorType() and <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.alphaType() if required. -<a href="#Pixels">Pixels</a> are readable when <a href="#Surface">Surface</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are readable when <a href='#Surface'>Surface</a> is raster, or backed by a GPU. The destination pixel storage must be allocated by the caller. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> do not match. Only pixels within both source and destination rectangles -are copied. <a href="#SkSurface_readPixels_2_dstPixels">dstPixels</a> contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +are copied. <a href='#SkSurface_readPixels_2_dstPixels'>dstPixels</a> contents outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkSurface_readPixels_2_srcX">srcX</a> or <a href="#SkSurface_readPixels_2_srcY">srcY</a> to offset pixels across or down destination. +Pass negative values for <a href='#SkSurface_readPixels_2_srcX'>srcX</a> or <a href='#SkSurface_readPixels_2_srcY'>srcY</a> to offset pixels across or down destination. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#Surface">Surface</a> pixels could not be converted to <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.colorType() or <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.alphaType().</td> </tr> <tr> - <td><a href="#SkSurface_readPixels_2_dstRowBytes">dstRowBytes</a> is too small to contain one row of pixels.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#Surface'>Surface</a> pixels could not be converted to <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.colorType() or <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.alphaType().</td> + </tr> <tr> + <td><a href='#SkSurface_readPixels_2_dstRowBytes'>dstRowBytes</a> is too small to contain one row of pixels.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkSurface_readPixels_2_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td> -width, height, <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> of <a href="#SkSurface_readPixels_2_dstPixels">dstPixels</a></td> - </tr> <tr> <td><a name="SkSurface_readPixels_2_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td> -storage for pixels; <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkSurface_height">height</a> times <a href="#SkSurface_readPixels_2_dstRowBytes">dstRowBytes</a>, or larger</td> - </tr> <tr> <td><a name="SkSurface_readPixels_2_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td> -size of one destination row; <a href="#SkSurface_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkSurface_width">width</a> times pixel size, or larger</td> - </tr> <tr> <td><a name="SkSurface_readPixels_2_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -offset into readable pixels in x; may be negative</td> - </tr> <tr> <td><a name="SkSurface_readPixels_2_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -offset into readable pixels in y; may be negative</td> +<table> <tr> <td><a name='SkSurface_readPixels_2_dstInfo'><code><strong>dstInfo</strong></code></a></td> + <td>width, height, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of <a href='#SkSurface_readPixels_2_dstPixels'>dstPixels</a></td> + </tr> + <tr> <td><a name='SkSurface_readPixels_2_dstPixels'><code><strong>dstPixels</strong></code></a></td> + <td>storage for pixels; <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_height'>height</a> times <a href='#SkSurface_readPixels_2_dstRowBytes'>dstRowBytes</a>, or larger</td> + </tr> + <tr> <td><a name='SkSurface_readPixels_2_dstRowBytes'><code><strong>dstRowBytes</strong></code></a></td> + <td>size of one destination row; <a href='#SkSurface_readPixels_2_dstInfo'>dstInfo</a>.<a href='#SkSurface_width'>width</a> times pixel size, or larger</td> + </tr> + <tr> <td><a name='SkSurface_readPixels_2_srcX'><code><strong>srcX</strong></code></a></td> + <td>offset into readable pixels in x; may be negative</td> + </tr> + <tr> <td><a name='SkSurface_readPixels_2_srcY'><code><strong>srcY</strong></code></a></td> + <td>offset into readable pixels in y; may be negative</td> </tr> </table> @@ -1383,57 +1744,63 @@ true if pixels were copied ### Example -<div><fiddle-embed name="d141d6c662d201d191fb1eea26d014fd"><div>A black oval drawn on a red background provides an image to copy. -<a href="#SkSurface_readPixels">readPixels</a> copies one quarter of the <a href="#Surface">Surface</a> into each of the four corners. +<div><fiddle-embed name="484d60dab5d846bf28c7a4d48892324a"><div>A black oval drawn on a red background provides an image to copy. +<a href='#SkSurface_readPixels'>readPixels</a> copies one quarter of the <a href='#Surface'>Surface</a> into each of the four corners. The copied quarter ovals overdraw the original oval. </div></fiddle-embed></div> ### See Also -<a href="#SkSurface_peekPixels">peekPixels</a> <a href="#SkSurface_writePixels">writePixels</a><sup><a href="#SkSurface_writePixels_2">[2]</a></sup> +<a href='#SkSurface_peekPixels'>peekPixels</a> <a href='#SkSurface_writePixels'>writePixels</a><sup><a href='#SkSurface_writePixels_2'>[2]</a></sup> --- -<a name="SkSurface_readPixels_3"></a> +<a name='SkSurface_readPixels_3'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool readPixels(const SkBitmap& dst, int srcX, int srcY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_readPixels'>readPixels</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& dst, int srcX, int srcY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from <a href="#Surface">Surface</a> into bitmap. +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from <a href='#Surface'>Surface</a> into bitmap. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkSurface_readPixels_3_srcX">srcX</a>, <a href="#SkSurface_readPixels_3_srcY">srcY</a>) and <a href="#Surface">Surface</a> (<a href="#SkSurface_width">width</a>, <a href="#SkSurface_height">height</a>). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (bitmap.<a href="#SkSurface_width">width</a>, bitmap.<a href="#SkSurface_height">height</a>). +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_readPixels_3_srcX'>srcX</a>, <a href='#SkSurface_readPixels_3_srcY'>srcY</a>) and <a href='#Surface'>Surface</a> (<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_height'>height</a>). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (bitmap.<a href='#SkSurface_width'>width</a>, bitmap.<a href='#SkSurface_height'>height</a>). Copies each readable pixel intersecting both rectangles, without scaling, converting to bitmap.colorType() and bitmap.alphaType() if required. -<a href="#Pixels">Pixels</a> are readable when <a href="#Surface">Surface</a> is raster, or backed by a GPU. +<a href='#Pixels'>Pixels</a> are readable when <a href='#Surface'>Surface</a> is raster, or backed by a GPU. The destination pixel storage must be allocated by the caller. -<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> +<a href='undocumented#Pixel'>Pixel</a> values are converted only if <a href='SkImageInfo_Reference#Color_Type'>Color Type</a> and <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> do not match. Only pixels within both source and destination rectangles -are copied. <a href="#SkSurface_readPixels_3_dst">dst</a> contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged. +are copied. <a href='#SkSurface_readPixels_3_dst'>dst</a> contents outside <a href='SkRect_Reference#Rect'>Rect</a> intersection are unchanged. -Pass negative values for <a href="#SkSurface_readPixels_3_srcX">srcX</a> or <a href="#SkSurface_readPixels_3_srcY">srcY</a> to offset pixels across or down destination. +Pass negative values for <a href='#SkSurface_readPixels_3_srcX'>srcX</a> or <a href='#SkSurface_readPixels_3_srcY'>srcY</a> to offset pixels across or down destination. Does not copy, and returns false if: <table> <tr> - <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#Surface">Surface</a> pixels could not be converted to <a href="#SkSurface_readPixels_3_dst">dst</a>.colorType() or <a href="#SkSurface_readPixels_3_dst">dst</a>.alphaType().</td> </tr> <tr> - <td><a href="#SkSurface_readPixels_3_dst">dst</a> pixels could not be allocated.</td> </tr> <tr> - <td><a href="#SkSurface_readPixels_3_dst">dst</a>.rowBytes() is too small to contain one row of pixels.</td> </tr> + <td>Source and destination rectangles do not intersect.</td> + </tr> <tr> + <td><a href='#Surface'>Surface</a> pixels could not be converted to <a href='#SkSurface_readPixels_3_dst'>dst</a>.colorType() or <a href='#SkSurface_readPixels_3_dst'>dst</a>.alphaType().</td> + </tr> <tr> + <td><a href='#SkSurface_readPixels_3_dst'>dst</a> pixels could not be allocated.</td> + </tr> <tr> + <td><a href='#SkSurface_readPixels_3_dst'>dst</a>.rowBytes() is too small to contain one row of pixels.</td> + </tr> </table> ### Parameters -<table> <tr> <td><a name="SkSurface_readPixels_3_dst"> <code><strong>dst </strong></code> </a></td> <td> -storage for pixels copied from <a href="#Surface">Surface</a></td> - </tr> <tr> <td><a name="SkSurface_readPixels_3_srcX"> <code><strong>srcX </strong></code> </a></td> <td> -offset into readable pixels in x; may be negative</td> - </tr> <tr> <td><a name="SkSurface_readPixels_3_srcY"> <code><strong>srcY </strong></code> </a></td> <td> -offset into readable pixels in y; may be negative</td> +<table> <tr> <td><a name='SkSurface_readPixels_3_dst'><code><strong>dst</strong></code></a></td> + <td>storage for pixels copied from <a href='#Surface'>Surface</a></td> + </tr> + <tr> <td><a name='SkSurface_readPixels_3_srcX'><code><strong>srcX</strong></code></a></td> + <td>offset into readable pixels in x; may be negative</td> + </tr> + <tr> <td><a name='SkSurface_readPixels_3_srcY'><code><strong>srcY</strong></code></a></td> + <td>offset into readable pixels in y; may be negative</td> </tr> </table> @@ -1443,38 +1810,40 @@ true if pixels were copied ### Example -<div><fiddle-embed name="dcbd4af9151820f63de45a35f3a8d110"></fiddle-embed></div> +<div><fiddle-embed name="2d991a231e49d1de13eeb2ba9b440e01"></fiddle-embed></div> ### See Also -<a href="#SkSurface_peekPixels">peekPixels</a> <a href="#SkSurface_writePixels">writePixels</a><sup><a href="#SkSurface_writePixels_2">[2]</a></sup> +<a href='#SkSurface_peekPixels'>peekPixels</a> <a href='#SkSurface_writePixels'>writePixels</a><sup><a href='#SkSurface_writePixels_2'>[2]</a></sup> --- -<a name="SkSurface_writePixels"></a> +<a name='SkSurface_writePixels'></a> ## writePixels -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void writePixels(const SkPixmap& src, int dstX, int dstY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkSurface_writePixels'>writePixels</a>(const <a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>& src, int dstX, int dstY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from the <a href="#SkSurface_writePixels_src">src</a> <a href="SkPixmap_Reference#Pixmap">Pixmap</a> to the <a href="#Surface">Surface</a>. +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from the <a href='#SkSurface_writePixels_src'>src</a> <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> to the <a href='#Surface'>Surface</a>. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkSurface_writePixels_src">src</a>.<a href="#SkSurface_width">width</a>, <a href="#SkSurface_writePixels_src">src</a>.<a href="#SkSurface_height">height</a>). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkSurface_writePixels_dstX">dstX</a>, <a href="#SkSurface_writePixels_dstY">dstY</a>) and(<a href="#SkSurface_writePixels_dstX">dstX</a> + <a href="#Surface">Surface</a> <a href="#SkSurface_width">width</a>, <a href="#SkSurface_writePixels_dstY">dstY</a> + <a href="#Surface">Surface</a> <a href="#SkSurface_height">height</a>) +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_writePixels_src'>src</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_src'>src</a>.<a href='#SkSurface_height'>height</a>). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_writePixels_dstX'>dstX</a>, <a href='#SkSurface_writePixels_dstY'>dstY</a>) and(<a href='#SkSurface_writePixels_dstX'>dstX</a> + <a href='#Surface'>Surface</a> <a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_dstY'>dstY</a> + <a href='#Surface'>Surface</a> <a href='#SkSurface_height'>height</a>) . Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#Surface">Surface</a> colorType() and <a href="#Surface">Surface</a> alphaType() if required. +converting to <a href='#Surface'>Surface</a> colorType() and <a href='#Surface'>Surface</a> alphaType() if required. ### Parameters -<table> <tr> <td><a name="SkSurface_writePixels_src"> <code><strong>src </strong></code> </a></td> <td> -storage for pixels to copy to <a href="#Surface">Surface</a></td> - </tr> <tr> <td><a name="SkSurface_writePixels_dstX"> <code><strong>dstX </strong></code> </a></td> <td> -x position relative to <a href="#Surface">Surface</a> to begin copy; may be negative</td> - </tr> <tr> <td><a name="SkSurface_writePixels_dstY"> <code><strong>dstY </strong></code> </a></td> <td> -x position relative to <a href="#Surface">Surface</a> to begin copy; may be negative</td> +<table> <tr> <td><a name='SkSurface_writePixels_src'><code><strong>src</strong></code></a></td> + <td>storage for pixels to copy to <a href='#Surface'>Surface</a></td> + </tr> + <tr> <td><a name='SkSurface_writePixels_dstX'><code><strong>dstX</strong></code></a></td> + <td>x position relative to <a href='#Surface'>Surface</a> to begin copy; may be negative</td> + </tr> + <tr> <td><a name='SkSurface_writePixels_dstY'><code><strong>dstY</strong></code></a></td> + <td>x position relative to <a href='#Surface'>Surface</a> to begin copy; may be negative</td> </tr> </table> @@ -1484,33 +1853,35 @@ x position relative to <a href="#Surface">Surface</a> to begin copy; may be nega ### See Also -<a href="#SkSurface_readPixels">readPixels</a><sup><a href="#SkSurface_readPixels_2">[2]</a></sup><sup><a href="#SkSurface_readPixels_3">[3]</a></sup> <a href="#SkSurface_peekPixels">peekPixels</a> +<a href='#SkSurface_readPixels'>readPixels</a><sup><a href='#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='#SkSurface_readPixels_3'>[3]</a></sup> <a href='#SkSurface_peekPixels'>peekPixels</a> --- -<a name="SkSurface_writePixels_2"></a> +<a name='SkSurface_writePixels_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void writePixels(const SkBitmap& src, int dstX, int dstY) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkSurface_writePixels'>writePixels</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& src, int dstX, int dstY) </pre> -Copies <a href="SkRect_Reference#Rect">Rect</a> of pixels from the <a href="#SkSurface_writePixels_2_src">src</a> <a href="SkBitmap_Reference#Bitmap">Bitmap</a> to the <a href="#Surface">Surface</a>. +Copies <a href='SkRect_Reference#Rect'>Rect</a> of pixels from the <a href='#SkSurface_writePixels_2_src'>src</a> <a href='SkBitmap_Reference#Bitmap'>Bitmap</a> to the <a href='#Surface'>Surface</a>. -Source <a href="SkRect_Reference#Rect">Rect</a> corners are (0, 0) and (<a href="#SkSurface_writePixels_2_src">src</a>.<a href="#SkSurface_width">width</a>, <a href="#SkSurface_writePixels_2_src">src</a>.<a href="#SkSurface_height">height</a>). -Destination <a href="SkRect_Reference#Rect">Rect</a> corners are (<a href="#SkSurface_writePixels_2_dstX">dstX</a>, <a href="#SkSurface_writePixels_2_dstY">dstY</a>) and(<a href="#SkSurface_writePixels_2_dstX">dstX</a> + <a href="#Surface">Surface</a> <a href="#SkSurface_width">width</a>, <a href="#SkSurface_writePixels_2_dstY">dstY</a> + <a href="#Surface">Surface</a> <a href="#SkSurface_height">height</a>) +Source <a href='SkRect_Reference#Rect'>Rect</a> corners are (0, 0) and (<a href='#SkSurface_writePixels_2_src'>src</a>.<a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_2_src'>src</a>.<a href='#SkSurface_height'>height</a>). +Destination <a href='SkRect_Reference#Rect'>Rect</a> corners are (<a href='#SkSurface_writePixels_2_dstX'>dstX</a>, <a href='#SkSurface_writePixels_2_dstY'>dstY</a>) and(<a href='#SkSurface_writePixels_2_dstX'>dstX</a> + <a href='#Surface'>Surface</a> <a href='#SkSurface_width'>width</a>, <a href='#SkSurface_writePixels_2_dstY'>dstY</a> + <a href='#Surface'>Surface</a> <a href='#SkSurface_height'>height</a>) . Copies each readable pixel intersecting both rectangles, without scaling, -converting to <a href="#Surface">Surface</a> colorType() and <a href="#Surface">Surface</a> alphaType() if required. +converting to <a href='#Surface'>Surface</a> colorType() and <a href='#Surface'>Surface</a> alphaType() if required. ### Parameters -<table> <tr> <td><a name="SkSurface_writePixels_2_src"> <code><strong>src </strong></code> </a></td> <td> -storage for pixels to copy to <a href="#Surface">Surface</a></td> - </tr> <tr> <td><a name="SkSurface_writePixels_2_dstX"> <code><strong>dstX </strong></code> </a></td> <td> -x position relative to <a href="#Surface">Surface</a> to begin copy; may be negative</td> - </tr> <tr> <td><a name="SkSurface_writePixels_2_dstY"> <code><strong>dstY </strong></code> </a></td> <td> -x position relative to <a href="#Surface">Surface</a> to begin copy; may be negative</td> +<table> <tr> <td><a name='SkSurface_writePixels_2_src'><code><strong>src</strong></code></a></td> + <td>storage for pixels to copy to <a href='#Surface'>Surface</a></td> + </tr> + <tr> <td><a name='SkSurface_writePixels_2_dstX'><code><strong>dstX</strong></code></a></td> + <td>x position relative to <a href='#Surface'>Surface</a> to begin copy; may be negative</td> + </tr> + <tr> <td><a name='SkSurface_writePixels_2_dstY'><code><strong>dstY</strong></code></a></td> + <td>x position relative to <a href='#Surface'>Surface</a> to begin copy; may be negative</td> </tr> </table> @@ -1520,18 +1891,18 @@ x position relative to <a href="#Surface">Surface</a> to begin copy; may be nega ### See Also -<a href="#SkSurface_readPixels">readPixels</a><sup><a href="#SkSurface_readPixels_2">[2]</a></sup><sup><a href="#SkSurface_readPixels_3">[3]</a></sup> <a href="#SkSurface_peekPixels">peekPixels</a> +<a href='#SkSurface_readPixels'>readPixels</a><sup><a href='#SkSurface_readPixels_2'>[2]</a></sup><sup><a href='#SkSurface_readPixels_3'>[3]</a></sup> <a href='#SkSurface_peekPixels'>peekPixels</a> --- -<a name="SkSurface_props"></a> +<a name='SkSurface_props'></a> ## props -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -const SkSurfaceProps& props() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +const <a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a>& <a href='#SkSurface_props'>props</a>() const </pre> -Returns <a href="undocumented#Surface_Properties">Surface Properties</a> for surface. +Returns <a href='undocumented#Surface_Properties'>Surface Properties</a> for surface. ### Return Value @@ -1551,38 +1922,56 @@ surf.props(): kRGB_H_SkPixelGeometry ### See Also -<a href="undocumented#SkSurfaceProps">SkSurfaceProps</a> +<a href='undocumented#SkSurfaceProps'>SkSurfaceProps</a> --- -<a name="SkSurface_prepareForExternalIO"></a> +<a name='SkSurface_prepareForExternalIO'></a> ## prepareForExternalIO -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void prepareForExternalIO() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkSurface_prepareForExternalIO'>prepareForExternalIO</a>() </pre> +Deprecated. + soon --- -## <a name="Utility"></a> Utility +## <a name='Utility'>Utility</a> -| name | description | -| --- | --- | -| <a href="#SkSurface_characterize">characterize</a> | sets <a href="undocumented#Surface_Characterization">Surface Characterization</a> for threaded GPU processing | -| <a href="#SkSurface_flush">flush</a> | resolve pending I/O | -| <a href="#SkSurface_flushAndSignalSemaphores">flushAndSignalSemaphores</a> | resolve pending I/O, and signal | -| <a href="#SkSurface_wait">wait</a> | rause commands until signaled | -<a name="SkSurface_flush"></a> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Topic</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_characterize'>characterize</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Surface_Characterization'>Surface Characterization</a> for threaded GPU processing</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flush'>flush</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O</td> + </tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>resolves pending I/O, and signal</td> + </tr> + <tr> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkSurface_wait'>wait</a></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>pauses commands until signaled</td> + </tr> +</table> + + +<a name='SkSurface_flush'></a> ## flush -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void flush() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkSurface_flush'>flush</a>() </pre> -Issues pending <a href="#Surface">Surface</a> commands to the GPU-backed API and resolves any <a href="#Surface">Surface</a> MSAA. +Issues pending <a href='#Surface'>Surface</a> commands to the GPU-backed API and resolves any <a href='#Surface'>Surface</a> MSAA. Skia flushes as needed, so it is not necessary to call this if Skia manages drawing and object lifetime. Call when interleaving Skia calls with native @@ -1590,36 +1979,36 @@ GPU calls. ### See Also -<a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> +<a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> --- -<a name="SkSurface_flushAndSignalSemaphores"></a> +<a name='SkSurface_flushAndSignalSemaphores'></a> ## flushAndSignalSemaphores -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores, - GrBackendSemaphore signalSemaphores[]) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='undocumented#GrSemaphoresSubmitted'>GrSemaphoresSubmitted</a> <a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a>(int numSemaphores, + <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> signalSemaphores[]) </pre> -Issues pending <a href="#Surface">Surface</a> commands to the GPU-backed API and resolves any <a href="#Surface">Surface</a> MSAA. -After issuing all commands, <a href="#SkSurface_flushAndSignalSemaphores_signalSemaphores">signalSemaphores</a> of count <a href="#SkSurface_flushAndSignalSemaphores_numSemaphores">numSemaphores</a> semaphores +Issues pending <a href='#Surface'>Surface</a> commands to the GPU-backed API and resolves any <a href='#Surface'>Surface</a> MSAA. +After issuing all commands, <a href='#SkSurface_flushAndSignalSemaphores_signalSemaphores'>signalSemaphores</a> of count <a href='#SkSurface_flushAndSignalSemaphores_numSemaphores'>numSemaphores</a> semaphores are signaled by the GPU. -For each <a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> in <a href="#SkSurface_flushAndSignalSemaphores_signalSemaphores">signalSemaphores</a>: -if <a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> is initialized, the GPU back-end uses the semaphore as is; -otherwise, a new semaphore is created and initializes <a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a>. +For each <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> in <a href='#SkSurface_flushAndSignalSemaphores_signalSemaphores'>signalSemaphores</a>: +if <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> is initialized, the GPU back-end uses the semaphore as is; +otherwise, a new semaphore is created and initializes <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a>. -The caller must delete the semaphores created and returned in <a href="#SkSurface_flushAndSignalSemaphores_signalSemaphores">signalSemaphores</a>. -<a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> can be deleted as soon as this function returns. +The caller must delete the semaphores created and returned in <a href='#SkSurface_flushAndSignalSemaphores_signalSemaphores'>signalSemaphores</a>. +<a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> can be deleted as soon as this function returns. -If the back-end API is OpenGL only uninitialized <a href="undocumented#Backend_Semaphore">Backend Semaphores</a> are supported. +If the back-end API is OpenGL only uninitialized <a href='undocumented#Backend_Semaphore'>Backend Semaphores</a> are supported. If the back-end API is Vulkan semaphores may be initialized or uninitialized. If uninitialized, created semaphores are valid only with the VkDevice with which they were created. -If <a href="undocumented#GrSemaphoresSubmitted_kNo">GrSemaphoresSubmitted::kNo</a> is returned, the GPU back-end did not create or +If <a href='undocumented#GrSemaphoresSubmitted_kNo'>GrSemaphoresSubmitted::kNo</a> 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. @@ -1627,28 +2016,29 @@ Pending surface commands are flushed regardless of the return result. ### Parameters -<table> <tr> <td><a name="SkSurface_flushAndSignalSemaphores_numSemaphores"> <code><strong>numSemaphores </strong></code> </a></td> <td> -size of <a href="#SkSurface_flushAndSignalSemaphores_signalSemaphores">signalSemaphores</a> array</td> - </tr> <tr> <td><a name="SkSurface_flushAndSignalSemaphores_signalSemaphores"> <code><strong>signalSemaphores </strong></code> </a></td> <td> -array of semaphore containers</td> +<table> <tr> <td><a name='SkSurface_flushAndSignalSemaphores_numSemaphores'><code><strong>numSemaphores</strong></code></a></td> + <td>size of <a href='#SkSurface_flushAndSignalSemaphores_signalSemaphores'>signalSemaphores</a> array</td> + </tr> + <tr> <td><a name='SkSurface_flushAndSignalSemaphores_signalSemaphores'><code><strong>signalSemaphores</strong></code></a></td> + <td>array of semaphore containers</td> </tr> </table> ### Return Value -one of: <a href="undocumented#GrSemaphoresSubmitted_kYes">GrSemaphoresSubmitted::kYes</a>, <a href="undocumented#GrSemaphoresSubmitted_kNo">GrSemaphoresSubmitted::kNo</a> +one of: <a href='undocumented#GrSemaphoresSubmitted_kYes'>GrSemaphoresSubmitted::kYes</a>, <a href='undocumented#GrSemaphoresSubmitted_kNo'>GrSemaphoresSubmitted::kNo</a> ### See Also -<a href="#SkSurface_wait">wait</a> <a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> +<a href='#SkSurface_wait'>wait</a> <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> --- -<a name="SkSurface_wait"></a> +<a name='SkSurface_wait'></a> ## wait -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_wait'>wait</a>(int numSemaphores, const <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a>* waitSemaphores) </pre> Inserts a list of GPU semaphores that the current GPU-backed API must wait on before @@ -1659,10 +2049,11 @@ and the client will still own the semaphores. ### Parameters -<table> <tr> <td><a name="SkSurface_wait_numSemaphores"> <code><strong>numSemaphores </strong></code> </a></td> <td> -size of <a href="#SkSurface_wait_waitSemaphores">waitSemaphores</a> array</td> - </tr> <tr> <td><a name="SkSurface_wait_waitSemaphores"> <code><strong>waitSemaphores </strong></code> </a></td> <td> -array of semaphore containers</td> +<table> <tr> <td><a name='SkSurface_wait_numSemaphores'><code><strong>numSemaphores</strong></code></a></td> + <td>size of <a href='#SkSurface_wait_waitSemaphores'>waitSemaphores</a> array</td> + </tr> + <tr> <td><a name='SkSurface_wait_waitSemaphores'><code><strong>waitSemaphores</strong></code></a></td> + <td>array of semaphore containers</td> </tr> </table> @@ -1672,28 +2063,28 @@ true if GPU is waiting on semaphores ### See Also -<a href="#SkSurface_flushAndSignalSemaphores">flushAndSignalSemaphores</a> <a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> +<a href='#SkSurface_flushAndSignalSemaphores'>flushAndSignalSemaphores</a> <a href='undocumented#GrBackendSemaphore'>GrBackendSemaphore</a> --- -<a name="SkSurface_characterize"></a> +<a name='SkSurface_characterize'></a> ## characterize -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool characterize(SkSurfaceCharacterization* characterization) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_characterize'>characterize</a>(<a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a>* characterization) const </pre> -Initializes <a href="undocumented#Surface_Characterization">Surface Characterization</a> that can be used to perform GPU back-end +Initializes <a href='undocumented#Surface_Characterization'>Surface Characterization</a> that can be used to perform GPU back-end processing in a separate thread. Typically this is used to divide drawing into multiple tiles. DeferredDisplayListRecorder records the drawing commands for each tile. -Return true if <a href="#Surface">Surface</a> supports <a href="#SkSurface_characterize_characterization">characterization</a>. <a href="undocumented#Raster_Surface">Raster Surface</a> returns false. +Return true if <a href='#Surface'>Surface</a> supports <a href='#SkSurface_characterize_characterization'>characterization</a>. <a href='undocumented#Raster_Surface'>Raster Surface</a> returns false. ### Parameters -<table> <tr> <td><a name="SkSurface_characterize_characterization"> <code><strong>characterization </strong></code> </a></td> <td> -properties for parallel drawing</td> +<table> <tr> <td><a name='SkSurface_characterize_characterization'><code><strong>characterization</strong></code></a></td> + <td>properties for parallel drawing</td> </tr> </table> @@ -1703,44 +2094,44 @@ true if supported ### Example -<div><fiddle-embed name="3df4e2fc63483a3fa19589b5388080bc" gpu="true"></fiddle-embed></div> +<div><fiddle-embed name="6de6f3ef699a72ff26da1b26b23a3316" gpu="true"></fiddle-embed></div> ### See Also -<a href="#SkSurface_draw">draw</a><sup><a href="#SkSurface_draw_2">[2]</a></sup> <a href="undocumented#SkSurfaceCharacterization">SkSurfaceCharacterization</a> <a href="undocumented#SkDeferredDisplayList">SkDeferredDisplayList</a> +<a href='#SkSurface_draw'>draw</a><sup><a href='#SkSurface_draw_2'>[2]</a></sup> <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a> <a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a> --- -<a name="SkSurface_draw_2"></a> +<a name='SkSurface_draw_2'></a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool draw(SkDeferredDisplayList* deferredDisplayList) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkSurface_draw'>draw</a>(<a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a>* deferredDisplayList) </pre> -Draws deferred display list created using <a href="undocumented#SkDeferredDisplayListRecorder">SkDeferredDisplayListRecorder</a>. -Has no effect and returns false if <a href="undocumented#Surface_Characterization">Surface Characterization</a> stored in -<a href="#SkSurface_draw_2_deferredDisplayList">deferredDisplayList</a> is not compatible with <a href="#Surface">Surface</a>. +Draws deferred display list created using <a href='undocumented#SkDeferredDisplayListRecorder'>SkDeferredDisplayListRecorder</a>. +Has no effect and returns false if <a href='undocumented#Surface_Characterization'>Surface Characterization</a> stored in +<a href='#SkSurface_draw_2_deferredDisplayList'>deferredDisplayList</a> is not compatible with <a href='#Surface'>Surface</a>. -<a href="undocumented#Raster_Surface">Raster Surface</a> returns false. +<a href='undocumented#Raster_Surface'>Raster Surface</a> returns false. ### Parameters -<table> <tr> <td><a name="SkSurface_draw_2_deferredDisplayList"> <code><strong>deferredDisplayList </strong></code> </a></td> <td> -drawing commands</td> +<table> <tr> <td><a name='SkSurface_draw_2_deferredDisplayList'><code><strong>deferredDisplayList</strong></code></a></td> + <td>drawing commands</td> </tr> </table> ### Return Value -false if <a href="#SkSurface_draw_2_deferredDisplayList">deferredDisplayList</a> is not compatible +false if <a href='#SkSurface_draw_2_deferredDisplayList'>deferredDisplayList</a> is not compatible ### Example -<div><fiddle-embed name="3dfa7496268dfb2c7465cda5da39dfbd" gpu="true" cpu="true"></fiddle-embed></div> +<div><fiddle-embed name="46d9bacf593deaaeabd74ff42f2571a0" gpu="true" cpu="true"></fiddle-embed></div> ### See Also -<a href="#SkSurface_characterize">characterize</a> <a href="undocumented#SkSurfaceCharacterization">SkSurfaceCharacterization</a> <a href="undocumented#SkDeferredDisplayList">SkDeferredDisplayList</a> +<a href='#SkSurface_characterize'>characterize</a> <a href='undocumented#SkSurfaceCharacterization'>SkSurfaceCharacterization</a> <a href='undocumented#SkDeferredDisplayList'>SkDeferredDisplayList</a> --- diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index 3af6fbfbf5..0b50b1acb1 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -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> @@ -64,8 +64,8 @@ "stdout": "color: kUnknown_SkColorType bytesPerPixel: 0\\ncolor: kAlpha_8_SkColorType bytesPerPixel: 1\\ncolor: kRGB_565_SkColorType bytesPerPixel: 2\\ncolor: kARGB_4444_SkColorType bytesPerPixel: 2\\ncolor: kRGBA_8888_SkColorType bytesPerPixel: 4\\ncolor: kRGB_888x_SkColorType bytesPerPixel: 4\\ncolor: kBGRA_8888_SkColorType bytesPerPixel: 4\\ncolor: kRGBA_1010102_SkColorType bytesPerPixel: 4\\ncolor: kRGB_101010x_SkColorType bytesPerPixel: 4\\ncolor: kGray_8_SkColorType bytesPerPixel: 1\\ncolor: kRGBA_F16_SkColorType bytesPerPixel: 8\\n" }, "SkBitmap_colorSpace": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType, \n SkColorSpace::MakeSRGBLinear()));\n SkColorSpace* colorSpace = bitmap.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", - "hash": "7ade8a1a21ea5197e565c86740b47b73", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n SkColorSpace::MakeSRGBLinear()));\n SkColorSpace* colorSpace = bitmap.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", + "hash": "817f95879fadba44baf87ea60e9b595a", "file": "SkBitmap_Reference", "name": "SkBitmap::colorSpace", "stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n" @@ -85,15 +85,15 @@ "stdout": "width: 1 height: 1 computeByteSize: 4\\nwidth: 1 height: 1000 computeByteSize: 4999\\nwidth: 1 height: 1000000 computeByteSize: 4999999\\nwidth: 1000 height: 1 computeByteSize: 4000\\nwidth: 1000 height: 1000 computeByteSize: 4999000\\nwidth: 1000 height: 1000000 computeByteSize: 4999999000\\nwidth: 1000000 height: 1 computeByteSize: 4000000\\nwidth: 1000000 height: 1000 computeByteSize: 4999000000\\nwidth: 1000000 height: 1000000 computeByteSize: 4999999000000\\n" }, "SkBitmap_copy_const_SkBitmap": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy(original); \n SkDebugf(\"original has pixels after copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", - "hash": "f12c2af14b0fffd094d632b5f766aa1d", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy(original);\n SkDebugf(\"original has pixels after copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", + "hash": "bbbae7a181bfd128a4484e8e9f454db1", "file": "SkBitmap_Reference", "name": "SkBitmap::SkBitmap(const SkBitmap& src)", "stdout": "original has pixels before copy: true\\noriginal has pixels after copy: true\\ncopy has pixels: true\\n" }, "SkBitmap_copy_operator": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy = original; \n SkDebugf(\"original has pixels after copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", - "hash": "98d5866308756c21c8f8b639bc4e033a", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy = original;\n SkDebugf(\"original has pixels after copy: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", + "hash": "45279c519ae808f78bd30e9d84bdfdde", "file": "SkBitmap_Reference", "name": "SkBitmap::operator=(const SkBitmap& src)", "stdout": "original has pixels before copy: true\\noriginal has pixels after copy: true\\ncopy has pixels: true\\n" @@ -127,8 +127,8 @@ "stdout": "width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType\\nwidth: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType\\n" }, "SkBitmap_extractSubset": { - "code": "void draw(SkCanvas* canvas) {\n SkIRect bounds, s;\n source.getBounds(&bounds);\n SkDebugf(\"bounds: %d, %d, %d, %d\\n\", bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n SkBitmap subset;\n for (int left: { -100, 0, 100, 1000 } ) {\n for (int right: { 0, 100, 1000 } ) {\n SkIRect b = SkIRect::MakeLTRB(left, 100, right, 200);\n bool success = source.extractSubset(&subset, b);\n SkDebugf(\"subset: %4d, %4d, %4d, %4d \", b.fLeft, b.fTop, b.fRight, b.fBottom);\n SkDebugf(\"success; %s\", success ? \"true\" : \"false\");\n if (success) {\n subset.getBounds(&s); \n SkDebugf(\" subset: %d, %d, %d, %d\", s.fLeft, s.fTop, s.fRight, s.fBottom);\n }\n SkDebugf(\"\\n\");\n } \n }\n}", - "hash": "3ad80d8fcb13344612f361812658b696", + "code": "void draw(SkCanvas* canvas) {\n SkIRect bounds, s;\n source.getBounds(&bounds);\n SkDebugf(\"bounds: %d, %d, %d, %d\\n\", bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n SkBitmap subset;\n for (int left: { -100, 0, 100, 1000 } ) {\n for (int right: { 0, 100, 1000 } ) {\n SkIRect b = SkIRect::MakeLTRB(left, 100, right, 200);\n bool success = source.extractSubset(&subset, b);\n SkDebugf(\"subset: %4d, %4d, %4d, %4d \", b.fLeft, b.fTop, b.fRight, b.fBottom);\n SkDebugf(\"success; %s\", success ? \"true\" : \"false\");\n if (success) {\n subset.getBounds(&s);\n SkDebugf(\" subset: %d, %d, %d, %d\", s.fLeft, s.fTop, s.fRight, s.fBottom);\n }\n SkDebugf(\"\\n\");\n }\n }\n}", + "hash": "304148c50c91490bfd58e9222342419c", "file": "SkBitmap_Reference", "name": "SkBitmap::extractSubset", "stdout": "bounds: 0, 0, 512, 512\\nsubset: -100, 100, 0, 200 success; false\\nsubset: -100, 100, 100, 200 success; true subset: 0, 0, 100, 100\\nsubset: -100, 100, 1000, 200 success; true subset: 0, 0, 512, 100\\nsubset: 0, 100, 0, 200 success; false\\nsubset: 0, 100, 100, 200 success; true subset: 0, 0, 100, 100\\nsubset: 0, 100, 1000, 200 success; true subset: 0, 0, 512, 100\\nsubset: 100, 100, 0, 200 success; false\\nsubset: 100, 100, 100, 200 success; false\\nsubset: 100, 100, 1000, 200 success; true subset: 0, 0, 412, 100\\nsubset: 1000, 100, 0, 200 success; false\\nsubset: 1000, 100, 100, 200 success; false\\nsubset: 1000, 100, 1000, 200 success; false\\n" @@ -141,8 +141,8 @@ "stdout": "addr interval == rowBytes\\n" }, "SkBitmap_getAddr16": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap16;\n SkImageInfo dstInfo = SkImageInfo::Make(source.width(), source.height(), kARGB_4444_SkColorType, \n kPremul_SkAlphaType);\n bitmap16.allocPixels(dstInfo);\n if (source.readPixels(dstInfo, bitmap16.getPixels(), bitmap16.rowBytes(), 0, 0)) {\n uint16_t* row0 = bitmap16.getAddr16(0, 0);\n uint16_t* row1 = bitmap16.getAddr16(0, 1);\n size_t interval = (row1 - row0) * bitmap16.bytesPerPixel();\n SkDebugf(\"addr interval %c= rowBytes\\n\", interval == bitmap16.rowBytes() ? '=' : '!');\n }\n}", - "hash": "3d7e49d428c9a4812558b39cf505baa6", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap16;\n SkImageInfo dstInfo = SkImageInfo::Make(source.width(), source.height(), kARGB_4444_SkColorType,\n kPremul_SkAlphaType);\n bitmap16.allocPixels(dstInfo);\n if (source.readPixels(dstInfo, bitmap16.getPixels(), bitmap16.rowBytes(), 0, 0)) {\n uint16_t* row0 = bitmap16.getAddr16(0, 0);\n uint16_t* row1 = bitmap16.getAddr16(0, 1);\n size_t interval = (row1 - row0) * bitmap16.bytesPerPixel();\n SkDebugf(\"addr interval %c= rowBytes\\n\", interval == bitmap16.rowBytes() ? '=' : '!');\n }\n}", + "hash": "53e00899ef2e00e2096daf7a07d9b059", "file": "SkBitmap_Reference", "name": "SkBitmap::getAddr16", "stdout": "addr interval == rowBytes\\n" @@ -162,8 +162,8 @@ "stdout": "\\u0026pixels[4][2] == bitmap.getAddr8(2, 4)\\n" }, "SkBitmap_getColor": { - "code": "void draw(SkCanvas* canvas) {\n const int w = 4;\n const int h = 4;\n SkColor colors[][w] = {\n 0x00000000, 0x2a0e002a, 0x55380055, 0x7f7f007f,\n 0x2a000e2a, 0x551c1c55, 0x7f542a7f, 0xaaaa38aa,\n 0x55003855, 0x7f2a547f, 0xaa7171aa, 0xd4d48dd4,\n 0x7f007f7f, 0xaa38aaaa, 0xd48dd4d4, 0xffffffff, \n };\n SkDebugf(\"Premultiplied:\\n\");\n for (int y = 0; y < h; ++y) {\n SkDebugf(\"(0, %d) \", y);\n for (int x = 0; x < w; ++x) {\n SkDebugf(\"0x%08x%c\", colors[y][x], x == w - 1 ? '\\n' : ' ');\n }\n }\n SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), colors, w * 4);\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n SkDebugf(\"Unpremultiplied:\\n\");\n for (int y = 0; y < h; ++y) {\n SkDebugf(\"(0, %d) \", y);\n for (int x = 0; x < w; ++x) {\n SkDebugf(\"0x%08x%c\", bitmap.getColor(x, y), x == w - 1 ? '\\n' : ' ');\n }\n }\n}", - "hash": "2e49fa71dd4be95470248ea6eb35468b", + "code": "void draw(SkCanvas* canvas) {\n const int w = 4;\n const int h = 4;\n SkColor colors[][w] = {\n 0x00000000, 0x2a0e002a, 0x55380055, 0x7f7f007f,\n 0x2a000e2a, 0x551c1c55, 0x7f542a7f, 0xaaaa38aa,\n 0x55003855, 0x7f2a547f, 0xaa7171aa, 0xd4d48dd4,\n 0x7f007f7f, 0xaa38aaaa, 0xd48dd4d4, 0xffffffff,\n };\n SkDebugf(\"Premultiplied:\\n\");\n for (int y = 0; y < h; ++y) {\n SkDebugf(\"(0, %d) \", y);\n for (int x = 0; x < w; ++x) {\n SkDebugf(\"0x%08x%c\", colors[y][x], x == w - 1 ? '\\n' : ' ');\n }\n }\n SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), colors, w * 4);\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n SkDebugf(\"Unpremultiplied:\\n\");\n for (int y = 0; y < h; ++y) {\n SkDebugf(\"(0, %d) \", y);\n for (int x = 0; x < w; ++x) {\n SkDebugf(\"0x%08x%c\", bitmap.getColor(x, y), x == w - 1 ? '\\n' : ' ');\n }\n }\n}", + "hash": "0f05970f0ce47f462e8c0a3aa146575f", "file": "SkBitmap_Reference", "name": "SkBitmap::getColor", "stdout": "Premultiplied:\\n(0, 0) 0x00000000 0x2a0e002a 0x55380055 0x7f7f007f\\n(0, 1) 0x2a000e2a 0x551c1c55 0x7f542a7f 0xaaaa38aa\\n(0, 2) 0x55003855 0x7f2a547f 0xaa7171aa 0xd4d48dd4\\n(0, 3) 0x7f007f7f 0xaa38aaaa 0xd48dd4d4 0xffffffff\\nUnpremultiplied:\\n(0, 0) 0x00000000 0x2a5500ff 0x55a800ff 0x7fff00ff\\n(0, 1) 0x2a0055ff 0x555454ff 0x7fa954ff 0xaaff54ff\\n(0, 2) 0x5500a8ff 0x7f54a9ff 0xaaaaaaff 0xd4ffaaff\\n(0, 3) 0x7f00ffff 0xaa54ffff 0xd4aaffff 0xffffffff\\n" @@ -204,15 +204,15 @@ "stdout": "width: 56 height: 56 color: BGRA_8888 alpha: Opaque\\n" }, "SkBitmap_installPixels": { - "code": "static void releaseProc(void* addr, void* ) {\n SkDebugf(\"releaseProc called\\n\");\n delete[] (uint32_t*) addr; \n}\n\nvoid draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n void* pixels = new uint32_t[8 * 8];\n SkImageInfo info = SkImageInfo::MakeN32(8, 8, kOpaque_SkAlphaType);\n SkDebugf(\"before installPixels\\n\");\n bool installed = bitmap.installPixels(info, pixels, 16, releaseProc, nullptr);\n SkDebugf(\"install \" \"%s\" \"successful\\n\", installed ? \"\" : \"not \");\n}\n", - "hash": "ff5b5c349efb5d929ff5dff07b7727e6", + "code": "static void releaseProc(void* addr, void* ) {\n SkDebugf(\"releaseProc called\\n\");\n delete[] (uint32_t*) addr;\n}\n\nvoid draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n void* pixels = new uint32_t[8 * 8];\n SkImageInfo info = SkImageInfo::MakeN32(8, 8, kOpaque_SkAlphaType);\n SkDebugf(\"before installPixels\\n\");\n bool installed = bitmap.installPixels(info, pixels, 16, releaseProc, nullptr);\n SkDebugf(\"install \" \"%s\" \"successful\\n\", installed ? \"\" : \"not \");\n}\n", + "hash": "8c4f7bf73fffa1a812ee8e88e44e639c", "file": "SkBitmap_Reference", "name": "SkBitmap::installPixels", "stdout": "before installPixels\\nreleaseProc called\\ninstall not successful\\n" }, "SkBitmap_isImmutable": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap original; \n SkImageInfo info = SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType);\n if (original.tryAllocPixels(info)) {\n original.setImmutable();\n SkBitmap copy;\n original.extractSubset(©, {5, 10, 15, 20}); \n SkDebugf(\"original is \" \"%s\" \"immutable\\n\", original.isImmutable() ? \"\" : \"not \");\n SkDebugf(\"copy is \" \"%s\" \"immutable\\n\", copy.isImmutable() ? \"\" : \"not \");\n }\n}", - "hash": "cca4f94232e5e1fcee9a841b13df9d9c", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n SkImageInfo info = SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType);\n if (original.tryAllocPixels(info)) {\n original.setImmutable();\n SkBitmap copy;\n original.extractSubset(©, {5, 10, 15, 20});\n SkDebugf(\"original is \" \"%s\" \"immutable\\n\", original.isImmutable() ? \"\" : \"not \");\n SkDebugf(\"copy is \" \"%s\" \"immutable\\n\", copy.isImmutable() ? \"\" : \"not \");\n }\n}", + "hash": "db61fdcd382342ee88ea1b4f27c27b95", "file": "SkBitmap_Reference", "name": "SkBitmap::isImmutable", "stdout": "original is immutable\\ncopy is immutable\\n" @@ -232,22 +232,22 @@ "stdout": "isOpaque: false\\nisOpaque: false\\nisOpaque: true\\nisOpaque: true\\n" }, "SkBitmap_isVolatile": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap original; \n SkImageInfo info = SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType);\n if (original.tryAllocPixels(info)) {\n original.setIsVolatile(true);\n SkBitmap copy;\n original.extractSubset(©, {5, 10, 15, 20}); \n SkDebugf(\"original is \" \"%s\" \"volatile\\n\", original.isVolatile() ? \"\" : \"not \");\n SkDebugf(\"copy is \" \"%s\" \"volatile\\n\", copy.isImmutable() ? \"\" : \"not \");\n }\n}", - "hash": "4f3e4d39cf34ea52fcd933dbafc46dfa", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n SkImageInfo info = SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType);\n if (original.tryAllocPixels(info)) {\n original.setIsVolatile(true);\n SkBitmap copy;\n original.extractSubset(©, {5, 10, 15, 20});\n SkDebugf(\"original is \" \"%s\" \"volatile\\n\", original.isVolatile() ? \"\" : \"not \");\n SkDebugf(\"copy is \" \"%s\" \"volatile\\n\", copy.isImmutable() ? \"\" : \"not \");\n }\n}", + "hash": "23c4543ac6cdd0e8fe762816a0dc2e03", "file": "SkBitmap_Reference", "name": "SkBitmap::isVolatile", "stdout": "original is volatile\\ncopy is not volatile\\n" }, "SkBitmap_move_SkBitmap": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy(std::move(original)); \n SkDebugf(\"original has pixels after move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", - "hash": "a137b2027d2ac098a21d68d93391f5bb", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy(std::move(original));\n SkDebugf(\"original has pixels after move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", + "hash": "40afd4f1fa69e02d69d92b38252088ef", "file": "SkBitmap_Reference", "name": "SkBitmap::SkBitmap(SkBitmap&& src)", "stdout": "original has pixels before move: true\\noriginal has pixels after move: false\\ncopy has pixels: true\\n" }, "SkBitmap_move_operator": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy = std::move(original); \n SkDebugf(\"original has pixels after move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", - "hash": "02836d36fa714d553c32f0d8ea11da73", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap original;\n if (original.tryAllocPixels(\n SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {\n SkDebugf(\"original has pixels before move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkBitmap copy = std::move(original);\n SkDebugf(\"original has pixels after move: %s\\n\", original.getPixels() ? \"true\" : \"false\");\n SkDebugf(\"copy has pixels: %s\\n\", copy.getPixels() ? \"true\" : \"false\");\n }\n}\n", + "hash": "35ea3fed27d8db22dc00f48670de64de", "file": "SkBitmap_Reference", "name": "SkBitmap::operator=(SkBitmap&& src)", "stdout": "original has pixels before move: true\\noriginal has pixels after move: false\\ncopy has pixels: true\\n" @@ -281,15 +281,15 @@ "stdout": "----------\\n---xx-----\\n--x--x----\\n--x-------\\n--xx------\\n--x-x---x-\\n-x---x--x-\\n-x----xx--\\n-xx---x---\\n--xxxx-xx-\\n----------\\n" }, "SkBitmap_refColorSpace": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap1, bitmap2;\n bitmap1.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType, \n SkColorSpace::MakeSRGBLinear()));\n bitmap2.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n bitmap1.refColorSpace()));\n SkColorSpace* colorSpace = bitmap2.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", - "hash": "972e9bb22c1ce94bb97b2d106168280e", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap1, bitmap2;\n bitmap1.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n SkColorSpace::MakeSRGBLinear()));\n bitmap2.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n bitmap1.refColorSpace()));\n SkColorSpace* colorSpace = bitmap2.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", + "hash": "cb028b7931da85b949ad0953b9711f9f", "file": "SkBitmap_Reference", "name": "SkBitmap::refColorSpace", "stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n" }, "SkBitmap_reset": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap; \n bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n bitmap.allocPixels();\n SkDebugf(\"width:%d height:%d isNull:%s\\n\", bitmap.width(), bitmap.height(),\n bitmap.isNull() ? \"true\" : \"false\");\n bitmap.reset();\n SkDebugf(\"width:%d height:%d isNull:%s\\n\", bitmap.width(), bitmap.height(),\n bitmap.isNull() ? \"true\" : \"false\");\n}", - "hash": "458f838acf38302abec477cec3102f0f", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n bitmap.allocPixels();\n SkDebugf(\"width:%d height:%d isNull:%s\\n\", bitmap.width(), bitmap.height(),\n bitmap.isNull() ? \"true\" : \"false\");\n bitmap.reset();\n SkDebugf(\"width:%d height:%d isNull:%s\\n\", bitmap.width(), bitmap.height(),\n bitmap.isNull() ? \"true\" : \"false\");\n}", + "hash": "52ccaeda67924373c5b55a2b89fe314d", "file": "SkBitmap_Reference", "name": "SkBitmap::reset()", "stdout": "width:1 height:1 isNull:false\\nwidth:0 height:0 isNull:true\\n" @@ -309,8 +309,8 @@ "stdout": "rowBytes: 4 rowBytesAsPixels: 1\\nrowBytes: 5 rowBytesAsPixels: 1\\nrowBytes: 6 rowBytesAsPixels: 1\\nrowBytes: 7 rowBytesAsPixels: 1\\nrowBytes: 8 rowBytesAsPixels: 2\\n" }, "SkBitmap_setAlphaType": { - "code": "void draw(SkCanvas* canvas) {\n const char* colors[] = { \"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\" };\n const char* alphas[] = {\"Unknown \", \"Opaque \", \"Premul \", \"Unpremul\"}; \n SkBitmap bitmap;\n SkAlphaType alphaTypes[] = { kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType,\n kUnpremul_SkAlphaType\n };\n SkDebugf(\"%88s\", \"Canonical Unknown Opaque Premul Unpremul\\n\");\n for (SkColorType colorType : {\n kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType,\n kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType,\n kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType,\n kGray_8_SkColorType, kRGBA_F16_SkColorType\n } ) {\n for (SkAlphaType canonicalAlphaType : alphaTypes) {\n SkColorTypeValidateAlphaType(colorType, kUnknown_SkAlphaType, &canonicalAlphaType );\n SkDebugf(\"%10s %10s \", colors[(int) colorType], alphas[(int) canonicalAlphaType ]);\n for (SkAlphaType alphaType : alphaTypes) {\n bitmap.setInfo(SkImageInfo::Make(4, 4, colorType, canonicalAlphaType));\n bool result = bitmap.setAlphaType(alphaType);\n SkDebugf(\"%s %s \", result ? \"true \" : \"false\", alphas[(int) bitmap.alphaType()]);\n }\n SkDebugf(\"\\n\");\n }\n }\n}\n", - "hash": "be21305f5654a1d8ed765710813a1f14", + "code": "void draw(SkCanvas* canvas) {\n const char* colors[] = { \"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\" };\n const char* alphas[] = {\"Unknown \", \"Opaque \", \"Premul \", \"Unpremul\"};\n SkBitmap bitmap;\n SkAlphaType alphaTypes[] = { kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType,\n kUnpremul_SkAlphaType\n };\n SkDebugf(\"%88s\", \"Canonical Unknown Opaque Premul Unpremul\\n\");\n for (SkColorType colorType : {\n kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType,\n kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kRGB_888x_SkColorType,\n kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType,\n kGray_8_SkColorType, kRGBA_F16_SkColorType\n } ) {\n for (SkAlphaType canonicalAlphaType : alphaTypes) {\n SkColorTypeValidateAlphaType(colorType, kUnknown_SkAlphaType, &canonicalAlphaType );\n SkDebugf(\"%10s %10s \", colors[(int) colorType], alphas[(int) canonicalAlphaType ]);\n for (SkAlphaType alphaType : alphaTypes) {\n bitmap.setInfo(SkImageInfo::Make(4, 4, colorType, canonicalAlphaType));\n bool result = bitmap.setAlphaType(alphaType);\n SkDebugf(\"%s %s \", result ? \"true \" : \"false\", alphas[(int) bitmap.alphaType()]);\n }\n SkDebugf(\"\\n\");\n }\n }\n}\n", + "hash": "dd73f0f927a049b17982c8cf06dd2d00", "file": "SkBitmap_Reference", "name": "SkBitmap::setAlphaType", "stdout": "Canonical Unknown Opaque Premul Unpremul\\n Unknown Unknown true Unknown true Unknown true Unknown true Unknown \\n Unknown Unknown true Unknown true Unknown true Unknown true Unknown \\n Unknown Unknown true Unknown true Unknown true Unknown true Unknown \\n Unknown Unknown true Unknown true Unknown true Unknown true Unknown \\n Alpha_8 Unknown true Unknown true Unknown true Unknown true Unknown \\n Alpha_8 Opaque false Opaque true Opaque true Premul true Premul \\n Alpha_8 Premul false Premul true Opaque true Premul true Premul \\n Alpha_8 Unpremul false Premul true Opaque true Premul true Premul \\n RGB_565 Opaque true Opaque true Opaque true Opaque true Opaque \\n RGB_565 Opaque true Opaque true Opaque true Opaque true Opaque \\n RGB_565 Opaque true Opaque true Opaque true Opaque true Opaque \\n RGB_565 Opaque true Opaque true Opaque true Opaque true Opaque \\n ARGB_4444 Unknown true Unknown true Unknown true Unknown true Unknown \\n ARGB_4444 Opaque false Opaque true Opaque true Premul true Unpremul \\n ARGB_4444 Premul false Premul true Opaque true Premul true Unpremul \\n ARGB_4444 Unpremul false Unpremul true Opaque true Premul true Unpremul \\n RGBA_8888 Unknown true Unknown true Unknown true Unknown true Unknown \\n RGBA_8888 Opaque false Opaque true Opaque true Premul true Unpremul \\n RGBA_8888 Premul false Premul true Opaque true Premul true Unpremul \\n RGBA_8888 Unpremul false Unpremul true Opaque true Premul true Unpremul \\n RGB_888x Opaque true Opaque true Opaque true Opaque true Opaque \\n RGB_888x Opaque true Opaque true Opaque true Opaque true Opaque \\n RGB_888x Opaque true Opaque true Opaque true Opaque true Opaque \\n RGB_888x Opaque true Opaque true Opaque true Opaque true Opaque \\n BGRA_8888 Unknown true Unknown true Unknown true Unknown true Unknown \\n BGRA_8888 Opaque false Opaque true Opaque true Premul true Unpremul \\n BGRA_8888 Premul false Premul true Opaque true Premul true Unpremul \\n BGRA_8888 Unpremul false Unpremul true Opaque true Premul true Unpremul \\nRGBA_1010102 Unknown true Unknown true Unknown true Unknown true Unknown \\nRGBA_1010102 Opaque false Opaque true Opaque true Premul true Unpremul \\nRGBA_1010102 Premul false Premul true Opaque true Premul true Unpremul \\nRGBA_1010102 Unpremul false Unpremul true Opaque true Premul true Unpremul \\nRGB_101010x Opaque true Opaque true Opaque true Opaque true Opaque \\nRGB_101010x Opaque true Opaque true Opaque true Opaque true Opaque \\nRGB_101010x Opaque true Opaque true Opaque true Opaque true Opaque \\nRGB_101010x Opaque true Opaque true Opaque true Opaque true Opaque \\n Gray_8 Opaque true Opaque true Opaque true Opaque true Opaque \\n Gray_8 Opaque true Opaque true Opaque true Opaque true Opaque \\n Gray_8 Opaque true Opaque true Opaque true Opaque true Opaque \\n Gray_8 Opaque true Opaque true Opaque true Opaque true Opaque \\n RGBA_F16 Unknown true Unknown true Unknown true Unknown true Unknown \\n RGBA_F16 Opaque false Opaque true Opaque true Premul true Unpremul \\n RGBA_F16 Premul false Premul true Opaque true Premul true Unpremul \\n RGBA_F16 Unpremul false Unpremul true Opaque true Premul true Unpremul \\n" @@ -344,8 +344,8 @@ "stdout": "bitmap dimensions (6, 11)\\n" }, "SkBitmap_tryAllocPixelsFlags": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n if (!bitmap.tryAllocPixelsFlags(SkImageInfo::MakeN32(10000, 10000, kOpaque_SkAlphaType), \n SkBitmap::kZeroPixels_AllocFlag)) {\n SkDebugf(\"bitmap allocation failed!\\n\");\n } else {\n SkDebugf(\"bitmap allocation succeeded!\\n\");\n }\n}", - "hash": "4fff5f5034ced615ad5a1d50c40aeff3", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n if (!bitmap.tryAllocPixelsFlags(SkImageInfo::MakeN32(10000, 10000, kOpaque_SkAlphaType),\n SkBitmap::kZeroPixels_AllocFlag)) {\n SkDebugf(\"bitmap allocation failed!\\n\");\n } else {\n SkDebugf(\"bitmap allocation succeeded!\\n\");\n }\n}", + "hash": "f1d1880d38e0aea4cefd3e11745e8a09", "file": "SkBitmap_Reference", "name": "SkBitmap::tryAllocPixelsFlags", "stdout": "bitmap allocation succeeded!\\n" @@ -365,8 +365,8 @@ "stdout": "---\\n-x-\\n---\\n" }, "SkCanvas_MakeRasterDirectN32": { - "code": "void draw(SkCanvas* ) {\n const int width = 3;\n const int height = 3;\n SkPMColor pixels[height][width]; // allocate a 3x3 Premultiplied bitmap on the stack\n // create a SkCanvas backed by a raster device, and delete it when the\n // function goes out of scope.\n std::unique_ptr<SkCanvas> canvas = SkCanvas::MakeRasterDirectN32(\n width,\n height,\n pixels[0], // top-left of the bitmap\n sizeof(pixels[0])); // byte width of the each row\n // write a premultiplied value for white into all pixels in the bitmap\n canvas->clear(SK_ColorWHITE);\n SkPMColor pmWhite = pixels[0][0]; // the Premultiplied format may vary\n SkPaint paint; // by default, draws black\n canvas->drawPoint(1, 1, paint); // draw in the center\n canvas->flush(); // ensure that pixels is ready to be read\n for (int y = 0; y < height; ++y) {\n for (int x = 0; x < width; ++x) {\n SkDebugf(\"%c\", pixels[y][x] == pmWhite ? '-' : 'x');\n }\n SkDebugf(\"\\n\");\n }\n}\n", - "hash": "a9b116a7ebd1708237ce81ef532e9cb4", + "code": "void draw(SkCanvas* ) {\n const int width = 3;\n const int height = 3;\n SkPMColor pixels[height][width]; // allocate a 3x3 Premultiplied bitmap on the stack\n // create a SkCanvas backed by a raster device, and delete it when the\n // function goes out of scope.\n std::unique_ptr<SkCanvas> canvas = SkCanvas::MakeRasterDirectN32(\n width,\n height,\n pixels[0], // top-left of the bitmap\n sizeof(pixels[0])); // byte width of the each row\n // write a Premultiplied value for white into all pixels in the bitmap\n canvas->clear(SK_ColorWHITE);\n SkPMColor pmWhite = pixels[0][0]; // the Premultiplied format may vary\n SkPaint paint; // by default, draws black\n canvas->drawPoint(1, 1, paint); // draw in the center\n canvas->flush(); // ensure that pixels is ready to be read\n for (int y = 0; y < height; ++y) {\n for (int x = 0; x < width; ++x) {\n SkDebugf(\"%c\", pixels[y][x] == pmWhite ? '-' : 'x');\n }\n SkDebugf(\"\\n\");\n }\n}\n", + "hash": "4cacf302830e644234d522f6e2f8f580", "file": "SkCanvas_Reference", "name": "SkCanvas::MakeRasterDirectN32", "stdout": "---\\n-x-\\n---\\n" @@ -771,8 +771,8 @@ "stdout": "rect: 15, 27, 45, 60\\n" }, "SkIRect_intersect": { - "code": "void draw(SkCanvas* canvas) {\n SkIRect leftRect = { 10, 40, 50, 80 };\n SkIRect rightRect = { 30, 60, 70, 90 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(rightRect) ? \"\" : \"no \");\n SkDebugf(\"%d, %d, %d, %d\\n\", leftRect.left(), leftRect.top(), \n leftRect.right(), leftRect.bottom());\n}", - "hash": "2be1302480e54a767e25cbeed5d41b41", + "code": "void draw(SkCanvas* canvas) {\n SkIRect leftRect = { 10, 40, 50, 80 };\n SkIRect rightRect = { 30, 60, 70, 90 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(rightRect) ? \"\" : \"no \");\n SkDebugf(\"%d, %d, %d, %d\\n\", leftRect.left(), leftRect.top(),\n leftRect.right(), leftRect.bottom());\n}", + "hash": "ea233f5d5d1ae0e76fc6f2eb371c927a", "file": "SkIRect_Reference", "name": "SkIRect::intersect()", "stdout": "intersection: 30, 60, 50, 80\\n" @@ -792,8 +792,8 @@ "stdout": "intersection: 30, 60, 50, 80\\n" }, "SkIRect_intersect_3": { - "code": "void draw(SkCanvas* canvas) {\n SkIRect leftRect = { 10, 40, 50, 80 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(30, 60, 70, 90) ? \"\" : \"no \");\n SkDebugf(\"%d, %d, %d, %d\\n\", leftRect.left(), leftRect.top(), \n leftRect.right(), leftRect.bottom());\n}", - "hash": "4e6f580a3906c08a5faee524f7e72334", + "code": "void draw(SkCanvas* canvas) {\n SkIRect leftRect = { 10, 40, 50, 80 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(30, 60, 70, 90) ? \"\" : \"no \");\n SkDebugf(\"%d, %d, %d, %d\\n\", leftRect.left(), leftRect.top(),\n leftRect.right(), leftRect.bottom());\n}", + "hash": "200422990eded2f754ab9893118f2645", "file": "SkIRect_Reference", "name": "SkIRect::intersect_3", "stdout": "intersection: 30, 60, 50, 80\\n" @@ -1002,8 +1002,8 @@ "stdout": "color: kUnknown_SkColorType bytesPerPixel: 0\\ncolor: kAlpha_8_SkColorType bytesPerPixel: 1\\ncolor: kRGB_565_SkColorType bytesPerPixel: 2\\ncolor: kARGB_4444_SkColorType bytesPerPixel: 2\\ncolor: kRGBA_8888_SkColorType bytesPerPixel: 4\\ncolor: kRGB_888x_SkColorType bytesPerPixel: 4\\ncolor: kBGRA_8888_SkColorType bytesPerPixel: 4\\ncolor: kRGBA_1010102_SkColorType bytesPerPixel: 4\\ncolor: kRGB_101010x_SkColorType bytesPerPixel: 4\\ncolor: kGray_8_SkColorType bytesPerPixel: 1\\ncolor: kRGBA_F16_SkColorType bytesPerPixel: 8\\n" }, "SkImageInfo_colorSpace": { - "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType, \n SkColorSpace::MakeSRGBLinear());\n SkColorSpace* colorSpace = info.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", - "hash": "2952a6c863bd504484c9f66cc727f968", + "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n SkColorSpace::MakeSRGBLinear());\n SkColorSpace* colorSpace = info.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", + "hash": "5602b816d7cf75e3851274ef36a4c10f", "file": "SkImageInfo_Reference", "name": "SkImageInfo::colorSpace", "stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n" @@ -1044,15 +1044,15 @@ "stdout": "isOpaque: false\\nisOpaque: false\\nisOpaque: true\\nisOpaque: true\\n" }, "SkImageInfo_minRowBytes": { - "code": "void draw(SkCanvas* canvas) {\n for (int shift = 24; shift < 32; ++shift) {\n int width = 1 << shift;\n SkImageInfo imageInfo = \n SkImageInfo::Make(width, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n size_t minRowBytes = imageInfo.minRowBytes();\n bool widthTooLarge = !minRowBytes;\n SkDebugf(\"RGBA_F16 width %d (0x%08x) %s\\n\",\n width, width, widthTooLarge ? \"too large\" : \"OK\"); \n }\n}", - "hash": "4cb6975732a7ffab2c9ebac31af1432e", + "code": "void draw(SkCanvas* canvas) {\n for (int shift = 24; shift < 32; ++shift) {\n int width = 1 << shift;\n SkImageInfo imageInfo =\n SkImageInfo::Make(width, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n size_t minRowBytes = imageInfo.minRowBytes();\n bool widthTooLarge = !minRowBytes;\n SkDebugf(\"RGBA_F16 width %d (0x%08x) %s\\n\",\n width, width, widthTooLarge ? \"too large\" : \"OK\");\n }\n}", + "hash": "897230ecfb36095486beca324fd369f9", "file": "SkImageInfo_Reference", "name": "SkImageInfo::minRowBytes", "stdout": "RGBA_F16 width 16777216 (0x01000000) OK\\nRGBA_F16 width 33554432 (0x02000000) OK\\nRGBA_F16 width 67108864 (0x04000000) OK\\nRGBA_F16 width 134217728 (0x08000000) OK\\nRGBA_F16 width 268435456 (0x10000000) too large\\nRGBA_F16 width 536870912 (0x20000000) too large\\nRGBA_F16 width 1073741824 (0x40000000) too large\\nRGBA_F16 width -2147483648 (0x80000000) too large\\n" }, "SkImageInfo_minRowBytes64": { - "code": "void draw(SkCanvas* canvas) {\n for (int shift = 24; shift < 32; ++shift) {\n int width = 1 << shift;\n SkImageInfo imageInfo = \n SkImageInfo::Make(width, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n uint64_t minRowBytes = imageInfo.minRowBytes64();\n bool widthTooLarge = (uint64_t) (int32_t) minRowBytes != minRowBytes;\n SkDebugf(\"RGBA_F16 width %d (0x%08x) %s\\n\",\n width, width, widthTooLarge ? \"too large\" : \"OK\"); \n }\n}", - "hash": "3004125e67431bd7a5c0ff3863aad8a0", + "code": "void draw(SkCanvas* canvas) {\n for (int shift = 24; shift < 32; ++shift) {\n int width = 1 << shift;\n SkImageInfo imageInfo =\n SkImageInfo::Make(width, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n uint64_t minRowBytes = imageInfo.minRowBytes64();\n bool widthTooLarge = (uint64_t) (int32_t) minRowBytes != minRowBytes;\n SkDebugf(\"RGBA_F16 width %d (0x%08x) %s\\n\",\n width, width, widthTooLarge ? \"too large\" : \"OK\");\n }\n}", + "hash": "4b5d3904476726a39f1c3e276d6b6ba7", "file": "SkImageInfo_Reference", "name": "SkImageInfo::minRowBytes64", "stdout": "RGBA_F16 width 16777216 (0x01000000) OK\\nRGBA_F16 width 33554432 (0x02000000) OK\\nRGBA_F16 width 67108864 (0x04000000) OK\\nRGBA_F16 width 134217728 (0x08000000) OK\\nRGBA_F16 width 268435456 (0x10000000) too large\\nRGBA_F16 width 536870912 (0x20000000) too large\\nRGBA_F16 width 1073741824 (0x40000000) too large\\nRGBA_F16 width -2147483648 (0x80000000) too large\\n" @@ -1065,8 +1065,8 @@ "stdout": "info1 != info2\\ninfo1 != info2\\ninfo1 != info2\\ninfo1 == info2\\n" }, "SkImageInfo_refColorSpace": { - "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info1 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType, \n SkColorSpace::MakeSRGBLinear());\n SkImageInfo info2 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n info1.refColorSpace());\n SkColorSpace* colorSpace = info2.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", - "hash": "f36afcc295602f5c8c4c2c2025c25884", + "code": "void draw(SkCanvas* canvas) {\n SkImageInfo info1 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n SkColorSpace::MakeSRGBLinear());\n SkImageInfo info2 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n info1.refColorSpace());\n SkColorSpace* colorSpace = info2.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", + "hash": "33f65524736736fd91802b4198ba6fa8", "file": "SkImageInfo_Reference", "name": "SkImageInfo::refColorSpace", "stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n" @@ -1226,8 +1226,8 @@ "stdout": "matrix.get(SkMatrix::kMSkewX) == 42\\nmatrix.get(SkMatrix::kMSkewY) == 24\\n" }, "SkMatrix_get9": { - "code": "void draw(SkCanvas* canvas) {\n SkMatrix matrix = SkMatrix::MakeRectToRect({0, 0, 1, 1}, {3, 4, 7, 9},\n SkMatrix::kFill_ScaleToFit);\n SkScalar b[9];\n matrix.get9(b);\n SkDebugf(\"{%g, %g, %g},\\n{%g, %g, %g},\\n{%g, %g, %g}\\n\", b[0], b[1], b[2], \n b[3], b[4], b[5], b[6], b[7], b[8]);\n}", - "hash": "df509d73b47cb98b0475e4465db7b246", + "code": "void draw(SkCanvas* canvas) {\n SkMatrix matrix = SkMatrix::MakeRectToRect({0, 0, 1, 1}, {3, 4, 7, 9},\n SkMatrix::kFill_ScaleToFit);\n SkScalar b[9];\n matrix.get9(b);\n SkDebugf(\"{%g, %g, %g},\\n{%g, %g, %g},\\n{%g, %g, %g}\\n\", b[0], b[1], b[2],\n b[3], b[4], b[5], b[6], b[7], b[8]);\n}", + "hash": "379fc375e011050b54ed9df83c0996a7", "file": "SkMatrix_Reference", "name": "SkMatrix::get9", "stdout": "{4, 0, 3},\\n{0, 5, 4},\\n{0, 0, 1}\\n" @@ -1940,8 +1940,8 @@ "stdout": "text size = 12\\n" }, "SkPath_ConvertToNonInverseFillType": { - "code": "#define nameValue(fill) { SkPath::fill, #fill }\n\nvoid draw(SkCanvas* canvas) {\n struct {\n SkPath::FillType fill;\n const char* name;\n } fills[] = {\n nameValue(kWinding_FillType),\n nameValue(kEvenOdd_FillType),\n nameValue(kInverseWinding_FillType),\n nameValue(kInverseEvenOdd_FillType),\n };\n for (unsigned i = 0; i < SK_ARRAY_COUNT(fills); ++i) {\n if (fills[i].fill != (SkPath::FillType) i) {\n SkDebugf(\"fills array order does not match FillType enum order\");\n break;\n } \n SkDebugf(\"ConvertToNonInverseFillType(%s) == %s\\n\", fills[i].name,\n fills[(int) SkPath::ConvertToNonInverseFillType(fills[i].fill)].name);\n }\n}\n", - "hash": "adfae398bbe9e37495f8220ad544c8f8", + "code": "#define nameValue(fill) { SkPath::fill, #fill }\n\nvoid draw(SkCanvas* canvas) {\n struct {\n SkPath::FillType fill;\n const char* name;\n } fills[] = {\n nameValue(kWinding_FillType),\n nameValue(kEvenOdd_FillType),\n nameValue(kInverseWinding_FillType),\n nameValue(kInverseEvenOdd_FillType),\n };\n for (unsigned i = 0; i < SK_ARRAY_COUNT(fills); ++i) {\n if (fills[i].fill != (SkPath::FillType) i) {\n SkDebugf(\"fills array order does not match FillType enum order\");\n break;\n }\n SkDebugf(\"ConvertToNonInverseFillType(%s) == %s\\n\", fills[i].name,\n fills[(int) SkPath::ConvertToNonInverseFillType(fills[i].fill)].name);\n }\n}\n", + "hash": "319f6b124458dcc0f9ce4d7bbde65810", "file": "SkPath_Reference", "name": "SkPath::ConvertToNonInverseFillType", "stdout": "ConvertToNonInverseFillType(kWinding_FillType) == kWinding_FillType\\nConvertToNonInverseFillType(kEvenOdd_FillType) == kEvenOdd_FillType\\nConvertToNonInverseFillType(kInverseWinding_FillType) == kWinding_FillType\\nConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType\\n" @@ -1968,8 +1968,8 @@ "stdout": "line from (100,100) to (100,100) is degenerate, nearly\\nline from (100,100) to (100,100) is degenerate, exactly\\nline from (100,100) to (100.0001,100.0001) is degenerate, nearly\\nline from (100,100) to (100.0001,100.0001) is not degenerate, exactly\\n" }, "SkPath_IsQuadDegenerate": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const SkPath& path, bool exact) -> void {\n SkDebugf(\"quad (%1.8g,%1.8g), (%1.8g,%1.8g), (%1.8g,%1.8g) is %s\" \"degenerate, %s\\n\", \n path.getPoint(0).fX, path.getPoint(0).fY, path.getPoint(1).fX,\n path.getPoint(1).fY, path.getPoint(2).fX, path.getPoint(2).fY,\n SkPath::IsQuadDegenerate(path.getPoint(0), path.getPoint(1), path.getPoint(2), exact) ?\n \"\" : \"not \", exact ? \"exactly\" : \"nearly\");\n };\n SkPath path, offset;\n path.moveTo({100, 100});\n path.quadTo({100.00001f, 100.00001f}, {100.00002f, 100.00002f});\n offset.addPath(path, 1000, 1000);\n for (bool exact : { false, true } ) {\n debugster(path, exact);\n debugster(offset, exact);\n }\n}\n", - "hash": "1d50896c528cd4581966646b7d96acff", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const SkPath& path, bool exact) -> void {\n SkDebugf(\"quad (%1.8g,%1.8g), (%1.8g,%1.8g), (%1.8g,%1.8g) is %s\" \"degenerate, %s\\n\",\n path.getPoint(0).fX, path.getPoint(0).fY, path.getPoint(1).fX,\n path.getPoint(1).fY, path.getPoint(2).fX, path.getPoint(2).fY,\n SkPath::IsQuadDegenerate(path.getPoint(0), path.getPoint(1), path.getPoint(2), exact) ?\n \"\" : \"not \", exact ? \"exactly\" : \"nearly\");\n };\n SkPath path, offset;\n path.moveTo({100, 100});\n path.quadTo({100.00001f, 100.00001f}, {100.00002f, 100.00002f});\n offset.addPath(path, 1000, 1000);\n for (bool exact : { false, true } ) {\n debugster(path, exact);\n debugster(offset, exact);\n }\n}\n", + "hash": "a2b255a7dac1926cc3a247d318d63c62", "file": "SkPath_Reference", "name": "SkPath::IsQuadDegenerate", "stdout": "quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is degenerate, nearly\\nquad (1100,1100), (1100,1100), (1100,1100) is degenerate, nearly\\nquad (100,100), (100.00001,100.00001), (100.00002,100.00002) is not degenerate, exactly\\nquad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly\\n" @@ -1989,22 +1989,22 @@ "stdout": "open:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkDone_Verb \\n\\nclosed:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkLine_Verb {30, 40}, {0, 0}, \\nkClose_Verb {0, 0}, \\nkDone_Verb \\n\\n" }, "SkPath_Iter_conicWeight": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::Iter iter(path, false); \n SkPoint p[4];\n SkDebugf(\"first verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"next verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"conic points: {%g,%g}, {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY,\n p[2].fX, p[2].fY);\n SkDebugf(\"conic weight: %g\\n\", iter.conicWeight());\n}\n", - "hash": "f97cc1191cf2eef161d6b97fcba67b02", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::Iter iter(path, false);\n SkPoint p[4];\n SkDebugf(\"first verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"next verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"conic points: {%g,%g}, {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY,\n p[2].fX, p[2].fY);\n SkDebugf(\"conic weight: %g\\n\", iter.conicWeight());\n}\n", + "hash": "7cdea37741d50f0594c6244eb07fd175", "file": "SkPath_Reference", "name": "SkPath::Iter::conicWeight", "stdout": "first verb is move\\nnext verb is conic\\nconic points: {0,0}, {1,2}, {3,4}\\nconic weight: 0.5\\n" }, "SkPath_Iter_isCloseLine": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.moveTo(6, 7);\n path.conicTo(1, 2, 3, 4, .5f);\n path.close();\n SkPath::Iter iter(path, false); \n SkPoint p[4];\n SkDebugf(\"1st verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"moveTo point: {%g,%g}\\n\", p[0].fX, p[0].fY);\n SkDebugf(\"2nd verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"3rd verb is \" \"%s\" \"line\\n\", SkPath::kLine_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"line points: {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY);\n SkDebugf(\"line \" \"%s\" \"generated by close\\n\", iter.isCloseLine() ? \"\" : \"not \");\n SkDebugf(\"4th verb is \" \"%s\" \"close\\n\", SkPath::kClose_Verb == iter.next(p) ? \"\" : \"not \");\n}\n", - "hash": "345e0646a010f7dce571078d1321f4df", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.moveTo(6, 7);\n path.conicTo(1, 2, 3, 4, .5f);\n path.close();\n SkPath::Iter iter(path, false);\n SkPoint p[4];\n SkDebugf(\"1st verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"moveTo point: {%g,%g}\\n\", p[0].fX, p[0].fY);\n SkDebugf(\"2nd verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"3rd verb is \" \"%s\" \"line\\n\", SkPath::kLine_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"line points: {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY);\n SkDebugf(\"line \" \"%s\" \"generated by close\\n\", iter.isCloseLine() ? \"\" : \"not \");\n SkDebugf(\"4th verb is \" \"%s\" \"close\\n\", SkPath::kClose_Verb == iter.next(p) ? \"\" : \"not \");\n}\n", + "hash": "7000b501f49341629bfdd9f80e686103", "file": "SkPath_Reference", "name": "SkPath::Iter::isCloseLine", "stdout": "1st verb is move\\nmoveTo point: {6,7}\\n2nd verb is conic\\n3rd verb is line\\nline points: {3,4}, {6,7}\\nline generated by close\\n4th verb is close\\n" }, "SkPath_Iter_isClosedContour": { - "code": "void draw(SkCanvas* canvas) {\n for (bool forceClose : { false, true } ) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::Iter iter(path, forceClose); \n SkDebugf(\"without close(), forceClose is %s: isClosedContour returns %s\\n\",\n forceClose ? \"true \" : \"false\", iter.isClosedContour() ? \"true\" : \"false\");\n path.close();\n iter.setPath(path, forceClose);\n SkDebugf(\"with close(), forceClose is %s: isClosedContour returns %s\\n\",\n forceClose ? \"true \" : \"false\", iter.isClosedContour() ? \"true\" : \"false\");\n }\n}\n", - "hash": "145ead5d4f5fb9ba0a0320cb6a5bf3e8", + "code": "void draw(SkCanvas* canvas) {\n for (bool forceClose : { false, true } ) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::Iter iter(path, forceClose);\n SkDebugf(\"without close(), forceClose is %s: isClosedContour returns %s\\n\",\n forceClose ? \"true \" : \"false\", iter.isClosedContour() ? \"true\" : \"false\");\n path.close();\n iter.setPath(path, forceClose);\n SkDebugf(\"with close(), forceClose is %s: isClosedContour returns %s\\n\",\n forceClose ? \"true \" : \"false\", iter.isClosedContour() ? \"true\" : \"false\");\n }\n}\n", + "hash": "b0d48a6e949db1cb545216ae9c3c3c70", "file": "SkPath_Reference", "name": "SkPath::Iter::isClosedContour", "stdout": "without close(), forceClose is false: isClosedContour returns false\\nwith close(), forceClose is false: isClosedContour returns true\\nwithout close(), forceClose is true : isClosedContour returns true\\nwith close(), forceClose is true : isClosedContour returns true\\n" @@ -2024,8 +2024,8 @@ "stdout": "quad open:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkDone_Verb \\n\\nconic closed:\\nkMove_Verb {0, 0}, \\nkConic_Verb {0, 0}, {1, 2}, {3, 4}, weight = 0.5\\nkLine_Verb {3, 4}, {0, 0}, \\nkClose_Verb {0, 0}, \\nkDone_Verb \\n\\n" }, "SkPath_RawIter_conicWeight": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::RawIter iter(path); \n SkPoint p[4];\n SkDebugf(\"first verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"next verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"conic points: {%g,%g}, {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY,\n p[2].fX, p[2].fY);\n SkDebugf(\"conic weight: %g\\n\", iter.conicWeight());\n}\n", - "hash": "9747e8177a50ea551471ba0b706f544b", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::RawIter iter(path);\n SkPoint p[4];\n SkDebugf(\"first verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"next verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"conic points: {%g,%g}, {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY,\n p[2].fX, p[2].fY);\n SkDebugf(\"conic weight: %g\\n\", iter.conicWeight());\n}\n", + "hash": "69f360a0ba8f40c51ef4cd9f972c5893", "file": "SkPath_Reference", "name": "SkPath::RawIter::conicWeight", "stdout": "first verb is move\\nnext verb is conic\\nconic points: {0,0}, {1,2}, {3,4}\\nconic weight: 0.5\\n" @@ -2045,8 +2045,8 @@ "stdout": "peek Move == verb Move\\npeek Quad == verb Quad\\npeek Conic == verb Conic\\npeek Cubic == verb Cubic\\npeek Done == verb Done\\npeek Done == verb Done\\n\\n" }, "SkPath_SegmentMask": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(10, 10, 20, 30, 1);\n SkDebugf(\"Path kConic_SegmentMask is %s\\n\", path.getSegmentMasks() & \n SkPath::kConic_SegmentMask ? \"set\" : \"clear\");\n SkDebugf(\"Path kQuad_SegmentMask is %s\\n\", path.getSegmentMasks() & \n SkPath::kQuad_SegmentMask ? \"set\" : \"clear\");\n}", - "hash": "0972a1bd6e012c7519d3998afc32e69f", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(10, 10, 20, 30, 1);\n SkDebugf(\"Path kConic_SegmentMask is %s\\n\", path.getSegmentMasks() &\n SkPath::kConic_SegmentMask ? \"set\" : \"clear\");\n SkDebugf(\"Path kQuad_SegmentMask is %s\\n\", path.getSegmentMasks() &\n SkPath::kQuad_SegmentMask ? \"set\" : \"clear\");\n}", + "hash": "a61e5758574e28190ec4ed8c4ae7e7fa", "file": "SkPath_Reference", "name": "SkPath::SegmentMask", "stdout": "Path kConic_SegmentMask is clear\\nPath kQuad_SegmentMask is set\\n" @@ -2073,8 +2073,8 @@ "stdout": "move to (156,20)\\nline (156,20),(200,20)\\n" }, "SkPath_computeTightBounds": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n const SkRect& bounds = path.computeTightBounds();\n SkDebugf(\"%s bounds = %g, %g, %g, %g\\n\", prefix, \n bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n };\n SkPath path;\n debugster(\"empty\", path);\n path.addCircle(50, 45, 25);\n debugster(\"circle\", path);\n SkMatrix matrix;\n matrix.setRotate(45, 50, 45);\n path.transform(matrix);\n debugster(\"rotated circle\", path);\n}", - "hash": "da34f02e69ec98d5681300aea9a2d0bf", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n const SkRect& bounds = path.computeTightBounds();\n SkDebugf(\"%s bounds = %g, %g, %g, %g\\n\", prefix,\n bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n };\n SkPath path;\n debugster(\"empty\", path);\n path.addCircle(50, 45, 25);\n debugster(\"circle\", path);\n SkMatrix matrix;\n matrix.setRotate(45, 50, 45);\n path.transform(matrix);\n debugster(\"rotated circle\", path);\n}", + "hash": "9a39c56e95b19a657133b7ad1fe0cf03", "file": "SkPath_Reference", "name": "SkPath::computeTightBounds", "stdout": "empty bounds = 0, 0, 0, 0\\ncircle bounds = 25, 20, 75, 70\\nrotated circle bounds = 25, 20, 75, 70\\n" @@ -2150,29 +2150,29 @@ "stdout": "empty one == two\\nmoveTo one != two\\nrewind one == two\\nreset one == two\\n" }, "SkPath_getBounds": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n const SkRect& bounds = path.getBounds();\n SkDebugf(\"%s bounds = %g, %g, %g, %g\\n\", prefix, \n bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n };\n SkPath path;\n debugster(\"empty\", path);\n path.addCircle(50, 45, 25);\n debugster(\"circle\", path);\n SkMatrix matrix;\n matrix.setRotate(45, 50, 45);\n path.transform(matrix);\n debugster(\"rotated circle\", path);\n}", - "hash": "9160aa6d1476bd87d927cfc8a4bf25e7", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n const SkRect& bounds = path.getBounds();\n SkDebugf(\"%s bounds = %g, %g, %g, %g\\n\", prefix,\n bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n };\n SkPath path;\n debugster(\"empty\", path);\n path.addCircle(50, 45, 25);\n debugster(\"circle\", path);\n SkMatrix matrix;\n matrix.setRotate(45, 50, 45);\n path.transform(matrix);\n debugster(\"rotated circle\", path);\n}", + "hash": "45c0fc3acb74fab99d544b80eadd10ad", "file": "SkPath_Reference", "name": "SkPath::getBounds", "stdout": "empty bounds = 0, 0, 0, 0\\ncircle bounds = 25, 20, 75, 70\\nrotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553\\n" }, "SkPath_getConvexity": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkDebugf(\"%s path convexity is %s\\n\", prefix, \n SkPath::kUnknown_Convexity == path.getConvexity() ? \"unknown\" :\n SkPath::kConvex_Convexity == path.getConvexity() ? \"convex\" : \"concave\"); };\n SkPath path;\n debugster(\"initial\", path);\n path.lineTo(50, 0);\n debugster(\"first line\", path);\n path.lineTo(50, 50);\n debugster(\"second line\", path);\n path.lineTo(100, 50);\n debugster(\"third line\", path);\n}\n", - "hash": "c8f5ac4040cb5026d234bf99e3f01e8e", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkDebugf(\"%s path convexity is %s\\n\", prefix,\n SkPath::kUnknown_Convexity == path.getConvexity() ? \"unknown\" :\n SkPath::kConvex_Convexity == path.getConvexity() ? \"convex\" : \"concave\"); };\n SkPath path;\n debugster(\"initial\", path);\n path.lineTo(50, 0);\n debugster(\"first line\", path);\n path.lineTo(50, 50);\n debugster(\"second line\", path);\n path.lineTo(100, 50);\n debugster(\"third line\", path);\n}\n", + "hash": "a8f36f2fa90003e3691fd0da0bb0c243", "file": "SkPath_Reference", "name": "SkPath::getConvexity", "stdout": "initial path convexity is convex\\nfirst line path convexity is convex\\nsecond line path convexity is convex\\nthird line path convexity is concave\\n" }, "SkPath_getConvexityOrUnknown": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkDebugf(\"%s path convexity is %s\\n\", prefix, \n SkPath::kUnknown_Convexity == path.getConvexityOrUnknown() ? \"unknown\" :\n SkPath::kConvex_Convexity == path.getConvexityOrUnknown() ? \"convex\" : \"concave\"); };\n SkPath path;\n debugster(\"initial\", path);\n path.lineTo(50, 0);\n debugster(\"first line\", path);\n path.getConvexity();\n path.lineTo(50, 50);\n debugster(\"second line\", path);\n path.lineTo(100, 50);\n path.getConvexity();\n debugster(\"third line\", path);\n}\n", - "hash": "bc19da9de880e3f339707247686efc0a", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkDebugf(\"%s path convexity is %s\\n\", prefix,\n SkPath::kUnknown_Convexity == path.getConvexityOrUnknown() ? \"unknown\" :\n SkPath::kConvex_Convexity == path.getConvexityOrUnknown() ? \"convex\" : \"concave\"); };\n SkPath path;\n debugster(\"initial\", path);\n path.lineTo(50, 0);\n debugster(\"first line\", path);\n path.getConvexity();\n path.lineTo(50, 50);\n debugster(\"second line\", path);\n path.lineTo(100, 50);\n path.getConvexity();\n debugster(\"third line\", path);\n}\n", + "hash": "111c59e9afadb940ab8f41bdc25378a4", "file": "SkPath_Reference", "name": "SkPath::getConvexityOrUnknown", "stdout": "initial path convexity is unknown\\nfirst line path convexity is unknown\\nsecond line path convexity is unknown\\nthird line path convexity is concave\\n" }, "SkPath_getFillType": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n SkDebugf(\"default path fill type is %s\\n\",\n path.getFillType() == SkPath::kWinding_FillType ? \"kWinding_FillType\" :\n path.getFillType() == SkPath::kEvenOdd_FillType ? \"kEvenOdd_FillType\" : \n path.getFillType() == SkPath::kInverseWinding_FillType ? \"kInverseWinding_FillType\" :\n \"kInverseEvenOdd_FillType\");\n}", - "hash": "2eb8f985d1e263e70b5c0aa4a8b68d8e", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n SkDebugf(\"default path fill type is %s\\n\",\n path.getFillType() == SkPath::kWinding_FillType ? \"kWinding_FillType\" :\n path.getFillType() == SkPath::kEvenOdd_FillType ? \"kEvenOdd_FillType\" :\n path.getFillType() == SkPath::kInverseWinding_FillType ? \"kInverseWinding_FillType\" :\n \"kInverseEvenOdd_FillType\");\n}", + "hash": "019af90e778914e8a109d6305ede4fc4", "file": "SkPath_Reference", "name": "SkPath::getFillType", "stdout": "default path fill type is kWinding_FillType\\n" @@ -2192,8 +2192,8 @@ "stdout": "last point: 35.2786, 52.9772\\n" }, "SkPath_getPoint": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.lineTo(20, 20);\n path.offset(-10, -10);\n for (int i= 0; i < path.countPoints(); ++i) {\n SkDebugf(\"point %d: (%1.8g,%1.8g)\\n\", i, path.getPoint(i).fX, path.getPoint(i).fY);\n } \n}\n", - "hash": "abd6796f0e15bc7b4fe6f52f6cd2d1a5", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.lineTo(20, 20);\n path.offset(-10, -10);\n for (int i= 0; i < path.countPoints(); ++i) {\n SkDebugf(\"point %d: (%1.8g,%1.8g)\\n\", i, path.getPoint(i).fX, path.getPoint(i).fY);\n }\n}\n", + "hash": "42885f1df13de109adccc5d531f62111", "file": "SkPath_Reference", "name": "SkPath::getPoint", "stdout": "point 0: (-10,-10)\\npoint 1: (10,10)\\n" @@ -2206,8 +2206,8 @@ "stdout": "no points point count: 3 \\nzero max point count: 3 \\ntoo small point count: 3 (0,0) (20,20) \\njust right point count: 3 (0,0) (20,20) (-10,-10) \\n" }, "SkPath_getSegmentMasks": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.quadTo(20, 30, 40, 50);\n path.close();\n const char* masks[] = { \"line\", \"quad\", \"conic\", \"cubic\" };\n int index = 0;\n for (auto mask : { SkPath::kLine_SegmentMask, SkPath::kQuad_SegmentMask,\n SkPath::kConic_SegmentMask, SkPath::kCubic_SegmentMask } ) {\n if (mask & path.getSegmentMasks()) {\n SkDebugf(\"mask %s set\\n\", masks[index]);\n } \n ++index;\n }\n}", - "hash": "dd9f620b419c8ca18cd306c881aadb5f", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.quadTo(20, 30, 40, 50);\n path.close();\n const char* masks[] = { \"line\", \"quad\", \"conic\", \"cubic\" };\n int index = 0;\n for (auto mask : { SkPath::kLine_SegmentMask, SkPath::kQuad_SegmentMask,\n SkPath::kConic_SegmentMask, SkPath::kCubic_SegmentMask } ) {\n if (mask & path.getSegmentMasks()) {\n SkDebugf(\"mask %s set\\n\", masks[index]);\n }\n ++index;\n }\n}", + "hash": "657a3f3e11acafea92b84d6bb0c13633", "file": "SkPath_Reference", "name": "SkPath::getSegmentMasks", "stdout": "mask quad set\\n" @@ -2269,8 +2269,8 @@ "stdout": "outer (7.5, 17.5, 32.5, 42.5); direction CW\\ninner (12.5, 22.5, 27.5, 37.5); direction CCW\\n" }, "SkPath_isRect": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkRect rect;\n SkPath::Direction direction;\n bool isClosed;\n path.isRect(&rect, &isClosed, &direction) ? \n SkDebugf(\"%s is rect (%g, %g, %g, %g); is %s\" \"closed; direction %s\\n\", prefix,\n rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, isClosed ? \"\" : \"not \",\n SkPath::kCW_Direction == direction ? \"CW\" : \"CCW\") :\n SkDebugf(\"%s is not rect\\n\", prefix);\n };\n SkPath path;\n debugster(\"empty\", path);\n path.addRect({10, 20, 30, 40});\n debugster(\"addRect\", path);\n path.moveTo(60, 70);\n debugster(\"moveTo\", path);\n path.lineTo(60, 70);\n debugster(\"lineTo\", path);\n path.reset();\n const SkPoint pts[] = { {0, 0}, {0, 80}, {80, 80}, {80, 0}, {40, 0}, {20, 0} };\n path.addPoly(pts, SK_ARRAY_COUNT(pts), false);\n debugster(\"addPoly\", path);\n}\n", - "hash": "063a5f0a8de1fe998d227393e0866557", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkRect rect;\n SkPath::Direction direction;\n bool isClosed;\n path.isRect(&rect, &isClosed, &direction) ?\n SkDebugf(\"%s is rect (%g, %g, %g, %g); is %s\" \"closed; direction %s\\n\", prefix,\n rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, isClosed ? \"\" : \"not \",\n SkPath::kCW_Direction == direction ? \"CW\" : \"CCW\") :\n SkDebugf(\"%s is not rect\\n\", prefix);\n };\n SkPath path;\n debugster(\"empty\", path);\n path.addRect({10, 20, 30, 40});\n debugster(\"addRect\", path);\n path.moveTo(60, 70);\n debugster(\"moveTo\", path);\n path.lineTo(60, 70);\n debugster(\"lineTo\", path);\n path.reset();\n const SkPoint pts[] = { {0, 0}, {0, 80}, {80, 80}, {80, 0}, {40, 0}, {20, 0} };\n path.addPoly(pts, SK_ARRAY_COUNT(pts), false);\n debugster(\"addPoly\", path);\n}\n", + "hash": "81a2aac1b8f0ff3d4c8d35ccb9149b16", "file": "SkPath_Reference", "name": "SkPath::isRect", "stdout": "empty is not rect\\naddRect is rect (10, 20, 30, 40); is closed; direction CW\\nmoveTo is rect (10, 20, 30, 40); is closed; direction CW\\nlineTo is not rect\\naddPoly is rect (0, 0, 80, 80); is not closed; direction CCW\\n" @@ -2318,8 +2318,8 @@ "stdout": "path is equal to copy\\n" }, "SkPath_setConvexity": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkDebugf(\"%s path convexity is %s\\n\", prefix, \n SkPath::kUnknown_Convexity == path.getConvexity() ? \"unknown\" :\n SkPath::kConvex_Convexity == path.getConvexity() ? \"convex\" : \"concave\"); };\n SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}}; \n SkPath path;\n path.addPoly(quad, SK_ARRAY_COUNT(quad), true);\n debugster(\"initial\", path);\n path.setConvexity(SkPath::kConcave_Convexity);\n debugster(\"after forcing concave\", path);\n path.setConvexity(SkPath::kUnknown_Convexity);\n debugster(\"after forcing unknown\", path);\n}\n", - "hash": "6fe0d520507eeafe118b80f7f1d9b588", + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkPath& path) -> void {\n SkDebugf(\"%s path convexity is %s\\n\", prefix,\n SkPath::kUnknown_Convexity == path.getConvexity() ? \"unknown\" :\n SkPath::kConvex_Convexity == path.getConvexity() ? \"convex\" : \"concave\"); };\n SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};\n SkPath path;\n path.addPoly(quad, SK_ARRAY_COUNT(quad), true);\n debugster(\"initial\", path);\n path.setConvexity(SkPath::kConcave_Convexity);\n debugster(\"after forcing concave\", path);\n path.setConvexity(SkPath::kUnknown_Convexity);\n debugster(\"after forcing unknown\", path);\n}\n", + "hash": "875e32b4b1cb48d739325705fc0fa42c", "file": "SkPath_Reference", "name": "SkPath::setConvexity", "stdout": "initial path convexity is convex\\nafter forcing concave path convexity is concave\\nafter forcing unknown path convexity is convex\\n" @@ -2444,8 +2444,8 @@ "stdout": "width: 0 height: 0 empty: true\\nwidth: 0 height: 2 empty: true\\nwidth: 2 height: 0 empty: true\\nwidth: 2 height: 2 empty: false\\n" }, "SkPixmap_colorSpace": { - "code": "void draw(SkCanvas* canvas) {\n SkPixmap pixmap(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType, \n SkColorSpace::MakeSRGBLinear()), nullptr, 64);\n SkColorSpace* colorSpace = pixmap.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", - "hash": "34c71f803b8edb48eaf1cd0c55bb212e", + "code": "void draw(SkCanvas* canvas) {\n SkPixmap pixmap(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,\n SkColorSpace::MakeSRGBLinear()), nullptr, 64);\n SkColorSpace* colorSpace = pixmap.colorSpace();\n SkDebugf(\"gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\\n\",\n colorSpace->gammaCloseToSRGB() ? \"true\" : \"false\",\n colorSpace->gammaIsLinear() ? \"true\" : \"false\",\n colorSpace->isSRGB() ? \"true\" : \"false\");\n}", + "hash": "3421bb20a302d563832ba7bb45e0cc58", "file": "SkPixmap_Reference", "name": "SkPixmap::colorSpace", "stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n" @@ -2521,8 +2521,8 @@ "stdout": "width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType\\nwidth: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType\\n" }, "SkPixmap_rowBytes": { - "code": "void draw(SkCanvas* canvas) {\n SkPixmap badPixmap = {SkImageInfo::MakeA8(4, 4), nullptr, 2};\n SkPixmap okPixmap = {SkImageInfo::MakeA8(4, 4), nullptr, 8};\n for (auto& pixmap : { badPixmap, okPixmap } ) {\n SkDebugf(\"rowBytes: %d minRowBytes: %d\\n\", pixmap.rowBytes(), \n pixmap.info().minRowBytes());\n }\n}", - "hash": "da5e1f7f49891d3805a5a6103a000eff", + "code": "void draw(SkCanvas* canvas) {\n SkPixmap badPixmap = {SkImageInfo::MakeA8(4, 4), nullptr, 2};\n SkPixmap okPixmap = {SkImageInfo::MakeA8(4, 4), nullptr, 8};\n for (auto& pixmap : { badPixmap, okPixmap } ) {\n SkDebugf(\"rowBytes: %d minRowBytes: %d\\n\", pixmap.rowBytes(),\n pixmap.info().minRowBytes());\n }\n}", + "hash": "19ac8bb81854680bd408fec8cb797d5c", "file": "SkPixmap_Reference", "name": "SkPixmap::rowBytes", "stdout": "rowBytes: 2 minRowBytes: 4\\nrowBytes: 8 minRowBytes: 4\\n" @@ -2535,15 +2535,15 @@ "stdout": "rowBytes: 4 rowBytesAsPixels: 1\\nrowBytes: 5 rowBytesAsPixels: 1\\nrowBytes: 6 rowBytesAsPixels: 1\\nrowBytes: 7 rowBytesAsPixels: 1\\nrowBytes: 8 rowBytesAsPixels: 2\\n" }, "SkPixmap_setColorSpace": { - "code": "void draw(SkCanvas* canvas) {\n SkPixmap pixmap;\n sk_sp<SkColorSpace> colorSpace1 = SkColorSpace::MakeRGB(SkColorSpace::kLinear_RenderTargetGamma,\n SkColorSpace::kRec2020_Gamut);\n SkDebugf(\"is %sunique\\n\", colorSpace1->unique() ? \"\" : \"not \"); \n pixmap.setColorSpace(colorSpace1);\n SkDebugf(\"is %sunique\\n\", colorSpace1->unique() ? \"\" : \"not \"); \n}\n", - "hash": "bc42aea1e30b7234544bc25b4fc09dd0", + "code": "void draw(SkCanvas* canvas) {\n SkPixmap pixmap;\n sk_sp<SkColorSpace> colorSpace1 = SkColorSpace::MakeRGB(SkColorSpace::kLinear_RenderTargetGamma,\n SkColorSpace::kRec2020_Gamut);\n SkDebugf(\"is %sunique\\n\", colorSpace1->unique() ? \"\" : \"not \");\n pixmap.setColorSpace(colorSpace1);\n SkDebugf(\"is %sunique\\n\", colorSpace1->unique() ? \"\" : \"not \");\n}\n", + "hash": "30d70aec4de17c831dba71e03dc9664a", "file": "SkPixmap_Reference", "name": "SkPixmap::setColorSpace", "stdout": "is unique\\nis not unique\\n" }, "SkPixmap_shiftPerPixel": { - "code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkImageInfo info = SkImageInfo::MakeA8(1, 1);\n for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,\n kRGB_565_SkColorType, kARGB_4444_SkColorType, \n kRGBA_8888_SkColorType, kBGRA_8888_SkColorType,\n kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {\n SkPixmap pixmap(info.makeColorType(colorType), nullptr, 4);\n SkDebugf(\"color: k\" \"%s\" \"_SkColorType\" \"%*s\" \"bytesPerPixel: %d shiftPerPixel: %d\\n\",\n colors[colorType], 10 - strlen(colors[colorType]), \" \",\n pixmap.info().bytesPerPixel(), pixmap.shiftPerPixel());\n }\n}", - "hash": "2e778ffd6edea51af4b07f5d322ceb6a", + "code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"RGB_888x\",\n \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkImageInfo info = SkImageInfo::MakeA8(1, 1);\n for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,\n kRGB_565_SkColorType, kARGB_4444_SkColorType,\n kRGBA_8888_SkColorType, kBGRA_8888_SkColorType,\n kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {\n SkPixmap pixmap(info.makeColorType(colorType), nullptr, 4);\n SkDebugf(\"color: k\" \"%s\" \"_SkColorType\" \"%*s\" \"bytesPerPixel: %d shiftPerPixel: %d\\n\",\n colors[colorType], 10 - strlen(colors[colorType]), \" \",\n pixmap.info().bytesPerPixel(), pixmap.shiftPerPixel());\n }\n}", + "hash": "bf31ee140e2c163c3957276e6d4c4f0c", "file": "SkPixmap_Reference", "name": "SkPixmap::shiftPerPixel", "stdout": "color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0\\ncolor: kAlpha_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0\\ncolor: kRGB_565_SkColorType bytesPerPixel: 2 shiftPerPixel: 1\\ncolor: kARGB_4444_SkColorType bytesPerPixel: 2 shiftPerPixel: 1\\ncolor: kRGBA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2\\ncolor: kBGRA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2\\ncolor: kGray_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0\\ncolor: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3\\n" @@ -2822,15 +2822,15 @@ "stdout": "rect: 15, 27, 45, 60\\n" }, "SkRect_intersect": { - "code": "void draw(SkCanvas* canvas) {\n SkRect leftRect = { 10, 40, 50, 80 };\n SkRect rightRect = { 30, 60, 70, 90 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(rightRect) ? \"\" : \"no \");\n SkDebugf(\"%g, %g, %g, %g\\n\", leftRect.left(), leftRect.top(), \n leftRect.right(), leftRect.bottom());\n}", - "hash": "70e5b3979fc8a31eda070cfed91bc271", + "code": "void draw(SkCanvas* canvas) {\n SkRect leftRect = { 10, 40, 50, 80 };\n SkRect rightRect = { 30, 60, 70, 90 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(rightRect) ? \"\" : \"no \");\n SkDebugf(\"%g, %g, %g, %g\\n\", leftRect.left(), leftRect.top(),\n leftRect.right(), leftRect.bottom());\n}", + "hash": "5d0b12e0ef6f1c181dddded4274230ca", "file": "SkRect_Reference", "name": "SkRect::intersect()", "stdout": "intersection: 30, 60, 50, 80\\n" }, "SkRect_intersect_2": { - "code": "void draw(SkCanvas* canvas) {\n SkRect leftRect = { 10, 40, 50, 80 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(30, 60, 70, 90) ? \"\" : \"no \");\n SkDebugf(\"%g, %g, %g, %g\\n\", leftRect.left(), leftRect.top(), \n leftRect.right(), leftRect.bottom());\n}", - "hash": "9f06dad5e6c712f7a2c149d075e816d2", + "code": "void draw(SkCanvas* canvas) {\n SkRect leftRect = { 10, 40, 50, 80 };\n SkDebugf(\"%s intersection: \", leftRect.intersect(30, 60, 70, 90) ? \"\" : \"no \");\n SkDebugf(\"%g, %g, %g, %g\\n\", leftRect.left(), leftRect.top(),\n leftRect.right(), leftRect.bottom());\n}", + "hash": "5002f65a72def2787086a33131933e70", "file": "SkRect_Reference", "name": "SkRect::intersect_2", "stdout": "intersection: 30, 60, 50, 80\\n" @@ -3253,13 +3253,61 @@ "file": "SkCanvas_Reference", "name": "State_Stack_2" }, - "Illustrations_Image_Info_Color_Type_ABGR_4444": { + "Color_Alpha_Constants_Opaque": { + "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> srcPixels;\n srcPixels.resize(source.height() * source.rowBytes());\n SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width(), source.height()),\n &srcPixels.front(), source.rowBytes());\n source.readPixels(pixmap, 0, 0);\n for (int y = 0; y < source.height(); ++y) {\n for (int x = 0; x < source.width(); ++x) {\n SkPMColor pixel = srcPixels[y * source.width() + x];\n const SkColor color = SkUnPreMultiply::PMColorToColor(pixel);\n if (SkColorGetA(color) == SK_AlphaOPAQUE) {\n srcPixels[y * source.width() + x] = SK_ColorGREEN;\n }\n }\n }\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", + "width": 256, + "height": 128, + "hash": "0424f67ebc2858e8fd04ae3367b115ff", + "file": "SkColor_Reference", + "name": "Alpha_Constants_Opaque" +}, + "Color_Alpha_Constants_Transparent": { + "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> srcPixels;\n srcPixels.resize(source.height() * source.rowBytes());\n SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width(), source.height()),\n &srcPixels.front(), source.rowBytes());\n source.readPixels(pixmap, 0, 0);\n for (int y = 0; y < 16; ++y) {\n for (int x = 0; x < 16; ++x) {\n int32_t* blockStart = &srcPixels.front() + y * source.width() * 16 + x * 16;\n size_t transparentCount = 0;\n for (int fillY = 0; fillY < source.height() / 16; ++fillY) {\n for (int fillX = 0; fillX < source.width() / 16; ++fillX) {\n const SkColor color = SkUnPreMultiply::PMColorToColor(blockStart[fillX]);\n transparentCount += SkColorGetA(color) == SK_AlphaTRANSPARENT;\n }\n blockStart += source.width();\n }\n if (transparentCount > 200) {\n blockStart = &srcPixels.front() + y * source.width() * 16 + x * 16;\n for (int fillY = 0; fillY < source.height() / 16; ++fillY) {\n for (int fillX = 0; fillX < source.width() / 16; ++fillX) {\n blockStart[fillX] = SK_ColorRED;\n }\n blockStart += source.width();\n }\n }\n }\n }\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", + "width": 256, + "height": 128, + "hash": "bc9c7ea424d10bbcd1e5a88770d4794e", + "file": "SkColor_Reference", + "name": "Alpha_Constants_Transparent" +}, + "Color_Color_Constants": { + "code": "#define SKIA_COLOR_PAIR(name) \"SK_Color\" #name, SK_Color##name\n\nvoid draw(SkCanvas* canvas) {\n struct ColorCompare {\n const char* fSVGName;\n SkColor fSVGColor;\n const char* fSkiaName;\n SkColor fSkiaColor;\n } colorCompare[] = { // see https://www.w3.org/TR/SVG/types.html#ColorKeywords\n {\"black\", SkColorSetRGB( 0, 0, 0), SKIA_COLOR_PAIR(BLACK) },\n {\"darkgray\", SkColorSetRGB(169, 169, 169), SKIA_COLOR_PAIR(DKGRAY) },\n {\"gray\", SkColorSetRGB(128, 128, 128), SKIA_COLOR_PAIR(GRAY) },\n {\"lightgray\", SkColorSetRGB(211, 211, 211), SKIA_COLOR_PAIR(LTGRAY) },\n {\"white\", SkColorSetRGB(255, 255, 255), SKIA_COLOR_PAIR(WHITE) },\n {\"red\", SkColorSetRGB(255, 0, 0), SKIA_COLOR_PAIR(RED) },\n {\"green\", SkColorSetRGB( 0, 128, 0), SKIA_COLOR_PAIR(GREEN) },\n {\"blue\", SkColorSetRGB( 0, 0, 255), SKIA_COLOR_PAIR(BLUE) },\n {\"yellow\", SkColorSetRGB(255, 255, 0), SKIA_COLOR_PAIR(YELLOW) },\n {\"aqua\", SkColorSetRGB( 0, 255, 255), SKIA_COLOR_PAIR(CYAN) },\n {\"fuchsia\", SkColorSetRGB(255, 0, 255), SKIA_COLOR_PAIR(MAGENTA) },\n };\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(14);\n for (auto compare : colorCompare) {\n paint.setStyle(SkPaint::kFill_Style);\n paint.setColor(compare.fSVGColor);\n canvas->drawRect({5, 5, 15, 15}, paint);\n paint.setColor(SK_ColorBLACK);\n canvas->drawString(compare.fSVGName, 20, 16, paint);\n paint.setColor(compare.fSkiaColor);\n canvas->drawRect({105, 5, 115, 15}, paint);\n paint.setColor(SK_ColorBLACK);\n canvas->drawString(compare.fSkiaName, 120, 16, paint);\n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawRect({5, 5, 15, 15}, paint);\n canvas->drawRect({105, 5, 115, 15}, paint);\n canvas->translate(0, 20);\n }\n}\n", + "width": 256, + "height": 256, + "hash": "1c2e38321464818847f953ddd45cb5a1", + "file": "SkColor_Reference", + "name": "Color_Constants" +}, + "Color_Color_Constants_Black": { + "code": "void draw(SkCanvas* canvas) {\n std::vector<uint32_t> srcPixels;\n constexpr int width = 256;\n constexpr int height = 256;\n srcPixels.resize(width * height);\n SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);\n SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());\n pixmap.erase(SK_ColorTRANSPARENT);\n pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );\n pixmap.erase(SK_ColorBLACK, { 48, 48, 168, 168 } );\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, 48, 48);\n}", + "width": 256, + "height": 256, + "hash": "6971489f28291f08e429cc6ccc73b09b", + "file": "SkColor_Reference", + "name": "Color_Constants_Black" +}, + "Color_Color_Constants_Transparent": { + "code": "void draw(SkCanvas* canvas) {\n std::vector<uint32_t> srcPixels;\n constexpr int width = 256;\n constexpr int height = 256;\n srcPixels.resize(width * height);\n SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);\n SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());\n pixmap.erase(SK_ColorTRANSPARENT);\n pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );\n pixmap.erase(SK_ColorTRANSPARENT, { 48, 48, 168, 168 } );\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, 48, 48);\n}", + "width": 256, + "height": 256, + "hash": "cfda8cd3b435bb28e2f4b9c7f15603a6", + "file": "SkColor_Reference", + "name": "Color_Constants_Transparent" +}, + "Color_Color_Constants_White": { + "code": "void draw(SkCanvas* canvas) {\n std::vector<uint32_t> srcPixels;\n constexpr int width = 256;\n constexpr int height = 256;\n srcPixels.resize(width * height);\n SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);\n SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());\n pixmap.erase(SK_ColorTRANSPARENT);\n pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );\n pixmap.erase(SK_ColorWHITE, { 48, 48, 168, 168 } );\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, 48, 48);\n}", + "width": 256, + "height": 256, + "hash": "fce650f997e802d4e55edf62b8437a2d", + "file": "SkColor_Reference", + "name": "Color_Constants_White" +}, + "Illustrations_Image_Info_Color_Type_ARGB_4444": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"16-bit word\", 5 + 20 * 8, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 4, 8, 12, 16 };\n const char* labels[] = { \"red\", \"green\", \"blue\", \"alpha\" };\n drawBoxText(&edges[0], &labels[0], 4, 15, 45);\n drawBoxText(&edges[0], &labels[2], 2, 7, 110);\n drawBoxText(&edges[0], &labels[0], 2, 7, 160);\n}\n", "width": 415, "height": 250, "hash": "0441bdba65a19aa72b75b7fa62d22121", "file": "illustrations", - "name": "Image_Info_Color_Type_ABGR_4444" + "name": "Image_Info_Color_Type_ARGB_4444" }, "Illustrations_Image_Info_Color_Type_BGRA_8888": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"32-bit word\", 5 + 20 * 16, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 8, 16, 24, 32 };\n const char* labels[] = { \"alpha\", \"red\", \"green\", \"blue\" };\n drawBoxText(edges, &labels[0], 4, 31, 45);\n drawBoxText(edges, &labels[3], 1, 7, 110);\n drawBoxText(edges, &labels[2], 1, 7, 160);\n drawBoxText(edges, &labels[1], 1, 7, 210);\n drawBoxText(edges, &labels[0], 1, 7, 260);\n}\n", @@ -3269,14 +3317,6 @@ "file": "illustrations", "name": "Image_Info_Color_Type_BGRA_8888" }, - "Illustrations_Image_Info_Color_Type_BGR_565": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"16-bit word\", 5 + 20 * 8, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 1.5f, 137, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 6.5f, 187, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 5, 11, 16, \n 0, 3, 8,\n 0, 5, 8 };\n const char* labels[] = { \"red\", \"green\", \"blue\" };\n drawBoxText(&edges[0], &labels[0], 3, 15, 45);\n drawBoxText(&edges[4], &labels[1], 2, 7, 110);\n drawBoxText(&edges[7], &labels[0], 2, 7, 160);\n}\n", - "width": 415, - "height": 250, - "hash": "b674a54eb4188d5ce66c04cebdb61089", - "file": "illustrations", - "name": "Image_Info_Color_Type_BGR_565" -}, "Illustrations_Image_Info_Color_Type_RGBA_1010102": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"32-bit word\", 5 + 20 * 16, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 4, 137, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 3, 187, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 7, 187, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 2, 237, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 6, 237, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 5, 287, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 2, 12, 22, 32,\n 0, 8,\n 0, 6, 8,\n 0, 4, 8,\n 0, 2, 8\n };\n const char* labels[] = { \"alpha\", \"blue\", \"green\", \"red\" };\n drawBoxText(&edges[0], &labels[0], 4, 31, 45);\n drawBoxText(&edges[5], &labels[3], 1, 7, 110);\n drawBoxText(&edges[7], &labels[2], 2, 7, 160);\n drawBoxText(&edges[10], &labels[1], 2, 7, 210);\n drawBoxText(&edges[13], &labels[0], 2, 7, 260);\n}\n", "width": 812, @@ -3301,21 +3341,29 @@ "file": "illustrations", "name": "Image_Info_Color_Type_RGBA_F16" }, - "Illustrations_Image_Info_Color_Type_RGB_101010x": { + "Illustrations_Image_Info_Color_Type_RGB_101010": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"32-bit word\", 5 + 20 * 16, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 4, 137, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 3, 187, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 7, 187, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 2, 237, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 6, 237, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 5, 287, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 2, 12, 22, 32,\n 0, 8,\n 0, 6, 8,\n 0, 4, 8,\n 0, 2, 8\n };\n const char* labels[] = { \"unused\", \"blue\", \"green\", \"red\" };\n drawBoxText(&edges[0], &labels[0], 4, 31, 45);\n drawBoxText(&edges[5], &labels[3], 1, 7, 110);\n drawBoxText(&edges[7], &labels[2], 2, 7, 160);\n drawBoxText(&edges[10], &labels[1], 2, 7, 210);\n drawBoxText(&edges[13], &labels[0], 2, 7, 260);\n}\n", "width": 812, "height": 380, "hash": "c22477b11dabaa3e3a0b5bb33a7733cd", "file": "illustrations", - "name": "Image_Info_Color_Type_RGB_101010x" + "name": "Image_Info_Color_Type_RGB_101010" +}, + "Illustrations_Image_Info_Color_Type_RGB_565": { + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"16-bit word\", 5 + 20 * 8, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 1.5f, 137, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 6.5f, 187, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 5, 11, 16,\n 0, 3, 8,\n 0, 5, 8 };\n const char* labels[] = { \"red\", \"green\", \"blue\" };\n drawBoxText(&edges[0], &labels[0], 3, 15, 45);\n drawBoxText(&edges[4], &labels[1], 2, 7, 110);\n drawBoxText(&edges[7], &labels[0], 2, 7, 160);\n}\n", + "width": 415, + "height": 250, + "hash": "f5981f4d2337dc5b6ee2d1d0c2a05078", + "file": "illustrations", + "name": "Image_Info_Color_Type_RGB_565" }, - "Illustrations_Image_Info_Color_Type_RGB_888x": { + "Illustrations_Image_Info_Color_Type_RGB_888": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"32-bit word\", 5 + 20 * 16, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 8, 16, 24, 32 };\n const char* labels[] = { \"(unused)\", \"blue\", \"green\", \"red\" };\n drawBoxText(edges, &labels[0], 4, 31, 45);\n drawBoxText(edges, &labels[3], 1, 7, 110);\n drawBoxText(edges, &labels[2], 1, 7, 160);\n drawBoxText(edges, &labels[1], 1, 7, 210);\n drawBoxText(edges, &labels[0], 1, 7, 260);\n}\n", "width": 812, "height": 365, "hash": "fecfe58c25cfc1b1e411e5eb50f7d8d1", "file": "illustrations", - "name": "Image_Info_Color_Type_RGB_888x" + "name": "Image_Info_Color_Type_RGB_888" }, "Image_Info_Alpha_Type_Opaque": { "code": "void draw(SkCanvas* canvas) {\n SkPMColor color = SkPreMultiplyARGB(255, 50, 100, 150);\n SkString s;\n s.printf(\"%u %u %u %u\", SkColorGetA(color), SkColorGetR(color),\n SkColorGetG(color), SkColorGetB(color));\n SkPaint paint;\n paint.setAntiAlias(true);\n canvas->drawString(s, 10, 62, paint);\n canvas->scale(50, 50);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(1, 1, kN32_SkColorType, kOpaque_SkAlphaType);\n if (bitmap.installPixels(imageInfo, (void*) &color, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 0, 0);\n }\n}", @@ -3341,13 +3389,13 @@ "file": "SkImageInfo_Reference", "name": "Alpha_Type_Unpremul" }, - "Image_Info_Color_Type_ABGR_4444": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack4444 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint16_t {\n return (a << 0) | (b << 4) | (g << 8) | (r << 12);\n };\n uint16_t red4444[] = { pack4444(0xF, 0xF, 0x0, 0x0), pack4444(0xF, 0xb, 0x0, 0x0), \n pack4444(0xF, 0x7, 0x0, 0x0), pack4444(0xF, 0x3, 0x0, 0x0) };\n uint16_t blue4444[] = { pack4444(0xF, 0x0, 0x0, 0xF), pack4444(0xF, 0x0, 0x0, 0xb),\n pack4444(0xF, 0x0, 0x0, 0x7), pack4444(0xF, 0x0, 0x0, 0x3) };\n SkPixmap redPixmap(imageInfo, &red4444, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue4444, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "Image_Info_Color_Type_ARGB_4444": { + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack4444 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint16_t {\n return (a << 0) | (b << 4) | (g << 8) | (r << 12);\n };\n uint16_t red4444[] = { pack4444(0xF, 0xF, 0x0, 0x0), pack4444(0xF, 0xb, 0x0, 0x0),\n pack4444(0xF, 0x7, 0x0, 0x0), pack4444(0xF, 0x3, 0x0, 0x0) };\n uint16_t blue4444[] = { pack4444(0xF, 0x0, 0x0, 0xF), pack4444(0xF, 0x0, 0x0, 0xb),\n pack4444(0xF, 0x0, 0x0, 0x7), pack4444(0xF, 0x0, 0x0, 0x3) };\n SkPixmap redPixmap(imageInfo, &red4444, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue4444, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", "width": 256, "height": 96, - "hash": "f89e8200d225ccb839e50a1481db48e9", + "hash": "33a360c3404ac21db801943336843d8e", "file": "SkImageInfo_Reference", - "name": "Color_Type_ABGR_4444" + "name": "Color_Type_ARGB_4444" }, "Image_Info_Color_Type_Alpha_8": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kAlpha_8_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n SkPaint orangePaint;\n orangePaint.setARGB(0xFF, 0xFF, 0xA5, 0x00);\n canvas->drawBitmap(bitmap, 0, 0, &orangePaint);\n uint8_t alpha8[] = { 0xFF, 0xBB, 0x77, 0x33 };\n SkPixmap alphaPixmap(imageInfo, &alpha8, imageInfo.minRowBytes());\n if (bitmap.writePixels(alphaPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2, &orangePaint);\n }\n}", @@ -3358,21 +3406,13 @@ "name": "Color_Type_Alpha_8" }, "Image_Info_Color_Type_BGRA_8888": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (b << 0) | (g << 8) | (r << 16) | (a << 24);\n };\n uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0), \n pack8888(0xFF, 0x99, 0x0, 0x0), pack8888(0xFF, 0x55, 0x0, 0x0) };\n uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),\n pack8888(0xFF, 0x0, 0x0, 0x099), pack8888(0xFF, 0x0, 0x0, 0x055) };\n SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (b << 0) | (g << 8) | (r << 16) | (a << 24);\n };\n uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0),\n pack8888(0xFF, 0x99, 0x0, 0x0), pack8888(0xFF, 0x55, 0x0, 0x0) };\n uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),\n pack8888(0xFF, 0x0, 0x0, 0x099), pack8888(0xFF, 0x0, 0x0, 0x055) };\n SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", "width": 256, "height": 96, - "hash": "fcadba68a4fe7253b1726487e12b1eeb", + "hash": "945ce5344fce5470f8604b2e06e9f9ae", "file": "SkImageInfo_Reference", "name": "Color_Type_BGRA_8888" }, - "Image_Info_Color_Type_BGR_565": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_565_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack565 = [](unsigned r, unsigned g, unsigned b) -> uint16_t {\n return (b << 0) | (g << 5) | (r << 11);\n };\n uint16_t red565[] = { pack565(0x1F, 0x00, 0x00), pack565(0x17, 0x00, 0x00), \n pack565(0x0F, 0x00, 0x00), pack565(0x07, 0x00, 0x00) };\n uint16_t blue565[] = { pack565(0x00, 0x00, 0x1F), pack565(0x00, 0x00, 0x17),\n pack565(0x00, 0x00, 0x0F), pack565(0x00, 0x00, 0x07) };\n SkPixmap redPixmap(imageInfo, &red565, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue565, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", - "width": 256, - "height": 96, - "hash": "54e4c690d64d73ba028c5b250c0d09f0", - "file": "SkImageInfo_Reference", - "name": "Color_Type_BGR_565" -}, "Image_Info_Color_Type_Gray_8": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kGray_8_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n uint8_t gray8[] = { 0xFF, 0xBB, 0x77, 0x33 };\n SkPixmap grayPixmap(imageInfo, &gray8, imageInfo.minRowBytes());\n if (bitmap.writePixels(grayPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n}", "width": 256, @@ -3382,44 +3422,52 @@ "name": "Color_Type_Gray_8" }, "Image_Info_Color_Type_RGBA_1010102": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_1010102_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack1010102 = [](unsigned r, unsigned g, unsigned b, unsigned a) -> uint32_t {\n return (r << 0) | (g << 10) | (b << 20) | (a << 30);\n };\n uint32_t redBits[] = { pack1010102(0x3FF, 0x000, 0x000, 0x3), \n pack1010102(0x2ff, 0x000, 0x000, 0x3), \n pack1010102(0x1ff, 0x000, 0x000, 0x3), \n pack1010102(0x0ff, 0x000, 0x000, 0x3) };\n uint32_t blueBits[] = { pack1010102(0x000, 0x000, 0x3FF, 0x3), \n pack1010102(0x000, 0x000, 0x2ff, 0x3),\n pack1010102(0x000, 0x000, 0x1ff, 0x3), \n pack1010102(0x000, 0x000, 0x0ff, 0x3) };\n if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());\n if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_1010102_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack1010102 = [](unsigned r, unsigned g, unsigned b, unsigned a) -> uint32_t {\n return (r << 0) | (g << 10) | (b << 20) | (a << 30);\n };\n uint32_t redBits[] = { pack1010102(0x3FF, 0x000, 0x000, 0x3),\n pack1010102(0x2ff, 0x000, 0x000, 0x3),\n pack1010102(0x1ff, 0x000, 0x000, 0x3),\n pack1010102(0x0ff, 0x000, 0x000, 0x3) };\n uint32_t blueBits[] = { pack1010102(0x000, 0x000, 0x3FF, 0x3),\n pack1010102(0x000, 0x000, 0x2ff, 0x3),\n pack1010102(0x000, 0x000, 0x1ff, 0x3),\n pack1010102(0x000, 0x000, 0x0ff, 0x3) };\n if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());\n if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", "width": 256, "height": 96, - "hash": "1bf1a6f087b4f2f93962960902061a7a", + "hash": "1282dc1127ce1b0061544619ae4de0f0", "file": "SkImageInfo_Reference", "name": "Color_Type_RGBA_1010102" }, "Image_Info_Color_Type_RGBA_8888": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (r << 0) | (g << 8) | (b << 16) | (a << 24);\n };\n uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0), \n pack8888(0xFF, 0x77, 0x0, 0x0), pack8888(0xFF, 0x33, 0x0, 0x0) };\n uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),\n pack8888(0xFF, 0x0, 0x0, 0x077), pack8888(0xFF, 0x0, 0x0, 0x033) };\n SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (r << 0) | (g << 8) | (b << 16) | (a << 24);\n };\n uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0),\n pack8888(0xFF, 0x77, 0x0, 0x0), pack8888(0xFF, 0x33, 0x0, 0x0) };\n uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),\n pack8888(0xFF, 0x0, 0x0, 0x077), pack8888(0xFF, 0x0, 0x0, 0x033) };\n SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", "width": 256, "height": 96, - "hash": "f3b9effa700b1b95ce10caf422b020cd", + "hash": "947922a19d59893fe7f9d9ee1954379b", "file": "SkImageInfo_Reference", "name": "Color_Type_RGBA_8888" }, "Image_Info_Color_Type_RGBA_F16": { - "code": "union FloatUIntUnion {\n uint32_t fUInt;\n float fFloat;\n};\nuint16_t FloatToHalf(float f) {\n static const FloatUIntUnion magic = { 15 << 23 };\n static const uint32_t round_mask = ~0xfffu;\n FloatUIntUnion floatUnion;\n floatUnion.fFloat = f;\n uint32_t sign = floatUnion.fUInt & 0x80000000u;\n floatUnion.fUInt ^= sign;\n floatUnion.fUInt &= round_mask;\n floatUnion.fFloat *= magic.fFloat;\n floatUnion.fUInt -= round_mask;\n return (floatUnion.fUInt >> 13) | (sign >> 16);\n}\n\nvoid draw(SkCanvas* canvas) { \n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto H = [](float c) -> uint16_t {\n return FloatToHalf(c);\n };\n // R G B A\n uint16_t red_f16[][4] = { { H(1.0f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.75f), H(0.0f), H(0.0f), H(1.0f) }, \n { H(.50f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.25f), H(0.0f), H(0.0f), H(1.0f) } };\n uint16_t blue_f16[][4] = { { H(0.0f), H(0.0f), H(1.0f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.75f), H(1.0f) }, \n { H(0.0f), H(0.0f), H(.50f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.25f), H(1.0f) } };\n SkPixmap redPixmap(imageInfo, red_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, blue_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}\n", + "code": "union FloatUIntUnion {\n uint32_t fUInt;\n float fFloat;\n};\nuint16_t FloatToHalf(float f) {\n static const FloatUIntUnion magic = { 15 << 23 };\n static const uint32_t round_mask = ~0xfffu;\n FloatUIntUnion floatUnion;\n floatUnion.fFloat = f;\n uint32_t sign = floatUnion.fUInt & 0x80000000u;\n floatUnion.fUInt ^= sign;\n floatUnion.fUInt &= round_mask;\n floatUnion.fFloat *= magic.fFloat;\n floatUnion.fUInt -= round_mask;\n return (floatUnion.fUInt >> 13) | (sign >> 16);\n}\n\nvoid draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto H = [](float c) -> uint16_t {\n return FloatToHalf(c);\n };\n // R G B A\n uint16_t red_f16[][4] = { { H(1.0f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.75f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.50f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.25f), H(0.0f), H(0.0f), H(1.0f) } };\n uint16_t blue_f16[][4] = { { H(0.0f), H(0.0f), H(1.0f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.75f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.50f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.25f), H(1.0f) } };\n SkPixmap redPixmap(imageInfo, red_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, blue_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}\n", "width": 256, "height": 96, - "hash": "1795410dffea303b08ba98ee78dc1556", + "hash": "788ac33198103a14a5076dc3e03f2f4b", "file": "SkImageInfo_Reference", "name": "Color_Type_RGBA_F16" }, - "Image_Info_Color_Type_RGB_101010x": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_101010x_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack101010x = [](unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (r << 0) | (g << 10) | (b << 20);\n };\n uint32_t redBits[] = { pack101010x(0x3FF, 0x000, 0x000), pack101010x(0x2ff, 0x000, 0x000), \n pack101010x(0x1ff, 0x000, 0x000), pack101010x(0x0ff, 0x000, 0x000) };\n uint32_t blueBits[] = { pack101010x(0x000, 0x000, 0x3FF), pack101010x(0x000, 0x000, 0x2ff),\n pack101010x(0x000, 0x000, 0x1ff), pack101010x(0x000, 0x000, 0x0ff) };\n if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());\n if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "Image_Info_Color_Type_RGB_101010": { + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_101010x_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack101010x = [](unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (r << 0) | (g << 10) | (b << 20);\n };\n uint32_t redBits[] = { pack101010x(0x3FF, 0x000, 0x000), pack101010x(0x2ff, 0x000, 0x000),\n pack101010x(0x1ff, 0x000, 0x000), pack101010x(0x0ff, 0x000, 0x000) };\n uint32_t blueBits[] = { pack101010x(0x000, 0x000, 0x3FF), pack101010x(0x000, 0x000, 0x2ff),\n pack101010x(0x000, 0x000, 0x1ff), pack101010x(0x000, 0x000, 0x0ff) };\n if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());\n if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", "width": 256, "height": 96, - "hash": "d975ec17354b1297841e4a31d3f6a5d5", + "hash": "92f81aa0459230459600a01e79ccff29", "file": "SkImageInfo_Reference", - "name": "Color_Type_RGB_101010x" + "name": "Color_Type_RGB_101010" }, - "Image_Info_Color_Type_RGB_888x": { - "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_888x_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack888 = [](unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (r << 0) | (g << 8) | (b << 16);\n };\n uint32_t red888[] = { pack888(0xFF, 0x00, 0x00), pack888(0xbb, 0x00, 0x00), \n pack888(0x77, 0x00, 0x00), pack888(0x33, 0x00, 0x00) };\n uint32_t blue888[] = { pack888(0x00, 0x00, 0xFF), pack888(0x00, 0x00, 0xbb),\n pack888(0x00, 0x00, 0x77), pack888(0x00, 0x00, 0x33) };\n if (bitmap.installPixels(imageInfo, (void*) red888, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n if (bitmap.installPixels(imageInfo, (void*) blue888, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "Image_Info_Color_Type_RGB_565": { + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_565_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack565 = [](unsigned r, unsigned g, unsigned b) -> uint16_t {\n return (b << 0) | (g << 5) | (r << 11);\n };\n uint16_t red565[] = { pack565(0x1F, 0x00, 0x00), pack565(0x17, 0x00, 0x00),\n pack565(0x0F, 0x00, 0x00), pack565(0x07, 0x00, 0x00) };\n uint16_t blue565[] = { pack565(0x00, 0x00, 0x1F), pack565(0x00, 0x00, 0x17),\n pack565(0x00, 0x00, 0x0F), pack565(0x00, 0x00, 0x07) };\n SkPixmap redPixmap(imageInfo, &red565, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, &blue565, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", "width": 256, "height": 96, - "hash": "1e236c4c9ce0597c22186589fee9dc1e", + "hash": "7e7c46bb4572e21e13529ff364eb0a9c", "file": "SkImageInfo_Reference", - "name": "Color_Type_RGB_888x" + "name": "Color_Type_RGB_565" +}, + "Image_Info_Color_Type_RGB_888": { + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_888x_SkColorType, kOpaque_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto pack888 = [](unsigned r, unsigned g, unsigned b) -> uint32_t {\n return (r << 0) | (g << 8) | (b << 16);\n };\n uint32_t red888[] = { pack888(0xFF, 0x00, 0x00), pack888(0xbb, 0x00, 0x00),\n pack888(0x77, 0x00, 0x00), pack888(0x33, 0x00, 0x00) };\n uint32_t blue888[] = { pack888(0x00, 0x00, 0xFF), pack888(0x00, 0x00, 0xbb),\n pack888(0x00, 0x00, 0x77), pack888(0x00, 0x00, 0x33) };\n if (bitmap.installPixels(imageInfo, (void*) red888, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n if (bitmap.installPixels(imageInfo, (void*) blue888, imageInfo.minRowBytes())) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}", + "width": 256, + "height": 96, + "hash": "4260d6cc15db2c60c07f6fdc8d9ae425", + "file": "SkImageInfo_Reference", + "name": "Color_Type_RGB_888" }, "Matrix_MemberIndex": { "code": "void draw(SkCanvas* canvas) {\n SkPaint black;\n black.setAntiAlias(true);\n black.setTextSize(48);\n SkPaint gray = black;\n gray.setColor(0xFF9f9f9f);\n SkScalar offset[] = { 1.5f, 1.5f, 20, 1.5f, 1.5f, 20, .03f, .01f, 2 };\n for (int i : { SkMatrix::kMScaleX, SkMatrix::kMSkewX, SkMatrix::kMTransX,\n SkMatrix::kMSkewY, SkMatrix::kMScaleY, SkMatrix::kMTransY,\n SkMatrix::kMPersp0, SkMatrix::kMPersp1, SkMatrix::kMPersp2 } ) {\n SkMatrix m;\n m.setIdentity();\n m.set(i, offset[i]);\n SkAutoCanvasRestore autoRestore(canvas, true);\n canvas->translate(22 + (i % 3) * 88, 44 + (i / 3) * 88);\n canvas->drawString(\"&\", 0, 0, gray);\n canvas->concat(m);\n canvas->drawString(\"&\", 0, 0, black);\n }\n}", @@ -3733,118 +3781,6 @@ "file": "SkPath_Reference", "name": "Path_2" }, - "SK_AlphaOPAQUE": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_AlphaOPAQUE" -}, - "SK_AlphaTRANSPARENT": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_AlphaTRANSPARENT" -}, - "SK_ColorBLACK": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorBLACK" -}, - "SK_ColorBLUE": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorBLUE" -}, - "SK_ColorCYAN": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorCYAN" -}, - "SK_ColorDKGRAY": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorDKGRAY" -}, - "SK_ColorGRAY": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorGRAY" -}, - "SK_ColorGREEN": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorGREEN" -}, - "SK_ColorLTGRAY": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorLTGRAY" -}, - "SK_ColorMAGENTA": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorMAGENTA" -}, - "SK_ColorRED": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorRED" -}, - "SK_ColorTRANSPARENT": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorTRANSPARENT" -}, - "SK_ColorWHITE": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorWHITE" -}, - "SK_ColorYELLOW": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor_Reference", - "name": "SK_ColorYELLOW" -}, "SkAutoCanvasRestore_SkCanvas_star": { "code": "void draw(SkCanvas* canvas) {\n SkPaint p;\n p.setAntiAlias(true);\n p.setTextSize(64);\n for (SkScalar sx : { -1, 1 } ) {\n for (SkScalar sy : { -1, 1 } ) {\n SkAutoCanvasRestore autoRestore(canvas, true);\n SkMatrix m = SkMatrix::MakeAll(sx, 1, 96, 0, sy, 64, 0, 0, 1);\n canvas->concat(m);\n canvas->drawString(\"R\", 0, 0, p);\n }\n }\n}", "width": 256, @@ -3870,10 +3806,10 @@ "name": "SkBitmap::allocPixels" }, "SkBitmap_allocPixelsFlags": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixelsFlags(SkImageInfo::MakeN32(44, 16, kPremul_SkAlphaType), \n SkBitmap::kZeroPixels_AllocFlag);\n SkCanvas offscreen(bitmap);\n SkPaint paint;\n offscreen.drawString(\"!@#$%\", 0, 12, paint);\n canvas->scale(6, 6);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, 8, 8);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixelsFlags(SkImageInfo::MakeN32(44, 16, kPremul_SkAlphaType),\n SkBitmap::kZeroPixels_AllocFlag);\n SkCanvas offscreen(bitmap);\n SkPaint paint;\n offscreen.drawString(\"!@#$%\", 0, 12, paint);\n canvas->scale(6, 6);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, 8, 8);\n}", "width": 256, "height": 128, - "hash": "f21b8965a88c94a32393a8890c4672af", + "hash": "737e721c7d9e0f367d25521a1b823b9d", "file": "SkBitmap_Reference", "name": "SkBitmap::allocPixelsFlags" }, @@ -3910,26 +3846,26 @@ "name": "SkBitmap::bounds()" }, "SkBitmap_erase": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap; \n bitmap.allocPixels(SkImageInfo::MakeN32(2, 2, kPremul_SkAlphaType));\n bitmap.erase(0x7fff7f3f, SkIRect::MakeWH(1, 1));\n bitmap.erase(0x7f7f3fff, SkIRect::MakeXYWH(0, 1, 1, 1));\n bitmap.erase(0x7f3fff7f, SkIRect::MakeXYWH(1, 0, 1, 1));\n bitmap.erase(0x7f1fbf5f, SkIRect::MakeXYWH(1, 1, 1, 1));\n canvas->scale(25, 25);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, .5f, .5f);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(2, 2, kPremul_SkAlphaType));\n bitmap.erase(0x7fff7f3f, SkIRect::MakeWH(1, 1));\n bitmap.erase(0x7f7f3fff, SkIRect::MakeXYWH(0, 1, 1, 1));\n bitmap.erase(0x7f3fff7f, SkIRect::MakeXYWH(1, 0, 1, 1));\n bitmap.erase(0x7f1fbf5f, SkIRect::MakeXYWH(1, 1, 1, 1));\n canvas->scale(25, 25);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, .5f, .5f);\n}", "width": 256, "height": 70, - "hash": "116baaa35348b5c0a353fb6d4917d574", + "hash": "2c5c4230ccd2861a5d15b7cd2764ab6e", "file": "SkBitmap_Reference", "name": "SkBitmap::erase()" }, "SkBitmap_eraseARGB": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap; \n bitmap.allocPixels(SkImageInfo::MakeN32(1, 1, kPremul_SkAlphaType));\n bitmap.eraseARGB(0x7f, 0xff, 0x7f, 0x3f);\n canvas->scale(50, 50);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, .5f, .5f);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(1, 1, kPremul_SkAlphaType));\n bitmap.eraseARGB(0x7f, 0xff, 0x7f, 0x3f);\n canvas->scale(50, 50);\n canvas->drawBitmap(bitmap, 0, 0);\n canvas->drawBitmap(bitmap, .5f, .5f);\n}", "width": 256, "height": 80, - "hash": "ebaa436565ce9c0f883bef871d099654", + "hash": "67277b0a1003f340473a35982533561c", "file": "SkBitmap_Reference", "name": "SkBitmap::eraseARGB" }, "SkBitmap_eraseColor": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap; \n bitmap.allocPixels(SkImageInfo::MakeN32(1, 1, kOpaque_SkAlphaType));\n bitmap.eraseColor(SK_ColorRED);\n canvas->scale(16, 16);\n canvas->drawBitmap(bitmap, 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(1, 1, kOpaque_SkAlphaType));\n bitmap.eraseColor(SK_ColorRED);\n canvas->scale(16, 16);\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, "height": 20, - "hash": "22804faa423192f96a29578b1d396ace", + "hash": "418928dbfffa9eb00c8225530f44baf5", "file": "SkBitmap_Reference", "name": "SkBitmap::eraseColor" }, @@ -3990,10 +3926,10 @@ "name": "SkBitmap::installPixels_3" }, "SkBitmap_notifyPixelsChanged": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap; \n bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n bitmap.allocPixels();\n bitmap.eraseColor(SK_ColorRED);\n canvas->scale(16, 16);\n canvas->drawBitmap(bitmap, 0, 0);\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorBLUE);\n canvas->drawBitmap(bitmap, 2, 0);\n bitmap.notifyPixelsChanged();\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 4, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n bitmap.allocPixels();\n bitmap.eraseColor(SK_ColorRED);\n canvas->scale(16, 16);\n canvas->drawBitmap(bitmap, 0, 0);\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorBLUE);\n canvas->drawBitmap(bitmap, 2, 0);\n bitmap.notifyPixelsChanged();\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 4, 0);\n}", "width": 256, "height": 20, - "hash": "706e6409c8364e7786d6c69db7242c76", + "hash": "8f463ed17b0ed4fb9c503a0ec71706f9", "file": "SkBitmap_Reference", "name": "SkBitmap::notifyPixelsChanged" }, @@ -4022,10 +3958,10 @@ "name": "SkBitmap::readPixels_3" }, "SkBitmap_readPixels_4": { - "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> srcPixels;\n srcPixels.resize(source.height() * source.width() * 8);\n for (int i = 0; i < 2; ++i) {\n SkPixmap pixmap(SkImageInfo::Make(source.width() * 2, source.height(), \n i ? kRGBA_8888_SkColorType : kBGRA_8888_SkColorType, kPremul_SkAlphaType),\n &srcPixels.front() + i * source.width(), source.rowBytes() * 2);\n source.readPixels(pixmap);\n }\n canvas->scale(.25f, .25f);\n SkBitmap bitmap;\n bitmap.installPixels(SkImageInfo::MakeN32Premul(source.width() * 2, source.height()),\n &srcPixels.front(), source.rowBytes() * 2);\n canvas->drawBitmap(bitmap, 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> srcPixels;\n srcPixels.resize(source.height() * source.width() * 8);\n for (int i = 0; i < 2; ++i) {\n SkPixmap pixmap(SkImageInfo::Make(source.width() * 2, source.height(),\n i ? kRGBA_8888_SkColorType : kBGRA_8888_SkColorType, kPremul_SkAlphaType),\n &srcPixels.front() + i * source.width(), source.rowBytes() * 2);\n source.readPixels(pixmap);\n }\n canvas->scale(.25f, .25f);\n SkBitmap bitmap;\n bitmap.installPixels(SkImageInfo::MakeN32Premul(source.width() * 2, source.height()),\n &srcPixels.front(), source.rowBytes() * 2);\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, "height": 128, - "hash": "2260ff6d04708699b6223b4f73fd268e", + "hash": "4590fbf052659d6e629fbfd827081ae5", "file": "SkBitmap_Reference", "name": "SkBitmap::readPixels_4" }, @@ -4046,18 +3982,18 @@ "name": "SkBitmap::setInfo" }, "SkBitmap_setIsVolatile": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap; \n bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n bitmap.allocPixels();\n bitmap.eraseColor(SK_ColorRED);\n canvas->scale(16, 16);\n canvas->drawBitmap(bitmap, 0, 0);\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorBLUE);\n canvas->drawBitmap(bitmap, 2, 0);\n bitmap.setIsVolatile(true);\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 4, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n bitmap.allocPixels();\n bitmap.eraseColor(SK_ColorRED);\n canvas->scale(16, 16);\n canvas->drawBitmap(bitmap, 0, 0);\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorBLUE);\n canvas->drawBitmap(bitmap, 2, 0);\n bitmap.setIsVolatile(true);\n *(SkPMColor*) bitmap.getPixels() = SkPreMultiplyColor(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 4, 0);\n}", "width": 256, "height": 20, - "hash": "9443ada07e6123fc895be4c958244218", + "hash": "e8627a4df659b896402f89a91326618f", "file": "SkBitmap_Reference", "name": "SkBitmap::setIsVolatile" }, "SkBitmap_setPixelRef": { - "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::Make(source.width() - 5, source.height() - 5, \n kGray_8_SkColorType, kOpaque_SkAlphaType), source.rowBytes());\n bitmap.setPixelRef(sk_ref_sp(source.pixelRef()), 5, 5);\n canvas->drawBitmap(bitmap, 10, 10);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::Make(source.width() - 5, source.height() - 5,\n kGray_8_SkColorType, kOpaque_SkAlphaType), source.rowBytes());\n bitmap.setPixelRef(sk_ref_sp(source.pixelRef()), 5, 5);\n canvas->drawBitmap(bitmap, 10, 10);\n}", "width": 256, "height": 140, - "hash": "13df9e5b1adcec33d11e4b0f8a91ecb8", + "hash": "f98cc0451c6e77a8833d261c9a484c5f", "file": "SkBitmap_Reference", "name": "SkBitmap::setPixelRef" }, @@ -4973,14 +4909,6 @@ "file": "SkColor4f_Reference", "name": "SkColor4f::pin()" }, - "SkColor4f_premul": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkColor4f_Reference", - "name": "SkColor4f::premul()" -}, "SkColor4f_toSkColor": { "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", "width": 256, @@ -5046,18 +4974,18 @@ "name": "SkColorSetA" }, "SkColorSetARGB": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawColor(SK_ColorRED);\n canvas->clipRect(SkRect::MakeWH(150, 150));\n canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0xFF, 0x00));\n canvas->clipRect(SkRect::MakeWH(75, 75));\n canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0x00, 0xFF));\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "35888f0869e01a6e03b5b93bba563734", "file": "SkColor_Reference", "name": "SkColorSetARGB" }, "SkColorSetRGB": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n canvas->drawColor(SK_ColorRED);\n canvas->clipRect(SkRect::MakeWH(150, 150));\n canvas->drawColor(SkColorSetRGB(0x00, 0xFF, 0x00));\n canvas->clipRect(SkRect::MakeWH(75, 75));\n canvas->drawColor(SkColorSetRGB(0x00, 0x00, 0xFF));\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "dad12dd912197cd5edd789ac0801bf8a", "file": "SkColor_Reference", "name": "SkColorSetRGB" }, @@ -5182,10 +5110,10 @@ "name": "SkImageInfo::MakeN32Premul_2" }, "SkImageInfo_MakeS32": { - "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 32;\n SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);\n SkColor gradColors[] = { 0xFFAA0055, 0xFF11CC88 };\n SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } };\n SkPaint gradPaint;\n gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,\n SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType));\n SkCanvas offscreen(bitmap);\n offscreen.drawRect(SkRect::MakeWH(width, height), gradPaint);\n canvas->drawBitmap(bitmap, 0, 0);\n bitmap.allocPixels(SkImageInfo::MakeS32(width, height, kPremul_SkAlphaType));\n SkCanvas sRGBOffscreen(bitmap);\n sRGBOffscreen.drawRect(SkRect::MakeWH(width, height), gradPaint);\n canvas->drawBitmap(bitmap, 0, 48);\n SkBitmap noColorSpaceBitmap;\n noColorSpaceBitmap.setInfo(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType));\n noColorSpaceBitmap.setPixels(bitmap.getAddr(0, 0));\n canvas->drawBitmap(noColorSpaceBitmap, 0, 96);\n}", + "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 32;\n SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);\n SkColor gradColors[] = { 0xFFAA0055, 0xFF11CC88 };\n SkPoint gradPoints[] = { { 0, 0 }, { width, 0 } };\n SkPaint gradPaint;\n gradPaint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,\n SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType));\n SkCanvas offScreen(bitmap);\n offScreen.drawRect(SkRect::MakeWH(width, height), gradPaint);\n canvas->drawBitmap(bitmap, 0, 0);\n bitmap.allocPixels(SkImageInfo::MakeS32(width, height, kPremul_SkAlphaType));\n SkCanvas sRGBOffscreen(bitmap);\n sRGBOffscreen.drawRect(SkRect::MakeWH(width, height), gradPaint);\n canvas->drawBitmap(bitmap, 0, 48);\n SkBitmap noColorSpaceBitmap;\n noColorSpaceBitmap.setInfo(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType));\n noColorSpaceBitmap.setPixels(bitmap.getAddr(0, 0));\n canvas->drawBitmap(noColorSpaceBitmap, 0, 96);\n}", "width": 256, "height": 128, - "hash": "bb85fc8a82fe772e1d611f3ab8770a1d", + "hash": "de418ccb42471d1589508ef3955f8c53", "file": "SkImageInfo_Reference", "name": "SkImageInfo::MakeS32" }, @@ -5262,10 +5190,10 @@ "name": "SkImageInfo::height()" }, "SkImageInfo_makeAlphaType": { - "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 128;\n SkColor pixels[height][width];\n for (int y = 0; y < height; ++y) {\n for (int x = 0; x < width; ++x) {\n int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f))); \n int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f))); \n int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f)));\n int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f)));\n pixels[y][x] = \n SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255);\n }\n }\n SkBitmap bitmap;\n SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.installPixels(info, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(source, 0, 0);\n canvas->drawBitmap(bitmap, 0, 0);\n SkImageInfo unpremulInfo = info.makeAlphaType(kUnpremul_SkAlphaType);\n bitmap.installPixels(unpremulInfo, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(bitmap, 0, 128);\n}", + "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 128;\n SkColor pixels[height][width];\n for (int y = 0; y < height; ++y) {\n for (int x = 0; x < width; ++x) {\n int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f)));\n int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f)));\n int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f)));\n int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f)));\n pixels[y][x] =\n SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255);\n }\n }\n SkBitmap bitmap;\n SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.installPixels(info, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(source, 0, 0);\n canvas->drawBitmap(bitmap, 0, 0);\n SkImageInfo unpremulInfo = info.makeAlphaType(kUnpremul_SkAlphaType);\n bitmap.installPixels(unpremulInfo, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(bitmap, 0, 128);\n}", "width": 256, "height": 256, - "hash": "5166f1a04d53443ed8aed519d0faa3db", + "hash": "e72db006f1bea26feceaef8727ff9818", "file": "SkImageInfo_Reference", "name": "SkImageInfo::makeAlphaType" }, @@ -5278,18 +5206,18 @@ "name": "SkImageInfo::makeColorSpace" }, "SkImageInfo_makeColorType": { - "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 128;\n SkColor pixels[height][width];\n for (int y = 0; y < height; ++y) {\n for (int x = 0; x < width; ++x) {\n int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f))); \n int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f))); \n int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f)));\n int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f)));\n pixels[y][x] = \n SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255);\n }\n }\n SkBitmap bitmap;\n SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.installPixels(info, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(source, 0, 0);\n canvas->drawBitmap(bitmap, 0, 0);\n SkImageInfo rgbaInfo = info.makeColorType(kRGBA_8888_SkColorType);\n bitmap.installPixels(rgbaInfo, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(bitmap, 0, 128);\n}", + "code": "void draw(SkCanvas* canvas) {\n const int width = 256;\n const int height = 128;\n SkColor pixels[height][width];\n for (int y = 0; y < height; ++y) {\n for (int x = 0; x < width; ++x) {\n int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f)));\n int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f)));\n int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f)));\n int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f)));\n pixels[y][x] =\n SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255);\n }\n }\n SkBitmap bitmap;\n SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n bitmap.installPixels(info, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(source, 0, 0);\n canvas->drawBitmap(bitmap, 0, 0);\n SkImageInfo rgbaInfo = info.makeColorType(kRGBA_8888_SkColorType);\n bitmap.installPixels(rgbaInfo, (void*) pixels, sizeof(SkColor) * width);\n canvas->drawBitmap(bitmap, 0, 128);\n}", "width": 256, "height": 256, - "hash": "0d67609fbf0988bfaf9ca5e2460af3d3", + "hash": "3ac267b08b12dc83c95f91d8dd5d70ee", "file": "SkImageInfo_Reference", "name": "SkImageInfo::makeColorType" }, "SkImageInfo_makeWH": { - "code": "void draw(SkCanvas* canvas) {\n SkImageInfo canvasImageInfo = canvas->imageInfo();\n SkRect canvasBounds = SkRect::Make(canvasImageInfo.bounds());\n canvas->drawBitmapRect(source, source.bounds(), canvasBounds, nullptr);\n SkImageInfo insetImageInfo = \n canvasImageInfo.makeWH(canvasBounds.width() / 2, canvasBounds.height() / 2);\n SkBitmap inset;\n inset.allocPixels(insetImageInfo);\n SkCanvas offscreen(inset);\n offscreen.drawBitmapRect(source, source.bounds(), SkRect::Make(inset.bounds()), nullptr);\n canvas->drawBitmap(inset, canvasBounds.width() / 4, canvasBounds.height() / 4);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkImageInfo canvasImageInfo = canvas->imageInfo();\n SkRect canvasBounds = SkRect::Make(canvasImageInfo.bounds());\n canvas->drawBitmapRect(source, source.bounds(), canvasBounds, nullptr);\n SkImageInfo insetImageInfo =\n canvasImageInfo.makeWH(canvasBounds.width() / 2, canvasBounds.height() / 2);\n SkBitmap inset;\n inset.allocPixels(insetImageInfo);\n SkCanvas offscreen(inset);\n offscreen.drawBitmapRect(source, source.bounds(), SkRect::Make(inset.bounds()), nullptr);\n canvas->drawBitmap(inset, canvasBounds.width() / 4, canvasBounds.height() / 4);\n}", "width": 256, "height": 144, - "hash": "26827898b6b199d6c4b5e4d2c6e6bac8", + "hash": "cd203a3f9c5fb68272f21f302dd54fbc", "file": "SkImageInfo_Reference", "name": "SkImageInfo::makeWH" }, @@ -5302,10 +5230,10 @@ "name": "SkImageInfo::width()" }, "SkImage_MakeBackendTextureFromSkImage": { - "code": "static sk_sp<SkImage> create_gpu_image(GrContext* grContext) {\n const SkImageInfo info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType);\n auto surface(SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info));\n SkCanvas* canvas = surface->getCanvas();\n canvas->clear(SK_ColorWHITE);\n SkPaint paint;\n paint.setColor(SK_ColorBLACK);\n canvas->drawRect(SkRect::MakeXYWH(5, 5, 10, 10), paint);\n return surface->makeImageSnapshot();\n}\n\nvoid draw(SkCanvas* canvas) { \n GrContext* grContext = canvas->getGrContext();\n if (!grContext) {\n return;\n }\n sk_sp<SkImage> backEndImage = create_gpu_image(grContext);\n canvas->drawImage(backEndImage, 0, 0);\n GrBackendTexture texture;\n SkImage::BackendTextureReleaseProc proc;\n if (!SkImage::MakeBackendTextureFromSkImage(grContext, std::move(backEndImage),\n &texture, &proc)) {\n return;\n }\n sk_sp<SkImage> i2 = SkImage::MakeFromTexture(grContext, texture, kTopLeft_GrSurfaceOrigin,\n kN32_SkColorType, kOpaque_SkAlphaType, nullptr);\n canvas->drawImage(i2, 30, 30);\n}\n", + "code": "static sk_sp<SkImage> create_gpu_image(GrContext* grContext) {\n const SkImageInfo info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType);\n auto surface(SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info));\n SkCanvas* canvas = surface->getCanvas();\n canvas->clear(SK_ColorWHITE);\n SkPaint paint;\n paint.setColor(SK_ColorBLACK);\n canvas->drawRect(SkRect::MakeXYWH(5, 5, 10, 10), paint);\n return surface->makeImageSnapshot();\n}\n\nvoid draw(SkCanvas* canvas) {\n GrContext* grContext = canvas->getGrContext();\n if (!grContext) {\n return;\n }\n sk_sp<SkImage> backEndImage = create_gpu_image(grContext);\n canvas->drawImage(backEndImage, 0, 0);\n GrBackendTexture texture;\n SkImage::BackendTextureReleaseProc proc;\n if (!SkImage::MakeBackendTextureFromSkImage(grContext, std::move(backEndImage),\n &texture, &proc)) {\n return;\n }\n sk_sp<SkImage> i2 = SkImage::MakeFromTexture(grContext, texture, kTopLeft_GrSurfaceOrigin,\n kN32_SkColorType, kOpaque_SkAlphaType, nullptr);\n canvas->drawImage(i2, 30, 30);\n}\n", "width": 256, "height": 64, - "hash": "98e70337c2964abd2624239d28bbecd7", + "hash": "06aeb3cf63ffccf7b49fe556e5def351", "file": "SkImage_Reference", "name": "SkImage::MakeBackendTextureFromSkImage" }, @@ -5326,10 +5254,10 @@ "name": "SkImage::MakeCrossContextFromPixmap" }, "SkImage_MakeFromAdoptedTexture": { - "code": "void draw(SkCanvas* canvas) {\n if (!canvas->getGrContext()) {\n return;\n }\n canvas->scale(.5f, .5f);\n canvas->clear(0x7f3f5f7f);\n int x = 0, y = 0;\n for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {\n for (auto alpha : { kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType } ) {\n sk_sp<SkImage> image = SkImage::MakeFromAdoptedTexture(canvas->getGrContext(),\n backEndTexture, origin, \n kRGBA_8888_SkColorType, alpha);\n canvas->drawImage(image, x, y);\n x += 160;\n }\n x -= 160 * 3;\n y += 256;\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n if (!canvas->getGrContext()) {\n return;\n }\n canvas->scale(.5f, .5f);\n canvas->clear(0x7f3f5f7f);\n int x = 0, y = 0;\n for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {\n for (auto alpha : { kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType } ) {\n sk_sp<SkImage> image = SkImage::MakeFromAdoptedTexture(canvas->getGrContext(),\n backEndTexture, origin,\n kRGBA_8888_SkColorType, alpha);\n canvas->drawImage(image, x, y);\n x += 160;\n }\n x -= 160 * 3;\n y += 256;\n }\n}", "width": 256, "height": 256, - "hash": "b07964ec9c5c8a6febba805f1cf4d071", + "hash": "b034517e39394b7543f06ec885e36d7d", "file": "SkImage_Reference", "name": "SkImage::MakeFromAdoptedTexture" }, @@ -5390,10 +5318,10 @@ "name": "SkImage::MakeRasterCopy" }, "SkImage_MakeRasterData": { - "code": "void draw(SkCanvas* canvas) {\n size_t rowBytes = image->width() * SkColorTypeBytesPerPixel(kRGBA_8888_SkColorType);\n sk_sp<SkData> data = SkData::MakeUninitialized(rowBytes * image->height());\n SkImageInfo dstInfo = SkImageInfo::MakeN32(image->width(), image->height(), \n kPremul_SkAlphaType);\n image->readPixels(dstInfo, data->writable_data(), rowBytes, 0, 0, SkImage::kAllow_CachingHint);\n sk_sp<SkImage> raw = SkImage::MakeRasterData(dstInfo.makeColorType(kRGBA_8888_SkColorType),\n data, rowBytes);\n canvas->drawImage(image, 0, 0);\n canvas->drawImage(raw.get(), 128, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n size_t rowBytes = image->width() * SkColorTypeBytesPerPixel(kRGBA_8888_SkColorType);\n sk_sp<SkData> data = SkData::MakeUninitialized(rowBytes * image->height());\n SkImageInfo dstInfo = SkImageInfo::MakeN32(image->width(), image->height(),\n kPremul_SkAlphaType);\n image->readPixels(dstInfo, data->writable_data(), rowBytes, 0, 0, SkImage::kAllow_CachingHint);\n sk_sp<SkImage> raw = SkImage::MakeRasterData(dstInfo.makeColorType(kRGBA_8888_SkColorType),\n data, rowBytes);\n canvas->drawImage(image, 0, 0);\n canvas->drawImage(raw.get(), 128, 0);\n}", "width": 256, "height": 256, - "hash": "367bdf6ee6ef2482eea95d4a9887c9b0", + "hash": "22e7ce79ab2fe94252d23319f2258127", "file": "SkImage_Reference", "name": "SkImage::MakeRasterData" }, @@ -5726,10 +5654,10 @@ "name": "SkMatrix::invert()" }, "SkMatrix_isSimilarity": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint p;\n p.setAntiAlias(true);\n SkMatrix m;\n int below = 175;\n for (SkScalar sx : { -1, 1 } ) {\n for (SkScalar sy : { -1, 1 } ) {\n m.setAll(sx, 1, 128, 1, sy, 32, 0, 0, 1);\n bool isSimilarity = m.isSimilarity();\n SkString str;\n str.printf(\"sx: %g sy: %g sim: %s\", sx, sy, isSimilarity ? \"true\" : \"false\");\n {\n SkAutoCanvasRestore autoRestore(canvas, true);\n canvas->concat(m);\n canvas->drawString(str, 0, 0, p); \n }\n if (!isSimilarity) {\n canvas->drawString(str, 40, below, p);\n below += 20;\n }\n }\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint p;\n p.setAntiAlias(true);\n SkMatrix m;\n int below = 175;\n for (SkScalar sx : { -1, 1 } ) {\n for (SkScalar sy : { -1, 1 } ) {\n m.setAll(sx, 1, 128, 1, sy, 32, 0, 0, 1);\n bool isSimilarity = m.isSimilarity();\n SkString str;\n str.printf(\"sx: %g sy: %g sim: %s\", sx, sy, isSimilarity ? \"true\" : \"false\");\n {\n SkAutoCanvasRestore autoRestore(canvas, true);\n canvas->concat(m);\n canvas->drawString(str, 0, 0, p);\n }\n if (!isSimilarity) {\n canvas->drawString(str, 40, below, p);\n below += 20;\n }\n }\n }\n}", "width": 256, "height": 256, - "hash": "98d60230ad633ae74d851de3a65d72d6", + "hash": "8b37f4ae7fec1756433c0f984175fb14", "file": "SkMatrix_Reference", "name": "SkMatrix::isSimilarity" }, @@ -5910,10 +5838,10 @@ "name": "SkMatrix::postSkew_2" }, "SkMatrix_postTranslate": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkRect rect = {20, 20, 100, 100};\n for (int i = 0; i < 2; ++i ) {\n SkMatrix matrix;\n i == 0 ? matrix.reset(): matrix.setRotate(25, rect.centerX(), 320);\n { \n SkAutoCanvasRestore acr(canvas, true);\n canvas->concat(matrix);\n paint.setColor(SK_ColorGRAY);\n canvas->drawRect(rect, paint);\n }\n paint.setColor(SK_ColorRED);\n for (int j = 0; j < 2; ++j ) {\n SkAutoCanvasRestore acr(canvas, true);\n matrix.postTranslate(40, 40);\n canvas->concat(matrix);\n canvas->drawCircle(0, 0, 3, paint);\n }\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkRect rect = {20, 20, 100, 100};\n for (int i = 0; i < 2; ++i ) {\n SkMatrix matrix;\n i == 0 ? matrix.reset(): matrix.setRotate(25, rect.centerX(), 320);\n {\n SkAutoCanvasRestore acr(canvas, true);\n canvas->concat(matrix);\n paint.setColor(SK_ColorGRAY);\n canvas->drawRect(rect, paint);\n }\n paint.setColor(SK_ColorRED);\n for (int j = 0; j < 2; ++j ) {\n SkAutoCanvasRestore acr(canvas, true);\n matrix.postTranslate(40, 40);\n canvas->concat(matrix);\n canvas->drawCircle(0, 0, 3, paint);\n }\n }\n}", "width": 256, "height": 160, - "hash": "57e4cff302c0d754ac6c66050d741772", + "hash": "f5144ef4bd7cea294fad2f756ed335af", "file": "SkMatrix_Reference", "name": "SkMatrix::postTranslate" }, @@ -5974,18 +5902,18 @@ "name": "SkMatrix::preSkew_2" }, "SkMatrix_preTranslate": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkRect rect = {20, 20, 100, 100};\n for (int i = 0; i < 2; ++i ) {\n SkMatrix matrix;\n i == 0 ? matrix.reset(): matrix.setRotate(25, rect.centerX(), 320);\n { \n SkAutoCanvasRestore acr(canvas, true);\n canvas->concat(matrix);\n paint.setColor(SK_ColorGRAY);\n canvas->drawRect(rect, paint);\n }\n paint.setColor(SK_ColorRED);\n for (int j = 0; j < 2; ++j ) {\n SkAutoCanvasRestore acr(canvas, true);\n matrix.preTranslate(40, 40);\n canvas->concat(matrix);\n canvas->drawCircle(0, 0, 3, paint);\n }\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkRect rect = {20, 20, 100, 100};\n for (int i = 0; i < 2; ++i ) {\n SkMatrix matrix;\n i == 0 ? matrix.reset(): matrix.setRotate(25, rect.centerX(), 320);\n {\n SkAutoCanvasRestore acr(canvas, true);\n canvas->concat(matrix);\n paint.setColor(SK_ColorGRAY);\n canvas->drawRect(rect, paint);\n }\n paint.setColor(SK_ColorRED);\n for (int j = 0; j < 2; ++j ) {\n SkAutoCanvasRestore acr(canvas, true);\n matrix.preTranslate(40, 40);\n canvas->concat(matrix);\n canvas->drawCircle(0, 0, 3, paint);\n }\n }\n}", "width": 256, "height": 160, - "hash": "08f6749933f4ce541073077ab506fd9b", + "hash": "f75a9b629aa6c51ed888f8799b5ba5f7", "file": "SkMatrix_Reference", "name": "SkMatrix::preTranslate" }, "SkMatrix_preservesRightAngles": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint p;\n p.setAntiAlias(true);\n SkMatrix m;\n int pos = 0;\n for (SkScalar sx : { 1, 2 } ) {\n for (SkScalar kx : { 0, 1 } ) {\n m.setAll(sx, kx, 16, 0, 1, 32, 0, 0, 1);\n bool isSimilarity = m.isSimilarity();\n bool preservesRightAngles = m.preservesRightAngles();\n SkString str;\n str.printf(\"sx: %g kx: %g %s %s\", sx, kx, isSimilarity ? \"sim\" : \"\",\n preservesRightAngles ? \"right\" : \"\");\n SkAutoCanvasRestore autoRestore(canvas, true);\n canvas->concat(m);\n canvas->drawString(str, 0, pos, p); \n pos += 20;\n }\n }\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint p;\n p.setAntiAlias(true);\n SkMatrix m;\n int pos = 0;\n for (SkScalar sx : { 1, 2 } ) {\n for (SkScalar kx : { 0, 1 } ) {\n m.setAll(sx, kx, 16, 0, 1, 32, 0, 0, 1);\n bool isSimilarity = m.isSimilarity();\n bool preservesRightAngles = m.preservesRightAngles();\n SkString str;\n str.printf(\"sx: %g kx: %g %s %s\", sx, kx, isSimilarity ? \"sim\" : \"\",\n preservesRightAngles ? \"right\" : \"\");\n SkAutoCanvasRestore autoRestore(canvas, true);\n canvas->concat(m);\n canvas->drawString(str, 0, pos, p);\n pos += 20;\n }\n }\n}", "width": 256, "height": 128, - "hash": "a3d5bfebc1c3423fb983d30aaf4ac5f4", + "hash": "b9becf0dc24a9f00726e24a81fb72f16", "file": "SkMatrix_Reference", "name": "SkMatrix::preservesRightAngles" }, @@ -6422,10 +6350,10 @@ "name": "SkPath::ConvertConicToQuads" }, "SkPath_Convexity": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}}; \n const char* labels[] = { \"unknown\", \"convex\", \"concave\" };\n for (SkScalar x : { 40, 100 } ) {\n SkPath path;\n quad[0].fX = x;\n path.addPoly(quad, SK_ARRAY_COUNT(quad), true);\n canvas->drawPath(path, paint);\n canvas->drawString(labels[(int) path.getConvexity()], 30, 100, paint);\n canvas->translate(100, 100);\n }\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};\n const char* labels[] = { \"unknown\", \"convex\", \"concave\" };\n for (SkScalar x : { 40, 100 } ) {\n SkPath path;\n quad[0].fX = x;\n path.addPoly(quad, SK_ARRAY_COUNT(quad), true);\n canvas->drawPath(path, paint);\n canvas->drawString(labels[(int) path.getConvexity()], 30, 100, paint);\n canvas->translate(100, 100);\n }\n}\n", "width": 256, "height": 256, - "hash": "b7d0c0732411db76fa37b05fc18712b3", + "hash": "ac49e8b810bd6ed5d84b4f5a3b40a0ec", "file": "SkPath_Reference", "name": "SkPath::Convexity" }, @@ -6438,26 +6366,26 @@ "name": "SkPath::Direction" }, "SkPath_FillType": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.addRect({10, 10, 30, 30}, SkPath::kCW_Direction);\n path.addRect({20, 20, 40, 40}, SkPath::kCW_Direction);\n path.addRect({10, 60, 30, 80}, SkPath::kCW_Direction);\n path.addRect({20, 70, 40, 90}, SkPath::kCCW_Direction);\n SkPaint strokePaint;\n strokePaint.setStyle(SkPaint::kStroke_Style);\n SkRect clipRect = {0, 0, 51, 100};\n canvas->drawPath(path, strokePaint);\n SkPaint fillPaint;\n for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType, \n SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {\n canvas->translate(51, 0);\n canvas->save();\n canvas->clipRect(clipRect);\n path.setFillType(fillType);\n canvas->drawPath(path, fillPaint);\n canvas->restore();\n }\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.addRect({10, 10, 30, 30}, SkPath::kCW_Direction);\n path.addRect({20, 20, 40, 40}, SkPath::kCW_Direction);\n path.addRect({10, 60, 30, 80}, SkPath::kCW_Direction);\n path.addRect({20, 70, 40, 90}, SkPath::kCCW_Direction);\n SkPaint strokePaint;\n strokePaint.setStyle(SkPaint::kStroke_Style);\n SkRect clipRect = {0, 0, 51, 100};\n canvas->drawPath(path, strokePaint);\n SkPaint fillPaint;\n for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,\n SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {\n canvas->translate(51, 0);\n canvas->save();\n canvas->clipRect(clipRect);\n path.setFillType(fillType);\n canvas->drawPath(path, fillPaint);\n canvas->restore();\n }\n}\n", "width": 256, "height": 100, - "hash": "525ed591c31960de23068dba8ea11a75", + "hash": "71fc6c069c377d808799f2453edabaf5", "file": "SkPath_Reference", "name": "SkPath::FillType" }, "SkPath_FillType_a": { - "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.addRect({20, 10, 80, 70}, SkPath::kCW_Direction);\n path.addRect({40, 30, 100, 90}, SkPath::kCW_Direction);\n SkPaint strokePaint;\n strokePaint.setStyle(SkPaint::kStroke_Style);\n SkRect clipRect = {0, 0, 128, 128};\n canvas->drawPath(path, strokePaint);\n canvas->drawLine({0, 50}, {120, 50}, strokePaint);\n SkPaint textPaint;\n textPaint.setAntiAlias(true);\n textPaint.setTextAlign(SkPaint::kCenter_Align);\n SkScalar textHPos[] = { 10, 30, 60, 90, 110 };\n canvas->drawPosTextH(\"01210\", 5, textHPos, 48, textPaint);\n textPaint.setTextSize(18);\n canvas->translate(0, 128);\n canvas->scale(.5f, .5f);\n canvas->drawString(\"inverse\", 384, 150, textPaint);\n SkPaint fillPaint;\n for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType, \n SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {\n canvas->save();\n canvas->clipRect(clipRect);\n path.setFillType(fillType);\n canvas->drawPath(path, fillPaint);\n canvas->restore();\n canvas->drawString(fillType & 1 ? \"even-odd\" : \"winding\", 64, 170, textPaint);\n canvas->translate(128, 0);\n }\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.addRect({20, 10, 80, 70}, SkPath::kCW_Direction);\n path.addRect({40, 30, 100, 90}, SkPath::kCW_Direction);\n SkPaint strokePaint;\n strokePaint.setStyle(SkPaint::kStroke_Style);\n SkRect clipRect = {0, 0, 128, 128};\n canvas->drawPath(path, strokePaint);\n canvas->drawLine({0, 50}, {120, 50}, strokePaint);\n SkPaint textPaint;\n textPaint.setAntiAlias(true);\n textPaint.setTextAlign(SkPaint::kCenter_Align);\n SkScalar textHPos[] = { 10, 30, 60, 90, 110 };\n canvas->drawPosTextH(\"01210\", 5, textHPos, 48, textPaint);\n textPaint.setTextSize(18);\n canvas->translate(0, 128);\n canvas->scale(.5f, .5f);\n canvas->drawString(\"inverse\", 384, 150, textPaint);\n SkPaint fillPaint;\n for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,\n SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {\n canvas->save();\n canvas->clipRect(clipRect);\n path.setFillType(fillType);\n canvas->drawPath(path, fillPaint);\n canvas->restore();\n canvas->drawString(fillType & 1 ? \"even-odd\" : \"winding\", 64, 170, textPaint);\n canvas->translate(128, 0);\n }\n}\n", "width": 256, "height": 230, - "hash": "0ebf978b234a00e2c2573cfa7b04e776", + "hash": "d84cd32b0bfd9ad2714f753120ed0ee1", "file": "SkPath_Reference", "name": "SkPath::FillType_2" }, "SkPath_Iter": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(256);\n SkPath asterisk, path;\n paint.getTextPath(\"*\", 1, 50, 192, &asterisk);\n SkPath::Iter iter(asterisk, true); \n SkPoint start[4], pts[4];\n iter.next(start); // skip moveTo\n iter.next(start); // first quadTo\n path.moveTo((start[0] + start[1]) * 0.5f);\n while (SkPath::kClose_Verb != iter.next(pts)) {\n path.quadTo(pts[0], (pts[0] + pts[1]) * 0.5f);\n }\n path.quadTo(start[0], (start[0] + start[1]) * 0.5f);\n canvas->drawPath(path, paint);\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(256);\n SkPath asterisk, path;\n paint.getTextPath(\"*\", 1, 50, 192, &asterisk);\n SkPath::Iter iter(asterisk, true);\n SkPoint start[4], pts[4];\n iter.next(start); // skip moveTo\n iter.next(start); // first quadTo\n path.moveTo((start[0] + start[1]) * 0.5f);\n while (SkPath::kClose_Verb != iter.next(pts)) {\n path.quadTo(pts[0], (pts[0] + pts[1]) * 0.5f);\n }\n path.quadTo(start[0], (start[0] + start[1]) * 0.5f);\n canvas->drawPath(path, paint);\n}\n", "width": 256, "height": 128, - "hash": "3ca8417e2a1466bf5b3ac97780a8070c", + "hash": "2f53df9201769ab7e7c0e164a1334309", "file": "SkPath_Reference", "name": "SkPath::Iter" }, @@ -6694,10 +6622,10 @@ "name": "SkPath::interpolate()" }, "SkPath_isConvex": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}}; \n for (SkScalar x : { 40, 100 } ) {\n SkPath path;\n quad[0].fX = x;\n path.addPoly(quad, SK_ARRAY_COUNT(quad), true);\n path.setConvexity(SkPath::kConvex_Convexity);\n canvas->drawPath(path, paint);\n canvas->drawString(path.isConvex() ? \"convex\" : \"not convex\", 30, 100, paint);\n canvas->translate(100, 100);\n }\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};\n for (SkScalar x : { 40, 100 } ) {\n SkPath path;\n quad[0].fX = x;\n path.addPoly(quad, SK_ARRAY_COUNT(quad), true);\n path.setConvexity(SkPath::kConvex_Convexity);\n canvas->drawPath(path, paint);\n canvas->drawString(path.isConvex() ? \"convex\" : \"not convex\", 30, 100, paint);\n canvas->translate(100, 100);\n }\n}\n", "width": 256, "height": 256, - "hash": "dfd2c40e1c2a7b539a94aec8d040d349", + "hash": "d8be8b6e59de244e4cbf58ec9554557b", "file": "SkPath_Reference", "name": "SkPath::isConvex" }, @@ -6742,10 +6670,10 @@ "name": "SkPath::moveTo" }, "SkPath_moveTo_2": { - "code": "void draw(SkCanvas* canvas) {\n SkPoint data[][3] = {{{30,40},{60,60},{90,30}}, {{30,120},{60,100},{90,120}}, \n {{60,100},{60,40},{70,30}}, {{60,40},{50,20},{70,30}}};\n SkPath path;\n for (unsigned i = 0; i < SK_ARRAY_COUNT(data); ++i) {\n path.moveTo(data[i][0]);\n path.lineTo(data[i][1]);\n path.lineTo(data[i][2]);\n }\n SkPaint paint;\n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawPath(path, paint);\n}\n", + "code": "void draw(SkCanvas* canvas) {\n SkPoint data[][3] = {{{30,40},{60,60},{90,30}}, {{30,120},{60,100},{90,120}},\n {{60,100},{60,40},{70,30}}, {{60,40},{50,20},{70,30}}};\n SkPath path;\n for (unsigned i = 0; i < SK_ARRAY_COUNT(data); ++i) {\n path.moveTo(data[i][0]);\n path.lineTo(data[i][1]);\n path.lineTo(data[i][2]);\n }\n SkPaint paint;\n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawPath(path, paint);\n}\n", "width": 128, "height": 128, - "hash": "53b351d3fac667a4803418238e44a593", + "hash": "cb8d37990f6e7df3bcc85e7240c81274", "file": "SkPath_Reference", "name": "SkPath::moveTo_2" }, @@ -6966,10 +6894,10 @@ "name": "SkPixmap::readPixels_5" }, "SkPixmap_reset_2": { - "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n int x = 0;\n for (auto colorType : { kRGBA_8888_SkColorType, kBGRA_8888_SkColorType } ) {\n pixmap.reset(SkImageInfo::Make(image->width(), image->height(), colorType, \n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, x, 0);\n x += 128;\n }\n}\n", + "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n int x = 0;\n for (auto colorType : { kRGBA_8888_SkColorType, kBGRA_8888_SkColorType } ) {\n pixmap.reset(SkImageInfo::Make(image->width(), image->height(), colorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, x, 0);\n x += 128;\n }\n}\n", "width": 256, "height": 64, - "hash": "a7c9bfe44f5d888ab5b9996f2b126788", + "hash": "9a392b753167cfa849cebeefd5a6e07d", "file": "SkPixmap_Reference", "name": "SkPixmap::reset_2" }, @@ -6990,10 +6918,10 @@ "name": "SkPixmap::writable_addr16" }, "SkPixmap_writable_addr32": { - "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n for (int y = 0; y < pixmap.height() / 2; ++y) {\n for (int x = 0; x < pixmap.width(); ++x) {\n if ((x & 4) == (y & 4)) {\n SkTSwap(*pixmap.writable_addr32(x, y), \n *pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));\n }\n }\n }\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n std::vector<int32_t> pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n for (int y = 0; y < pixmap.height() / 2; ++y) {\n for (int x = 0; x < pixmap.width(); ++x) {\n if ((x & 4) == (y & 4)) {\n SkTSwap(*pixmap.writable_addr32(x, y),\n *pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));\n }\n }\n }\n SkBitmap bitmap;\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, "height": 72, - "hash": "f4fdce206b8c0a4e79f0a9f52b7f47a6", + "hash": "d99d5d394182e8c2c0cab402f93ca6c7", "file": "SkPixmap_Reference", "name": "SkPixmap::writable_addr32" }, @@ -7278,10 +7206,10 @@ "name": "SkSurface::MakeRenderTarget_3" }, "SkSurface_characterize": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n sk_sp<SkSurface> gpuSurface = SkSurface::MakeRenderTarget(\n context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(64, 64));\n SkSurfaceCharacterization characterization;\n if (!gpuSurface->characterize(&characterization)) {\n canvas->drawString(\"characterization unsupported\", 20, 40, paint);\n return;\n }\n // start of threadable work \n SkDeferredDisplayListRecorder recorder(characterization);\n SkCanvas* subCanvas = recorder.getCanvas();\n subCanvas->clear(SK_ColorGREEN);\n std::unique_ptr<SkDeferredDisplayList> displayList = recorder.detach();\n // end of threadable work\n gpuSurface->draw(displayList.get());\n sk_sp<SkImage> img = gpuSurface->makeImageSnapshot();\n canvas->drawImage(std::move(img), 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n sk_sp<SkSurface> gpuSurface = SkSurface::MakeRenderTarget(\n context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(64, 64));\n SkSurfaceCharacterization characterization;\n if (!gpuSurface->characterize(&characterization)) {\n canvas->drawString(\"characterization unsupported\", 20, 40, paint);\n return;\n }\n // start of threadable work\n SkDeferredDisplayListRecorder recorder(characterization);\n SkCanvas* subCanvas = recorder.getCanvas();\n subCanvas->clear(SK_ColorGREEN);\n std::unique_ptr<SkDeferredDisplayList> displayList = recorder.detach();\n // end of threadable work\n gpuSurface->draw(displayList.get());\n sk_sp<SkImage> img = gpuSurface->makeImageSnapshot();\n canvas->drawImage(std::move(img), 0, 0);\n}", "width": 256, "height": 64, - "hash": "3df4e2fc63483a3fa19589b5388080bc", + "hash": "6de6f3ef699a72ff26da1b26b23a3316", "file": "SkSurface_Reference", "name": "SkSurface::characterize()" }, @@ -7294,10 +7222,10 @@ "name": "SkSurface::draw()" }, "SkSurface_draw_2": { - "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(16);\n sk_sp<SkSurface> gpuSurface = SkSurface::MakeRasterN32Premul(64, 64);\n SkSurfaceCharacterization characterization;\n if (!gpuSurface->characterize(&characterization)) {\n canvas->drawString(\"characterization unsupported\", 20, 40, paint);\n return;\n }\n // start of threadable work \n SkDeferredDisplayListRecorder recorder(characterization);\n SkCanvas* subCanvas = recorder.getCanvas();\n subCanvas->clear(SK_ColorGREEN);\n std::unique_ptr<SkDeferredDisplayList> displayList = recorder.detach();\n // end of threadable work\n gpuSurface->draw(displayList.get());\n sk_sp<SkImage> img = gpuSurface->makeImageSnapshot();\n canvas->drawImage(std::move(img), 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(16);\n sk_sp<SkSurface> gpuSurface = SkSurface::MakeRasterN32Premul(64, 64);\n SkSurfaceCharacterization characterization;\n if (!gpuSurface->characterize(&characterization)) {\n canvas->drawString(\"characterization unsupported\", 20, 40, paint);\n return;\n }\n // start of threadable work\n SkDeferredDisplayListRecorder recorder(characterization);\n SkCanvas* subCanvas = recorder.getCanvas();\n subCanvas->clear(SK_ColorGREEN);\n std::unique_ptr<SkDeferredDisplayList> displayList = recorder.detach();\n // end of threadable work\n gpuSurface->draw(displayList.get());\n sk_sp<SkImage> img = gpuSurface->makeImageSnapshot();\n canvas->drawImage(std::move(img), 0, 0);\n}", "width": 256, "height": 64, - "hash": "3dfa7496268dfb2c7465cda5da39dfbd", + "hash": "46d9bacf593deaaeabd74ff42f2571a0", "file": "SkSurface_Reference", "name": "SkSurface::draw_2" }, @@ -7342,18 +7270,18 @@ "name": "SkSurface::readPixels" }, "SkSurface_readPixels_2": { - "code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorRED);\n SkPaint paint;\n surfCanvas->drawOval({4, 8, 58, 54}, paint);\n SkImageInfo info = SkImageInfo::Make(64, 64, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n sk_sp<SkData> data(SkData::MakeUninitialized(info.minRowBytes() * info.height()));\n sk_bzero(data->writable_data(), info.minRowBytes() * info.height());\n for (int x : { 32, -32 } ) {\n for (int y : { 32, -32 } ) {\n surf->readPixels(info, data->writable_data(), info.minRowBytes(), x, y);\n } \n }\n sk_sp<SkImage> image = SkImage::MakeRasterData(info, data, info.minRowBytes());\n canvas->drawImage(image, 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorRED);\n SkPaint paint;\n surfCanvas->drawOval({4, 8, 58, 54}, paint);\n SkImageInfo info = SkImageInfo::Make(64, 64, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n sk_sp<SkData> data(SkData::MakeUninitialized(info.minRowBytes() * info.height()));\n sk_bzero(data->writable_data(), info.minRowBytes() * info.height());\n for (int x : { 32, -32 } ) {\n for (int y : { 32, -32 } ) {\n surf->readPixels(info, data->writable_data(), info.minRowBytes(), x, y);\n }\n }\n sk_sp<SkImage> image = SkImage::MakeRasterData(info, data, info.minRowBytes());\n canvas->drawImage(image, 0, 0);\n}", "width": 256, "height": 64, - "hash": "d141d6c662d201d191fb1eea26d014fd", + "hash": "484d60dab5d846bf28c7a4d48892324a", "file": "SkSurface_Reference", "name": "SkSurface::readPixels_2" }, "SkSurface_readPixels_3": { - "code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorGREEN);\n SkPaint paint;\n surfCanvas->drawOval({2, 10, 58, 54}, paint);\n SkImageInfo info = SkImageInfo::Make(64, 64, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n SkBitmap bitmap;\n bitmap.setInfo(info);\n bitmap.allocPixels();\n for (int x : { 32, -32 } ) {\n for (int y : { 32, -32 } ) {\n surf->readPixels(bitmap, x, y);\n } \n }\n canvas->drawBitmap(bitmap, 0, 0);\n}", + "code": "void draw(SkCanvas* canvas) {\n sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));\n auto surfCanvas = surf->getCanvas();\n surfCanvas->clear(SK_ColorGREEN);\n SkPaint paint;\n surfCanvas->drawOval({2, 10, 58, 54}, paint);\n SkImageInfo info = SkImageInfo::Make(64, 64, kBGRA_8888_SkColorType, kPremul_SkAlphaType);\n SkBitmap bitmap;\n bitmap.setInfo(info);\n bitmap.allocPixels();\n for (int x : { 32, -32 } ) {\n for (int y : { 32, -32 } ) {\n surf->readPixels(bitmap, x, y);\n }\n }\n canvas->drawBitmap(bitmap, 0, 0);\n}", "width": 256, "height": 256, - "hash": "dcbd4af9151820f63de45a35f3a8d110", + "hash": "2d991a231e49d1de13eeb2ba9b440e01", "file": "SkSurface_Reference", "name": "SkSurface::readPixels_3" }, diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index 95846019b0..b4f83bd4b4 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -1,900 +1,705 @@ undocumented === -# <a name="Alias"></a> Alias +# <a name='Alias'>Alias</a> -# <a name="Anti-alias"></a> Anti-alias +# <a name='Arc'>Arc</a> -# <a name="Arc"></a> Arc +# <a name='BBH_Factory'>BBH Factory</a> -# <a name="BBH_Factory"></a> BBH Factory +# <a name='SkBBHFactory'>Class SkBBHFactory</a> -# <a name="SkBBHFactory"></a> Class SkBBHFactory +# <a name='Backend_Semaphore'>Backend Semaphore</a> -# <a name="Backend_Semaphore"></a> Backend Semaphore +# <a name='GrBackendSemaphore'>Class GrBackendSemaphore</a> -# <a name="GrBackendSemaphore"></a> Class GrBackendSemaphore +# <a name='Blend_Mode'>Blend Mode</a> -# <a name="Blend_Mode"></a> Blend Mode - -## <a name="SkBlendMode"></a> Enum SkBlendMode +## <a name='SkBlendMode'>Enum SkBlendMode</a> ### Constants -<table> - <tr> - <td><a name="SkBlendMode_kSrc"> <code><strong>SkBlendMode::kSrc </strong></code> </a></td><td>1</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkBlendMode_kSrc'><code>SkBlendMode::kSrc</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="SkBlendMode_kSrcOver"> <code><strong>SkBlendMode::kSrcOver </strong></code> </a></td><td>3</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkBlendMode_kSrcOver'><code>SkBlendMode::kSrcOver</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> - <tr> - <td><a name="SkBlendMode_kPlus"> <code><strong>SkBlendMode::kPlus </strong></code> </a></td><td>12</td><td></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkBlendMode_kPlus'><code>SkBlendMode::kPlus</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>12</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> +</table> +# <a name='Circle'>Circle</a> +# <a name='Clip_Op'>Clip Op</a> -# <a name="Circle"></a> Circle - -# <a name="Clip_Op"></a> Clip Op - -## <a name="SkClipOp"></a> Enum SkClipOp +## <a name='SkClipOp'>Enum SkClipOp</a> ### Constants -<table> - <tr> - <td><a name="SkClipOp_kDifference"> <code><strong>SkClipOp::kDifference </strong></code> </a></td><td>0</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkClipOp_kDifference'><code>SkClipOp::kDifference</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="SkClipOp_kIntersect"> <code><strong>SkClipOp::kIntersect </strong></code> </a></td><td>1</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkClipOp_kIntersect'><code>SkClipOp::kIntersect</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> +</table> +# <a name='Color_Filter'>Color Filter</a> +# <a name='SkColorFilter'>Class SkColorFilter</a> -# <a name="Color_Filter"></a> Color Filter - -# <a name="SkColorFilter"></a> Class SkColorFilter - -<a name="SkColorFilter_toString"></a> +<a name='SkColorFilter_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkColorFilter_toString'>toString</a>(<a href='#SkString'>SkString</a>* str) const </pre> --- -# <a name="Color_Space"></a> Color Space +# <a name='Color_Space'>Color Space</a> -# <a name="SkColorSpace"></a> Class SkColorSpace +# <a name='SkColorSpace'>Class SkColorSpace</a> -<a name="SkColorSpace_MakeSRGBLinear"></a> +<a name='SkColorSpace_MakeSRGBLinear'></a> ## MakeSRGBLinear -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkColorSpace> MakeSRGBLinear() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#sk_sp'>sk sp</a><<a href='#SkColorSpace'>SkColorSpace</a>> <a href='#SkColorSpace_MakeSRGBLinear'>MakeSRGBLinear</a>() </pre> --- -<a name="SkColorSpace_gammaCloseToSRGB"></a> +<a name='SkColorSpace_gammaCloseToSRGB'></a> ## gammaCloseToSRGB -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool gammaCloseToSRGB() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkColorSpace_gammaCloseToSRGB'>gammaCloseToSRGB</a>() const </pre> --- -<a name="SkColorSpace_Equals"></a> +<a name='SkColorSpace_Equals'></a> ## Equals -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static bool Equals(const SkColorSpace* src, const SkColorSpace* dst) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static bool <a href='#SkColorSpace_Equals'>Equals</a>(const <a href='#SkColorSpace'>SkColorSpace</a>* src, const <a href='#SkColorSpace'>SkColorSpace</a>* dst) </pre> --- -## <a name="SkTransferFunctionBehavior"></a> Enum SkTransferFunctionBehavior +## <a name='SkTransferFunctionBehavior'>Enum SkTransferFunctionBehavior</a> ### Constants -<table> - <tr> - <td><a name="SkTransferFunctionBehavior_kRespect"> <code><strong>SkTransferFunctionBehavior::kRespect </strong></code> </a></td><td>0</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkTransferFunctionBehavior_kRespect'><code>SkTransferFunctionBehavior::kRespect</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="SkTransferFunctionBehavior_kIgnore"> <code><strong>SkTransferFunctionBehavior::kIgnore </strong></code> </a></td><td>1</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkTransferFunctionBehavior_kIgnore'><code>SkTransferFunctionBehavior::kIgnore</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> +</table> +# <a name='Core_Graphics'>Core Graphics</a> +# <a name='Core_Text'>Core Text</a> -# <a name="Core_Graphics"></a> Core Graphics - -# <a name="Core_Text"></a> Core Text - -# <a name="Create_Color_Space_Xform_Canvas"></a> Create Color Space Xform Canvas +# <a name='Create_Color_Space_Xform_Canvas'>Create Color Space Xform Canvas</a> -<a name="SkCreateColorSpaceXformCanvas"></a> +<a name='SkCreateColorSpaceXformCanvas'></a> ## SkCreateColorSpaceXformCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -std::unique_ptr<SkCanvas> SK_API SkCreateColorSpaceXformCanvas(SkCanvas* target, - sk_sp<SkColorSpace> targetCS) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +std::unique_ptr<<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>> SK_API <a href='#SkCreateColorSpaceXformCanvas'>SkCreateColorSpaceXformCanvas</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* target, + <a href='#sk_sp'>sk sp</a><<a href='#SkColorSpace'>SkColorSpace</a>> targetCS) </pre> --- -# <a name="Curve"></a> Curve +# <a name='Curve'>Curve</a> -# <a name="Data"></a> Data +# <a name='Data'>Data</a> -# <a name="SkData"></a> Class SkData +# <a name='SkData'>Class SkData</a> -# <a name="Debug_Canvas"></a> Debug Canvas +# <a name='Debug_Canvas'>Debug Canvas</a> -# <a name="SkDebugCanvas"></a> Class SkDebugCanvas +# <a name='SkDebugCanvas'>Class SkDebugCanvas</a> -# <a name="Debugging"></a> Debugging +# <a name='Debugging'>Debugging</a> -<a name="SkDebugf"></a> +<a name='SkDebugf'></a> ## SkDebugf -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SK_API void SkDebugf(const char format[], ...) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +SK_API void <a href='#SkDebugf'>SkDebugf</a>(const char format[], ...) </pre> --- -# <a name="Deferred_Display_List"></a> Deferred Display List +# <a name='Deferred_Display_List'>Deferred Display List</a> -# <a name="SkDeferredDisplayList"></a> Class SkDeferredDisplayList +# <a name='SkDeferredDisplayList'>Class SkDeferredDisplayList</a> -## <a name="Recorder"></a> Recorder +## <a name='Recorder'>Recorder</a> -# <a name="SkDeferredDisplayListRecorder"></a> Class SkDeferredDisplayListRecorder +# <a name='SkDeferredDisplayListRecorder'>Class SkDeferredDisplayListRecorder</a> -# <a name="Device"></a> Device +# <a name='Device'>Device</a> -# <a name="SkBaseDevice"></a> Class SkBaseDevice +# <a name='SkBaseDevice'>Class SkBaseDevice</a> -# <a name="Document"></a> Document +# <a name='Document'>Document</a> -# <a name="SkDocument"></a> Class SkDocument +# <a name='SkDocument'>Class SkDocument</a> -<a name="SkDocument_beginPage"></a> +<a name='SkDocument_beginPage'></a> ## beginPage -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas* beginPage(SkScalar width, SkScalar height, const SkRect* content = NULL) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* <a href='#SkDocument_beginPage'>beginPage</a>(<a href='#SkScalar'>SkScalar</a> width, <a href='#SkScalar'>SkScalar</a> height, const <a href='SkRect_Reference#SkRect'>SkRect</a>* content = NULL) </pre> --- -## <a name="PDF"></a> PDF +## <a name='PDF'>PDF</a> -# <a name="Draw_Filter"></a> Draw Filter +# <a name='Draw_Filter'>Draw Filter</a> -# <a name="SkDrawFilter"></a> Class SkDrawFilter +# <a name='SkDrawFilter'>Class SkDrawFilter</a> -# <a name="Draw_Layer"></a> Draw Layer +# <a name='Draw_Layer'>Draw Layer</a> -# <a name="Draw_Looper"></a> Draw Looper +# <a name='Draw_Looper'>Draw Looper</a> -# <a name="SkDrawLooper"></a> Class SkDrawLooper +# <a name='SkDrawLooper'>Class SkDrawLooper</a> -# <a name="Drawable"></a> Drawable +# <a name='Drawable'>Drawable</a> -# <a name="SkDrawable"></a> Class SkDrawable +# <a name='SkDrawable'>Class SkDrawable</a> -<a name="SkDrawable_draw"></a> +<a name='SkDrawable_draw'></a> ## draw -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void draw(SkCanvas*, const SkMatrix* = NULL) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkDrawable_draw'>draw</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>*, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* = NULL) </pre> --- -# <a name="Encoded_Image_Format"></a> Encoded Image Format - -## <a name="SkEncodedImageFormat"></a> Enum SkEncodedImageFormat - -### Constants - -<table> - <tr> - <td><a name="SkEncodedImageFormat_kUnknown"> <code><strong>SkEncodedImageFormat::kUnknown </strong></code> </a></td><td>0</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kBMP"> <code><strong>SkEncodedImageFormat::kBMP </strong></code> </a></td><td>1</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kGIF"> <code><strong>SkEncodedImageFormat::kGIF </strong></code> </a></td><td>2</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kICO"> <code><strong>SkEncodedImageFormat::kICO </strong></code> </a></td><td>3</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kJPEG"> <code><strong>SkEncodedImageFormat::kJPEG </strong></code> </a></td><td>4</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kPNG"> <code><strong>SkEncodedImageFormat::kPNG </strong></code> </a></td><td>5</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kWBMP"> <code><strong>SkEncodedImageFormat::kWBMP </strong></code> </a></td><td>6</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kWEBP"> <code><strong>SkEncodedImageFormat::kWEBP </strong></code> </a></td><td>7</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kPKM"> <code><strong>SkEncodedImageFormat::kPKM </strong></code> </a></td><td>8</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kKTX"> <code><strong>SkEncodedImageFormat::kKTX </strong></code> </a></td><td>9</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kASTC"> <code><strong>SkEncodedImageFormat::kASTC </strong></code> </a></td><td>10</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kDNG"> <code><strong>SkEncodedImageFormat::kDNG </strong></code> </a></td><td>11</td><td></td> - </tr> - <tr> - <td><a name="SkEncodedImageFormat_kHEIF"> <code><strong>SkEncodedImageFormat::kHEIF </strong></code> </a></td><td>12</td><td></td> - </tr> - - - -# <a name="Filter_Quality"></a> Filter Quality +# <a name='Filter_Quality'>Filter Quality</a> -## <a name="SkFilterQuality"></a> Enum SkFilterQuality +## <a name='SkFilterQuality'>Enum SkFilterQuality</a> ### Constants -<table> - <tr> - <td><a name="kNone_SkFilterQuality"> <code><strong>kNone_SkFilterQuality </strong></code> </a></td><td>0</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kNone_SkFilterQuality'><code>kNone_SkFilterQuality</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="kLow_SkFilterQuality"> <code><strong>kLow_SkFilterQuality </strong></code> </a></td><td>1</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kLow_SkFilterQuality'><code>kLow_SkFilterQuality</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> - <tr> - <td><a name="kMedium_SkFilterQuality"> <code><strong>kMedium_SkFilterQuality </strong></code> </a></td><td>2</td><td></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kMedium_SkFilterQuality'><code>kMedium_SkFilterQuality</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="kHigh_SkFilterQuality"> <code><strong>kHigh_SkFilterQuality </strong></code> </a></td><td>3</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='kHigh_SkFilterQuality'><code>kHigh_SkFilterQuality</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> +</table> +## <a name='Nearest_Neighbor'>Nearest Neighbor</a> +## <a name='Bilerp'>Bilerp</a> -## <a name="Nearest_Neighbor"></a> Nearest Neighbor - -## <a name="Bilerp"></a> Bilerp - -## <a name="MipMap"></a> MipMap - -## <a name="BiCubic"></a> BiCubic +## <a name='MipMap'>MipMap</a> -# <a name="Font"></a> Font +## <a name='BiCubic'>BiCubic</a> -## <a name="Advance"></a> Advance +# <a name='Font'>Font</a> -## <a name="Engine"></a> Engine +## <a name='Advance'>Advance</a> -# <a name="Font_Manager"></a> Font Manager +## <a name='Engine'>Engine</a> -# <a name="GPU_Context"></a> GPU Context +# <a name='Font_Manager'>Font Manager</a> -## <a name="Resource_Cache_Limits"></a> Resource Cache Limits +# <a name='GPU_Context'>GPU Context</a> -# <a name="GrContext"></a> Class GrContext +# <a name='GrContext'>Class GrContext</a> -<a name="GrContext_flush"></a> +<a name='GrContext_flush'></a> ## flush -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void flush() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#GrContext_flush'>flush</a>() </pre> --- -# <a name="GPU_Surface"></a> GPU Surface - -# <a name="GPU_Texture"></a> GPU Texture +# <a name='GPU_Surface'>GPU Surface</a> -# <a name="Glyph"></a> Glyph +# <a name='GPU_Texture'>GPU Texture</a> -# <a name="HTML_Canvas"></a> HTML Canvas +# <a name='Glyph'>Glyph</a> -## <a name="ArcTo"></a> ArcTo +# <a name='HTML_Canvas'>HTML Canvas</a> -# <a name="ISize"></a> ISize +## <a name='ArcTo'>ArcTo</a> -# <a name="SkISize"></a> Struct SkISize +# <a name='ISize'>ISize</a> -# <a name="Image_Filter"></a> Image Filter +# <a name='SkISize'>Struct SkISize</a> -## <a name="Scaling"></a> Scaling +# <a name='Image_Filter'>Image Filter</a> -# <a name="SkImageFilter"></a> Class SkImageFilter +# <a name='SkImageFilter'>Class SkImageFilter</a> -<a name="SkImageFilter_toString"></a> +<a name='SkImageFilter_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkImageFilter_toString'>toString</a>(<a href='#SkString'>SkString</a>* str) const </pre> --- -# <a name="Image_Scaling"></a> Image Scaling +# <a name='Image_Scaling'>Image Scaling</a> -# <a name="Left_Side_Bearing"></a> Left Side Bearing +# <a name='Left_Side_Bearing'>Left Side Bearing</a> -# <a name="Line"></a> Line +# <a name='Line'>Line</a> -# <a name="Malloc_Pixel_Ref"></a> Malloc Pixel Ref +# <a name='Mask_Alpha'>Mask Alpha</a> -# <a name="SkMallocPixelRef"></a> Class SkMallocPixelRef - -<a name="SkMallocPixelRef_MakeZeroed"></a> -## MakeZeroed - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkPixelRef> MakeZeroed(const SkImageInfo&, size_t rowBytes) -</pre> +# <a name='Mask_Filter'>Mask Filter</a> ---- - -<a name="SkMallocPixelRef_MakeAllocate"></a> -## MakeAllocate - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkPixelRef> MakeAllocate(const SkImageInfo&, size_t rowBytes) -</pre> - ---- +# <a name='SkMaskFilter'>Class SkMaskFilter</a> -# <a name="Mask_Alpha"></a> Mask Alpha - -# <a name="Mask_Filter"></a> Mask Filter - -# <a name="SkMaskFilter"></a> Class SkMaskFilter - -<a name="SkMaskFilter_toString"></a> +<a name='SkMaskFilter_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const -</pre> - ---- - -# <a name="Math"></a> Math - -<a name="sk_64_isS32"></a> -## sk_64_isS32 - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static inline bool sk_64_isS32(int64_t value) -</pre> - ---- - -<a name="SkIntToScalar"></a> -## SkIntToScalar - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkIntToScalar(x) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkMaskFilter_toString'>toString</a>(<a href='#SkString'>SkString</a>* str) const </pre> --- -<a name="SkScalarRoundToInt"></a> -## SkScalarRoundToInt +# <a name='Meta_Data'>Meta Data</a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarRoundToInt(x) -</pre> +# <a name='SkMetaData'>Class SkMetaData</a> ---- +# <a name='Mip_Map'>Mip Map</a> -<a name="SkScalarFloorToInt"></a> -## SkScalarFloorToInt +# <a name='Nine_Patch'>Nine Patch</a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarFloorToInt(x) -</pre> - ---- +# <a name='OS_X'>OS X</a> -<a name="SkScalarCeilToInt"></a> -## SkScalarCeilToInt +# <a name='Oval'>Oval</a> -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarCeilToInt(x) -</pre> - ---- - -<a name="SkScalarFloorToScalar"></a> -## SkScalarFloorToScalar - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarFloorToScalar(x) -</pre> - ---- - -<a name="SkScalarCeilToScalar"></a> -## SkScalarCeilToScalar - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarCeilToScalar(x) -</pre> - ---- - -<a name="SkScalarIsFinite"></a> -## SkScalarIsFinite - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarIsFinite(x) -</pre> - ---- - -<a name="SkScalarIsNaN"></a> -## SkScalarIsNaN - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkScalarIsNaN(x) -</pre> - ---- - -<a name="SkTFitsIn"></a> -## SkTFitsIn - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -template <typename D, typename S> inline bool SkTFitsIn(S s) -</pre> - ---- - -# <a name="Meta_Data"></a> Meta Data - -# <a name="SkMetaData"></a> Class SkMetaData - -# <a name="Mip_Map"></a> Mip Map - -# <a name="Nine_Patch"></a> Nine Patch - -# <a name="Number_Types"></a> Number Types - -## <a name="Scalar"></a> Scalar +# <a name='Paint_Defaults'>Paint Defaults</a> ### Constants -<table> - <tr> - <td><a name="SK_MinS32FitsInFloat"> <code><strong>SK_MinS32FitsInFloat </strong></code> </a></td><td>to be written</td><td></td> - </tr> - <tr> - <td><a name="SK_MaxS32FitsInFloat"> <code><strong>SK_MaxS32FitsInFloat </strong></code> </a></td><td>to be written</td><td></td> - </tr> - <tr> - <td><a name="SK_ScalarMin"> <code><strong>SK_ScalarMin </strong></code> </a></td><td>to be written</td><td></td> - </tr> - <tr> - <td><a name="SK_ScalarMax"> <code><strong>SK_ScalarMax </strong></code> </a></td><td>to be written</td><td></td> - </tr> - <tr> - <td><a name="SK_ScalarInfinity"> <code><strong>SK_ScalarInfinity </strong></code> </a></td><td>to be written</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaintDefaults_Flags'><code>SkPaintDefaults_Flags</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="SK_ScalarNegativeInfinity"> <code><strong>SK_ScalarNegativeInfinity </strong></code> </a></td><td>to be written</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaintDefaults_Hinting'><code>SkPaintDefaults_Hinting</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> - <tr> - <td><a name="SK_ScalarNaN"> <code><strong>SK_ScalarNaN </strong></code> </a></td><td>to be written</td><td></td> - </tr> - <tr> - <td><a name="SK_MinS32"> <code><strong>SK_MinS32 </strong></code> </a></td><td>to be written</td><td></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaintDefaults_TextSize'><code>SkPaintDefaults_TextSize</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>12</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="SK_MaxS32"> <code><strong>SK_MaxS32 </strong></code> </a></td><td>to be written</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaintDefaults_MiterLimit'><code>SkPaintDefaults_MiterLimit</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> - <tr> - <td><a name="SK_MaxSizeT"> <code><strong>SK_MaxSizeT </strong></code> </a></td><td>to be written</td><td></td> - </tr> -</table> -# <a name="OS_X"></a> OS X -# <a name="Oval"></a> Oval +# <a name='Patch'>Patch</a> -# <a name="Paint_Defaults"></a> Paint Defaults +# <a name='PathOps'>PathOps</a> -### Constants +## <a name='SkPathOp'>Enum SkPathOp</a> -<table> - <tr> - <td><a name="SkPaintDefaults_Flags"> <code><strong>SkPaintDefaults_Flags </strong></code> </a></td><td>0</td><td></td> - </tr> - <tr> - <td><a name="SkPaintDefaults_Hinting"> <code><strong>SkPaintDefaults_Hinting </strong></code> </a></td><td>2</td><td></td> - </tr> - <tr> - <td><a name="SkPaintDefaults_TextSize"> <code><strong>SkPaintDefaults_TextSize </strong></code> </a></td><td>12</td><td></td> - </tr> - <tr> - <td><a name="SkPaintDefaults_MiterLimit"> <code><strong>SkPaintDefaults_MiterLimit </strong></code> </a></td><td>4</td><td></td> - </tr> - -# <a name="Patch"></a> Patch - -# <a name="PathOps"></a> PathOps +</table> -<a name="Op"></a> +<a name='Op'></a> ## Op -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool SK_API Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool SK_API <a href='#Op'>Op</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& one, const <a href='SkPath_Reference#SkPath'>SkPath</a>& two, <a href='#SkPathOp'>SkPathOp</a> op, <a href='SkPath_Reference#SkPath'>SkPath</a>* result) </pre> --- -# <a name="Path_Effect"></a> Path Effect +# <a name='Path_Effect'>Path Effect</a> -# <a name="SkPathEffect"></a> Class SkPathEffect +# <a name='SkPathEffect'>Class SkPathEffect</a> -<a name="SkPathEffect_toString"></a> +<a name='SkPathEffect_toString'></a> ## toString -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void toString(SkString* str) const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPathEffect_toString'>toString</a>(<a href='#SkString'>SkString</a>* str) const </pre> --- -# <a name="Path_Measure"></a> Path Measure - -# <a name="SkPathMeasure"></a> Class SkPathMeasure - -<a name="SkPathMeasure_dump"></a> -## dump - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump() const -</pre> - ---- +# <a name='Picture'>Picture</a> -# <a name="Picture"></a> Picture +# <a name='SkPicture'>Class SkPicture</a> -# <a name="SkPicture"></a> Class SkPicture - -<a name="SkPicture_playback"></a> +<a name='SkPicture_playback'></a> ## playback -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -virtual void playback(SkCanvas*, AbortCallback* = nullptr) const = 0 +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +virtual void <a href='#SkPicture_playback'>playback</a>(<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>*, AbortCallback* = nullptr) const = 0 </pre> --- -## <a name="Recorder"></a> Recorder +## <a name='Recorder'>Recorder</a> -# <a name="SkPictureRecorder"></a> Class SkPictureRecorder +# <a name='SkPictureRecorder'>Class SkPictureRecorder</a> -<a name="SkPictureRecorder_beginRecording"></a> +<a name='SkPictureRecorder_beginRecording'></a> ## beginRecording -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL, +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>* <a href='#SkPictureRecorder_beginRecording'>beginRecording</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& bounds, <a href='#SkBBHFactory'>SkBBHFactory</a>* bbhFactory = NULL, uint32_t recordFlags = 0) </pre> --- -# <a name="Pixel"></a> Pixel +# <a name='Pixel'>Pixel</a> -## <a name="Storage"></a> Storage +## <a name='Storage'>Storage</a> -# <a name="Pixel_Ref"></a> Pixel Ref +# <a name='Pixel_Ref'>Pixel Ref</a> -# <a name="SkPixelRef"></a> Class SkPixelRef +# <a name='SkPixelRef'>Class SkPixelRef</a> -<a name="SkPixelRef_width"></a> +<a name='SkPixelRef_width'></a> ## width -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int width() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPixelRef_width'>width</a>() const </pre> --- -<a name="SkPixelRef_height"></a> +<a name='SkPixelRef_height'></a> ## height -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int height() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +int <a href='#SkPixelRef_height'>height</a>() const </pre> --- -<a name="SkPixelRef_isImmutable"></a> +<a name='SkPixelRef_isImmutable'></a> ## isImmutable -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isImmutable() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#SkPixelRef_isImmutable'>isImmutable</a>() const </pre> --- -<a name="SkPixelRef_setImmutable"></a> +<a name='SkPixelRef_setImmutable'></a> ## setImmutable -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void setImmutable() +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkPixelRef_setImmutable'>setImmutable</a>() </pre> --- -# <a name="Point3"></a> Point3 +# <a name='Point3'>Point3</a> + +# <a name='SkPoint3'>Struct SkPoint3</a> -# <a name="SkPoint3"></a> Struct SkPoint3 +# <a name='PostScript'>PostScript</a> -# <a name="PostScript"></a> PostScript +## <a name='Arct'>Arct</a> -## <a name="Arct"></a> Arct +# <a name='Premultiply'>Premultiply</a> -# <a name="Premultiply"></a> Premultiply +# <a name='RSXform'>RSXform</a> -# <a name="RSXform"></a> RSXform +# <a name='SkRSXform'>Struct SkRSXform</a> -# <a name="SkRSXform"></a> Struct SkRSXform +# <a name='Raster_Bitmap'>Raster Bitmap</a> -# <a name="Raster_Bitmap"></a> Raster Bitmap +# <a name='Raster_Engine'>Raster Engine</a> -# <a name="Raster_Engine"></a> Raster Engine +# <a name='Raster_Handle_Allocator'>Raster Handle Allocator</a> -# <a name="Raster_Handle_Allocator"></a> Raster Handle Allocator +# <a name='SkRasterHandleAllocator'>Class SkRasterHandleAllocator</a> -# <a name="SkRasterHandleAllocator"></a> Class SkRasterHandleAllocator +# <a name='SkRasterHandleAllocator_Handle'>Typedef SkRasterHandleAllocator::Handle</a> -# <a name="SkRasterHandleAllocator_Rec"></a> Struct SkRasterHandleAllocator::Rec +# <a name='SkRasterHandleAllocator_Rec'>Struct SkRasterHandleAllocator::Rec</a> -<a name="SkRasterHandleAllocator_MakeCanvas"></a> +<a name='SkRasterHandleAllocator_MakeCanvas'></a> ## MakeCanvas -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static std::unique_ptr<SkCanvas> MakeCanvas(std::unique_ptr<SkRasterHandleAllocator>, - const SkImageInfo&, const Rec* rec = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static std::unique_ptr<<a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>> <a href='#SkRasterHandleAllocator_MakeCanvas'>MakeCanvas</a>(std::unique_ptr<<a href='#SkRasterHandleAllocator'>SkRasterHandleAllocator</a>>, + const <a href='SkImageInfo_Reference#SkImageInfo'>SkImageInfo</a>&, const <a href='#SkRasterHandleAllocator_Rec'>Rec</a>* rec = nullptr) </pre> --- -# <a name="Raster_Surface"></a> Raster Surface - -# <a name="Rasterizer"></a> Rasterizer - -# <a name="SkRasterizer"></a> Class SkRasterizer - -## <a name="Layer"></a> Layer - -# <a name="Read_Buffer"></a> Read Buffer - -# <a name="SkReadBuffer"></a> Struct SkReadBuffer +# <a name='Raster_Surface'>Raster Surface</a> -# <a name="Reference_Count"></a> Reference Count +# <a name='Reference_Count'>Reference Count</a> -# <a name="SkRefCnt"></a> Class SkRefCnt +# <a name='SkRefCnt'>Class SkRefCnt</a> -# <a name="sk_sp"></a> Class sk_sp +# <a name='sk_sp'>Class sk_sp</a> -# <a name="Region"></a> Region +# <a name='Region'>Region</a> -# <a name="SkRegion"></a> Class SkRegion +# <a name='SkRegion'>Class SkRegion</a> -# <a name="RenderTarget"></a> RenderTarget +# <a name='RenderTarget'>RenderTarget</a> -# <a name="GrBackendRenderTarget"></a> Class GrBackendRenderTarget +# <a name='GrBackendRenderTarget'>Class GrBackendRenderTarget</a> -<a name="GrBackendRenderTarget_isValid"></a> +<a name='GrBackendRenderTarget_isValid'></a> ## isValid -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isValid() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#GrBackendRenderTarget_isValid'>isValid</a>() const </pre> --- -# <a name="Render_Target"></a> Render Target +# <a name='Render_Target'>Render Target</a> -# <a name="GrRenderTarget"></a> Class GrRenderTarget +# <a name='GrRenderTarget'>Class GrRenderTarget</a> -# <a name="Right_Side_Bearing"></a> Right Side Bearing +# <a name='Right_Side_Bearing'>Right Side Bearing</a> -# <a name="Round_Rect"></a> Round Rect +# <a name='Round_Rect'>Round Rect</a> -# <a name="SkRRect"></a> Class SkRRect +# <a name='SkRRect'>Class SkRRect</a> -<a name="SkRRect_dump"></a> +<a name='SkRRect_dump'></a> ## dump -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dump() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRRect_dump'>dump</a>() const </pre> --- -<a name="SkRRect_dumpHex"></a> +<a name='SkRRect_dumpHex'></a> ## dumpHex -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -void dumpHex() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +void <a href='#SkRRect_dumpHex'>dumpHex</a>() const </pre> --- -# <a name="SVG"></a> SVG +# <a name='SVG'>SVG</a> -## <a name="Canvas"></a> Canvas +## <a name='Canvas'>Canvas</a> -## <a name="Arc"></a> Arc +## <a name='Arc'>Arc</a> -# <a name="Shader"></a> Shader +# <a name='Scalar'>Scalar</a> -# <a name="SkShader"></a> Class SkShader +# <a name='SkScalar'>Typedef SkScalar</a> -## <a name="SkShader_TileMode"></a> Enum SkShader::TileMode +# <a name='Shader'>Shader</a> + +# <a name='SkShader'>Class SkShader</a> + +## <a name='SkShader_TileMode'>Enum SkShader::TileMode</a> ### Constants -<table> - <tr> - <td><a name="SkShader_kClamp_TileMode"> <code><strong>SkShader::kClamp_TileMode </strong></code> </a></td><td>0</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkShader_kClamp_TileMode'><code>SkShader::kClamp_TileMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> <tr> - <td><a name="SkShader_kRepeat_TileMode"> <code><strong>SkShader::kRepeat_TileMode </strong></code> </a></td><td>1</td><td></td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkShader_kRepeat_TileMode'><code>SkShader::kRepeat_TileMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> - <tr> - <td><a name="SkShader_kMirror_TileMode"> <code><strong>SkShader::kMirror_TileMode </strong></code> </a></td><td>2</td><td></td> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkShader_kMirror_TileMode'><code>SkShader::kMirror_TileMode</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> +</table> - - -<a name="SkShader_MakeBitmapShader"></a> +<a name='SkShader_MakeBitmapShader'></a> ## MakeBitmapShader -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -static sk_sp<SkShader> MakeBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy, - const SkMatrix* localMatrix = nullptr) +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +static <a href='#sk_sp'>sk sp</a><<a href='#SkShader'>SkShader</a>> <a href='#SkShader_MakeBitmapShader'>MakeBitmapShader</a>(const <a href='SkBitmap_Reference#SkBitmap'>SkBitmap</a>& src, <a href='#SkShader_TileMode'>TileMode</a> tmx, <a href='#SkShader_TileMode'>TileMode</a> tmy, + const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* localMatrix = nullptr) </pre> --- -## <a name="Gradient"></a> Gradient - -# <a name="Size"></a> Size +# <a name='Size'>Size</a> -# <a name="SkSize"></a> Struct SkSize +# <a name='SkSize'>Struct SkSize</a> -# <a name="Sprite"></a> Sprite +# <a name='Sprite'>Sprite</a> -# <a name="Stream"></a> Stream +# <a name='Stream'>Stream</a> -# <a name="SkStream"></a> Class SkStream +# <a name='SkWStream'>Class SkWStream</a> -# <a name="String"></a> String +# <a name='String'>String</a> -# <a name="SkString"></a> Class SkString +# <a name='SkString'>Class SkString</a> -# <a name="Supersampling"></a> Supersampling +# <a name='Supersampling'>Supersampling</a> -# <a name="Surface_Characterization"></a> Surface Characterization +# <a name='Surface_Characterization'>Surface Characterization</a> -# <a name="SkSurfaceCharacterization"></a> Class SkSurfaceCharacterization +# <a name='SkSurfaceCharacterization'>Class SkSurfaceCharacterization</a> -# <a name="Surface_Properties"></a> Surface Properties +# <a name='Surface_Properties'>Surface Properties</a> -# <a name="SkSurfaceProps"></a> Class SkSurfaceProps +# <a name='SkSurfaceProps'>Class SkSurfaceProps</a> -## <a name="Legacy_Font_Host"></a> Legacy Font Host +## <a name='Legacy_Font_Host'>Legacy Font Host</a> -## <a name="SkSurfaceProps_InitType"></a> Enum SkSurfaceProps::InitType +## <a name='SkSurfaceProps_InitType'>Enum SkSurfaceProps::InitType</a> ### Constants -<table> - <tr> - <td><a name="SkSurfaceProps_kLegacyFontHost_InitType"> <code><strong>SkSurfaceProps::kLegacyFontHost_InitType </strong></code> </a></td><td>0</td><td></td> +<table style='border-collapse: collapse; width: 62.5em'> + <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> +<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> +<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> + <tr style='background-color: #f0f0f0; '> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkSurfaceProps_kLegacyFontHost_InitType'><code>SkSurfaceProps::kLegacyFontHost_InitType</code></a></td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> +</td> </tr> +</table> # Topic -# <a name="Text"></a> Text +# <a name='Text'>Text</a> -# <a name="Text_Blob"></a> Text Blob +# <a name='Text_Blob'>Text Blob</a> -# <a name="SkTextBlob"></a> Class SkTextBlob +# <a name='SkTextBlob'>Class SkTextBlob</a> -# <a name="Texture"></a> Texture +# <a name='Texture'>Texture</a> -# <a name="GrBackendTexture"></a> Class GrBackendTexture +# <a name='GrBackendTexture'>Class GrBackendTexture</a> -<a name="GrBackendTexture_isValid"></a> +<a name='GrBackendTexture_isValid'></a> ## isValid -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool isValid() const +<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> +bool <a href='#GrBackendTexture_isValid'>isValid</a>() const </pre> --- -# <a name="Transfer_Mode"></a> Transfer Mode - -# <a name="Typeface"></a> Typeface - -# <a name="SkTypeface"></a> Class SkTypeface - -# <a name="Types"></a> Types - -## <a name="GrSurfaceOrigin"></a> Enum GrSurfaceOrigin - -### Constants - -<table> - <tr> - <td><a name="kBottomLeft_GrSurfaceOrigin"> <code><strong>kBottomLeft_GrSurfaceOrigin </strong></code> </a></td><td>0 </td><td></td> - </tr> - <tr> - <td><a name="kTopLeft_GrSurfaceOrigin"> <code><strong>kTopLeft_GrSurfaceOrigin </strong></code> </a></td><td>1</td><td></td> - </tr> - - - -## <a name="Budgeted"></a> Budgeted - -## <a name="SkBudgeted"></a> Enum SkBudgeted - -### Constants - -<table> - <tr> - <td><a name="SkBudgeted_kNo"> <code><strong>SkBudgeted::kNo </strong></code> </a></td><td>0</td><td></td> - </tr> - <tr> - <td><a name="SkBudgeted_kYes"> <code><strong>SkBudgeted::kYes </strong></code> </a></td><td>1</td><td></td> - </tr> - - - -## <a name="GrSemaphoresSubmitted"></a> Enum GrSemaphoresSubmitted - -### Constants - -<table> - <tr> - <td><a name="GrSemaphoresSubmitted_kNo"> <code><strong>GrSemaphoresSubmitted::kNo </strong></code> </a></td><td>0</td><td></td> - </tr> - <tr> - <td><a name="GrSemaphoresSubmitted_kYes"> <code><strong>GrSemaphoresSubmitted::kYes </strong></code> </a></td><td>1</td><td></td> - </tr> +# <a name='Transfer_Mode'>Transfer Mode</a> +# <a name='Typeface'>Typeface</a> +# <a name='SkTypeface'>Class SkTypeface</a> -# <a name="Unpremultiply"></a> Unpremultiply +# <a name='Unpremultiply'>Unpremultiply</a> -# <a name="Vertices"></a> Vertices +# <a name='Vertices'>Vertices</a> -## <a name="Colors"></a> Colors +# <a name='SkVertices'>Class SkVertices</a> -## <a name="Texs"></a> Texs +## <a name='Colors'>Colors</a> -# <a name="Write_Buffer"></a> Write Buffer +## <a name='Texs'>Texs</a> -# <a name="SkWriteBuffer"></a> Struct SkWriteBuffer diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md index f622daf6e1..004361a2dc 100644 --- a/site/user/api/usingBookmaker.md +++ b/site/user/api/usingBookmaker.md @@ -1,18 +1,18 @@ usingBookmaker === -# <a name="Bookmaker"></a> Bookmaker -How to use the <a href="#Bookmaker">Bookmaker</a> utility. +# <a name='Bookmaker'>Bookmaker</a> +How to use the <a href='#Bookmaker'>Bookmaker</a> utility. -## <a name="Broken_Build"></a> Broken Build +## <a name='Broken_Build'>Broken Build</a> -If the <a href="https://status.skia.org/repo/skia?filter=search&search_value=Housekeeper-PerCommit-Bookmaker">Housekeeper-PerCommit-Bookmaker</a> bot is red, the bot has detected that the files in docs and include/core differ. +If the <a href='https://status.skia.org/repo/skia?filter=search&search_value=Housekeeper-PerCommit-Bookmaker'>Housekeeper-PerCommit-Bookmaker</a></a> bot is red, the bot has detected that the files in docs and include/core differ. The bot output describes what changed. To fix this, edit the docs file corresponding to the changed include file. -For instance, if the change was made to <a href="SkIRect_Reference#SkIRect">SkIRect</a>, edit docs/SkIRect_Reference.bmh. +For instance, if the change was made to <a href='SkIRect_Reference#SkIRect'>SkIRect</a>, edit docs/SkIRect_Reference.bmh. Checking in the edited docs/SkIRect_Reference.bmh will fix the bot. If the interface is deprecated, but still present in the interface, mark-up the @@ -32,28 +32,32 @@ Use if the change is soon to be deprecated. -To regenerate the documentation, follow the <a href="#Installing">Installing</a> and <a href="#Regenerate">Regenerate</a> steps below. +To regenerate the documentation, follow the <a href='#Installing'>Installing</a> and <a href='#Regenerate'>Regenerate</a> steps below. -If the <a href="https://status.skia.org/repo/skia?filter=search&search_value=Housekeeper-Nightly-Bookmaker">Housekeeper-Nightly-Bookmaker</a> bot is red, one of several things may have gone wrong: +If the <a href='https://status.skia.org/repo/skia?filter=search&search_value=Housekeeper-Nightly-Bookmaker'>Housekeeper-Nightly-Bookmaker</a></a> bot is red, one of several things may have gone wrong: <table> <tr> - <td>A change to include broke documentation examples.</td> </tr> <tr> - <td>Something changed the examples that output text.</td> </tr> <tr> - <td>Some interface was added, deleted, edited.</td> </tr> <tr> - <td>Documentation is malformed.</td> </tr> + <td>A change to include broke documentation examples.</td> + </tr> <tr> + <td>Something changed the examples that output text.</td> + </tr> <tr> + <td>Some interface was added, deleted, edited.</td> + </tr> <tr> + <td>Documentation is malformed.</td> + </tr> </table> The bot output describes what changed, and includes the file and line where the error occurred. -To regenerate the documentation, follow the <a href="#Installing">Installing</a> and <a href="#Regenerate">Regenerate</a> steps below. +To regenerate the documentation, follow the <a href='#Installing'>Installing</a> and <a href='#Regenerate'>Regenerate</a> steps below. -## <a name="Editing_Comments"></a> Editing Comments +## <a name='Editing_Comments'>Editing Comments</a> Edit docs instead of include/core files to update comments if possible. -The <a href="#Bookmaker">Bookmaker</a> bots do not complain if the docs file does not match the -corresponding include comments. Running <a href="#Bookmaker">Bookmaker</a> include generation will +The <a href='#Bookmaker'>Bookmaker</a> bots do not complain if the docs file does not match the +corresponding include comments. Running <a href='#Bookmaker'>Bookmaker</a> include generation will report when docs and includes comments do not match. For instance, if include/core/SkSurface.h comments do not match @@ -66,16 +70,16 @@ $ ./out/dir/bookmaker -b docs -i include/core/SkSurface.h -p generates <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -wrote updated <a href="SkSurface_Reference#SkSurface">SkSurface</a>.h +wrote updated <a href='SkSurface_Reference#SkSurface'>SkSurface</a>.h </pre> The updated SkSurface.h is written to the root to avoid subsequent runs of -<a href="#Bookmaker">Bookmaker</a> from recompiling. if SkSurface.h was not changed, it is not written, -and <a href="#Bookmaker">Bookmaker</a> will not generate any output. +<a href='#Bookmaker'>Bookmaker</a> from recompiling. if SkSurface.h was not changed, it is not written, +and <a href='#Bookmaker'>Bookmaker</a> will not generate any output. -## <a name="Broken_Example"></a> Broken Example +## <a name='Broken_Example'>Broken Example</a> -An example may cause <a href="#Bookmaker">Bookmaker</a> or a bot running <a href="#Bookmaker">Bookmaker</a> to fail if it can't +An example may cause <a href='#Bookmaker'>Bookmaker</a> or a bot running <a href='#Bookmaker'>Bookmaker</a> to fail if it can't be compiled by fiddle. If the example cannot be fixed, it can be commented out by changing @@ -93,9 +97,9 @@ to The disabled example can contain additional markup, which will be ignored. -## <a name="Installing"></a> Installing +## <a name='Installing'>Installing</a> -Install <a href="https://golang.org/doc/install">Go</a> if needed. +Install <a href='https://golang.org/doc/install'>Go</a></a> if needed. Get the fiddle command line interface tool. By default this will appear in your home directory. @@ -103,13 +107,13 @@ By default this will appear in your home directory. $ go get go.skia.org/infra/fiddle/go/fiddlecli </pre> -Build <a href="#Bookmaker">Bookmaker</a>. +Build <a href='#Bookmaker'>Bookmaker</a>. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> $ ninja -C out/dir bookmaker </pre> -## <a name="Regenerate"></a> Regenerate +## <a name='Regenerate'>Regenerate</a> Complete rebuilding of all bookmaker output looks like: @@ -121,9 +125,9 @@ $ ./out/skia/bookmaker -a docs/status.json -x $ ./out/skia/bookmaker -a docs/status.json -p </pre> -## <a name="New_Documentation"></a> New Documentation +## <a name='New_Documentation'>New Documentation</a> -Generate an starter <a href="#Bookmaker">Bookmaker</a> file from an existing include. +Generate an starter <a href='#Bookmaker'>Bookmaker</a> file from an existing include. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> $ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs @@ -132,7 +136,7 @@ $ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs If a method or function has an unnamed parameter, bookmaker generates an error: <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -C:/puregit/include/core/<a href="SkPixmap_Reference#SkPixmap">SkPixmap</a>.h(208): error: #Method missing param name +C:/puregit/include/core/<a href='SkPixmap_Reference#SkPixmap'>SkPixmap</a>.h(208): error: #Method missing param name bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const ^ </pre> @@ -156,7 +160,7 @@ docs/SkXXX_Reference.bmh . -## <a name="Style"></a> Style +## <a name='Style'>Style</a> Documentation consists of cross references, descriptions, and examples. All structs, classes, enums, their members and methods, functions, and so on, @@ -203,12 +207,12 @@ After editing is complete, searching for "" should fail, assuming "" is not the perfect word to use in a description or example! -## <a name="Adding_Documentation"></a> Adding Documentation +## <a name='Adding_Documentation'>Adding Documentation</a> Generate fiddle.json from all examples, including the ones you just wrote. Error checking is syntatic: starting keywords are closed, keywords have the correct parents. -If you run <a href="#Bookmaker">Bookmaker</a> inside Visual_Studio, you can click on errors and it +If you run <a href='#Bookmaker'>Bookmaker</a> inside Visual_Studio, you can click on errors and it will take you to the source line in question. <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> @@ -255,7 +259,7 @@ If the new file has been added to status.json, you can run any of the above commands with -a docs/status.json in place of -b docs or -i includes. -## <a name="Bugs"></a> Bugs +## <a name='Bugs'>Bugs</a> -<a href="#Bookmaker">Bookmaker</a> bugs are tracked <a href="bug.skia.org/6898">here</a> . +<a href='#Bookmaker'>Bookmaker</a> bugs are tracked <a href='https://bug.skia.org/6898'>here</a></a> . diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp index 49e347e6ea..aaf3781974 100644 --- a/tools/bookmaker/bookmaker.cpp +++ b/tools/bookmaker/bookmaker.cpp @@ -29,18 +29,14 @@ DEFINE_string2(spellcheck, s, "", "Spell-check [once, all, mispelling]. (Require DEFINE_bool2(tokens, t, false, "Write bmh from include. (Requires -b -i)"); DEFINE_bool2(crosscheck, x, false, "Check bmh against includes. (Requires -b -i)"); // v is reserved for verbose +DEFINE_bool2(validate, V, false, "Validate that all anchor references have definitions. (Requires -r)"); DEFINE_bool2(skip, z, false, "Skip degenerate missed in legacy preprocessor."); -/* recipe for generating timestamps for existing doxygen comments -find include/core -type f -name '*.h' -print -exec git blame {} \; > ~/all.blame.txt +/* todos: + +add new markup to associate enum SaveLayerFlagsSet with typedef SaveLayerFlags, if needed. -todos: -add new markup to associate typedef SaveLayerFlags with Enum so that, for - documentation purposes, this enum is named rather than anonymous -check column 1 of subtopic tables to see that they start lowercase and don't have a trailing period -space table better for Constants should Return be on same line as 'Return Value'? -remove anonymous header, e.g. Enum SkPaint::::anonymous_2 #Member lost all formatting #List needs '# content ##', formatting consts like enum members need fully qualfied refs to make a valid link @@ -53,6 +49,45 @@ deprecated methods should be sorted down in md out, and show include "Deprecated rewrap text to fit in some number of columns #Literal is inflexible, making the entire #Code block link-less (see $Literal in SkImageInfo) would rather keep links for boby above #Literal, and/or make it a block and not a one-liner +add check to require #Const to contain #Code block if defining const or constexpr (enum consts have + #Code blocks inside the #Enum def +add spelling rule to look for x-bit but allow x bits + +There are a number of formatting bugs with ad hoc patches where a substitution doesn't keep +the space before or after, or the linefeeds before or after. The rules are not very good either. +Linefeeds in the bmh file are intended to be respected, but #Formula tends to start on a new line +even if the contents is intended to be inlined. Probably need to require it to be, e.g.: + + array length must be #Formula # (fXCount + 1) * (fYCount + 1) ##. + +where there is always a space between prior words and formula (i.e., between "be" and "(fXCount"; +and, an absense of a space after ## denotes no space between "+ 1)" and ".". These rules preserve +that # commands are always preceded by a whitespace character. Similarly, #PhraseDef/Ref +need to be inline or create new paragraphs. #phrase_ref# is sufficiently flexible that it can be +treated as a word without trailing whitespace, adapting the whitespace of its context. It also must +always have leading whitespace. + +It's awkward that phrase param is a child of the phrase def. Since phrase refs may also be children, +there is special case code to skip phrase def when looking for additional substitutions in the +phrase def. Could put it in the token list instead I guess, or make a definition subclass used +by phrase def with an additional slot... + + + +#Deprecated soon +## +should emit the text "To be deprecated soon." (right now you get just "soon") + +SkCanvas_ColorBehavior_kLegacy missing </table> in md out + +rearrange const out for md so that const / value / short description comes first in a table, +followed by more elaborate descriptions, examples, seealso. In md.cpp, look to see if #Subtopic +has #Const children. If so, generate a summary table first. +Or, only allow #Line and moderate text description in #Const. Put more verbose text, example, +seealso, in subsequent #SubTopic. Alpha_Type does this and it looks good. + +more spelling: x-value y-value + see head of selfCheck.cpp for additional todos */ @@ -67,6 +102,8 @@ see head of selfCheck.cpp for additional todos #define M(mt) (1LL << (int) MarkType::k##mt) #define M_D M(Description) #define M_CS M(Class) | M(Struct) +#define M_MD M(Method) | M(Define) +#define M_MDCM M_MD | M(Const) | M(Member) #define M_ST M(Subtopic) | M(Topic) #define M_CSST M_CS | M_ST #ifdef M_E @@ -84,35 +121,35 @@ see head of selfCheck.cpp for additional todos #define E_N Exemplary::kNo #define E_O Exemplary::kOptional +// ToDo: add column to denote which marks are one-liners BmhParser::MarkProps BmhParser::kMarkProps[] = { // names without formal definitions (e.g. Column) aren't included -// fill in other names once they're actually used { "", MarkType::kNone, R_Y, E_N, 0 } , { "A", MarkType::kAnchor, R_N, E_N, 0 } -, { "Alias", MarkType::kAlias, R_N, E_N, 0 } -, { "Bug", MarkType::kBug, R_N, E_N, 0 } -, { "Class", MarkType::kClass, R_Y, E_O, M_CSST | M(Root) } -, { "Code", MarkType::kCode, R_F, E_N, M_CSST | M_E | M(Method) | M(Define) | M(Typedef) } +, { "Alias", MarkType::kAlias, R_N, E_N, M_ST | M(Const) } +, { "Bug", MarkType::kBug, R_N, E_N, M_CSST | M_MDCM | M_E + | M(Example) | M(NoExample) } +, { "Class", MarkType::kClass, R_Y, E_O, M_CSST } +, { "Code", MarkType::kCode, R_F, E_N, M_CSST | M_E | M_MD | M(Typedef) } , { "", MarkType::kColumn, R_Y, E_N, M(Row) } , { "", MarkType::kComment, R_N, E_N, 0 } , { "Const", MarkType::kConst, R_Y, E_O, M_E | M_ST } , { "Define", MarkType::kDefine, R_O, E_Y, M_ST } , { "DefinedBy", MarkType::kDefinedBy, R_N, E_N, M(Method) } -, { "Deprecated", MarkType::kDeprecated, R_Y, E_N, 0 } +, { "Deprecated", MarkType::kDeprecated, R_Y, E_N, M_CS | M_MDCM | M_E } , { "Description", MarkType::kDescription, R_Y, E_N, M(Example) | M(NoExample) } -, { "Doxygen", MarkType::kDoxygen, R_Y, E_N, 0 } +, { "Details", MarkType::kDetails, R_N, E_N, M(Const) } , { "Duration", MarkType::kDuration, R_N, E_N, M(Example) | M(NoExample) } -, { "Enum", MarkType::kEnum, R_Y, E_O, M_CSST | M(Root) } -, { "EnumClass", MarkType::kEnumClass, R_Y, E_O, M_CSST | M(Root) } -, { "Example", MarkType::kExample, R_O, E_N, M_CSST | M_E | M(Method) | M(Const) | M(Define) } -, { "Experimental", MarkType::kExperimental, R_Y, E_N, 0 } -, { "External", MarkType::kExternal, R_Y, E_N, M(Root) } -, { "File", MarkType::kFile, R_N, E_N, M(Track) } -, { "Formula", MarkType::kFormula, R_F, E_N, - M(Column) | M_E | M_ST | M(Member) | M(Method) | M_D } +, { "Enum", MarkType::kEnum, R_Y, E_O, M_CSST } +, { "EnumClass", MarkType::kEnumClass, R_Y, E_O, M_CSST } +, { "Example", MarkType::kExample, R_O, E_N, M_CSST | M_E | M_MD } +, { "Experimental", MarkType::kExperimental, R_Y, E_N, M_CS | M_MDCM | M_E } +, { "External", MarkType::kExternal, R_Y, E_N, 0 } +, { "Formula", MarkType::kFormula, R_F, E_N, M(Column) | M(Description) + | M_E | M_ST | M_MDCM } , { "Function", MarkType::kFunction, R_O, E_N, M(Example) | M(NoExample) } , { "Height", MarkType::kHeight, R_N, E_N, M(Example) | M(NoExample) } -, { "Illustration", MarkType::kIllustration, R_N, E_N, M(Subtopic) } +, { "Illustration", MarkType::kIllustration, R_N, E_N, M_CSST | M_MD } , { "Image", MarkType::kImage, R_N, E_N, M(Example) | M(NoExample) } , { "In", MarkType::kIn, R_N, E_N, M_CSST | M_E | M(Method) | M(Typedef) } , { "Legend", MarkType::kLegend, R_Y, E_N, M(Table) } @@ -123,32 +160,31 @@ BmhParser::MarkProps BmhParser::kMarkProps[] = { , { "", MarkType::kMarkChar, R_N, E_N, 0 } , { "Member", MarkType::kMember, R_Y, E_N, M_CSST } , { "Method", MarkType::kMethod, R_Y, E_Y, M_CSST } -, { "NoExample", MarkType::kNoExample, R_N, E_N, M_CSST | M_E | M(Method) | M(Const) | M(Define) } +, { "NoExample", MarkType::kNoExample, R_N, E_N, M_CSST | M_E | M_MD } +, { "NoJustify", MarkType::kNoJustify, R_N, E_N, M(Const) | M(Member) } , { "Outdent", MarkType::kOutdent, R_N, E_N, M(Code) } , { "Param", MarkType::kParam, R_Y, E_N, M(Method) | M(Define) } , { "PhraseDef", MarkType::kPhraseDef, R_Y, E_N, M(Subtopic) } -, { "", MarkType::kPhraseRef, R_Y, E_N, 0 } +, { "", MarkType::kPhraseParam, R_Y, E_N, 0 } +, { "", MarkType::kPhraseRef, R_N, E_N, 0 } , { "Platform", MarkType::kPlatform, R_N, E_N, M(Example) | M(NoExample) } , { "Populate", MarkType::kPopulate, R_N, E_N, M(Subtopic) } -, { "Private", MarkType::kPrivate, R_N, E_N, 0 } +, { "Private", MarkType::kPrivate, R_Y, E_N, M_CSST | M_MDCM | M_E } , { "Return", MarkType::kReturn, R_Y, E_N, M(Method) } -, { "", MarkType::kRoot, R_Y, E_N, 0 } , { "", MarkType::kRow, R_Y, E_N, M(Table) | M(List) } -, { "SeeAlso", MarkType::kSeeAlso, R_C, E_N, M_CSST | M_E | M(Method) | M(Define) | M(Typedef) } +, { "SeeAlso", MarkType::kSeeAlso, R_C, E_N, M_CSST | M_E | M_MD | M(Typedef) } , { "Set", MarkType::kSet, R_N, E_N, M(Example) | M(NoExample) } , { "StdOut", MarkType::kStdOut, R_N, E_N, M(Example) | M(NoExample) } -, { "Struct", MarkType::kStruct, R_Y, E_O, M(Class) | M(Root) | M_ST } +, { "Struct", MarkType::kStruct, R_Y, E_O, M(Class) | M_ST } , { "Substitute", MarkType::kSubstitute, R_N, E_N, M_ST } , { "Subtopic", MarkType::kSubtopic, R_Y, E_Y, M_CSST } , { "Table", MarkType::kTable, R_Y, E_N, M(Method) | M_CSST | M_E } -, { "Template", MarkType::kTemplate, R_Y, E_N, 0 } +, { "Template", MarkType::kTemplate, R_Y, E_N, M_CSST } , { "", MarkType::kText, R_N, E_N, 0 } -, { "Time", MarkType::kTime, R_Y, E_N, M(Track) } , { "ToDo", MarkType::kToDo, R_N, E_N, 0 } -, { "Topic", MarkType::kTopic, R_Y, E_Y, M_CS | M(Root) | M(Topic) } -, { "Track", MarkType::kTrack, R_Y, E_N, M_E | M_ST } -, { "Typedef", MarkType::kTypedef, R_Y, E_N, M(Class) | M_ST } -, { "", MarkType::kUnion, R_Y, E_N, 0 } +, { "Topic", MarkType::kTopic, R_Y, E_Y, 0 } +, { "Typedef", MarkType::kTypedef, R_Y, E_N, M_CSST | M_E } +, { "Union", MarkType::kUnion, R_Y, E_N, M_CSST } , { "Volatile", MarkType::kVolatile, R_N, E_N, M(StdOut) } , { "Width", MarkType::kWidth, R_N, E_N, M(Example) | M(NoExample) } }; @@ -163,6 +199,7 @@ BmhParser::MarkProps BmhParser::kMarkProps[] = { #undef M_CSST #undef M_ST #undef M_CS +#undef M_MCD #undef M_D #undef M @@ -438,18 +475,46 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy fParent->fChildren.push_back(definition); } break; + } else if (MarkType::kPhraseDef == markType) { + bool hasParams = '(' == this->next(); + fMarkup.emplace_front(markType, defStart, fLineCount, fParent, fMC); + definition = &fMarkup.front(); + definition->fName = typeNameBuilder[0]; + definition->fFiddle = fParent->fFiddle; + definition->fContentStart = fChar; + if (hasParams) { + char lastChar; + do { + const char* subEnd = this->anyOf(",)\n"); + if (!subEnd || '\n' == *subEnd) { + return this->reportError<bool>("unexpected phrase list end"); + } + fMarkup.emplace_front(MarkType::kPhraseParam, fChar, fLineCount, fParent, + fMC); + Definition* phraseParam = &fMarkup.front(); + phraseParam->fContentStart = fChar; + phraseParam->fContentEnd = subEnd; + phraseParam->fName = string(fChar, subEnd - fChar); + definition->fChildren.push_back(phraseParam); + this->skipTo(subEnd); + lastChar = this->next(); + phraseParam->fTerminator = fChar; + } while (')' != lastChar); + this->skipWhiteSpace(); + definition->fContentStart = fChar; + } + this->setAsParent(definition); + break; } // not one-liners case MarkType::kCode: case MarkType::kExample: - case MarkType::kExperimental: case MarkType::kFormula: case MarkType::kFunction: case MarkType::kLegend: case MarkType::kList: case MarkType::kPrivate: case MarkType::kTable: - case MarkType::kTrack: if (hasEnd) { definition = fParent; if (markType != fParent->fMarkType) { @@ -502,21 +567,22 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy case MarkType::kAnchor: case MarkType::kBug: case MarkType::kDeprecated: + case MarkType::kDetails: case MarkType::kDuration: - case MarkType::kFile: + case MarkType::kExperimental: case MarkType::kHeight: case MarkType::kIllustration: case MarkType::kImage: case MarkType::kIn: case MarkType::kLine: case MarkType::kLiteral: + case MarkType::kNoJustify: case MarkType::kOutdent: case MarkType::kPlatform: case MarkType::kPopulate: case MarkType::kSeeAlso: case MarkType::kSet: case MarkType::kSubstitute: - case MarkType::kTime: case MarkType::kVolatile: case MarkType::kWidth: // todo : add check disallowing children? @@ -569,16 +635,37 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy } fMarkup.emplace_front(MarkType::kText, start, fLineCount, definition, fMC); Definition* text = &fMarkup.front(); + if (!islower(start[0]) && (!isdigit(start[0]) + || MarkType::kConst != definition->fParent->fMarkType)) { + return this->reportError<bool>("expect lower case start"); + } + string contents = string(start, end - start); + if (string::npos != contents.find('.')) { + return this->reportError<bool>("expect phrase, not sentence"); + } + size_t firstSpace = contents.find(' '); + if (string::npos == firstSpace || 0 == firstSpace || 's' != start[firstSpace - 1]) { + if (MarkType::kMethod == fParent->fMarkType && "experimental" != contents + && "incomplete" != contents) { + return this->reportError<bool>( "expect phrase in third person present" + " tense (1st word should end in 's'"); + } + } text->fContentStart = start; text->fContentEnd = end; text->fTerminator = fChar; definition->fContentEnd = text->fContentEnd; definition->fTerminator = fChar; definition->fChildren.emplace_back(text); - } else if (MarkType::kDeprecated == markType) { + } else if (IncompleteAllowed(markType)) { this->skipSpace(); fParent->fDeprecated = true; - fParent->fToBeDeprecated = this->skipExact("soon"); + fParent->fDetails = + this->skipExact("soon") ? Definition::Details::kSoonToBe_Deprecated : + this->skipExact("testing") ? Definition::Details::kTestingOnly_Experiment : + this->skipExact("do not use") ? Definition::Details::kDoNotUse_Experiement : + this->skipExact("not ready") ? Definition::Details::kNotReady_Experiment : + Definition::Details::kNone; this->skipSpace(); if ('\n' != this->peek()) { return this->reportError<bool>("unexpected text after #Deprecated"); @@ -1210,8 +1297,8 @@ bool BmhParser::findDefinitions() { const char* defStart = fChar - 1; MarkType markType = this->getMarkType(MarkLookup::kRequire); bool hasEnd = this->hasEndToken(); - if (!hasEnd) { - MarkType parentType = fParent ? fParent->fMarkType : MarkType::kRoot; + if (!hasEnd && fParent) { + MarkType parentType = fParent->fMarkType; uint64_t parentMask = kMarkProps[(int) markType].fParentMask; if (parentMask && !(parentMask & (1LL << (int) parentType))) { return this->reportError<bool>("invalid parent"); @@ -1298,8 +1385,24 @@ bool BmhParser::findDefinitions() { const char* phraseNameStart = fChar; this->skipPhraseName(); string phraseKey = string(phraseNameStart, fChar - phraseNameStart); - if (fMC != this->next()) { - return this->reportError<bool>("expect # after phrase-name"); + char delimiter = this->next(); + vector<string> params; + vector<const char*> paramsLoc; + if (fMC != delimiter) { + if ('(' != delimiter) { + return this->reportError<bool>("expect # after phrase name"); + } + // phrase may take comma delimited parameter list + do { + const char* subEnd = this->anyOf(",)\n"); + if (!subEnd || '\n' == *subEnd) { + return this->reportError<bool>("unexpected phrase list end"); + } + params.push_back(string(fChar, subEnd - fChar)); + paramsLoc.push_back(fChar); + this->skipTo(subEnd); + + } while (')' != this->next()); } const char* start = phraseNameStart; SkASSERT('#' == start[-1]); @@ -1309,12 +1412,24 @@ bool BmhParser::findDefinitions() { } fMarkup.emplace_front(MarkType::kPhraseRef, start, fLineCount, fParent, fMC); Definition* markChar = &fMarkup.front(); + this->skipExact("#"); markChar->fContentStart = fChar; - this->skipToEndBracket('\n'); markChar->fContentEnd = fChar; markChar->fTerminator = fChar; markChar->fName = phraseKey; fParent->fChildren.push_back(markChar); + int paramLocIndex = 0; + for (auto param : params) { + const char* paramLoc = paramsLoc[paramLocIndex++]; + fMarkup.emplace_front(MarkType::kPhraseParam, paramLoc, fLineCount, fParent, + fMC); + Definition* phraseParam = &fMarkup.front(); + phraseParam->fContentStart = paramLoc; + phraseParam->fContentEnd = paramLoc + param.length(); + phraseParam->fTerminator = paramLoc + param.length(); + phraseParam->fName = param; + markChar->fChildren.push_back(phraseParam); + } } } char nextChar = this->next(); @@ -1384,13 +1499,14 @@ bool HackParser::hackFiles() { SkASSERT(!root->fParent); fStart = root->fStart; fChar = fStart; - fClassesAndStructs = nullptr; + fClasses = nullptr; fConstants = nullptr; fConstructors = nullptr; fMemberFunctions = nullptr; fMembers = nullptr; fOperators = nullptr; fRelatedFunctions = nullptr; + fStructs = nullptr; this->topicIter(root); fprintf(fOut, "%.*s", (int) (fEnd - fChar), fChar); fclose(fOut); @@ -1442,31 +1558,35 @@ string HackParser::searchTable(const Definition* tableHolder, const Definition* // returns true if topic has method void HackParser::topicIter(const Definition* topic) { - if (string::npos != topic->fName.find(MdOut::kClassesAndStructs)) { - SkASSERT(!fClassesAndStructs); - fClassesAndStructs = topic; + if (string::npos != topic->fName.find(SubtopicKeys::kClasses)) { + SkASSERT(!fClasses); + fClasses = topic; + } + if (string::npos != topic->fName.find(SubtopicKeys::kStructs)) { + SkASSERT(!fStructs); + fStructs = topic; } - if (string::npos != topic->fName.find(MdOut::kConstants)) { + if (string::npos != topic->fName.find(SubtopicKeys::kConstants)) { SkASSERT(!fConstants); fConstants = topic; } - if (string::npos != topic->fName.find(MdOut::kConstructors)) { + if (string::npos != topic->fName.find(SubtopicKeys::kConstructors)) { SkASSERT(!fConstructors); fConstructors = topic; } - if (string::npos != topic->fName.find(MdOut::kMemberFunctions)) { + if (string::npos != topic->fName.find(SubtopicKeys::kMemberFunctions)) { SkASSERT(!fMemberFunctions); fMemberFunctions = topic; } - if (string::npos != topic->fName.find(MdOut::kMembers)) { + if (string::npos != topic->fName.find(SubtopicKeys::kMembers)) { SkASSERT(!fMembers); fMembers = topic; } - if (string::npos != topic->fName.find(MdOut::kOperators)) { + if (string::npos != topic->fName.find(SubtopicKeys::kOperators)) { SkASSERT(!fOperators); fOperators = topic; } - if (string::npos != topic->fName.find(MdOut::kRelatedFunctions)) { + if (string::npos != topic->fName.find(SubtopicKeys::kRelatedFunctions)) { SkASSERT(!fRelatedFunctions); fRelatedFunctions = topic; } @@ -1539,8 +1659,11 @@ void HackParser::topicIter(const Definition* topic) { this->topicIter(child); break; case MarkType::kStruct: + this->addOneLiner(fStructs, child, hasLine, false); + this->topicIter(child); + break; case MarkType::kClass: - this->addOneLiner(fClassesAndStructs, child, hasLine, false); + this->addOneLiner(fClasses, child, hasLine, false); this->topicIter(child); break; case MarkType::kEnum: @@ -1822,6 +1945,7 @@ void TextParser::reportError(const char* errorStr) const { } void TextParser::reportWarning(const char* errorStr) const { + SkASSERT(fLine < fEnd); TextParser err(fFileName, fLine, fEnd, fLineCount); size_t lineLen = this->lineLength(); ptrdiff_t spaces = fChar - fLine; @@ -1892,7 +2016,13 @@ string TextParser::typedefName() { do { this->skipToWhiteSpace(); if (fChar < end && isspace(fChar[0])) { + const char* whiteStart = fChar; this->skipWhiteSpace(); + // FIXME: test should be for fMC + if ('#' == fChar[0]) { + end = whiteStart; + break; + } lastWord = fChar; } else { break; @@ -2051,8 +2181,6 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) { break; case MarkType::kCode: case MarkType::kDescription: - case MarkType::kDoxygen: - case MarkType::kExperimental: case MarkType::kExternal: case MarkType::kFormula: case MarkType::kFunction: @@ -2060,7 +2188,6 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) { case MarkType::kList: case MarkType::kNoExample: case MarkType::kPrivate: - case MarkType::kTrack: this->skipNoName(); break; case MarkType::kLine: @@ -2071,13 +2198,15 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) { case MarkType::kBug: // fixme: expect number case MarkType::kDefinedBy: case MarkType::kDeprecated: + case MarkType::kDetails: case MarkType::kDuration: - case MarkType::kFile: + case MarkType::kExperimental: case MarkType::kHeight: case MarkType::kIllustration: case MarkType::kImage: case MarkType::kIn: case MarkType::kLiteral: + case MarkType::kNoJustify: case MarkType::kOutdent: case MarkType::kPlatform: case MarkType::kPopulate: @@ -2085,7 +2214,6 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) { case MarkType::kSeeAlso: case MarkType::kSet: case MarkType::kSubstitute: - case MarkType::kTime: case MarkType::kToDo: case MarkType::kVolatile: case MarkType::kWidth: @@ -2104,12 +2232,22 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) { builder = this->typedefName(); break; case MarkType::kParam: - case MarkType::kPhraseDef: // fixme: expect camelCase for param builder = this->word("", ""); this->skipSpace(); *checkEnd = false; break; + case MarkType::kPhraseDef: { + const char* nameEnd = this->anyOf("(\n"); + builder = string(fChar, nameEnd - fChar); + this->skipLower(); + if (fChar != nameEnd) { + this->reportError("expect lower case only"); + break; + } + this->skipTo(nameEnd); + *checkEnd = false; + } break; case MarkType::kTable: this->skipNoName(); break; // unnamed @@ -2516,6 +2654,7 @@ int main(int argc, char** const argv) { } MdOut mdOut(bmhParser); mdOut.fDebugOut = FLAGS_stdout; + mdOut.fValidate = FLAGS_validate; if (!FLAGS_bmh.isEmpty() && mdOut.buildReferences(includeParser, FLAGS_bmh[0], FLAGS_ref[0])) { bmhParser.fWroteOut = true; @@ -2523,6 +2662,9 @@ int main(int argc, char** const argv) { if (!FLAGS_status.isEmpty() && mdOut.buildStatus(FLAGS_status[0], FLAGS_ref[0])) { bmhParser.fWroteOut = true; } + if (FLAGS_validate) { + mdOut.checkAnchors(); + } } if (!done && !FLAGS_spellcheck.isEmpty() && FLAGS_examples.isEmpty()) { if (!FLAGS_bmh.isEmpty()) { diff --git a/tools/bookmaker/bookmaker.h b/tools/bookmaker/bookmaker.h index 7e09d41afd..c755beec43 100644 --- a/tools/bookmaker/bookmaker.h +++ b/tools/bookmaker/bookmaker.h @@ -95,14 +95,13 @@ enum class MarkType { kDefinedBy, kDeprecated, kDescription, - kDoxygen, + kDetails, // used by #Const to specify #Subtopic details with examples and so on kDuration, kEnum, kEnumClass, kExample, kExperimental, kExternal, - kFile, kFormula, kFunction, kHeight, @@ -118,15 +117,16 @@ enum class MarkType { kMember, kMethod, kNoExample, + kNoJustify, // don't contribute this #Line to tabular comment measure, even if it fits kOutdent, kParam, kPhraseDef, + kPhraseParam, kPhraseRef, kPlatform, kPopulate, kPrivate, kReturn, - kRoot, kRow, kSeeAlso, kSet, @@ -137,16 +137,18 @@ enum class MarkType { kTable, kTemplate, kText, - kTime, kToDo, kTopic, - kTrack, kTypedef, kUnion, kVolatile, kWidth, }; +static inline bool IncompleteAllowed(MarkType markType) { + return MarkType::kDeprecated == markType || MarkType::kExperimental == markType; +} + enum { Last_MarkType = (int) MarkType::kWidth, }; @@ -299,21 +301,23 @@ public: return *loc; } + // either /n/n or /n# will stop parsing a typedef const char* doubleLF() const { - int count = 0; - const char* ptr = fChar; + const char* ptr = fChar - 1; const char* doubleStart = nullptr; - while (ptr < fEnd) { - if ('\n' == ptr[0]) { - if (++count == 1) { + while (++ptr < fEnd) { + if (!doubleStart) { + if ('\n' == ptr[0]) { doubleStart = ptr; - } else { - return doubleStart; } - } else if (' ' < ptr[0]) { - count = 0; + continue; + } + if ('\n' == ptr[0] || '#' == ptr[0]) { + return doubleStart; + } + if (' ' < ptr[0]) { + doubleStart = nullptr; } - ++ptr; } return nullptr; } @@ -476,6 +480,12 @@ public: return true; } + void skipLower() { + while (fChar < fEnd && (islower(fChar[0]) || '_' == fChar[0])) { + fChar++; + } + } + void skipToNonAlphaNum() { while (fChar < fEnd && (isalnum(fChar[0]) || '_' == fChar[0])) { fChar++; @@ -796,6 +806,19 @@ public: kOmitReturn, }; + enum class Details { + kNone, + kSoonToBe_Deprecated, + kTestingOnly_Experiment, + kDoNotUse_Experiement, + kNotReady_Experiment, + }; + + enum class DetailsType { + kPhrase, + kSentence, + }; + Definition() {} Definition(const char* start, const char* end, int line, Definition* parent, char mc) @@ -845,7 +868,6 @@ public: virtual ~Definition() {} virtual RootDefinition* asRoot() { SkASSERT(0); return nullptr; } - virtual const RootDefinition* asRoot() const { SkASSERT(0); return nullptr; } bool boilerplateIfDef(); bool boilerplateEndIf() { @@ -857,7 +879,7 @@ public: bool crossCheck(const Definition& includeToken) const; bool crossCheckInside(const char* start, const char* end, const Definition& includeToken) const; - const Definition* csParent() const { + Definition* csParent() { Definition* test = fParent; while (test) { if (MarkType::kStruct == test->fMarkType || MarkType::kClass == test->fMarkType) { @@ -875,12 +897,14 @@ public: const Definition* hasChild(MarkType markType) const; bool hasMatch(string name) const; const Definition* hasParam(string ref) const; + string incompleteMessage(DetailsType ) const; bool isClone() const { return fClone; } - Definition* iRootParent() { - Definition* test = fParent; + const Definition* iRootParent() const { + const Definition* test = fParent; while (test) { - if (Type::kKeyWord == test->fType && KeyWord::kClass == test->fKeyWord) { + if (Type::kKeyWord == test->fType + && (KeyWord::kClass == test->fKeyWord || KeyWord::kStruct == test->fKeyWord)) { return test; } test = test->fParent; @@ -923,6 +947,17 @@ public: fParentIndex = fParent ? (int) fParent->fTokens.size() : -1; } + const Definition* subtopicParent() const { + Definition* test = fParent; + while (test) { + if (MarkType::kTopic == test->fMarkType || MarkType::kSubtopic == test->fMarkType) { + return test; + } + test = test->fParent; + } + return nullptr; + } + const Definition* topicParent() const { Definition* test = fParent; while (test) { @@ -962,13 +997,29 @@ public: bool fDeprecated = false; bool fOperatorConst = false; bool fPrivate = false; - bool fShort = false; - bool fToBeDeprecated = false; + Details fDetails = Details::kNone; bool fMemberStart = false; bool fAnonymous = false; mutable bool fVisited = false; }; +class SubtopicKeys { +public: + static constexpr const char* kClasses = "Class"; + static constexpr const char* kConstants = "Constant"; + static constexpr const char* kConstructors = "Constructor"; + static constexpr const char* kDefines = "Define"; + static constexpr const char* kMemberFunctions = "Member_Function"; + static constexpr const char* kMembers = "Member"; + static constexpr const char* kOperators = "Operator"; + static constexpr const char* kOverview = "Overview"; + static constexpr const char* kRelatedFunctions = "Related_Function"; + static constexpr const char* kStructs = "Struct"; + static constexpr const char* kTypedefs = "Typedef"; + + static const char* kGeneratedSubtopics[]; +}; + class RootDefinition : public Definition { public: enum class AllowParens { @@ -976,6 +1027,15 @@ public: kYes, }; + struct SubtopicContents { + SubtopicContents() + : fShowClones(false) { + } + + vector<Definition*> fMembers; + bool fShowClones; + }; + RootDefinition() { } @@ -994,17 +1054,22 @@ public: } RootDefinition* asRoot() override { return this; } - const RootDefinition* asRoot() const override { return this; } void clearVisited(); bool dumpUnVisited(); - const Definition* find(string ref, AllowParens ) const; + Definition* find(string ref, AllowParens ); bool isRoot() const override { return true; } + + SubtopicContents& populator(const char* key) { + return fPopulators[key]; + } + RootDefinition* rootParent() override { return fRootParent; } const RootDefinition* rootParent() const override { return fRootParent; } void setRootParent(RootDefinition* rootParent) { fRootParent = rootParent; } unordered_map<string, RootDefinition*> fBranches; unordered_map<string, Definition> fLeaves; + unordered_map<string, SubtopicContents> fPopulators; private: RootDefinition* fRootParent = nullptr; }; @@ -1044,6 +1109,7 @@ public: ParserCommon() : TextParser() , fParent(nullptr) , fDebugOut(false) + , fValidate(false) { } @@ -1196,7 +1262,10 @@ public: int fPendingSpace; // one or two spaces should preceed the next string or block char fLastChar; // last written bool fDebugOut; // set true to write to std out + bool fValidate; // set true to check anchor defs and refs bool fOutdentNext; // set at end of embedded struct to prevent premature outdent + bool fWroteSomething; // used to detect empty content; an alternative source is preferable + private: typedef TextParser INHERITED; }; @@ -1238,6 +1307,7 @@ public: kFormula, // resolve methods as they are used, not as they are prototyped kLiteral, // output untouched kClone, // resolved, output, with references to clones as well + kSimple, // resolve simple words (used to resolve method declarations) }; enum class ExampleOptions { @@ -1283,14 +1353,13 @@ public: , { nullptr, MarkType::kDefinedBy } , { nullptr, MarkType::kDeprecated } , { nullptr, MarkType::kDescription } - , { nullptr, MarkType::kDoxygen } + , { nullptr, MarkType::kDetails } , { nullptr, MarkType::kDuration } , { &fEnumMap, MarkType::kEnum } , { &fClassMap, MarkType::kEnumClass } , { nullptr, MarkType::kExample } , { nullptr, MarkType::kExperimental } , { nullptr, MarkType::kExternal } - , { nullptr, MarkType::kFile } , { nullptr, MarkType::kFormula } , { nullptr, MarkType::kFunction } , { nullptr, MarkType::kHeight } @@ -1306,15 +1375,16 @@ public: , { nullptr, MarkType::kMember } , { &fMethodMap, MarkType::kMethod } , { nullptr, MarkType::kNoExample } + , { nullptr, MarkType::kNoJustify } , { nullptr, MarkType::kOutdent } , { nullptr, MarkType::kParam } , { nullptr, MarkType::kPhraseDef } + , { nullptr, MarkType::kPhraseParam } , { nullptr, MarkType::kPhraseRef } , { nullptr, MarkType::kPlatform } , { nullptr, MarkType::kPopulate } , { nullptr, MarkType::kPrivate } , { nullptr, MarkType::kReturn } - , { nullptr, MarkType::kRoot } , { nullptr, MarkType::kRow } , { nullptr, MarkType::kSeeAlso } , { nullptr, MarkType::kSet } @@ -1325,10 +1395,8 @@ public: , { nullptr, MarkType::kTable } , { nullptr, MarkType::kTemplate } , { nullptr, MarkType::kText } - , { nullptr, MarkType::kTime } , { nullptr, MarkType::kToDo } , { nullptr, MarkType::kTopic } - , { nullptr, MarkType::kTrack } , { &fTypedefMap, MarkType::kTypedef } , { nullptr, MarkType::kUnion } , { nullptr, MarkType::kVolatile } @@ -1484,14 +1552,13 @@ public: , { nullptr, MarkType::kDefinedBy } , { nullptr, MarkType::kDeprecated } , { nullptr, MarkType::kDescription } - , { nullptr, MarkType::kDoxygen } + , { nullptr, MarkType::kDetails } , { nullptr, MarkType::kDuration } , { &fIEnumMap, MarkType::kEnum } , { &fIEnumMap, MarkType::kEnumClass } , { nullptr, MarkType::kExample } , { nullptr, MarkType::kExperimental } , { nullptr, MarkType::kExternal } - , { nullptr, MarkType::kFile } , { nullptr, MarkType::kFormula } , { nullptr, MarkType::kFunction } , { nullptr, MarkType::kHeight } @@ -1507,15 +1574,16 @@ public: , { nullptr, MarkType::kMember } , { nullptr, MarkType::kMethod } , { nullptr, MarkType::kNoExample } + , { nullptr, MarkType::kNoJustify } , { nullptr, MarkType::kOutdent } , { nullptr, MarkType::kParam } , { nullptr, MarkType::kPhraseDef } + , { nullptr, MarkType::kPhraseParam } , { nullptr, MarkType::kPhraseRef } , { nullptr, MarkType::kPlatform } , { nullptr, MarkType::kPopulate } , { nullptr, MarkType::kPrivate } , { nullptr, MarkType::kReturn } - , { nullptr, MarkType::kRoot } , { nullptr, MarkType::kRow } , { nullptr, MarkType::kSeeAlso } , { nullptr, MarkType::kSet } @@ -1526,10 +1594,8 @@ public: , { nullptr, MarkType::kTable } , { &fITemplateMap, MarkType::kTemplate } , { nullptr, MarkType::kText } - , { nullptr, MarkType::kTime } , { nullptr, MarkType::kToDo } , { nullptr, MarkType::kTopic } - , { nullptr, MarkType::kTrack } , { &fITypedefMap, MarkType::kTypedef } , { &fIUnionMap, MarkType::kUnion } , { nullptr, MarkType::kVolatile } @@ -1905,6 +1971,13 @@ public: kOut, }; + enum class ItemState { + kNone, + kName, + kValue, + kComment, + }; + struct IterState { IterState (list<Definition>::iterator tIter, list<Definition>::iterator tIterEnd) : fDefIter(tIter) @@ -1937,6 +2010,23 @@ public: bool fWord; }; + struct Item { + string fName; + string fValue; + }; + + struct LastItem { + const char* fStart; + const char* fEnd; + }; + + struct ItemLength { + int fCurName; + int fCurValue; + int fLongestName; + int fLongestValue; + }; + IncludeWriter() : IncludeParser() { this->reset(); } @@ -1954,11 +2044,19 @@ public: return 0 == size; } + bool checkChildCommentLength(const Definition* parent, MarkType childType) const; + void checkEnumLengths(const Definition& child, string enumName, ItemLength* length) const; void constOut(const Definition* memberStart, const Definition& child, - const Definition* bmhConst); + const Definition* bmhConst); void descriptionOut(const Definition* def, SkipFirstLine , Phrase ); - void enumHeaderOut(const RootDefinition* root, const Definition& child); - void enumMembersOut(const RootDefinition* root, Definition& child); + void enumHeaderOut(RootDefinition* root, const Definition& child); + string enumMemberComment(const Definition* currentEnumItem, const Definition& child) const; + const Definition* enumMemberForComment(const Definition* currentEnumItem) const; + ItemState enumMemberName(const Definition& child, + const Definition* token, Item* , LastItem* , const Definition** enumItem); + void enumMemberOut(const Definition* currentEnumItem, const Definition& child, + const Item& , Preprocessor& ); + void enumMembersOut(Definition& child); bool enumPreprocessor(Definition* token, MemberPass pass, vector<IterState>& iterStack, IterState** iterState, Preprocessor* ); void enumSizeItems(const Definition& child); @@ -1970,7 +2068,8 @@ public: int lookupReference(const PunctuationState punctuation, const Word word, const int start, const int run, int lastWrite, const char last, const char* data); - void methodOut(const Definition* method, const Definition& child); + const Definition* matchMemberName(string matchName, const Definition& child) const; + void methodOut(Definition* method, const Definition& child); bool populate(Definition* def, ParentPair* parentPair, RootDefinition* root); bool populate(BmhParser& bmhParser); @@ -1993,7 +2092,6 @@ public: Definition* structMemberOut(const Definition* memberStart, const Definition& child); void structOut(const Definition* root, const Definition& child, const char* commentStart, const char* commentEnd); - void structSetMembersShort(const vector<Definition*>& bmhChildren); void structSizeMembers(const Definition& child); private: BmhParser* fBmhParser; @@ -2002,7 +2100,7 @@ private: const Definition* fBmhMethod; const Definition* fEnumDef; const Definition* fMethodDef; - const Definition* fBmhStructDef; + Definition* fBmhStructDef; const char* fContinuation; // used to construct paren-qualified method name int fAnonymousEnumCount; int fEnumItemValueTab; @@ -2120,13 +2218,14 @@ public: private: const BmhParser& fBmhParser; - const Definition* fClassesAndStructs; + const Definition* fClasses; const Definition* fConstants; const Definition* fConstructors; const Definition* fMemberFunctions; const Definition* fMembers; const Definition* fOperators; const Definition* fRelatedFunctions; + const Definition* fStructs; bool hackFiles(); typedef ParserCommon INHERITED; @@ -2134,25 +2233,21 @@ private: class MdOut : public ParserCommon { public: - MdOut(const BmhParser& bmh) : ParserCommon() + struct SubtopicDescriptions { + string fName; + string fOneLiner; + string fDetails; + }; + + MdOut(BmhParser& bmh) : ParserCommon() , fBmhParser(bmh) { this->reset(); + this->addPopulators(); } bool buildReferences(const IncludeParser& , const char* docDir, const char* mdOutDirOrFile); bool buildStatus(const char* docDir, const char* mdOutDir); - - static constexpr const char* kClassesAndStructs = "Class_or_Struct"; - static constexpr const char* kConstants = "Constant"; - static constexpr const char* kConstructors = "Constructor"; - static constexpr const char* kDefines = "Define"; - static constexpr const char* kMemberFunctions = "Member_Function"; - static constexpr const char* kMembers = "Member"; - static constexpr const char* kOperators = "Operator"; - static constexpr const char* kOverview = "Overview"; - static constexpr const char* kRelatedFunctions = "Related_Function"; - static constexpr const char* kSubtopics = "Overview_Subtopic"; - static constexpr const char* kTypedefs = "Typedef"; + void checkAnchors(); private: enum class TableState { @@ -2161,34 +2256,39 @@ private: kColumn, }; - struct TableContents { - TableContents() - : fShowClones(false) { - } - - string fDescription; - vector<const Definition*> fMembers; - bool fShowClones; + struct AnchorDef { + string fDef; + MarkType fMarkType; }; + void addPopulators(); string addReferences(const char* start, const char* end, BmhParser::Resolvable ); + string anchorDef(string def, string name); + string anchorLocalRef(string ref, string name); + string anchorRef(string def, string name); + bool buildRefFromFile(const char* fileName, const char* outDir); bool checkParamReturnBody(const Definition* def); - void childrenOut(const Definition* def, const char* contentStart); - const Definition* csParent() const; + Definition* checkParentsForMatch(Definition* test, string ref) const; + void childrenOut(Definition* def, const char* contentStart); + Definition* csParent(); const Definition* findParamType(); + string getMemberTypeName(const Definition* def, string* memberType); + static bool HasDetails(const Definition* def); + void htmlOut(string ); const Definition* isDefined(const TextParser& , string ref, BmhParser::Resolvable ); + const Definition* isDefinedByParent(RootDefinition* root, string ref); string linkName(const Definition* ) const; - string linkRef(string leadingSpaces, const Definition*, string ref, - BmhParser::Resolvable ) const; - void markTypeOut(Definition* ); + string linkRef(string leadingSpaces, const Definition*, string ref, BmhParser::Resolvable ); + void markTypeOut(Definition* , const Definition** prior); void mdHeaderOut(int depth) { mdHeaderOutLF(depth, 2); } void mdHeaderOutLF(int depth, int lf); - void overviewOut(); bool parseFromFile(const char* path) override { return true; } - void populateTables(const Definition* def); + void populateOne(Definition* def, + unordered_map<string, RootDefinition::SubtopicContents>& populator); + void populateTables(const Definition* def, RootDefinition* ); - TableContents& populator(const char* key) { + SubtopicDescriptions& populator(string key) { auto entry = fPopulators.find(key); // FIXME: this should have been detected earlier SkASSERT(fPopulators.end() != entry); @@ -2200,6 +2300,7 @@ private: fEnumClass = nullptr; fMethod = nullptr; fRoot = nullptr; + fSubtopic = nullptr; fLastParam = nullptr; fTableState = TableState::kNone; fAddRefFailed = false; @@ -2208,6 +2309,7 @@ private: fInList = false; fResolveAndIndent = false; fLiteralAndIndent = false; + fLastDef = nullptr; } BmhParser::Resolvable resolvable(const Definition* definition) const { @@ -2227,19 +2329,32 @@ private: } void resolveOut(const char* start, const char* end, BmhParser::Resolvable ); - void rowOut(const char * name, string description); - void subtopicOut(const TableContents& tableContents); - void subtopicsOut(); + void rowOut(const char * name, string description, bool literalName); + + void subtopicOut(string name); + void subtopicsOut(Definition* def); + void summaryOut(const Definition* def, MarkType , string name); + string tableDataCodeDef(const Definition* def); + string tableDataCodeDef(string def, string name); + string tableDataCodeLocalRef(string name); + string tableDataCodeLocalRef(string ref, string name); + string tableDataCodeRef(const Definition* ref); + string tableDataCodeRef(string ref, string name); - unordered_map<string, TableContents> fPopulators; vector<const Definition*> fClassStack; + unordered_map<string, vector<AnchorDef> > fAllAnchorDefs; + unordered_map<string, vector<string> > fAllAnchorRefs; - const BmhParser& fBmhParser; + BmhParser& fBmhParser; const Definition* fEnumClass; + const Definition* fLastDef; Definition* fMethod; - const RootDefinition* fRoot; + RootDefinition* fRoot; // used in generating populated tables; always struct or class + RootDefinition* fSubtopic; // used in resolving symbols const Definition* fLastParam; TableState fTableState; + unordered_map<string, SubtopicDescriptions> fPopulators; + unordered_map<string, string> fPhraseParams; bool fAddRefFailed; bool fHasFiddle; bool fInDescription; // FIXME: for now, ignore unfound camelCase in description since it may @@ -2247,6 +2362,8 @@ private: bool fInList; bool fLiteralAndIndent; bool fResolveAndIndent; + bool fOddRow; + bool fHasDetails; typedef ParserCommon INHERITED; }; @@ -2272,7 +2389,7 @@ public: } } - void skipToMethodEnd() { + void skipToMethodEnd(BmhParser::Resolvable resolvable) { if (this->eof()) { return; } @@ -2284,7 +2401,8 @@ public: return; } } - if (this->startsWith(fClassName.c_str()) || this->startsWith("operator")) { + if (BmhParser::Resolvable::kSimple != resolvable + && (this->startsWith(fClassName.c_str()) || this->startsWith("operator"))) { const char* ptr = this->anyOf("\n ("); if (ptr && '(' == *ptr) { this->skipToEndBracket(')'); diff --git a/tools/bookmaker/definition.cpp b/tools/bookmaker/definition.cpp index 06db96487e..9a6d0f6d49 100644 --- a/tools/bookmaker/definition.cpp +++ b/tools/bookmaker/definition.cpp @@ -338,6 +338,9 @@ bool Definition::boilerplateIfDef() { // fixme: this will need to be more complicated to handle all of Skia // for now, just handle paint -- maybe fiddle will loosen naming restrictions void Definition::setCanonicalFiddle() { + if (string::npos != fName.find("SkCanvas::SaveLayerRec")) { + SkDebugf(""); + } fMethodType = Definition::MethodType::kNone; size_t doubleColons = fName.find("::", 0); SkASSERT(string::npos != doubleColons); @@ -372,6 +375,15 @@ void Definition::setCanonicalFiddle() { size_t openParen = fName.find('(', doubleColons); if (string::npos == openParen) { result += fName.substr(doubleColons); + // see if it is a constructor -- if second to last delimited name equals last + size_t nextColons = fName.find("::", doubleColons); + if (string::npos != nextColons) { + nextColons += 2; + if (!strncmp(&fName[doubleColons], &fName[nextColons], + nextColons - doubleColons - 2)) { + fMethodType = Definition::MethodType::kConstructor; + } + } } else { size_t comma = fName.find(',', doubleColons); if (string::npos == comma) { @@ -677,7 +689,7 @@ string Definition::formatFunction(Format format) const { lastStart = saveStart; lastEnd = methodParser.fChar; indent = SkTMin(indent, (size_t) (limit - maxLine)); - // write string wtih trimmmed indent + // write string with trimmmed indent string methodStr; int written = 0; do { @@ -804,6 +816,32 @@ bool Definition::hasMatch(string name) const { return false; } +string Definition::incompleteMessage(DetailsType detailsType) const { + if (!IncompleteAllowed(fMarkType)) { + auto iter = std::find_if(fChildren.begin(), fChildren.end(), + [](const Definition* test) { return IncompleteAllowed(test->fMarkType); }); + SkASSERT(fChildren.end() != iter); + return (*iter)->incompleteMessage(detailsType); + } + string message = MarkType::kExperimental == fMarkType ? + "Experimental." : "Deprecated."; + if (Definition::Details::kDoNotUse_Experiement == fDetails) { + message += " Do not use."; + } else if (Definition::Details::kNotReady_Experiment == fDetails) { + message += " Not ready for general use."; + } else if (Definition::Details::kSoonToBe_Deprecated == fDetails) { + message += " Soon to be deprecated."; + } else if (Definition::Details::kTestingOnly_Experiment == fDetails) { + message += " For testing only."; + } + if (DetailsType::kPhrase == detailsType) { + message = message.substr(0, message.length() - 1); // remove trailing period + std::replace(message.begin(), message.end(), '.', ':'); + std::transform(message.begin(), message.end(), message.begin(), ::tolower); + } + return message; +} + bool Definition::isStructOrClass() const { if (MarkType::kStruct != fMarkType && MarkType::kClass != fMarkType) { return false; @@ -1084,7 +1122,7 @@ bool RootDefinition::dumpUnVisited() { return success; } -const Definition* RootDefinition::find(string ref, AllowParens allowParens) const { +Definition* RootDefinition::find(string ref, AllowParens allowParens) { const auto leafIter = fLeaves.find(ref); if (leafIter != fLeaves.end()) { return &leafIter->second; @@ -1098,12 +1136,12 @@ const Definition* RootDefinition::find(string ref, AllowParens allowParens) cons } const auto branchIter = fBranches.find(ref); if (branchIter != fBranches.end()) { - const RootDefinition* rootDef = branchIter->second; + RootDefinition* rootDef = branchIter->second; return rootDef; } - const Definition* result = nullptr; + Definition* result = nullptr; for (const auto& branch : fBranches) { - const RootDefinition* rootDef = branch.second; + RootDefinition* rootDef = branch.second; result = rootDef->find(ref, allowParens); if (result) { break; diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp index e2ba6c67b8..c1a98cf786 100644 --- a/tools/bookmaker/includeWriter.cpp +++ b/tools/bookmaker/includeWriter.cpp @@ -7,6 +7,57 @@ #include "bookmaker.h" +bool IncludeWriter::checkChildCommentLength(const Definition* parent, MarkType childType) const { + bool oneMember = false; + for (auto& item : parent->fChildren) { + if (childType != item->fMarkType) { + continue; + } + oneMember = true; + int lineLen = 0; + for (auto& itemChild : item->fChildren) { + if (MarkType::kExperimental == itemChild->fMarkType) { + lineLen = sizeof("experimental") - 1; + break; + } + if (MarkType::kDeprecated == itemChild->fMarkType) { + lineLen = sizeof("deprecated") - 1; + // todo: look for 'soon' + break; + } + if (MarkType::kLine == itemChild->fMarkType) { + lineLen = itemChild->length(); + break; + } + } + if (!lineLen) { + item->reportError<void>("missing #Line"); + } + if (fEnumItemCommentTab + lineLen >= 100) { +// if too long, remove spaces until it fits, or wrap +// item->reportError<void>("#Line comment too long"); + } + } + return oneMember; +} + +void IncludeWriter::checkEnumLengths(const Definition& child, string enumName, ItemLength* length) const { + const Definition* enumItem = this->matchMemberName(enumName, child); + if (std::any_of(enumItem->fChildren.begin(), enumItem->fChildren.end(), + [](Definition* child){return MarkType::kNoJustify == child->fMarkType;})) { + return; + } + string comment = this->enumMemberComment(enumItem, child); + int lineLimit = 100 - fIndent - 7; // 7: , space //!< space + if (length->fCurValue) { + lineLimit -= 3; // space = space + } + if (length->fCurName + length->fCurValue + (int) comment.length() < lineLimit) { + length->fLongestName = SkTMax(length->fLongestName, length->fCurName); + length->fLongestValue = SkTMax(length->fLongestValue, length->fCurValue); + } +} + void IncludeWriter::constOut(const Definition* memberStart, const Definition& child, const Definition* bmhConst) { const char* bodyEnd = fDeferComment ? fDeferComment->fContentStart - 1 : @@ -33,7 +84,8 @@ void IncludeWriter::descriptionOut(const Definition* def, SkipFirstLine skipFirs bool breakOut = false; SkDEBUGCODE(bool wroteCode = false); if (def->fDeprecated) { - this->writeString(def->fToBeDeprecated ? "To be deprecated soon." : "Deprecated."); + string message = def->incompleteMessage(Definition::DetailsType::kSentence); + this->writeString(message); this->lfcr(); } for (auto prop : def->fChildren) { @@ -92,9 +144,10 @@ void IncludeWriter::descriptionOut(const Definition* def, SkipFirstLine skipFirs } } commentStart = prop->fContentStart; - if (def->fToBeDeprecated) { - commentStart += 4; // skip over "soon" // FIXME: this is awkward - } else if (MarkType::kBug == prop->fMarkType) { + if (' ' < commentStart[0]) { + commentStart = strchr(commentStart, '\n'); + } + if (MarkType::kBug == prop->fMarkType) { commentStart = prop->fContentEnd; } commentLen = (int) (prop->fContentEnd - commentStart); @@ -115,6 +168,9 @@ void IncludeWriter::descriptionOut(const Definition* def, SkipFirstLine skipFirs this->writeString("EXPERIMENTAL:"); this->writeSpace(); commentStart = prop->fContentStart; + if (' ' < commentStart[0]) { + commentStart = strchr(commentStart, '\n'); + } commentLen = (int) (prop->fContentEnd - commentStart); if (commentLen > 0) { if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart, Phrase::kNo)) { @@ -202,7 +258,41 @@ void IncludeWriter::descriptionOut(const Definition* def, SkipFirstLine skipFirs return this->reportError<void>("missing phrase definition"); } Definition* phraseDef = iter->second; - this->rewriteBlock(phraseDef->length(), phraseDef->fContentStart, Phrase::kYes); + // TODO: given TextParser(commentStart, prop->fStart + up to #) return if + // it ends with two of more linefeeds, ignoring other whitespace + Phrase defIsPhrase = '\n' == prop->fStart[0] && '\n' == prop->fStart[-1] ? + Phrase::kNo : Phrase::kYes; + if (Phrase::kNo == defIsPhrase) { + this->lf(2); + } + const char* start = phraseDef->fContentStart; + int length = phraseDef->length(); + auto propParams = prop->fChildren.begin(); + // can this share code or logic with mdout somehow? + for (auto child : phraseDef->fChildren) { + if (MarkType::kPhraseParam == child->fMarkType) { + continue; + } + int localLength = child->fStart - start; + this->rewriteBlock(localLength, start, defIsPhrase); + start += localLength; + length -= localLength; + SkASSERT(propParams != prop->fChildren.end()); + if (fColumn > 0) { + this->writeSpace(); + } + this->writeString((*propParams)->fName); + localLength = child->fContentEnd - child->fStart; + start += localLength; + length -= localLength; + if (isspace(start[0])) { + this->writeSpace(); + } + defIsPhrase = Phrase::kYes; + } + if (length > 0) { + this->rewriteBlock(length, start, defIsPhrase); + } commentStart = prop->fContentStart; commentLen = (int) (def->fContentEnd - commentStart); } break; @@ -220,8 +310,7 @@ void IncludeWriter::descriptionOut(const Definition* def, SkipFirstLine skipFirs } } -void IncludeWriter::enumHeaderOut(const RootDefinition* root, - const Definition& child) { +void IncludeWriter::enumHeaderOut(RootDefinition* root, const Definition& child) { const Definition* enumDef = nullptr; const char* bodyEnd = fDeferComment ? fDeferComment->fContentStart - 1 : child.fContentStart; @@ -281,8 +370,7 @@ void IncludeWriter::enumHeaderOut(const RootDefinition* root, bool lastAnchor = false; SkDEBUGCODE(bool foundConst = false); for (auto test : enumDef->fChildren) { - if (MarkType::kCode == test->fMarkType) { - SkASSERT(!codeBlock); // FIXME: check enum for correct order earlier + if (MarkType::kCode == test->fMarkType && !codeBlock) { codeBlock = test; commentStart = codeBlock->fTerminator; continue; @@ -316,17 +404,23 @@ void IncludeWriter::enumHeaderOut(const RootDefinition* root, lastAnchor = false; } this->rewriteBlock((int) (commentEnd - commentStart), commentStart, Phrase::kNo); - if (MarkType::kAnchor == test->fMarkType) { + if (MarkType::kAnchor == test->fMarkType || MarkType::kCode == test->fMarkType) { bool newLine = commentEnd - commentStart > 1 && '\n' == commentEnd[-1] && '\n' == commentEnd[-2]; commentStart = test->fContentStart; - commentEnd = test->fChildren[0]->fStart; + commentEnd = MarkType::kAnchor == test->fMarkType ? test->fChildren[0]->fStart : + test->fContentEnd; if (newLine) { this->lf(2); } else { this->writeSpace(); } - this->rewriteBlock((int) (commentEnd - commentStart), commentStart, Phrase::kNo); + if (MarkType::kAnchor == test->fMarkType) { + this->rewriteBlock((int) (commentEnd - commentStart), commentStart, Phrase::kNo); + } else { + this->writeBlock((int) (commentEnd - commentStart), commentStart); + this->lf(2); + } lastAnchor = true; // this->writeSpace(); } commentStart = test->fTerminator; @@ -358,176 +452,189 @@ void IncludeWriter::enumHeaderOut(const RootDefinition* root, fEnumDef = enumDef; } -void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child) { - // iterate through include tokens and find how much remains for 1 line comments - // put ones that fit on same line, ones that are too big on preceding line? - const Definition* currentEnumItem = nullptr; - const char* commentStart = nullptr; - const char* lastEnd = nullptr; - int commentLen = 0; - enum class State { - kNoItem, - kItemName, - kItemValue, - kItemComment, - }; - State state = State::kNoItem; +const Definition* IncludeWriter::enumMemberForComment(const Definition* currentEnumItem) const { + for (auto constItem : currentEnumItem->fChildren) { + if (MarkType::kLine == constItem->fMarkType + || MarkType::kExperimental == constItem->fMarkType + || MarkType::kDeprecated == constItem->fMarkType) { + return constItem; + } + } + SkASSERT(0); + return nullptr; +} + +string IncludeWriter::enumMemberComment(const Definition* currentEnumItem, + const Definition& child) const { + // #Const should always be followed by #Line, so description follows that + string shortComment; + for (auto constItem : currentEnumItem->fChildren) { + if (MarkType::kLine == constItem->fMarkType) { + shortComment = string(constItem->fContentStart, constItem->length()); + break; + } + if (IncompleteAllowed(constItem->fMarkType)) { + shortComment = constItem->incompleteMessage(Definition::DetailsType::kPhrase); + } + } + if (!shortComment.length()) { + currentEnumItem->reportError<void>("missing #Line or #Deprecated or #Experimental"); + } + return shortComment; +} + +IncludeWriter::ItemState IncludeWriter::enumMemberName( + const Definition& child, const Definition* token, Item* item, LastItem* last, + const Definition** currentEnumItem) { + TextParser parser(fFileName, last->fStart, last->fEnd, fLineCount); + parser.skipWhiteSpace(); + item->fName = string(parser.fChar, (int) (last->fEnd - parser.fChar)); + *currentEnumItem = this->matchMemberName(item->fName, child); + if (token) { + fStart = token->fContentEnd; + TextParser enumLine(token->fFileName, last->fEnd, token->fContentStart, token->fLineCount); + const char* end = enumLine.anyOf(",}="); + SkASSERT(end); + if ('=' == *end) { // write enum value + last->fEnd = token->fContentEnd; + item->fValue = string(token->fContentStart, (int) (last->fEnd - token->fContentStart)); + return ItemState::kValue; + } + } + return ItemState::kComment; +} + +void IncludeWriter::enumMemberOut(const Definition* currentEnumItem, const Definition& child, + const Item& item, Preprocessor& preprocessor) { + SkASSERT(currentEnumItem); + string shortComment = this->enumMemberComment(currentEnumItem, child); + int enumItemValueTab = + SkTMax((int) item.fName.length() + fIndent + 1, fEnumItemValueTab); // 1: , + int valueLength = item.fValue.length(); + int assignLength = valueLength ? valueLength + 3 : 0; // 3: space = space + int enumItemCommentTab = SkTMax(enumItemValueTab + assignLength, fEnumItemCommentTab); + int trimNeeded = enumItemCommentTab + shortComment.length() - (100 - (sizeof("//!< ") - 1)); + bool crAfterName = false; + if (trimNeeded > 0) { + if (item.fValue.length()) { + int valueSpare = SkTMin(trimNeeded, // 3 below: space = space + (int) (enumItemCommentTab - enumItemValueTab - item.fValue.length() - 3)); + SkASSERT(valueSpare >= 0); + trimNeeded -= valueSpare; + enumItemCommentTab -= valueSpare; + } + if (trimNeeded > 0) { + int nameSpare = SkTMin(trimNeeded, (int) (enumItemValueTab - item.fName.length() + - fIndent - 1)); // 1: , + SkASSERT(nameSpare >= 0); + trimNeeded -= nameSpare; + enumItemValueTab -= nameSpare; + enumItemCommentTab -= nameSpare; + } + if (trimNeeded > 0) { + crAfterName = true; + if (!valueLength) { + this->enumMemberForComment(currentEnumItem)->reportError<void>("comment too long"); + } else if (valueLength + fIndent + 8 + shortComment.length() > // 8: addtional indent + 100 - (sizeof(", //!< ") - 1)) { // -1: zero-terminated string + this->enumMemberForComment(currentEnumItem)->reportError<void>("comment 2 long"); + } // 2: = space + enumItemValueTab = fEnumItemValueTab + 2 // 2: , space + - SkTMax(0, fEnumItemValueTab + 2 + valueLength + 2 - fEnumItemCommentTab); + enumItemCommentTab = SkTMax(enumItemValueTab + valueLength + 2, fEnumItemCommentTab); + } + } + this->lfcr(); + this->writeString(item.fName); + int saveIndent = fIndent; + if (item.fValue.length()) { + if (!crAfterName) { + this->indentToColumn(enumItemValueTab); + } else { + this->writeSpace(); + } + this->writeString("="); + if (crAfterName) { + this->lfcr(); + fIndent = enumItemValueTab; + } else { + this->writeSpace(); + } + this->writeString(item.fValue); + } + this->writeString(","); + this->indentToColumn(enumItemCommentTab); + this->writeString("//!<"); + this->writeSpace(); + this->rewriteBlock(shortComment.length(), shortComment.c_str(), Phrase::kYes); + this->lfcr(); + fIndent = saveIndent; + if (preprocessor.fStart) { + SkASSERT(preprocessor.fEnd); + int saveIndent = fIndent; + fIndent = SkTMax(0, fIndent - 8); + this->lf(2); + this->writeBlock( + (int) (preprocessor.fEnd - preprocessor.fStart), preprocessor.fStart); + this->lfcr(); + fIndent = saveIndent; + preprocessor.reset(); + } +} + +// iterate through include tokens and find how much remains for 1 line comments +// put ones that fit on same line, ones that are too big wrap +void IncludeWriter::enumMembersOut(Definition& child) { + ItemState state = ItemState::kNone; + const Definition* currentEnumItem; + LastItem last = { nullptr, nullptr }; + auto brace = child.fChildren[0]; + if (KeyWord::kClass == brace->fKeyWord) { + brace = brace->fChildren[0]; + } + SkASSERT(Bracket::kBrace == brace->fBracket); vector<IterState> iterStack; - iterStack.emplace_back(child.fTokens.begin(), child.fTokens.end()); + iterStack.emplace_back(brace->fTokens.begin(), brace->fTokens.end()); IterState* iterState = &iterStack[0]; Preprocessor preprocessor; - for (int onePast = 0; onePast < 2; onePast += iterState->fDefIter == iterState->fDefEnd) { - Definition* token = onePast ? nullptr : &*iterState->fDefIter++; - if (this->enumPreprocessor(token, MemberPass::kOut, iterStack, &iterState, + Item item; + while (iterState->fDefIter != iterState->fDefEnd) { + auto& token = *iterState->fDefIter++; + if (this->enumPreprocessor(&token, MemberPass::kOut, iterStack, &iterState, &preprocessor)) { continue; } - if (token && State::kItemName == state) { - TextParser enumLine(token->fFileName, lastEnd, - token->fContentStart, token->fLineCount); - const char* end = enumLine.anyOf(",}="); - SkASSERT(end); - state = '=' == *end ? State::kItemValue : State::kItemComment; - if (State::kItemValue == state) { // write enum value - this->indentToColumn(fEnumItemValueTab); - this->writeString("="); - this->writeSpace(); - lastEnd = token->fContentEnd; - this->writeBlock((int) (lastEnd - token->fContentStart), - token->fContentStart); // write const value if any - continue; - } + if (ItemState::kName == state) { + state = this->enumMemberName(child, &token, &item, &last, ¤tEnumItem); } - if (token && State::kItemValue == state) { - TextParser valueEnd(token->fFileName, lastEnd, - token->fContentStart, token->fLineCount); + if (ItemState::kValue == state) { + TextParser valueEnd(token.fFileName, last.fEnd, token.fContentStart, token.fLineCount); const char* end = valueEnd.anyOf(",}"); if (!end) { // write expression continuation - if (' ' == lastEnd[0]) { - this->writeSpace(); - } - this->writeBlock((int) (token->fContentEnd - lastEnd), lastEnd); - continue; - } - } - if (State::kNoItem != state) { - this->writeString(","); - SkASSERT(currentEnumItem); - if (currentEnumItem->fShort) { - this->indentToColumn(fEnumItemCommentTab); - if (commentLen || currentEnumItem->fDeprecated) { - this->writeString("//!<"); - this->writeSpace(); - if (currentEnumItem->fDeprecated) { - this->writeString(child.fToBeDeprecated ? "to be deprecated soon" - : "deprecated"); - } else { - this->rewriteBlock(commentLen, commentStart, Phrase::kNo); - } - } - } - if (onePast) { - fIndent -= 4; - } - this->lfcr(); - if (preprocessor.fStart) { - SkASSERT(preprocessor.fEnd); - int saveIndent = fIndent; - fIndent = SkTMax(0, fIndent - 8); - this->lf(2); - this->writeBlock( - (int) (preprocessor.fEnd - preprocessor.fStart), preprocessor.fStart); - this->lfcr(); - fIndent = saveIndent; - preprocessor.reset(); - } - if (token && State::kItemValue == state) { - fStart = token->fContentStart; - } - state = State::kNoItem; - } - SkASSERT(State::kNoItem == state); - if (onePast) { - break; - } - SkASSERT(token); - string itemName; - if (!fEnumDef->isRoot()) { - itemName = root->fName + "::"; - if (KeyWord::kClass == child.fParent->fKeyWord) { - itemName += child.fParent->fName + "::"; - } - } - itemName += string(token->fContentStart, (int) (token->fContentEnd - token->fContentStart)); - for (auto& enumItem : fEnumDef->fChildren) { - if (MarkType::kConst != enumItem->fMarkType) { - continue; - } - if (itemName != enumItem->fName) { + item.fValue += string(last.fEnd, (int) (token.fContentEnd - last.fEnd)); continue; } - currentEnumItem = enumItem; - break; - } - SkASSERT(currentEnumItem); - // if description fits, it goes after item - commentStart = currentEnumItem->fContentStart; - const char* commentEnd; - if (currentEnumItem->fChildren.size() > 0) { - commentEnd = currentEnumItem->fChildren[0]->fStart; - } else { - commentEnd = currentEnumItem->fContentEnd; - } - TextParser enumComment(fFileName, commentStart, commentEnd, currentEnumItem->fLineCount); - bool isDeprecated = false; - if (enumComment.skipToLineStart()) { // skip const value - commentStart = enumComment.fChar; - commentLen = (int) (commentEnd - commentStart); - } else { - const Definition* childDef = currentEnumItem->fChildren[0]; - isDeprecated = MarkType::kDeprecated == childDef->fMarkType; - if (MarkType::kPrivate == childDef->fMarkType || isDeprecated) { - commentStart = childDef->fContentStart; - if (currentEnumItem->fToBeDeprecated) { - SkASSERT(isDeprecated); - commentStart += 4; // skip over "soon" // FIXME: this is awkward - } - commentLen = (int) (childDef->fContentEnd - commentStart); - } } - // FIXME: may assert here if there's no const value - // should have detected and errored on that earlier when enum fContentStart was set - SkASSERT((commentLen > 0 && commentLen < 1000) || isDeprecated); - if (!currentEnumItem->fShort) { - this->writeCommentHeader(); - fIndent += 4; - bool wroteLineFeed = false; - if (isDeprecated) { - this->writeString(currentEnumItem->fToBeDeprecated - ? "To be deprecated soon." : "Deprecated."); - } - TextParserSave save(this); - this->setForErrorReporting(currentEnumItem, commentStart); - wroteLineFeed = Wrote::kLF == - this->rewriteBlock(commentLen, commentStart, Phrase::kNo); - save.restore(); - fIndent -= 4; - if (wroteLineFeed || fColumn > 100 - 3 /* space * / */ ) { - this->lfcr(); - } else { - this->writeSpace(); - } - this->writeCommentTrailer(); + if (ItemState::kNone != state) { + this->enumMemberOut(currentEnumItem, child, item, preprocessor); + fStart = token.fContentStart; + state = ItemState::kNone; + last.fStart = nullptr; } - lastEnd = token->fContentEnd; - this->lfcr(); - if (',' == fStart[0]) { - ++fStart; + SkASSERT(ItemState::kNone == state); + if (!last.fStart) { + last.fStart = fStart; } - this->writeBlock((int) (lastEnd - fStart), fStart); // enum item name - fStart = token->fContentEnd; - state = State::kItemName; + last.fEnd = token.fContentEnd; + state = ItemState::kName; + } + if (ItemState::kName == state) { + state = this->enumMemberName(child, nullptr, &item, &last, ¤tEnumItem); + } + if (ItemState::kValue == state || ItemState::kComment == state) { + this->enumMemberOut(currentEnumItem, child, item, preprocessor); } + fIndent -= 4; } bool IncludeWriter::enumPreprocessor(Definition* token, MemberPass pass, @@ -590,18 +697,9 @@ bool IncludeWriter::enumPreprocessor(Definition* token, MemberPass pass, } void IncludeWriter::enumSizeItems(const Definition& child) { - enum class State { - kNoItem, - kItemName, - kItemValue, - kItemComment, - }; - State state = State::kNoItem; - int longestName = 0; - int longestValue = 0; - int valueLen = 0; + ItemState state = ItemState::kNone; + ItemLength lengths = { 0, 0, 0, 0 }; const char* lastEnd = nullptr; -// SkASSERT(child.fChildren.size() == 1 || child.fChildren.size() == 2); auto brace = child.fChildren[0]; if (KeyWord::kClass == brace->fKeyWord) { brace = brace->fChildren[0]; @@ -611,70 +709,85 @@ void IncludeWriter::enumSizeItems(const Definition& child) { iterStack.emplace_back(brace->fTokens.begin(), brace->fTokens.end()); IterState* iterState = &iterStack[0]; Preprocessor preprocessor; + string enumName; while (iterState->fDefIter != iterState->fDefEnd) { auto& token = *iterState->fDefIter++; if (this->enumPreprocessor(&token, MemberPass::kCount, iterStack, &iterState, &preprocessor)) { continue; } - if (State::kItemName == state) { - TextParser enumLine(token.fFileName, lastEnd, - token.fContentStart, token.fLineCount); + if (ItemState::kName == state) { + TextParser enumLine(token.fFileName, lastEnd, token.fContentStart, token.fLineCount); const char* end = enumLine.anyOf(",}="); SkASSERT(end); - state = '=' == *end ? State::kItemValue : State::kItemComment; - if (State::kItemValue == state) { - valueLen = (int) (token.fContentEnd - token.fContentStart); + state = '=' == *end ? ItemState::kValue : ItemState::kComment; + if (ItemState::kValue == state) { lastEnd = token.fContentEnd; + lengths.fCurValue = (int) (lastEnd - token.fContentStart); continue; } } - if (State::kItemValue == state) { - TextParser valueEnd(token.fFileName, lastEnd, - token.fContentStart, token.fLineCount); + if (ItemState::kValue == state) { + TextParser valueEnd(token.fFileName, lastEnd, token.fContentStart, token.fLineCount); const char* end = valueEnd.anyOf(",}"); if (!end) { // write expression continuation - valueLen += (int) (token.fContentEnd - lastEnd); + lengths.fCurValue += (int) (token.fContentEnd - lastEnd); continue; } } - if (State::kNoItem != state) { - longestValue = SkTMax(longestValue, valueLen); - state = State::kNoItem; + if (ItemState::kNone != state) { + this->checkEnumLengths(child, enumName, &lengths); + lengths.fCurValue = 0; + state = ItemState::kNone; } - SkASSERT(State::kNoItem == state); + SkASSERT(ItemState::kNone == state); lastEnd = token.fContentEnd; - longestName = SkTMax(longestName, (int) (lastEnd - token.fContentStart)); - state = State::kItemName; + lengths.fCurName = (int) (lastEnd - token.fContentStart); + enumName = string(token.fContentStart, lengths.fCurName); + state = ItemState::kName; } - if (State::kItemValue == state) { - longestValue = SkTMax(longestValue, valueLen); + if (ItemState::kNone != state) { + this->checkEnumLengths(child, enumName, &lengths); } - fEnumItemValueTab = longestName + fIndent + 1 /* space before = */ ; - if (longestValue) { - longestValue += 3; /* = space , */ + fEnumItemValueTab = lengths.fLongestName + fIndent + 1 /* 1: , */ ; + if (lengths.fLongestValue) { + lengths.fLongestValue += 3; // 3: space = space } - fEnumItemCommentTab = fEnumItemValueTab + longestValue + 1 /* space before //!< */ ; + fEnumItemCommentTab = fEnumItemValueTab + lengths.fLongestValue + 1 ; // 1: space before //!< // iterate through bmh children and see which comments fit on include lines - for (auto& enumItem : fEnumDef->fChildren) { - if (MarkType::kConst != enumItem->fMarkType) { + if (!this->checkChildCommentLength(fEnumDef, MarkType::kConst)) { + fEnumDef->reportError<void>("expected at least one #Const in #Enum"); + } +} + +const Definition* IncludeWriter::matchMemberName(string matchName, const Definition& child) const { + const Definition* parent = &child; + if (KeyWord::kEnum == child.fKeyWord && child.fChildren.size() > 0 + && KeyWord::kClass == child.fChildren[0]->fKeyWord) { + matchName = child.fChildren[0]->fName + "::" + matchName; + } + do { + if (KeyWord::kStruct == parent->fKeyWord || KeyWord::kClass == parent->fKeyWord) { + matchName = parent->fName + "::" + matchName; + } + } while ((parent = parent->fParent)); + const Definition* enumItem = nullptr; + for (auto testItem : fEnumDef->fChildren) { + if (MarkType::kConst != testItem->fMarkType) { continue; } - TextParser enumLine(enumItem); - enumLine.trimEnd(); - enumLine.skipToLineStart(); // skip const value - const char* commentStart = enumLine.fChar; - enumLine.skipLine(); - ptrdiff_t lineLen = enumLine.fChar - commentStart + 5 /* //!< space */ ; - if (!enumLine.eof()) { - enumLine.skipWhiteSpace(); + if (matchName != testItem->fName) { + continue; } - enumItem->fShort = enumLine.eof() && fEnumItemCommentTab + lineLen < 100; + enumItem = testItem; + break; } + SkASSERT(enumItem); + return enumItem; } // walk children and output complete method doxygen description -void IncludeWriter::methodOut(const Definition* method, const Definition& child) { +void IncludeWriter::methodOut(Definition* method, const Definition& child) { if (fPendingMethod) { fIndent -= 4; fPendingMethod = false; @@ -683,7 +796,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child) fMethodDef = &child; fContinuation = nullptr; fDeferComment = nullptr; - const Definition* csParent = method->csParent(); + Definition* csParent = method->csParent(); if (csParent && (0 == fIndent || fIndentNext)) { fIndent += 4; fIndentNext = false; @@ -745,7 +858,7 @@ void IncludeWriter::structOut(const Definition* root, const Definition& child, fIndent += 4; this->lfcr(); if (child.fDeprecated) { - this->writeString(child.fToBeDeprecated ? "to be deprecated soon" : "deprecated"); + this->writeString(child.incompleteMessage(Definition::DetailsType::kSentence)); } else { this->rewriteBlock((int)(commentEnd - commentStart), commentStart, Phrase::kNo); } @@ -805,6 +918,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const if (!commentBlock) { return memberStart->reportError<Definition*>("member missing comment block"); } +#if 0 if (!commentBlock->fShort) { const char* commentStart = commentBlock->fContentStart; ptrdiff_t commentLen = commentBlock->fContentEnd - commentStart; @@ -831,6 +945,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const } this->writeCommentTrailer(); } +#endif this->lfcr(); this->writeBlock((int) (child.fStart - memberStart->fContentStart), memberStart->fContentStart); @@ -852,7 +967,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const valueStart->fContentStart); } this->writeString(";"); - if (commentBlock->fShort) { + /* if (commentBlock->fShort) */ { this->indentToColumn(fStructCommentTab); this->writeString("//!<"); this->writeSpace(); @@ -863,29 +978,6 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const return valueEnd; } -// iterate through bmh children and see which comments fit on include lines -void IncludeWriter::structSetMembersShort(const vector<Definition*>& bmhChildren) { - for (auto memberDef : bmhChildren) { - if (MarkType::kMember != memberDef->fMarkType) { - continue; - } - string extract = fBmhParser->extractText(memberDef, BmhParser::TrimExtract::kYes); - bool multiline = string::npos != extract.find('\n'); - if (multiline) { - memberDef->fShort = false; - } else { - ptrdiff_t lineLen = extract.length() + 5 /* //!< space */ ; - memberDef->fShort = fStructCommentTab + lineLen < 100; - } - } - for (auto memberDef : bmhChildren) { - if (MarkType::kSubtopic != memberDef->fMarkType && MarkType::kTopic != memberDef->fMarkType) { - continue; - } - this->structSetMembersShort(memberDef->fChildren); - } -} - void IncludeWriter::structSizeMembers(const Definition& child) { int longestType = 0; Definition* typeStart = nullptr; @@ -996,8 +1088,9 @@ void IncludeWriter::structSizeMembers(const Definition& child) { fStructCommentTab += longestValue + 3 /* space = space */ ; fStructValueTab -= 1 /* ; */ ; } - // iterate through bmh children and see which comments fit on include lines - this->structSetMembersShort(fBmhStructDef->fChildren); + // iterate through struct to ensure that members' comments fit on line + // struct or class may not have any members + (void) this->checkChildCommentLength(fBmhStructDef, MarkType::kMember); } static bool find_start(const Definition* startDef, const char* start) { @@ -1026,8 +1119,8 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti // skip include comment // if there is a series of same named methods, write one set of comments, then write all methods string methodName; - const Definition* method = nullptr; - const Definition* clonedMethod = nullptr; + Definition* method = nullptr; + Definition* clonedMethod = nullptr; const Definition* memberStart = nullptr; const Definition* memberEnd = nullptr; fContinuation = nullptr; @@ -1285,8 +1378,8 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti if (fInStruct) { // try child; root+child; root->parent+child; etc. int trial = 0; - const RootDefinition* search = root; - const Definition* parent = search->fParent; + RootDefinition* search = root; + Definition* parent = search->fParent; do { string name; if (0 == trial) { @@ -1301,7 +1394,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti } fBmhStructDef = search->find(name, RootDefinition::AllowParens::kNo); } while (!fBmhStructDef && ++trial); - root = const_cast<RootDefinition*>(fBmhStructDef->asRoot()); + root = fBmhStructDef->asRoot(); SkASSERT(root); fIndent += 4; this->structSizeMembers(child); @@ -1472,7 +1565,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti (KeyWord::kClass == child.fParent->fKeyWord && child.fParent->fParent && KeyWord::kEnum == child.fParent->fParent->fKeyWord)) { SkASSERT(Bracket::kBrace == child.fBracket); - this->enumMembersOut(root, child); + this->enumMembersOut(*child.fParent); this->writeString("};"); this->lf(2); startDef = child.fParent; @@ -2095,6 +2188,7 @@ IncludeWriter::Wrote IncludeWriter::rewriteBlock(int size, const char* data, Phr case 'z': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + case '%': // to do : ensure that preceding is a number case '-': switch (word) { case Word::kStart: diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp index db6a8cf7d6..7f07bc2d3e 100644 --- a/tools/bookmaker/mdOut.cpp +++ b/tools/bookmaker/mdOut.cpp @@ -16,6 +16,155 @@ } \ fprintf(fOut, __VA_ARGS__) +const char* SubtopicKeys::kGeneratedSubtopics[] = { + kClasses, kConstants, kConstructors, kDefines, + kMemberFunctions, kMembers, kOperators, kRelatedFunctions, kStructs, kTypedefs, +}; + +const char* kConstTableStyle = +"<style>" "\n" + ".td_const td, th { border: 2px solid #dddddd; text-align: left; padding: 8px; }" "\n" + ".tr_const tr:nth-child(even) { background-color: #f0f0f0; }" "\n" + ".td2_const td:first-child + td { text-align: center; }" "\n" +"</style>" "\n"; + +const char* kTableDeclaration = "<table style='border-collapse: collapse; width: 62.5em'>"; + +#define kTD_Base "border: 2px solid #dddddd; padding: 8px; " +#define kTH_Left "<th style='text-align: left; " kTD_Base "'>" +#define kTH_Center "<th style='text-align: center; " kTD_Base "'>" + +string kTD_Left = " <td style='text-align: left; " kTD_Base "'>"; +string kTD_Center = " <td style='text-align: center; " kTD_Base "'>"; +string kTR_Dark = " <tr style='background-color: #f0f0f0; '>"; + +const char* kAllConstTableHeader = " <tr>" kTH_Left "Const</th>" "\n" + kTH_Center "Value</th>" "\n" + kTH_Left "Description</th>" "</tr>"; +const char* kSubConstTableHeader = " <tr>" kTH_Left "Const</th>" "\n" + kTH_Center "Value</th>" "\n" + kTH_Left "Details</th>" "\n" + kTH_Left "Description</th>" "</tr>"; +const char* kAllMemberTableHeader = " <tr>" kTH_Left "Type</th>" "\n" + kTH_Left "Name</th>" "\n" + kTH_Left "Description</th>" "</tr>"; +const char* kSubMemberTableHeader = " <tr>" kTH_Left "Type</th>" "\n" + kTH_Left "Name</th>" "\n" + kTH_Left "Details</th>" "\n" + kTH_Left "Description</th>" "</tr>"; +const char* kTopicsTableHeader = " <tr>" kTH_Left "Topic</th>" "\n" + kTH_Left "Description</th>" "</tr>"; + +static string html_file_name(string bmhFileName) { + SkASSERT("docs" == bmhFileName.substr(0, 4)); + SkASSERT('\\' == bmhFileName[4] || '/' == bmhFileName[4]); + SkASSERT(".bmh" == bmhFileName.substr(bmhFileName.length() - 4)); + string result = bmhFileName.substr(5, bmhFileName.length() - 4 - 5); + return result; +} + +string MdOut::anchorDef(string str, string name) { + if (fValidate) { + string htmlName = html_file_name(fFileName); + vector<AnchorDef>& allDefs = fAllAnchorDefs[htmlName]; + if (!std::any_of(allDefs.begin(), allDefs.end(), + [str](AnchorDef compare) { return compare.fDef == str; } )) { + MarkType markType = fLastDef->fMarkType; + if (MarkType::kMethod == markType + && std::any_of(fLastDef->fChildren.begin(), fLastDef->fChildren.end(), + [](const Definition* compare) { + return IncompleteAllowed(compare->fMarkType); } )) { + markType = MarkType::kDeprecated; + } + if (MarkType::kMethod == markType && fLastDef->fClone) { + markType = MarkType::kDeprecated; // TODO: hack to allow missing reference + } + allDefs.push_back( { str, markType } ); + } + } + return "<a name='" + str + "'>" + name + "</a>"; +} + +string MdOut::anchorRef(string ref, string name) { + if (fValidate) { + string htmlName; + size_t hashIndex = ref.find('#'); + if (string::npos != hashIndex && "https://" != ref.substr(0, 8)) { + if (0 == hashIndex) { + htmlName = html_file_name(fFileName); + } else { + htmlName = ref.substr(0, hashIndex); + } + vector<string>& allRefs = fAllAnchorRefs[htmlName]; + string refPart = ref.substr(hashIndex + 1); + if (allRefs.end() == std::find(allRefs.begin(), allRefs.end(), refPart)) { + allRefs.push_back(refPart); + } + } + } + SkASSERT(string::npos != ref.find('#') || string::npos != ref.find("https://")); + return "<a href='" + ref + "'>" + name + "</a>"; +} + +string MdOut::anchorLocalRef(string ref, string name) { + return this->anchorRef("#" + ref, name); +} + +string MdOut::tableDataCodeRef(string ref, string name) { + return kTD_Left + this->anchorRef(ref, "<code>" + name + "</code>") + "</td>"; +} + +string MdOut::tableDataCodeLocalRef(string ref, string name) { + return this->tableDataCodeRef("#" + ref, name); +} + +string MdOut::tableDataCodeLocalRef(string name) { + return this->tableDataCodeLocalRef(name, name); +} + +string MdOut::tableDataCodeRef(const Definition* ref) { + return this->tableDataCodeLocalRef(ref->fFiddle, ref->fName); +} + +string MdOut::tableDataCodeDef(string def, string name) { + return kTD_Left + this->anchorDef(def, "<code>" + name + "</code>") + "</td>"; +} + +string MdOut::tableDataCodeDef(const Definition* def) { + return this->tableDataCodeDef(def->fFiddle, def->fName); +} + +static string table_data_const(const Definition* def, const char** textStartPtr) { + TextParser parser(def); + SkAssertResult(parser.skipToEndBracket('\n')); + string constant = string(def->fContentStart, (int) (parser.fChar - def->fContentStart)); + if (textStartPtr) { + *textStartPtr = parser.fChar; + } + return kTD_Center + constant + "</td>"; +} + +static string out_table_data_description_start() { + return kTD_Left; +} + +static string out_table_data_description(string str) { + return kTD_Left + str + "</td>"; +} + +static string out_table_data_description(const Definition* def) { + return out_table_data_description(string(def->fContentStart, + (int) (def->fContentEnd - def->fContentStart))); +} + +static string out_table_data_details(string details) { + return kTD_Left + details + "</td>"; +} + +#undef kConstTDBase +#undef kTH_Left +#undef kTH_Center + static void add_ref(string leadingSpaces, string ref, string* result) { *result += leadingSpaces + ref; } @@ -43,6 +192,92 @@ static bool all_lower(string ref) { return true; } +// from https://stackoverflow.com/questions/3418231/replace-part-of-a-string-with-another-string +void replace_all(string& str, const string& from, const string& to) { + SkASSERT(!from.empty()); + size_t start_pos = 0; + while ((start_pos = str.find(from, start_pos)) != std::string::npos) { + str.replace(start_pos, from.length(), to); + start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx' + } +} + +// detail strings are preceded by an example comment to check readability +void MdOut::addPopulators() { + fPopulators[SubtopicKeys::kClasses].fName = "Class Declarations"; + fPopulators[SubtopicKeys::kClasses].fOneLiner = "embedded class members"; + fPopulators[SubtopicKeys::kClasses].fDetails = + /* SkImageInfo */ "uses C++ classes to declare the public data" + " structures and interfaces."; + fPopulators[SubtopicKeys::kConstants].fName = "Constants"; + fPopulators[SubtopicKeys::kConstants].fOneLiner = "enum and enum class, and their const values"; + fPopulators[SubtopicKeys::kConstants].fDetails = + /* SkImageInfo */ "related constants are defined by <code>enum</code>," + " <code>enum class</code>, <code>#define</code>, <code>const</code>," + " and <code>constexpr</code>."; + fPopulators[SubtopicKeys::kConstructors].fName = "Constructors"; + fPopulators[SubtopicKeys::kConstructors].fOneLiner = "functions that construct"; + fPopulators[SubtopicKeys::kConstructors].fDetails = + /* SkImageInfo */ "can be constructed or initialized by these functions," + " including C++ class constructors."; + fPopulators[SubtopicKeys::kDefines].fName = "Defines"; + fPopulators[SubtopicKeys::kDefines].fOneLiner = "preprocessor definitions of functions, values"; + fPopulators[SubtopicKeys::kDefines].fDetails = + /* SkImageInfo */ "uses preprocessor definitions to inline code and constants," + " and to abstract platform-specific functionality."; + fPopulators[SubtopicKeys::kMemberFunctions].fName = "Functions"; + fPopulators[SubtopicKeys::kMemberFunctions].fOneLiner = "global and class member functions"; + fPopulators[SubtopicKeys::kMemberFunctions].fDetails = + /* SkImageInfo */ "member functions read and modify the structure properties."; + fPopulators[SubtopicKeys::kMembers].fName = "Members"; + fPopulators[SubtopicKeys::kMembers].fOneLiner = "member values"; + fPopulators[SubtopicKeys::kMembers].fDetails = + /* SkImageInfo */ "members may be read and written directly without using" + " a member function."; + fPopulators[SubtopicKeys::kOperators].fName = "Operators"; + fPopulators[SubtopicKeys::kOperators].fOneLiner = "operator overloading methods"; + fPopulators[SubtopicKeys::kOperators].fDetails = + /* SkImageInfo */ "operators inline class member functions with arithmetic" + " equivalents."; + fPopulators[SubtopicKeys::kRelatedFunctions].fName = "Related Functions"; + fPopulators[SubtopicKeys::kRelatedFunctions].fOneLiner = + "similar member functions grouped together"; + fPopulators[SubtopicKeys::kRelatedFunctions].fDetails = + /* SkImageInfo */ "global, <code>struct</code>, and <code>class</code> related member" + " functions share a topic."; + fPopulators[SubtopicKeys::kStructs].fName = "Struct Declarations"; + fPopulators[SubtopicKeys::kStructs].fOneLiner = "embedded struct members"; + fPopulators[SubtopicKeys::kStructs].fDetails = + /* SkImageInfo */ "uses C++ structs to declare the public data" + " structures and interfaces."; + fPopulators[SubtopicKeys::kTypedefs].fName = "Typedef Declarations"; + fPopulators[SubtopicKeys::kTypedefs].fOneLiner = "types defined by other types"; + fPopulators[SubtopicKeys::kTypedefs].fDetails = + /* SkImageInfo */ " <code>typedef</code> define a data type."; +} + +Definition* MdOut::checkParentsForMatch(Definition* test, string ref) const { + bool isSubtopic = MarkType::kSubtopic == test->fMarkType + || MarkType::kTopic == test->fMarkType; + do { + if (!test->isRoot()) { + continue; + } + bool localTopic = MarkType::kSubtopic == test->fMarkType + || MarkType::kTopic == test->fMarkType; + if (localTopic != isSubtopic) { + continue; + } + string prefix(isSubtopic ? "_" : "::"); + RootDefinition* root = test->asRoot(); + string prefixed = root->fName + prefix + ref; + if (Definition* def = root->find(prefixed, RootDefinition::AllowParens::kYes)) { + return def; + } + } while ((test = test->fParent)); + return nullptr; +} + // FIXME: preserve inter-line spaces and don't add new ones string MdOut::addReferences(const char* refStart, const char* refEnd, BmhParser::Resolvable resolvable) { @@ -84,7 +319,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, } else { leadingSpaces = string(base, wordStart - base); } - t.skipToMethodEnd(); + t.skipToMethodEnd(resolvable); if (base == t.fChar) { if (!t.eof() && '~' == base[0] && !isalnum(base[1])) { t.next(); @@ -99,13 +334,18 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, continue; } ref = string(start, t.fChar - start); + if (fMethod && "SkSurface::MakeRenderTarget" == fMethod->fName && "is" == ref) { + SkDebugf(""); + } if (const Definition* def = this->isDefined(t, ref, resolvable)) { if (MarkType::kExternal == def->fMarkType) { + (void) this->anchorRef("undocumented#" + ref, ""); // for anchor validate add_ref(leadingSpaces, ref, &result); continue; } SkASSERT(def->fFiddle.length()); - if (!t.eof() && '(' == t.peek() && t.strnchr(')', t.fEnd)) { + if (BmhParser::Resolvable::kSimple != resolvable + && !t.eof() && '(' == t.peek() && t.strnchr(')', t.fEnd)) { if (!t.skipToEndBracket(')')) { t.reportError("missing close paren"); fAddRefFailed = true; @@ -226,8 +466,9 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, } } } - if (BmhParser::Resolvable::kOut != resolvable && - BmhParser::Resolvable::kFormula != resolvable) { + if (BmhParser::Resolvable::kSimple != resolvable + && BmhParser::Resolvable::kOut != resolvable + && BmhParser::Resolvable::kFormula != resolvable) { t.reportError("missed camelCase"); fAddRefFailed = true; return result; @@ -259,37 +500,25 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, continue; } } - const Definition* test = fRoot; - do { - if (!test->isRoot()) { - continue; - } - for (string prefix : { "_", "::" } ) { - const RootDefinition* root = test->asRoot(); - string prefixed = root->fName + prefix + ref; - if (const Definition* def = root->find(prefixed, - RootDefinition::AllowParens::kYes)) { - result += linkRef(leadingSpaces, def, ref, resolvable); - goto found; - } - } - } while ((test = test->fParent)); - found: - if (!test) { - if (BmhParser::Resolvable::kOut != resolvable && - BmhParser::Resolvable::kFormula != resolvable) { - t.reportError("undefined reference"); - fAddRefFailed = true; - } else { - add_ref(leadingSpaces, ref, &result); - } + Definition* def = this->checkParentsForMatch(fSubtopic, ref); + if (!def) { + def = this->checkParentsForMatch(fRoot, ref); + } + if (def) { + result += this->linkRef(leadingSpaces, def, ref, resolvable); + continue; + } + if (BmhParser::Resolvable::kOut != resolvable && + BmhParser::Resolvable::kFormula != resolvable) { + t.reportError("undefined reference"); + fAddRefFailed = true; + } else { + add_ref(leadingSpaces, ref, &result); } } while (!t.eof()); return result; } - - bool MdOut::buildReferences(const IncludeParser& includeParser, const char* docDir, const char* mdFileOrPath) { if (!sk_isdir(mdFileOrPath)) { @@ -362,12 +591,7 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) { if (topicDef->fParent) { continue; } - if (!topicDef->isRoot()) { - fAddRefFailed = true; - return this->reportError<bool>("expected root topic"); - } - fRoot = topicDef->asRoot(); - if (string::npos == fRoot->fFileName.rfind(match)) { + if (string::npos == topicDef->fFileName.rfind(match)) { continue; } if (!fOut) { @@ -381,6 +605,9 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) { SkDebugf("could not open output file %s\n", fullName.c_str()); return false; } + if (false) { // try inlining the style + FPRINTF("%s", kConstTableStyle); + } size_t underscorePos = header.find('_'); if (string::npos != underscorePos) { header.replace(underscorePos, 1, " "); @@ -390,19 +617,8 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) { this->lfAlways(1); FPRINTF("==="); } - fPopulators.clear(); - fPopulators[kClassesAndStructs].fDescription = "embedded struct and class members"; - fPopulators[kConstants].fDescription = "enum and enum class, const values"; - fPopulators[kConstructors].fDescription = "functions that construct"; - fPopulators[kDefines].fDescription = "preprocessor definitions of functions, values"; - fPopulators[kMemberFunctions].fDescription = "static functions and member methods"; - fPopulators[kMembers].fDescription = "member values"; - fPopulators[kOperators].fDescription = "operator overloading methods"; - fPopulators[kRelatedFunctions].fDescription = "similar methods grouped together"; - fPopulators[kSubtopics].fDescription = ""; - fPopulators[kTypedefs].fDescription = "types defined by other types"; - this->populateTables(fRoot); - this->markTypeOut(topicDef); + const Definition* prior = nullptr; + this->markTypeOut(topicDef, &prior); } if (fOut) { this->writePending(); @@ -423,6 +639,91 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) { return !fAddRefFailed; } +static bool contains_referenced_child(const Definition* found, const vector<string>& refs) { + for (auto child : found->fChildren) { + if (refs.end() != std::find_if(refs.begin(), refs.end(), + [child](string def) { return child->fName == def; } )) { + return true; + } + if (contains_referenced_child(child, refs)) { + return true; + } + } + return false; +} + +void MdOut::checkAnchors() { + int missing = 0; + for (auto bmhFile : fAllAnchorRefs) { + auto defIter = fAllAnchorDefs.find(bmhFile.first); + SkASSERT(fAllAnchorDefs.end() != defIter); + vector<AnchorDef>& allDefs = defIter->second; + std::sort(allDefs.begin(), allDefs.end(), + [](const AnchorDef& a, const AnchorDef& b) { return a.fDef < b.fDef; } ); + std::sort(bmhFile.second.begin(), bmhFile.second.end()); + auto allDefsIter = allDefs.begin(); + auto allRefsIter = bmhFile.second.begin(); + for (;;) { + bool allDefsEnded = allDefsIter == allDefs.end(); + bool allRefsEnded = allRefsIter == bmhFile.second.end(); + if (allDefsEnded && allRefsEnded) { + break; + } + if (allRefsEnded || (!allDefsEnded && allDefsIter->fDef < *allRefsIter)) { + if (MarkType::kParam != allDefsIter->fMarkType + && !IncompleteAllowed(allDefsIter->fMarkType)) { + // If undocumented but parent or child is referred to: good enough for now + bool goodEnough = false; + if ("undocumented" == defIter->first) { + auto iter = fBmhParser.fTopicMap.find(allDefsIter->fDef); + if (fBmhParser.fTopicMap.end() != iter) { + const Definition* found = iter->second; + if (string::npos != found->fFileName.find("undocumented")) { + const Definition* parent = found; + while ((parent = parent->fParent)) { + if (bmhFile.second.end() != std::find_if(bmhFile.second.begin(), + bmhFile.second.end(), + [parent](string def) { + return parent->fName == def; } )) { + goodEnough = true; + break; + } + } + if (!goodEnough) { + goodEnough = contains_referenced_child(found, bmhFile.second); + } + } + } + } + if (!goodEnough) { + SkDebugf("missing ref %s %s\n", defIter->first.c_str(), + allDefsIter->fDef.c_str()); + missing++; + } + } + allDefsIter++; + } else if (allDefsEnded || (!allRefsEnded && allDefsIter->fDef > *allRefsIter)) { + if (fBmhParser.fExternals.end() == std::find_if(fBmhParser.fExternals.begin(), + fBmhParser.fExternals.end(), [allRefsIter](const RootDefinition& root) { + return *allRefsIter != root.fName; } )) { + SkDebugf("missing def %s %s\n", bmhFile.first.c_str(), allRefsIter->c_str()); + missing++; + } + allRefsIter++; + } else { + SkASSERT(!allDefsEnded); + SkASSERT(!allRefsEnded); + SkASSERT(allDefsIter->fDef == *allRefsIter); + allDefsIter++; + allRefsIter++; + } + if (missing >= 10) { + missing = 0; + } + } + } +} + bool MdOut::checkParamReturnBody(const Definition* def) { TextParser paramBody(def); const char* descriptionStart = paramBody.fChar; @@ -445,21 +746,23 @@ bool MdOut::checkParamReturnBody(const Definition* def) { return true; } -void MdOut::childrenOut(const Definition* def, const char* start) { +void MdOut::childrenOut(Definition* def, const char* start) { const char* end; fLineCount = def->fLineCount; - if (def->isRoot()) { - fRoot = const_cast<RootDefinition*>(def->asRoot()); - } else if (MarkType::kEnumClass == def->fMarkType) { + if (MarkType::kEnumClass == def->fMarkType) { fEnumClass = def; } BmhParser::Resolvable resolvable = this->resolvable(def); + const Definition* prior = nullptr; for (auto& child : def->fChildren) { + if (MarkType::kPhraseParam == child->fMarkType) { + continue; + } end = child->fStart; if (BmhParser::Resolvable::kNo != resolvable) { this->resolveOut(start, end, resolvable); } - this->markTypeOut(child); + this->markTypeOut(child, &prior); start = child->fTerminator; } if (BmhParser::Resolvable::kNo != resolvable) { @@ -471,8 +774,59 @@ void MdOut::childrenOut(const Definition* def, const char* start) { } } -const Definition* MdOut::csParent() const { - const Definition* csParent = fRoot->csParent(); +// output header for subtopic for all consts: name, value, short descriptions (#Line) +// output link to in context #Const with moderate description +void MdOut::summaryOut(const Definition* def, MarkType markType, string name) { + this->writePending(); + SkASSERT(TableState::kNone == fTableState); + this->mdHeaderOut(3); + FPRINTF("%s", name.c_str()); + this->lfAlways(2); + FPRINTF("%s", kTableDeclaration); // <table> with style info + this->lfAlways(1); + FPRINTF("%s", MarkType::kConst == markType ? kAllConstTableHeader : kAllMemberTableHeader); + this->lfAlways(1); + bool odd = true; + for (auto child : def->fChildren) { + if (markType != child->fMarkType) { + continue; + } + auto oneLiner = std::find_if(child->fChildren.begin(), child->fChildren.end(), + [](const Definition* test){ return MarkType::kLine == test->fMarkType; } ); + if (child->fChildren.end() == oneLiner) { + child->reportError<void>("missing #Line"); + continue; + } + FPRINTF("%s", odd ? kTR_Dark.c_str() : " <tr>"); + this->lfAlways(1); + if (MarkType::kConst == markType) { + FPRINTF("%s", tableDataCodeRef(def).c_str()); + this->lfAlways(1); + FPRINTF("%s", table_data_const(def, nullptr).c_str()); + } else { + string memberType; + string memberName = this->getMemberTypeName(child, &memberType); + SkASSERT(MarkType::kMember == markType); + FPRINTF("%s", out_table_data_description(memberType).c_str()); + this->lfAlways(1); + FPRINTF("%s", tableDataCodeLocalRef(memberName).c_str()); + } + this->lfAlways(1); + FPRINTF("%s", out_table_data_description(*oneLiner).c_str()); + this->lfAlways(1); + FPRINTF("%s", " </tr>"); + this->lfAlways(1); + odd = !odd; + } + FPRINTF("</table>"); + this->lfAlways(1); +} + +Definition* MdOut::csParent() { + if (!fRoot) { + return nullptr; + } + Definition* csParent = fRoot->csParent(); if (!csParent) { const Definition* topic = fRoot; while (topic && MarkType::kTopic != topic->fMarkType) { @@ -515,6 +869,106 @@ const Definition* MdOut::findParamType() { return nullptr; } +string MdOut::getMemberTypeName(const Definition* def, string* memberType) { + TextParser parser(def->fFileName, def->fStart, def->fContentStart, + def->fLineCount); + parser.skipExact("#Member"); + parser.skipWhiteSpace(); + const char* typeStart = parser.fChar; + const char* typeEnd = nullptr; + const char* nameStart = nullptr; + const char* nameEnd = nullptr; + do { + parser.skipToWhiteSpace(); + if (nameStart) { + nameEnd = parser.fChar; + } + if (parser.eof()) { + break; + } + const char* spaceLoc = parser.fChar; + if (parser.skipWhiteSpace()) { + typeEnd = spaceLoc; + nameStart = parser.fChar; + } + } while (!parser.eof()); + SkASSERT(typeEnd); + *memberType = string(typeStart, (int) (typeEnd - typeStart)); + replace_all(*memberType, " ", " "); + SkASSERT(nameStart); + SkASSERT(nameEnd); + return string(nameStart, (int) (nameEnd - nameStart)); +} + +bool MdOut::HasDetails(const Definition* def) { + for (auto child : def->fChildren) { + if (MarkType::kDetails == child->fMarkType) { + return true; + } + if (MdOut::HasDetails(child)) { + return true; + } + } + return false; +} + +void MdOut::htmlOut(string s) { + SkASSERT(string::npos != s.find('<')); + FPRINTF("%s", s.c_str()); +} + +const Definition* MdOut::isDefinedByParent(RootDefinition* root, string ref) { + if (ref == root->fName) { + return root; + } + if (const Definition* definition = root->find(ref, RootDefinition::AllowParens::kYes)) { + return definition; + } + Definition* test = root; + bool isSubtopic = MarkType::kSubtopic == root->fMarkType + || MarkType::kTopic == root->fMarkType; + do { + if (!test->isRoot()) { + continue; + } + bool testIsSubtopic = MarkType::kSubtopic == test->fMarkType + || MarkType::kTopic == test->fMarkType; + if (isSubtopic != testIsSubtopic) { + continue; + } + RootDefinition* root = test->asRoot(); + for (auto& leaf : root->fBranches) { + if (ref == leaf.first) { + return leaf.second; + } + const Definition* definition = leaf.second->find(ref, + RootDefinition::AllowParens::kYes); + if (definition) { + return definition; + } + } + string prefix = isSubtopic ? "_" : "::"; + string prefixed = root->fName + prefix + ref; + if (Definition* definition = root->find(prefixed, RootDefinition::AllowParens::kYes)) { + return definition; + } + if (isSubtopic && isupper(prefixed[0])) { + auto topicIter = fBmhParser.fTopicMap.find(prefixed); + if (topicIter != fBmhParser.fTopicMap.end()) { + return topicIter->second; + } + } + if (isSubtopic) { + string fiddlePrefixed = root->fFiddle + "_" + ref; + auto topicIter = fBmhParser.fTopicMap.find(fiddlePrefixed); + if (topicIter != fBmhParser.fTopicMap.end()) { + return topicIter->second; + } + } + } while ((test = test->fParent)); + return nullptr; +} + const Definition* MdOut::isDefined(const TextParser& parser, string ref, BmhParser::Resolvable resolvable) { auto rootIter = fBmhParser.fClassMap.find(ref); @@ -550,55 +1004,18 @@ const Definition* MdOut::isDefined(const TextParser& parser, string ref, return &external; } } - if (fRoot) { - if (ref == fRoot->fName) { - return fRoot; - } - if (const Definition* definition = fRoot->find(ref, RootDefinition::AllowParens::kYes)) { - return definition; - } - const Definition* test = fRoot; - do { - if (!test->isRoot()) { - continue; - } - const RootDefinition* root = test->asRoot(); - for (auto& leaf : root->fBranches) { - if (ref == leaf.first) { - return leaf.second; - } - const Definition* definition = leaf.second->find(ref, - RootDefinition::AllowParens::kYes); - if (definition) { - return definition; - } - } - for (string prefix : { "::", "_" } ) { - string prefixed = root->fName + prefix + ref; - if (const Definition* definition = root->find(prefixed, - RootDefinition::AllowParens::kYes)) { - return definition; - } - if (isupper(prefixed[0])) { - auto topicIter = fBmhParser.fTopicMap.find(prefixed); - if (topicIter != fBmhParser.fTopicMap.end()) { - return topicIter->second; - } - } - } - string fiddlePrefixed = root->fFiddle + "_" + ref; - auto topicIter = fBmhParser.fTopicMap.find(fiddlePrefixed); - if (topicIter != fBmhParser.fTopicMap.end()) { - return topicIter->second; - } - } while ((test = test->fParent)); + if (const Definition* definition = this->isDefinedByParent(fRoot, ref)) { + return definition; + } + if (const Definition* definition = this->isDefinedByParent(fSubtopic, ref)) { + return definition; } size_t doubleColon = ref.find("::"); if (string::npos != doubleColon) { string className = ref.substr(0, doubleColon); auto classIter = fBmhParser.fClassMap.find(className); if (classIter != fBmhParser.fClassMap.end()) { - const RootDefinition& classDef = classIter->second; + RootDefinition& classDef = classIter->second; const Definition* result = classDef.find(ref, RootDefinition::AllowParens::kYes); if (result) { return result; @@ -611,7 +1028,7 @@ const Definition* MdOut::isDefined(const TextParser& parser, string ref, ref.length() > 1 && isupper(ref[1]))) { // try with a prefix if ('k' == ref[0]) { - for (auto const& iter : fBmhParser.fEnumMap) { + for (auto& iter : fBmhParser.fEnumMap) { auto def = iter.second.find(ref, RootDefinition::AllowParens::kYes); if (def) { return def; @@ -692,13 +1109,14 @@ string MdOut::linkName(const Definition* ref) const { result = namePart; } } + replace_all(result, "::", "_"); return result; } // for now, hard-code to html links // def should not include SkXXX_ string MdOut::linkRef(string leadingSpaces, const Definition* def, - string ref, BmhParser::Resolvable resolvable) const { + string ref, BmhParser::Resolvable resolvable) { string buildup; string refName; const string* str = &def->fFiddle; @@ -708,7 +1126,9 @@ string MdOut::linkRef(string leadingSpaces, const Definition* def, if (MarkType::kAlias == def->fMarkType) { def = def->fParent; SkASSERT(def); - SkASSERT(MarkType::kSubtopic == def->fMarkType ||MarkType::kTopic == def->fMarkType); + SkASSERT(MarkType::kSubtopic == def->fMarkType + || MarkType::kTopic == def->fMarkType + || MarkType::kConst == def->fMarkType); } if (MarkType::kSubtopic == def->fMarkType) { const Definition* topic = def->topicParent(); @@ -756,7 +1176,7 @@ string MdOut::linkRef(string leadingSpaces, const Definition* def, if (ref.length() > 2 && islower(ref[0]) && "()" == ref.substr(ref.length() - 2)) { refOut = refOut.substr(0, refOut.length() - 2); } - string result = leadingSpaces + "<a href=\"" + buildup + "\">" + refOut + "</a>"; + string result = leadingSpaces + this->anchorRef(buildup, refOut); if (BmhParser::Resolvable::kClone == resolvable && MarkType::kMethod == def->fMarkType && def->fCloned && !def->fClone) { bool found = false; @@ -771,7 +1191,8 @@ string MdOut::linkRef(string leadingSpaces, const Definition* def, string clone = match + num; const auto& leafIter = classIter->second.fLeaves.find(clone); if (leafIter != classIter->second.fLeaves.end()) { - result += "<sup><a href=\"" + buildup + "_" + num + "\">[" + num + "]</a></sup>"; + result += "<sup>" + this->anchorRef(buildup + "_" + num, + string("[") + num + "]") + "</sup>"; found = true; } } @@ -783,19 +1204,27 @@ string MdOut::linkRef(string leadingSpaces, const Definition* def, return result; } -void MdOut::markTypeOut(Definition* def) { +static bool writeTableEnd(MarkType markType, Definition* def, const Definition** prior) { + return markType != def->fMarkType && *prior && markType == (*prior)->fMarkType; +} + +void MdOut::markTypeOut(Definition* def, const Definition** prior) { string printable = def->printableName(); const char* textStart = def->fContentStart; - if (MarkType::kParam != def->fMarkType && MarkType::kConst != def->fMarkType && - (!def->fParent || MarkType::kConst != def->fParent->fMarkType) && - TableState::kNone != fTableState && - (MarkType::kPhraseRef != def->fMarkType || !def->fParent || - MarkType::kParam != def->fParent->fMarkType)) { + bool lookForOneLiner = false; + // #Param and #Const don't have markers to say when the last is seen, so detect that by looking + // for a change in type. + if (MarkType::kStruct == def->fMarkType) { + SkDebugf(""); + } + if (writeTableEnd(MarkType::kParam, def, prior) || writeTableEnd(MarkType::kConst, def, prior) + || writeTableEnd(MarkType::kMember, def, prior)) { this->writePending(); FPRINTF("</table>"); this->lf(2); fTableState = TableState::kNone; } + fLastDef = def; switch (def->fMarkType) { case MarkType::kAlias: break; @@ -806,20 +1235,52 @@ void MdOut::markTypeOut(Definition* def) { this->writePending(); TextParser parser(def); const char* start = parser.fChar; - parser.skipToEndBracket(" # "); + parser.skipToEndBracket((string(" ") + def->fMC + " ").c_str()); string anchorText(start, parser.fChar - start); - parser.skipExact(" # "); + parser.skipExact((string(" ") + def->fMC + " ").c_str()); string anchorLink(parser.fChar, parser.fEnd - parser.fChar); - FPRINTF("<a href=\"%s\">%s", anchorLink.c_str(), anchorText.c_str()); + this->htmlOut(anchorRef(anchorLink, anchorText)); } break; case MarkType::kBug: break; case MarkType::kClass: + case MarkType::kStruct: { + fRoot = def->asRoot(); this->mdHeaderOut(1); - FPRINTF("<a name=\"%s\"></a> Class %s", this->linkName(def).c_str(), - def->fName.c_str()); + if (MarkType::kStruct == def->fMarkType) { + this->htmlOut(anchorDef(def->fFiddle, "Struct " + def->fName)); + } else { + this->htmlOut(anchorDef(this->linkName(def), "Class " + def->fName)); + } this->lf(1); - break; + if (string::npos != fRoot->fFileName.find("undocumented")) { + break; + } + // if class or struct contains constants, and doesn't contain subtopic kConstant, add it + // and add a child populate + const Definition* subtopic = def->subtopicParent(); + const Definition* topic = def->topicParent(); + for (auto item : SubtopicKeys::kGeneratedSubtopics) { + string subname; + if (subtopic != topic) { + subname = subtopic->fName + '_'; + } + subname += item; + if (fRoot->populator(item).fMembers.size() + && !std::any_of(fRoot->fChildren.begin(), fRoot->fChildren.end(), + [subname](const Definition* child) { + return MarkType::kSubtopic == child->fMarkType + && subname == child->fName; + } )) { + // generate subtopic + this->mdHeaderOut(2); + this->htmlOut(anchorDef(subname, item)); + this->lf(2); + // generate populate + this->subtopicOut(item); + } + } + } break; case MarkType::kCode: this->lfAlways(2); FPRINTF("<pre style=\"padding: 1em 1em 1em 1em;" @@ -837,56 +1298,105 @@ void MdOut::markTypeOut(Definition* def) { break; case MarkType::kComment: break; + case MarkType::kMember: case MarkType::kConst: { + bool isConst = MarkType::kConst == def->fMarkType; + lookForOneLiner = false; + fWroteSomething = false; + // output consts for one parent with moderate descriptions + // optional link to subtopic with longer descriptions, examples if (TableState::kNone == fTableState) { + SkASSERT(!*prior || (isConst && MarkType::kConst != (*prior)->fMarkType) + || (!isConst && MarkType::kMember != (*prior)->fMarkType)); this->mdHeaderOut(3); - FPRINTF("Constants\n" - "\n" - "<table>"); + FPRINTF("%s", this->fPopulators[isConst ? SubtopicKeys::kConstants : + SubtopicKeys::kMembers].fName.c_str()); + this->lfAlways(2); + FPRINTF("%s", kTableDeclaration); fTableState = TableState::kRow; - this->lf(1); + fOddRow = true; + this->lfAlways(1); + // look ahead to see if the details column has data or not + fHasDetails = MdOut::HasDetails(def->fParent); + FPRINTF("%s", fHasDetails ? \ + (isConst ? kSubConstTableHeader : kSubMemberTableHeader) : \ + (isConst ? kAllConstTableHeader : kAllMemberTableHeader)); + this->lfAlways(1); } if (TableState::kRow == fTableState) { this->writePending(); - FPRINTF(" <tr>"); - this->lf(1); + FPRINTF("%s", fOddRow ? kTR_Dark.c_str() : " <tr>"); + fOddRow = !fOddRow; + this->lfAlways(1); fTableState = TableState::kColumn; } this->writePending(); - FPRINTF(" <td><a name=\"%s\"> <code><strong>%s </strong></code> </a></td>", - def->fFiddle.c_str(), def->fName.c_str()); - const char* lineEnd = strchr(textStart, '\n'); - SkASSERT(lineEnd < def->fTerminator); - SkASSERT(lineEnd > textStart); - SkASSERT((int) (lineEnd - textStart) == lineEnd - textStart); - FPRINTF("<td>%.*s</td>", (int) (lineEnd - textStart), textStart); - FPRINTF("<td>"); - textStart = lineEnd; + if (isConst) { + // TODO: if fHasDetails is true, could defer def and issue a ref instead + // unclear if this is a good idea or not + FPRINTF("%s", this->tableDataCodeDef(def).c_str()); + this->lfAlways(1); + FPRINTF("%s", table_data_const(def, &textStart).c_str()); + } else { + string memberType; + string memberName = this->getMemberTypeName(def, &memberType); + FPRINTF("%s", out_table_data_description(memberType).c_str()); + this->lfAlways(1); + FPRINTF("%s", tableDataCodeDef(def->fFiddle, memberName).c_str()); + } + this->lfAlways(1); + if (fHasDetails) { + string details; + auto subtopic = std::find_if(def->fChildren.begin(), def->fChildren.end(), + [](const Definition* test){ + return MarkType::kDetails == test->fMarkType; } ); + if (def->fChildren.end() != subtopic) { + string subtopicName = string((*subtopic)->fContentStart, + (int) ((*subtopic)->fContentEnd - (*subtopic)->fContentStart)); + const Definition* parentSubtopic = def->subtopicParent(); + SkASSERT(parentSubtopic); + string fullName = parentSubtopic->fFiddle + '_' + subtopicName; + if (fBmhParser.fTopicMap.end() == fBmhParser.fTopicMap.find(fullName)) { + (*subtopic)->reportError<void>("missing #Details subtopic"); + } + subtopicName = parentSubtopic->fName + '_' + subtopicName; + string noUnderscores = subtopicName; + replace_all(noUnderscores, "_", " "); + details = this->anchorLocalRef(subtopicName, noUnderscores) + " "; + } + FPRINTF("%s", out_table_data_details(details).c_str()); + this->lfAlways(1); + } + lookForOneLiner = true; // if description is empty, use oneLiner data + FPRINTF("%s", out_table_data_description_start().c_str()); // start of Description + this->lfAlways(1); } break; case MarkType::kDefine: break; case MarkType::kDefinedBy: break; case MarkType::kDeprecated: + this->writeString("Deprecated."); + this->lf(2); break; case MarkType::kDescription: fInDescription = true; this->writePending(); - FPRINTF("<div>"); + FPRINTF("%s", "<div>"); break; - case MarkType::kDoxygen: + case MarkType::kDetails: break; case MarkType::kDuration: break; case MarkType::kEnum: case MarkType::kEnumClass: this->mdHeaderOut(2); - FPRINTF("<a name=\"%s\"></a> Enum %s", def->fFiddle.c_str(), def->fName.c_str()); + this->htmlOut(anchorDef(def->fFiddle, "Enum " + def->fName)); this->lf(2); break; case MarkType::kExample: { this->mdHeaderOut(3); - FPRINTF("Example\n" + FPRINTF("%s", "Example\n" "\n"); fHasFiddle = true; bool showGpu = false; @@ -904,15 +1414,15 @@ void MdOut::markTypeOut(Definition* def) { SkASSERT(def->fHash.length() > 0); FPRINTF("<div><fiddle-embed name=\"%s\"", def->fHash.c_str()); if (showGpu) { - FPRINTF(" gpu=\"true\""); + FPRINTF("%s", " gpu=\"true\""); if (gpuAndCpu) { - FPRINTF(" cpu=\"true\""); + FPRINTF("%s", " cpu=\"true\""); } } - FPRINTF(">"); + FPRINTF("%s", ">"); } else { SkASSERT(def->fHash.length() == 0); - FPRINTF("<pre style=\"padding: 1em 1em 1em 1em; font-size: 13px" + FPRINTF("%s", "<pre style=\"padding: 1em 1em 1em 1em; font-size: 13px" " width: 62.5em; background-color: #f0f0f0\">"); this->lfAlways(1); if (def->fWrapper.length() > 0) { @@ -922,10 +1432,11 @@ void MdOut::markTypeOut(Definition* def) { } } break; case MarkType::kExperimental: + writeString("Experimental."); + this->lf(2); break; case MarkType::kExternal: - break; - case MarkType::kFile: + SkDebugf(""); break; case MarkType::kFormula: break; @@ -962,8 +1473,9 @@ void MdOut::markTypeOut(Definition* def) { break; case MarkType::kList: fInList = true; + fTableState = TableState::kRow; this->lfAlways(2); - FPRINTF("<table>"); + FPRINTF("%s", "<table>"); this->lf(1); break; case MarkType::kLiteral: @@ -971,22 +1483,11 @@ void MdOut::markTypeOut(Definition* def) { case MarkType::kMarkChar: fBmhParser.fMC = def->fContentStart[0]; break; - case MarkType::kMember: { - TextParser tp(def->fFileName, def->fStart, def->fContentStart, def->fLineCount); - tp.skipExact("#Member"); - tp.skipWhiteSpace(); - const char* end = tp.trimmedBracketEnd('\n'); - this->lfAlways(2); - FPRINTF("<a name=\"%s\"> <code><strong>%.*s</strong></code> </a>", - def->fFiddle.c_str(), (int) (end - tp.fChar), tp.fChar); - this->lf(2); - } break; case MarkType::kMethod: { string method_name = def->methodName(); string formattedStr = def->formatFunction(Definition::Format::kIncludeReturn); - this->lfAlways(2); - FPRINTF("<a name=\"%s\"></a>", def->fFiddle.c_str()); + this->htmlOut(anchorDef(def->fFiddle, "")); if (!def->isClone()) { this->mdHeaderOutLF(2, 1); FPRINTF("%s", method_name.c_str()); @@ -997,22 +1498,26 @@ void MdOut::markTypeOut(Definition* def) { // TODO: 50em below should match limit = 80 in formatFunction() this->writePending(); string preformattedStr = preformat(formattedStr); - FPRINTF("<pre style=\"padding: 1em 1em 1em 1em;" - "width: 62.5em; background-color: #f0f0f0\">\n" - "%s\n" - "</pre>", preformattedStr.c_str()); + string references = this->addReferences(&preformattedStr.front(), + &preformattedStr.back() + 1, BmhParser::Resolvable::kSimple); + preformattedStr = references; + this->htmlOut("<pre style=\"padding: 1em 1em 1em 1em; width: 62.5em;" + "background-color: #f0f0f0\">\n" + preformattedStr + "\n" + "</pre>"); this->lf(2); fTableState = TableState::kNone; fMethod = def; } break; case MarkType::kNoExample: break; + case MarkType::kNoJustify: + break; case MarkType::kOutdent: break; case MarkType::kParam: { if (TableState::kNone == fTableState) { + SkASSERT(!*prior || MarkType::kParam != (*prior)->fMarkType); this->mdHeaderOut(3); - fprintf(fOut, + this->htmlOut( "Parameters\n" "\n" "<table>" @@ -1036,22 +1541,84 @@ void MdOut::markTypeOut(Definition* def) { paramParser.skipToSpace(); string paramNameStr(paramName, (int) (paramParser.fChar - paramName)); if (!this->checkParamReturnBody(def)) { + *prior = def; return; } string refNameStr = def->fParent->fFiddle + "_" + paramNameStr; - fprintf(fOut, - " <td><a name=\"%s\"> <code><strong>%s </strong></code> </a></td> <td>", - refNameStr.c_str(), paramNameStr.c_str()); + this->htmlOut(" <td>" + anchorDef(refNameStr, + "<code><strong>" + paramNameStr + "</strong></code>") + "</td>"); + this->lfAlways(1); + FPRINTF(" <td>"); } break; + case MarkType::kPhraseDef: + // skip text and children + *prior = def; + return; + case MarkType::kPhraseParam: + SkDebugf(""); // convenient place to set a breakpoint + break; + case MarkType::kPhraseRef: + if (fPhraseParams.end() != fPhraseParams.find(def->fName)) { + if (fColumn > 0) { + this->writeSpace(); + } + this->writeString(fPhraseParams[def->fName]); + if (isspace(def->fContentStart[0])) { + this->writeSpace(); + } + } else if (fBmhParser.fPhraseMap.end() == fBmhParser.fPhraseMap.find(def->fName)) { + def->reportError<void>("missing phrase definition"); + fAddRefFailed = true; + } else { + if (fColumn) { + SkASSERT(' ' >= def->fStart[0]); + this->writeSpace(); + } + Definition* phraseRef = fBmhParser.fPhraseMap.find(def->fName)->second; + // def->fChildren are parameters to substitute phraseRef->fChildren, + // phraseRef->fChildren has both param defines and references + // def->fChildren must have the same number of entries as phaseRef->fChildren + // which are kPhraseParam, and substitute one for one + // Then, each kPhraseRef in phaseRef looks up the key and value + fPhraseParams.clear(); + auto refKidsIter = phraseRef->fChildren.begin(); + for (auto child : def->fChildren) { + if (MarkType::kPhraseParam != child->fMarkType) { + // more work to do to support other types + this->reportError("phrase ref child must be param"); + } + do { + if (refKidsIter == phraseRef->fChildren.end()) { + this->reportError("phrase def missing param"); + break; + } + if (MarkType::kPhraseRef == (*refKidsIter)->fMarkType) { + continue; + } + if (MarkType::kPhraseParam != (*refKidsIter)->fMarkType) { + this->reportError("unexpected type in phrase def children"); + break; + } + fPhraseParams[(*refKidsIter)->fName] = child->fName; + break; + } while (true); + } + this->childrenOut(phraseRef, phraseRef->fContentStart); + fPhraseParams.clear(); + if (' ' >= def->fContentStart[0] && !fPendingLF) { + this->writeSpace(); + } + } + break; case MarkType::kPlatform: break; case MarkType::kPopulate: { SkASSERT(MarkType::kSubtopic == def->fParent->fMarkType); string name = def->fParent->fName; - if (kSubtopics == name) { - this->subtopicsOut(); + if (string::npos != name.find(SubtopicKeys::kOverview)) { + this->subtopicsOut(def->fParent); } else { - this->subtopicOut(this->populator(name.c_str())); + this->subtopicOut(name); } } break; case MarkType::kPrivate: @@ -1060,6 +1627,7 @@ void MdOut::markTypeOut(Definition* def) { this->mdHeaderOut(3); FPRINTF("Return Value"); if (!this->checkParamReturnBody(def)) { + *prior = def; return; } this->lf(2); @@ -1080,7 +1648,7 @@ void MdOut::markTypeOut(Definition* def) { case MarkType::kStdOut: { TextParser code(def); this->mdHeaderOut(4); - fprintf(fOut, + FPRINTF( "Example Output\n" "\n" "~~~~"); @@ -1094,18 +1662,27 @@ void MdOut::markTypeOut(Definition* def) { FPRINTF("~~~~"); this->lf(2); } break; - case MarkType::kStruct: - fRoot = def->asRoot(); - this->mdHeaderOut(1); - FPRINTF("<a name=\"%s\"></a> Struct %s", def->fFiddle.c_str(), def->fName.c_str()); - this->lf(1); - break; case MarkType::kSubstitute: break; case MarkType::kSubtopic: + fSubtopic = def->asRoot(); this->mdHeaderOut(2); - FPRINTF("<a name=\"%s\"></a> %s", def->fName.c_str(), printable.c_str()); + if (SubtopicKeys::kOverview == def->fName) { + this->writeString(def->fName); + } else { + this->htmlOut(anchorDef(def->fName, printable)); + } this->lf(2); + // if a subtopic child is const, generate short table of const name, value, line desc + if (std::any_of(def->fChildren.begin(), def->fChildren.end(), + [](Definition* child){return MarkType::kConst == child->fMarkType;})) { + this->summaryOut(def, MarkType::kConst, fPopulators[SubtopicKeys::kConstants].fName); + } + // if a subtopic child is member, generate short table of const name, value, line desc + if (std::any_of(def->fChildren.begin(), def->fChildren.end(), + [](Definition* child){return MarkType::kMember == child->fMarkType;})) { + this->summaryOut(def, MarkType::kMember, fPopulators[SubtopicKeys::kMembers].fName); + } break; case MarkType::kTable: this->lf(2); @@ -1114,20 +1691,26 @@ void MdOut::markTypeOut(Definition* def) { break; case MarkType::kText: break; - case MarkType::kTime: - break; case MarkType::kToDo: break; - case MarkType::kTopic: + case MarkType::kTopic: { + auto found = std::find_if(def->fChildren.begin(), def->fChildren.end(), + [](Definition* test) { return test->isStructOrClass(); } ); + bool hasClassOrStruct = def->fChildren.end() != found; + fRoot = hasClassOrStruct ? (*found)->asRoot() : def->asRoot(); + fSubtopic = def->asRoot(); + bool isUndocumented = string::npos != def->fFileName.find("undocumented"); + if (!isUndocumented) { + this->populateTables(def, fRoot); + } this->mdHeaderOut(1); - FPRINTF("<a name=\"%s\"></a> %s", this->linkName(def).c_str(), - printable.c_str()); + this->htmlOut(anchorDef(this->linkName(def), printable)); this->lf(1); - break; - case MarkType::kTrack: - // don't output children - return; + } break; case MarkType::kTypedef: + this->mdHeaderOut(1); + this->htmlOut(anchorDef(def->fFiddle, "Typedef " + def->fName)); + this->lf(1); break; case MarkType::kUnion: break; @@ -1135,39 +1718,36 @@ void MdOut::markTypeOut(Definition* def) { break; case MarkType::kWidth: break; - case MarkType::kPhraseDef: - // skip text and children - return; - case MarkType::kPhraseRef: - if (fBmhParser.fPhraseMap.end() == fBmhParser.fPhraseMap.find(def->fName)) { - def->reportError<void>("missing phrase definition"); - fAddRefFailed = true; - } else { - if (fColumn && ' ' >= def->fStart[0]) { - this->writeSpace(); - } - Definition* phraseRef = fBmhParser.fPhraseMap.find(def->fName)->second; - this->childrenOut(phraseRef, phraseRef->fContentStart); - if (' ' >= def->fContentStart[0]) { - this->writeSpace(); - } - } - break; default: SkDebugf("fatal error: MarkType::k%s unhandled in %s()\n", BmhParser::kMarkProps[(int) def->fMarkType].fName, __func__); SkASSERT(0); // handle everything break; } - TableState saveState = fTableState; + // TableState saveState = fTableState; + if (def->fLineCount >= 533 && string::npos != def->fFileName.find("SkSurface")) { + SkDebugf(""); + } this->childrenOut(def, textStart); - fTableState = saveState; + // fTableState = saveState; switch (def->fMarkType) { // post child work, at least for tables case MarkType::kAnchor: if (fColumn > 0) { this->writeSpace(); } break; + case MarkType::kClass: + case MarkType::kStruct: + if (TableState::kNone != fTableState) { + this->writePending(); + FPRINTF("</table>"); + this->lf(2); + fTableState = TableState::kNone; + } + if (def->csParent()) { + fRoot = def->csParent()->asRoot(); + } + break; case MarkType::kCode: fIndent = 0; this->lf(1); @@ -1180,7 +1760,7 @@ void MdOut::markTypeOut(Definition* def) { if (fInList) { this->writePending(); FPRINTF("</td>"); - this->lf(1); + this->lfAlways(1); } else { FPRINTF(" "); } @@ -1192,7 +1772,12 @@ void MdOut::markTypeOut(Definition* def) { break; case MarkType::kEnum: case MarkType::kEnumClass: - this->lfAlways(2); + if (TableState::kNone != fTableState) { + this->writePending(); + FPRINTF("</table>"); + this->lf(2); + fTableState = TableState::kNone; + } break; case MarkType::kExample: this->writePending(); @@ -1216,8 +1801,10 @@ void MdOut::markTypeOut(Definition* def) { case MarkType::kList: fInList = false; this->writePending(); + SkASSERT(TableState::kNone != fTableState); FPRINTF("</table>"); this->lf(2); + fTableState = TableState::kNone; break; case MarkType::kLegend: { SkASSERT(def->fChildren.size() == 1); @@ -1239,13 +1826,26 @@ void MdOut::markTypeOut(Definition* def) { this->lf(2); break; case MarkType::kConst: + case MarkType::kMember: + if (lookForOneLiner && !fWroteSomething) { + auto oneLiner = std::find_if(def->fChildren.begin(), def->fChildren.end(), + [](const Definition* test){ return MarkType::kLine == test->fMarkType; } ); + if (def->fChildren.end() != oneLiner) { + TextParser parser(*oneLiner); + parser.skipWhiteSpace(); + parser.trimEnd(); + FPRINTF("%.*s", (int) (parser.fEnd - parser.fChar), parser.fChar); + } + lookForOneLiner = false; + } case MarkType::kParam: SkASSERT(TableState::kColumn == fTableState); fTableState = TableState::kRow; this->writePending(); - FPRINTF("</td>\n"); + FPRINTF("</td>"); + this->lfAlways(1); FPRINTF(" </tr>"); - this->lf(1); + this->lfAlways(1); break; case MarkType::kReturn: case MarkType::kSeeAlso: @@ -1259,9 +1859,6 @@ void MdOut::markTypeOut(Definition* def) { } this->lf(1); break; - case MarkType::kStruct: - fRoot = fRoot->rootParent(); - break; case MarkType::kTable: this->lf(2); break; @@ -1269,9 +1866,22 @@ void MdOut::markTypeOut(Definition* def) { break; case MarkType::kPrivate: break; + case MarkType::kSubtopic: + SkASSERT(def); + do { + def = def->fParent; + } while (def && MarkType::kTopic != def->fMarkType + && MarkType::kSubtopic != def->fMarkType); + SkASSERT(def); + fSubtopic = def->asRoot(); + break; + case MarkType::kTopic: + fSubtopic = nullptr; + break; default: break; } + *prior = def; } void MdOut::mdHeaderOutLF(int depth, int lf) { @@ -1282,76 +1892,103 @@ void MdOut::mdHeaderOutLF(int depth, int lf) { FPRINTF(" "); } -void MdOut::populateTables(const Definition* def) { - const Definition* csParent = this->csParent(); - if (!csParent) { +void MdOut::populateOne(Definition* def, + unordered_map<string, RootDefinition::SubtopicContents>& populator) { + if (MarkType::kConst == def->fMarkType) { + populator[SubtopicKeys::kConstants].fMembers.push_back(def); return; } + if (MarkType::kEnum == def->fMarkType || MarkType::kEnumClass == def->fMarkType) { + populator[SubtopicKeys::kConstants].fMembers.push_back(def); + return; + } + if (MarkType::kDefine == def->fMarkType) { + populator[SubtopicKeys::kDefines].fMembers.push_back(def); + return; + } + if (MarkType::kMember == def->fMarkType) { + populator[SubtopicKeys::kMembers].fMembers.push_back(def); + return; + } + if (MarkType::kTypedef == def->fMarkType) { + populator[SubtopicKeys::kTypedefs].fMembers.push_back(def); + return; + } + if (MarkType::kMethod != def->fMarkType) { + return; + } + if (def->fClone) { + return; + } + if (Definition::MethodType::kConstructor == def->fMethodType + || Definition::MethodType::kDestructor == def->fMethodType) { + populator[SubtopicKeys::kConstructors].fMembers.push_back(def); + return; + } + if (Definition::MethodType::kOperator == def->fMethodType) { + populator[SubtopicKeys::kOperators].fMembers.push_back(def); + return; + } + populator[SubtopicKeys::kMemberFunctions].fMembers.push_back(def); + const Definition* csParent = this->csParent(); + if (csParent) { + if (0 == def->fName.find(csParent->fName + "::Make") + || 0 == def->fName.find(csParent->fName + "::make")) { + populator[SubtopicKeys::kConstructors].fMembers.push_back(def); + return; + } + } + for (auto item : def->fChildren) { + if (MarkType::kIn == item->fMarkType) { + string name(item->fContentStart, item->fContentEnd - item->fContentStart); + populator[name].fMembers.push_back(def); + populator[name].fShowClones = true; + break; + } + } +} + +void MdOut::populateTables(const Definition* def, RootDefinition* root) { for (auto child : def->fChildren) { - if (MarkType::kTopic == child->fMarkType || MarkType::kSubtopic == child->fMarkType) { + if (MarkType::kSubtopic == child->fMarkType) { string name = child->fName; - bool builtInTopic = name == kClassesAndStructs || name == kConstants - || name == kConstructors || name == kDefines || name == kMemberFunctions - || name == kMembers || name == kOperators || name == kOverview - || name == kRelatedFunctions || name == kSubtopics || name == kTypedefs; - if (!builtInTopic && child->fName != kOverview) { - this->populator(kRelatedFunctions).fMembers.push_back(child); - } - this->populateTables(child); + bool builtInTopic = name == SubtopicKeys::kOverview; + for (auto item : SubtopicKeys::kGeneratedSubtopics) { + builtInTopic |= name == item; + } + if (!builtInTopic) { + string subname; + const Definition* subtopic = child->subtopicParent(); + if (subtopic) { + subname = subtopic->fName + '_'; + } + builtInTopic = name == subname + SubtopicKeys::kOverview; + for (auto item : SubtopicKeys::kGeneratedSubtopics) { + builtInTopic |= name == subname + item; + } + if (!builtInTopic) { + root->populator(SubtopicKeys::kRelatedFunctions).fMembers.push_back(child); + } else { + SkDebugf(""); + } + } + this->populateTables(child, root); continue; } if (child->isStructOrClass()) { if (fClassStack.size() > 0) { - this->populator(kClassesAndStructs).fMembers.push_back(child); + root->populator(MarkType::kStruct != child->fMarkType ? SubtopicKeys::kClasses : + SubtopicKeys::kStructs).fMembers.push_back(child); } fClassStack.push_back(child); - this->populateTables(child); + this->populateTables(child, child->asRoot()); fClassStack.pop_back(); continue; } if (MarkType::kEnum == child->fMarkType || MarkType::kEnumClass == child->fMarkType) { - this->populator(kConstants).fMembers.push_back(child); - continue; - } - if (MarkType::kDefine == child->fMarkType) { - this->populator(kDefines).fMembers.push_back(child); - } - if (MarkType::kMember == child->fMarkType) { - this->populator(kMembers).fMembers.push_back(child); - continue; - } - if (MarkType::kTypedef == child->fMarkType) { - this->populator(kTypedefs).fMembers.push_back(child); - } - if (MarkType::kMethod != child->fMarkType) { - continue; - } - if (child->fClone) { - continue; - } - if (Definition::MethodType::kConstructor == child->fMethodType - || Definition::MethodType::kDestructor == child->fMethodType) { - this->populator(kConstructors).fMembers.push_back(child); - continue; - } - if (Definition::MethodType::kOperator == child->fMethodType) { - this->populator(kOperators).fMembers.push_back(child); - continue; - } - this->populator(kMemberFunctions).fMembers.push_back(child); - if (csParent && (0 == child->fName.find(csParent->fName + "::Make") - || 0 == child->fName.find(csParent->fName + "::make"))) { - this->populator(kConstructors).fMembers.push_back(child); - continue; - } - for (auto item : child->fChildren) { - if (MarkType::kIn == item->fMarkType) { - string name(item->fContentStart, item->fContentEnd - item->fContentStart); - fPopulators[name].fMembers.push_back(child); - fPopulators[name].fShowClones = true; - break; - } + this->populateTables(child, root); } + this->populateOne(child, root->fPopulators); } } @@ -1416,6 +2053,7 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable } string str(contentStart, lineLength); this->writeString(str.c_str()); + fWroteSomething = !!lineLength; } if (paragraph.eof()) { break; @@ -1431,51 +2069,96 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable } } -void MdOut::rowOut(const char* name, string description) { +void MdOut::rowOut(const char* name, string description, bool literalName) { + FPRINTF("%s", fOddRow ? kTR_Dark.c_str() : " <tr>"); this->lfAlways(1); - FPRINTF("| "); - this->resolveOut(name, name + strlen(name), BmhParser::Resolvable::kYes); - FPRINTF(" | "); + FPRINTF("%s", kTD_Left.c_str()); + if (literalName) { + if (strlen(name)) { + this->writeString(name); + } + } else { + this->resolveOut(name, name + strlen(name), BmhParser::Resolvable::kYes); + } + FPRINTF("</td>"); + this->lfAlways(1); + FPRINTF("%s", kTD_Left.c_str()); this->resolveOut(&description.front(), &description.back() + 1, BmhParser::Resolvable::kYes); - FPRINTF(" |"); - this->lf(1); + FPRINTF("</td>"); + this->lfAlways(1); + FPRINTF(" </tr>"); + this->lfAlways(1); + fOddRow = !fOddRow; } -void MdOut::subtopicsOut() { - const Definition* csParent = this->csParent(); - SkASSERT(csParent); - this->rowOut("name", "description"); - this->rowOut("---", "---"); - for (auto item : { kClassesAndStructs, kConstants, kConstructors, kDefines, - kMemberFunctions, kMembers, kOperators, kRelatedFunctions, kTypedefs } ) { - for (auto entry : this->populator(item).fMembers) { - if (entry->csParent() == csParent) { - string description = fPopulators.find(item)->second.fDescription; - if (kConstructors == item) { - description += " " + csParent->fName; +void MdOut::subtopicsOut(Definition* def) { + Definition* csParent = def->csParent(); + const Definition* subtopicParent = def->subtopicParent(); + const Definition* topicParent = def->topicParent(); + SkASSERT(subtopicParent); + this->lfAlways(1); + FPRINTF("%s", kTableDeclaration); + this->lfAlways(1); + FPRINTF("%s", kTopicsTableHeader); + this->lfAlways(1); + fOddRow = true; + for (auto item : SubtopicKeys::kGeneratedSubtopics) { + for (auto entry : fRoot->populator(item).fMembers) { + if ((csParent && entry->csParent() == csParent) + || entry->subtopicParent() == subtopicParent) { + auto popItem = fPopulators.find(item); + string description = popItem->second.fOneLiner; + if (SubtopicKeys::kConstructors == item) { + description += " " + fRoot->fName; + } + string subtopic; + if (subtopicParent != topicParent) { + subtopic = subtopicParent->fName + '_'; } - this->rowOut(item, description); + string link = this->anchorLocalRef(subtopic + item, popItem->second.fName); + this->rowOut(link.c_str(), description, true); break; } } } + FPRINTF("</table>"); + this->lfAlways(1); } -void MdOut::subtopicOut(const TableContents& tableContents) { - const auto& data = tableContents.fMembers; - const Definition* csParent = this->csParent(); +void MdOut::subtopicOut(string name) { + Definition* csParent = this->csParent(); SkASSERT(csParent); - fRoot = csParent->asRoot(); - this->rowOut("name", "description"); - this->rowOut("---", "---"); + const Definition* topicParent = fSubtopic ? fSubtopic->topicParent() : nullptr; + this->lfAlways(1); + if (fPopulators.end() != fPopulators.find(name)) { + const SubtopicDescriptions& tableDescriptions = this->populator(name); + this->anchorDef(name, tableDescriptions.fName); + this->lfAlways(1); + if (tableDescriptions.fDetails.length()) { + string details = csParent->fName; + details += " " + tableDescriptions.fDetails; + this->writeString(details); + this->lfAlways(1); + } + } else { + this->anchorDef(name, name); + this->lfAlways(1); + } + FPRINTF("%s", kTableDeclaration); + this->lfAlways(1); + FPRINTF("%s", kTopicsTableHeader); + this->lfAlways(1); + fOddRow = true; std::map<string, const Definition*> items; + const RootDefinition::SubtopicContents& tableContents = fRoot->populator(name.c_str()); + auto& data = tableContents.fMembers; for (auto entry : data) { - if (entry->csParent() != csParent) { + if (entry->csParent() != csParent && entry->topicParent() != topicParent) { continue; } size_t start = entry->fName.find_last_of("::"); - string name = entry->fName.substr(string::npos == start ? 0 : start + 1); - items[name] = entry; + string entryName = entry->fName.substr(string::npos == start ? 0 : start + 1); + items[entryName] = entry; } for (auto entry : items) { if (entry.second->fDeprecated) { @@ -1494,8 +2177,16 @@ void MdOut::subtopicOut(const TableContents& tableContents) { parser.reportError("missing #Line"); continue; } - this->rowOut(entry.first.c_str(), string(oneLiner->fContentStart, - oneLiner->fContentEnd - oneLiner->fContentStart)); + string keyName = entry.first; + TextParser dummy(entry.second); // for reporting errors, which we won't do + if (!this->isDefined(dummy, keyName, BmhParser::Resolvable::kOut)) { + keyName = entry.second->fName; + size_t doubleColon = keyName.find("::"); + SkASSERT(string::npos != doubleColon); + keyName = keyName.substr(doubleColon + 2); + } + this->rowOut(keyName.c_str(), string(oneLiner->fContentStart, + oneLiner->fContentEnd - oneLiner->fContentStart), false); if (tableContents.fShowClones && entry.second->fCloned) { int cloneNo = 2; string builder = entry.second->fName; @@ -1504,15 +2195,18 @@ void MdOut::subtopicOut(const TableContents& tableContents) { } builder += '_'; this->rowOut("", - preformat(entry.second->formatFunction(Definition::Format::kOmitReturn))); + preformat(entry.second->formatFunction(Definition::Format::kOmitReturn)), true); do { string match = builder + to_string(cloneNo); auto child = csParent->findClone(match); if (!child) { break; } - this->rowOut("", preformat(child->formatFunction(Definition::Format::kOmitReturn))); + this->rowOut("", + preformat(child->formatFunction(Definition::Format::kOmitReturn)), true); } while (++cloneNo); } } + FPRINTF("</table>"); + this->lfAlways(1); } diff --git a/tools/bookmaker/parserCommon.cpp b/tools/bookmaker/parserCommon.cpp index 072c996df3..0ce45dc1ff 100644 --- a/tools/bookmaker/parserCommon.cpp +++ b/tools/bookmaker/parserCommon.cpp @@ -154,6 +154,7 @@ bool ParserCommon::writeBlockTrim(int size, const char* data) { debug_out(size, data); } fprintf(fOut, "%.*s", size, data); + fWroteSomething = true; int added = 0; fLastChar = data[size - 1]; while (size > 0 && '\n' != data[--size]) { diff --git a/tools/bookmaker/spellCheck.cpp b/tools/bookmaker/spellCheck.cpp index 488ceacc7d..be17855f9b 100644 --- a/tools/bookmaker/spellCheck.cpp +++ b/tools/bookmaker/spellCheck.cpp @@ -42,12 +42,17 @@ private: kColumn, }; + enum class PrintCheck { + kWordsOnly, + kAllowNumbers, + }; + bool check(Definition* ); bool checkable(MarkType markType); - void childCheck(const Definition* def, const char* start); + void childCheck(Definition* def, const char* start); void leafCheck(const char* start, const char* end); bool parseFromFile(const char* path) override { return true; } - void printCheck(string str); + void printCheck(string str, PrintCheck); void reset() override { INHERITED::resetCommon(); @@ -168,7 +173,7 @@ bool SpellCheck::check(Definition* def) { case MarkType::kDescription: fInDescription = true; break; - case MarkType::kDoxygen: + case MarkType::kDetails: break; case MarkType::kDuration: break; @@ -182,8 +187,6 @@ bool SpellCheck::check(Definition* def) { break; case MarkType::kExternal: break; - case MarkType::kFile: - break; case MarkType::kFormula: fInFormula = true; break; @@ -223,6 +226,8 @@ bool SpellCheck::check(Definition* def) { } break; case MarkType::kNoExample: break; + case MarkType::kNoJustify: + break; case MarkType::kOutdent: break; case MarkType::kParam: { @@ -238,7 +243,13 @@ bool SpellCheck::check(Definition* def) { fInCode = true; this->wordCheck(paramParser.fChar - paramName, paramName); fInCode = false; - } break; + } break; + case MarkType::kPhraseDef: + break; + case MarkType::kPhraseParam: + break; + case MarkType::kPhraseRef: + break; case MarkType::kPlatform: break; case MarkType::kPopulate: @@ -271,7 +282,10 @@ bool SpellCheck::check(Definition* def) { case MarkType::kSubstitute: break; case MarkType::kSubtopic: - this->printCheck(printable); + // TODO: add a tag that allows subtopic labels in illustrations to skip spellcheck? + if (string::npos == fFileName.find("illustrations.bmh")) { + this->printCheck(printable, PrintCheck::kAllowNumbers); + } break; case MarkType::kTable: break; @@ -279,16 +293,11 @@ bool SpellCheck::check(Definition* def) { break; case MarkType::kText: break; - case MarkType::kTime: - break; case MarkType::kToDo: break; case MarkType::kTopic: - this->printCheck(printable); + this->printCheck(printable, PrintCheck::kWordsOnly); break; - case MarkType::kTrack: - // don't output children - return true; case MarkType::kTypedef: break; case MarkType::kUnion: @@ -348,11 +357,11 @@ bool SpellCheck::checkable(MarkType markType) { return BmhParser::Resolvable::kYes == fBmhParser.kMarkProps[(int) markType].fResolve; } -void SpellCheck::childCheck(const Definition* def, const char* start) { +void SpellCheck::childCheck(Definition* def, const char* start) { const char* end; fLineCount = def->fLineCount; if (def->isRoot()) { - fRoot = const_cast<RootDefinition*>(def->asRoot()); + fRoot = def->asRoot(); } for (auto& child : def->fChildren) { end = child->fStart; @@ -459,9 +468,16 @@ void SpellCheck::leafCheck(const char* start, const char* end) { } while (++chPtr <= end); } -void SpellCheck::printCheck(string str) { +void SpellCheck::printCheck(string str, PrintCheck allowed) { string word; for (std::stringstream stream(str); stream >> word; ) { + if (PrintCheck::kAllowNumbers == allowed && (std::isdigit(word.back()) || 'x' == word.back())) { + // allow ###x for RGB_888x + if ((size_t) std::count_if(word.begin(), word.end() - 1, + [](unsigned char c){ return std::isdigit(c); } ) == word.length() - 1) { + continue; + } + } wordCheck(word); } } |