diff options
author | 2018-02-07 07:27:09 -0500 | |
---|---|---|
committer | 2018-02-07 12:46:16 +0000 | |
commit | 78de7519692ea93a2d2c70f8c0e773668df49fce (patch) | |
tree | 3c6510b3d8b6b53c23c68efb6dd12fc9ad5666c2 /docs | |
parent | d521b0cc73717186559b9bbaf9728d107bb6b975 (diff) |
add subtopics to all methods
add self-check looking for #In markup on every method, pointing
to an existing #Subtopic to reference the method.
Docs-Preview: https://skia.org/?cl=104325
Bug: skia:6898
Change-Id: I749a25b9a43033ae68d193249b2c0b810dcf8fc8
Reviewed-on: https://skia-review.googlesource.com/104325
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkAutoCanvasRestore_Reference.bmh | 2 | ||||
-rw-r--r-- | docs/SkBitmap_Reference.bmh | 157 | ||||
-rw-r--r-- | docs/SkCanvas_Reference.bmh | 138 | ||||
-rw-r--r-- | docs/SkIRect_Reference.bmh | 4 | ||||
-rw-r--r-- | docs/SkImageInfo_Reference.bmh | 73 | ||||
-rw-r--r-- | docs/SkImage_Reference.bmh | 15 | ||||
-rw-r--r-- | docs/SkMatrix_Reference.bmh | 12 | ||||
-rw-r--r-- | docs/SkPaint_Reference.bmh | 19 | ||||
-rw-r--r-- | docs/SkPath_Reference.bmh | 18 | ||||
-rw-r--r-- | docs/SkPixmap_Reference.bmh | 22 | ||||
-rw-r--r-- | docs/SkRect_Reference.bmh | 1 |
11 files changed, 282 insertions, 179 deletions
diff --git a/docs/SkAutoCanvasRestore_Reference.bmh b/docs/SkAutoCanvasRestore_Reference.bmh index 132a042c95..e4d559da41 100644 --- a/docs/SkAutoCanvasRestore_Reference.bmh +++ b/docs/SkAutoCanvasRestore_Reference.bmh @@ -63,7 +63,7 @@ scope. ## #Method void restore() - +#In Member_Function #Line # restores Canvas to saved state ## Restores Canvas to saved state immediately. Subsequent calls and ~SkAutoCanvasRestore have no effect. diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh index 088158e748..6ecaddabe1 100644 --- a/docs/SkBitmap_Reference.bmh +++ b/docs/SkBitmap_Reference.bmh @@ -331,7 +331,7 @@ copy has pixels: true # ------------------------------------------------------------------------------ #Method void swap(SkBitmap& other) - +#In Utility #Line # exchanges Bitmap pair ## Swaps the fields of the two bitmaps. @@ -368,9 +368,13 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT ## # ------------------------------------------------------------------------------ +#Subtopic Property +#Populate +#Line # metrics and attributes ## +## #Method const SkPixmap& pixmap() const - +#In Property #Line # returns Pixmap ## Returns a constant reference to the Pixmap holding the Bitmap pixel address, row bytes, and Image_Info. @@ -417,7 +421,7 @@ address, row bytes, and Image_Info. # ------------------------------------------------------------------------------ #Method const SkImageInfo& info() const - +#In Property #Line # returns Image_Info ## Returns width, height, Alpha_Type, Color_Type, and Color_Space. @@ -446,7 +450,7 @@ width: 56 height: 56 color: BGRA_8888 alpha: Opaque # ------------------------------------------------------------------------------ #Method int width() const - +#In Property #Line # returns pixel column count ## Returns pixel count in each row. Should be equal or less than: @@ -477,7 +481,7 @@ bitmap width: 16 info width: 16 # ------------------------------------------------------------------------------ #Method int height() const - +#In Property #Line # returns pixel row count ## Returns pixel row count. @@ -503,7 +507,7 @@ bitmap height: 32 info height: 32 # ------------------------------------------------------------------------------ #Method SkColorType colorType() const - +#In Property #Line # returns Image_Info Color_Type ## Returns Color_Type, one of: kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType, kARGB_4444_SkColorType, kRGBA_8888_SkColorType, @@ -529,7 +533,7 @@ color type: kAlpha_8_SkColorType # ------------------------------------------------------------------------------ #Method SkAlphaType alphaType() const - +#In Property #Line # returns Image_Info Alpha_Type ## Returns Alpha_Type, one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType. @@ -552,7 +556,7 @@ alpha type: kPremul_SkAlphaType # ------------------------------------------------------------------------------ #Method SkColorSpace* colorSpace() const - +#In Property #Line # returns Image_Info Color_Space ## Returns Color_Space, the range of colors, associated with Image_Info. The reference count of Color_Space is unchanged. The returned Color_Space is @@ -585,7 +589,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false # ------------------------------------------------------------------------------ #Method sk_sp<SkColorSpace> refColorSpace() const - +#In Property #Line # returns Image_Info Color_Space ## Returns a smart pointer to Color_Space, the range of colors, associated with Image_Info. The smart pointer tracks the number of objects sharing this @@ -618,7 +622,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false # ------------------------------------------------------------------------------ #Method int bytesPerPixel() const - +#In Property #Line # returns number of bytes in pixel based on Color_Type ## Returns number of bytes per pixel required by Color_Type. Returns zero if colorType( is kUnknown_SkColorType. @@ -659,7 +663,7 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8 # ------------------------------------------------------------------------------ #Method int rowBytesAsPixels() const - +#In Property #Line # returns interval between rows in pixels ## Returns number of pixels that fit on row. Should be greater than or equal to width(). @@ -688,7 +692,7 @@ rowBytes: 8 rowBytesAsPixels: 2 # ------------------------------------------------------------------------------ #Method int shiftPerPixel() const - +#In Property #Line # returns bit shift from pixels to bytes ## Returns bit shift converting row bytes to row pixels. Returns zero for kUnknown_SkColorType. @@ -728,7 +732,7 @@ color: kRGBA_F16_SkColorType shiftPerPixel: 3 # ------------------------------------------------------------------------------ #Method bool empty() const - +#In Property #Line # returns true if Image_Info has zero width() or height() ## Returns true if either width() or height() are zero. @@ -761,7 +765,7 @@ width: 2 height: 2 empty: false # ------------------------------------------------------------------------------ #Method bool isNull() const - +#In Property #Line # returns true if Pixel_Ref is nullptr ## Return true if Pixel_Ref is nullptr. @@ -791,7 +795,7 @@ allocated bitmap does have pixels # ------------------------------------------------------------------------------ #Method bool drawsNothing() const - +#In Property #Line # returns true if no width(), no height(), or no Pixel_Ref ## Return true if width() or height() are zero, or if Pixel_Ref is nullptr. If true, Bitmap has no effect when drawn or drawn into. @@ -823,7 +827,7 @@ empty:false isNull:false drawsNothing:false # ------------------------------------------------------------------------------ #Method size_t rowBytes() const - +#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 @@ -856,7 +860,7 @@ setInfo returned:true rowBytes:8 # ------------------------------------------------------------------------------ #Method bool setAlphaType(SkAlphaType alphaType) - +#In Set #Line # sets Alpha_Type of shared pixels ## Sets Alpha_Type, if alphaType is compatible with Color_Type. Returns true unless alphaType is kUnknown_SkAlphaType and current Alpha_Type @@ -920,7 +924,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void* getPixels() const - +#In Property #Line # returns address of pixels ## Returns pixel address, the base address corresponding to the pixel origin. @@ -950,7 +954,7 @@ bitmap.getColor(0, 0) == 0xFFFFFFFF # ------------------------------------------------------------------------------ #Method size_t computeByteSize() const - +#In Utility #Line # returns size required for pixels ## Returns minimum memory required for pixel storage. Does not include unused memory on last row when rowBytesAsPixels exceeds width(). @@ -990,7 +994,7 @@ width: 1000000 height: 1000000 computeByteSize: 4999999000000 # ------------------------------------------------------------------------------ #Method bool isImmutable() const - +#In Property #Line # returns true if pixels will not change ## Returns true if pixels can not change. @@ -1021,7 +1025,7 @@ copy is immutable # ------------------------------------------------------------------------------ #Method void setImmutable() - +#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. @@ -1051,7 +1055,7 @@ Triggers assert if SK_DEBUG is true, runs fine otherwise. # ------------------------------------------------------------------------------ #Method bool isOpaque() const - +#In Property #Line # returns true if Image_Info describes opaque pixels ## Returns true if Alpha_Type is kOpaque_SkAlphaType. Does not check if Color_Type allows Alpha, or if any pixel value has @@ -1090,7 +1094,7 @@ isOpaque: true # ------------------------------------------------------------------------------ #Method bool isVolatile() const - +#In Property #Line # returns true if pixels should not be cached ## If true, provides a hint to caller that pixels should not be cached. Only true if setIsVolatile has been called to mark as volatile. @@ -1122,7 +1126,7 @@ copy is not volatile # ------------------------------------------------------------------------------ #Method void setIsVolatile(bool isVolatile) - +#In Set #Line # marks if pixels should not be cached ## Sets if pixels should be read from Pixel_Ref on every access. Bitmaps are not volatile by default; a GPU back end may upload pixel values expecting them to be @@ -1155,7 +1159,7 @@ consumption on Device. # ------------------------------------------------------------------------------ #Method void reset() - +#In Constructor #Line # sets to default values, releases pixel ownership ## Resets to its initial state; all fields are set to zero, as if Bitmap had been initialized by SkBitmap(). @@ -1188,7 +1192,7 @@ width:0 height:0 isNull:true # ------------------------------------------------------------------------------ #Method static bool ComputeIsOpaque(const SkBitmap& bm) - +#In Utility #Line # returns true if all pixels are opaque ## Returns true if all pixels are opaque. Color_Type determines how pixels are encoded, and whether pixel describes Alpha. Returns true for Color_Types @@ -1234,7 +1238,7 @@ computeIsOpaque: true # ------------------------------------------------------------------------------ #Method void getBounds(SkRect* bounds) const - +#In Property #Line # returns width() and height() as Rectangle ## Returns Rect { 0, 0, width(), height() }. @@ -1283,7 +1287,7 @@ Returns IRect { 0, 0, width(), height() }. # ------------------------------------------------------------------------------ #Method SkIRect bounds() const - +#In Property #Line # returns width() and height() as Rectangle ## Returns IRect { 0, 0, width(), height() }. @@ -1308,7 +1312,7 @@ Returns IRect { 0, 0, width(), height() }. # ------------------------------------------------------------------------------ #Method SkISize dimensions() const - +#In Property #Line # returns width() and height() ## Returns ISize { width(), height() }. @@ -1331,7 +1335,7 @@ Returns ISize { width(), height() }. # ------------------------------------------------------------------------------ #Method SkIRect getSubset() const - +#In Property #Line # returns bounds offset by origin ## Returns the bounds of this bitmap, offset by its Pixel_Ref origin. @@ -1361,7 +1365,7 @@ subset: 100, 100, 412, 412 # ------------------------------------------------------------------------------ #Method bool setInfo(const SkImageInfo& imageInfo, size_t rowBytes = 0) - +#In Set #Line # sets height, width, Color_Type, and so on, releasing pixels ## Sets width, height, Alpha_Type, Color_Type, Color_Space, and optional rowBytes. Frees pixels, and returns true if successful. @@ -1437,9 +1441,13 @@ AllocFlags provides the option to zero pixel memory when allocated. ## # ------------------------------------------------------------------------------ +#Subtopic Allocate +#Populate +#Line # allocates storage for pixels ## +## #Method bool SK_WARN_UNUSED_RESULT tryAllocPixelsFlags(const SkImageInfo& info, uint32_t flags) - +#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. @@ -1481,7 +1489,7 @@ bitmap allocation succeeded! # ------------------------------------------------------------------------------ #Method void allocPixelsFlags(const SkImageInfo& info, uint32_t flags) - +#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. @@ -1529,7 +1537,7 @@ canvas->drawBitmap(bitmap, 8, 8); # ------------------------------------------------------------------------------ #Method bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info, size_t rowBytes) - +#In Allocate #Line # allocates pixels from Image_Info if possible ## #ToDo am I ever conflicted about setInfo rules. It needs to be able to be replicated if, for instance, I generate one-page-per-method HTML-style documentation @@ -1577,7 +1585,7 @@ if (bitmap.tryAllocPixels(info, 0)) { # ------------------------------------------------------------------------------ #Method void allocPixels(const SkImageInfo& info, size_t rowBytes) - +#In Allocate #Line # allocates pixels from Image_Info, or aborts ## Sets Image_Info to info following the rules in setInfo and allocates pixel memory. rowBytes must equal or exceed info.width() times info.bytesPerPixel(), @@ -1685,7 +1693,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 pixel memory. If isOpaque is true, sets Image_Info to kOpaque_SkAlphaType; @@ -1727,7 +1735,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 pixel memory. If isOpaque is true, sets Image_Info to kPremul_SkAlphaType; @@ -1770,6 +1778,7 @@ the platform. Bitmap drawn to output device skips converting its pixel format. #Method bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, void (*releaseProc)(void* addr, void* context), void* context) +#In Allocate #Line # creates Pixel_Ref, with optional release function ## Sets Image_Info to info following the rules in setInfo, and creates Pixel_Ref @@ -1922,9 +1931,13 @@ Draw a five by five bitmap, and draw it again with a center white pixel. ## # ------------------------------------------------------------------------------ +#Subtopic Pixels +#Populate +#Line # read and write pixel values ## +## #Method void setPixels(void* pixels) - +#In Pixels #Line # sets Pixel_Ref without an offset ## Replaces Pixel_Ref with pixels, preserving Image_Info and rowBytes. Sets Pixel_Ref origin to (0, 0). @@ -1956,7 +1969,7 @@ of Bitmap and Pixel_Ref. # ------------------------------------------------------------------------------ #Method bool SK_WARN_UNUSED_RESULT tryAllocPixels() - +#In Allocate Allocates pixel memory with HeapAllocator, and replaces existing Pixel_Ref. The allocation size is determined by Image_Info width, height, and Color_Type. @@ -1992,7 +2005,7 @@ Pixel_Ref with set1. # ------------------------------------------------------------------------------ #Method void allocPixels() - +#In Allocate Allocates pixel memory with HeapAllocator, and replaces existing Pixel_Ref. The allocation size is determined by Image_Info width, height, and Color_Type. @@ -2032,7 +2045,7 @@ Allocates pixel memory with allocator, and replaces existing Pixel_Ref. The allocation size is determined by Image_Info width, height, and Color_Type. If allocator is nullptr, use HeapAllocator instead. -Returns false if allocator allocPixelRef return false. +Returns false if Allocator::allocPixelRef return false. #Param allocator instance of SkBitmap::Allocator instantiation ## @@ -2106,7 +2119,7 @@ Allocates pixel memory with allocator, and replaces existing Pixel_Ref. The allocation size is determined by Image_Info width, height, and Color_Type. If allocator is nullptr, use HeapAllocator instead. -Aborts if allocator allocPixelRef return false. Abort steps may be provided by +Aborts if Allocator::allocPixelRef return false. Abort steps may be provided by the user at compile time by defining SK_ABORT. #Param allocator instance of SkBitmap::Allocator instantiation ## @@ -2152,7 +2165,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method SkPixelRef* pixelRef() const - +#In Property #Line # returns Pixel_Ref, or nullptr ## Returns Pixel_Ref, which contains: pixel base address; its dimensions; and rowBytes, the interval from one row to the next. Does not change Pixel_Ref @@ -2177,7 +2190,7 @@ If Pixel_Ref has not been set, returns nullptr. # ------------------------------------------------------------------------------ #Method SkIPoint pixelRefOrigin() const - +#In Property #Line # returns offset within Pixel_Ref ## Returns origin of pixels within Pixel_Ref. Bitmap bounds is always contained by Pixel_Ref bounds, which may be the same size or larger. Multiple Bitmaps @@ -2209,9 +2222,13 @@ subset origin: 32, 64 ## # ------------------------------------------------------------------------------ +#Subtopic Set +#Line # updates values and attributes ## +#Populate +## #Method void setPixelRef(sk_sp<SkPixelRef> pixelRef, int dx, int dy) - +#In Set #Line # sets Pixel_Ref and offset ## Replaces pixelRef and origin in Bitmap. dx and dy specify the offset within the Pixel_Ref pixels for the top-left corner of the bitmap. @@ -2246,7 +2263,7 @@ Treating 32 bit data as 8 bit data is unlikely to produce useful results. # ------------------------------------------------------------------------------ #Method bool readyToDraw() const - +#In Utility #Line # returns true if address of pixels is not nullptr ## Returns true if Bitmap is can be drawn. @@ -2267,7 +2284,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 different value after notifyPixelsChanged has been called. @@ -2299,7 +2316,7 @@ 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 getGenerationID() return a different value. @@ -2324,9 +2341,13 @@ getGenerationID() return a different value. ## # ------------------------------------------------------------------------------ +#Subtopic Draw +#Populate +#Line # set pixels to Color ## +## #Method void eraseColor(SkColor c) const - +#In Draw #Line # writes Color to pixels ## Replaces pixel values with c. All pixels contained by bounds() are affected. If the colorType is kGray_8_SkColorType or k565_SkColorType, then Color_Alpha @@ -2351,7 +2372,7 @@ then Color_RGB is ignored. # ------------------------------------------------------------------------------ #Method void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const - +#In Draw #Line # writes Color to pixels ## Replaces pixel values with Unpremultiplied Color built from a, r, g, and b. All pixels contained by bounds() are affected. @@ -2381,7 +2402,7 @@ then r, g, and b are ignored. # ------------------------------------------------------------------------------ #Method void eraseRGB(U8CPU r, U8CPU g, U8CPU b) const - +#In Draw #Line # deprecated ## Deprecated. Use eraseARGB or eraseColor. @@ -2399,7 +2420,7 @@ Deprecated. Use eraseARGB or eraseColor. # ------------------------------------------------------------------------------ #Method void erase(SkColor c, const SkIRect& area) const - +#In Draw #Line # writes Color to rectangle of pixels ## Replaces pixel values inside area with c. If area does not intersect bounds(), call has no effect. @@ -2438,7 +2459,8 @@ then Color_RGB is ignored. # ------------------------------------------------------------------------------ #Method SkColor getColor(int x, int y) const - +#In Property +#In Pixels #Line # returns one pixel as Unpremultiplied Color ## Returns pixel at (x, y) as Unpremultiplied Color. Returns black with Alpha if Color_Type is kAlpha_8_SkColorType. @@ -2504,7 +2526,7 @@ Unpremultiplied: # ------------------------------------------------------------------------------ #Method void* getAddr(int x, int y) const - +#In Property #Line # returns readable pixel address as void pointer ## Returns pixel address at (x, y). @@ -2537,7 +2559,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). @@ -2572,7 +2594,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). @@ -2613,7 +2635,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). @@ -2652,7 +2674,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and: # ------------------------------------------------------------------------------ #Method bool extractSubset(SkBitmap* dst, const SkIRect& subset) const - +#In Constructor #Line # creates Bitmap, sharing pixels if possible ## Shares Pixel_Ref with dst. Pixels are not copied; Bitmap and dst point to the same pixels; dst bounds() are set to the intersection of subset @@ -2721,6 +2743,7 @@ subset: 1000, 100, 1000, 200 success; false #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior) const +#In Pixels #Line # copies and converts pixels ## Copies Rect of pixels from Bitmap pixels to dstPixels. Copy starts at (srcX, srcY), @@ -2995,7 +3018,7 @@ false if pixel conversion is not possible. # ------------------------------------------------------------------------------ #Method bool writePixels(const SkPixmap& src, int dstX, int dstY) - +#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()). @@ -3174,7 +3197,7 @@ pixels are treated as if they are linear, regardless of how they are encoded. # ------------------------------------------------------------------------------ #Method bool hasHardwareMipMap() const - +#In Property #Line # returns Mip_Map support present; Android only ## #Private Android framework only. @@ -3192,7 +3215,7 @@ Android framework only. # ------------------------------------------------------------------------------ #Method void setHasHardwareMipMap(bool hasHardwareMipMap) - +#In Set #Line # sets Mip_Map support present; Android only ## #Private Android framework only. @@ -3210,7 +3233,7 @@ Android framework only. # ------------------------------------------------------------------------------ #Method bool extractAlpha(SkBitmap* dst) const - +#In Constructor #Line # creates Bitmap containing Alpha of pixels ## Sets dst to Alpha described by pixels. Returns false if dst cannot be written to or dst pixels cannot be allocated. @@ -3341,7 +3364,7 @@ mask. # ------------------------------------------------------------------------------ #Method bool peekPixels(SkPixmap* pixmap) const - +#In Pixels #Line # returns Pixmap if possible ## Copies Bitmap pixel address, row bytes, and Image_Info to pixmap, if address is available, and returns true. If pixel address is not available, return @@ -3391,9 +3414,13 @@ x---x- ## # ------------------------------------------------------------------------------ +#Subtopic Utility +#Populate +#Line # rarely called management functions ## +## #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 SK_DEBUG is defined at compile time. @@ -3408,7 +3435,7 @@ SK_DEBUG is defined at compile time. # ------------------------------------------------------------------------------ #Method void toString(SkString* str) const; - +#In Utility #Line # converts Bitmap to machine readable form ## #DefinedBy SK_TO_STRING_NONVIRT() ## diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh index 67445d4464..6e6d6a7456 100644 --- a/docs/SkCanvas_Reference.bmh +++ b/docs/SkCanvas_Reference.bmh @@ -59,6 +59,7 @@ when no Surface is required, and some helpers implicitly create Raster_Surface. #Method static std::unique_ptr<SkCanvas> MakeRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes, const SkSurfaceProps* props = nullptr) +#In Constructor #Line # creates from SkImageInfo and Pixel_Storage ## Allocates raster Canvas that will draw directly into pixels. @@ -133,6 +134,7 @@ void draw(SkCanvas* ) { #Method static std::unique_ptr<SkCanvas> MakeRasterDirectN32(int width, int height, SkPMColor* pixels, size_t rowBytes) +#In Constructor #Line # creates from image data and Pixel_Storage ## Allocates raster Canvas specified by inline image specification. Subsequent Canvas @@ -493,9 +495,14 @@ void draw(SkCanvas* canvas) { ## # ------------------------------------------------------------------------------ +#Subtopic Property +#Populate +#Line # metrics and attributes ## +## #Method SkMetaData& getMetaData() - +#In Property +#In Utility #Line # associates additional data with the canvas ## Returns storage to associate additional data with the canvas. The storage is freed when Canvas is deleted. @@ -526,7 +533,7 @@ The storage is freed when Canvas is deleted. # ------------------------------------------------------------------------------ #Method SkImageInfo imageInfo() const - +#In Property #Line # returns Image_Info for Canvas ## Returns Image_Info for Canvas. If Canvas is not associated with Raster_Surface or GPU_Surface, returned Color_Type is set to kUnknown_SkColorType. @@ -551,7 +558,7 @@ GPU_Surface, returned Color_Type is set to kUnknown_SkColorType. # ------------------------------------------------------------------------------ #Method bool getProps(SkSurfaceProps* props) const - +#In Property #Line # copies Surface_Properties if available ## If Canvas is associated with Raster_Surface or GPU_Surface, copies Surface_Properties and returns true. Otherwise, @@ -584,9 +591,13 @@ return false and leave props unchanged. ## # ------------------------------------------------------------------------------ +#Subtopic Utility +#Populate +#Line # rarely called management functions ## +## #Method void flush() - +#In Utility #Line # triggers execution of all pending draw operations ## Triggers the immediate execution of all pending draw operations. If Canvas is associated with GPU_Surface, resolves all pending GPU operations. @@ -621,7 +632,7 @@ for posterity: this doesn't show a difference: fiddle.skia.org/c/@flushfail # ------------------------------------------------------------------------------ #Method virtual SkISize getBaseLayerSize() const - +#In Property #Line # returns size of base Layer in global coordinates ## Gets the size of the base or root Layer in global canvas coordinates. The origin of the base Layer is always (0,0). The area available for drawing may be @@ -691,7 +702,7 @@ does not have Surface_Properties, creates Surface with default Surface_Propertie # ------------------------------------------------------------------------------ #Method virtual GrContext* getGrContext() - +#In Property #Line # returns GPU_Context of the GPU_Surface ## Returns GPU_Context of the GPU_Surface associated with Canvas. @@ -716,7 +727,8 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* origin = nullptr) - +#In Utility +#In Property #Line # returns writable pixel access if available ## Returns the pixel base address, Image_Info, rowBytes, and origin if the pixels can be read directly. The returned address is only valid @@ -799,7 +811,8 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method SkRasterHandleAllocator::Handle accessTopRasterHandle() const - +#In Utility +#In Property #Line # returns context that tracks Clip and Matrix ## Returns custom context that tracks the Matrix and Clip. @@ -857,9 +870,13 @@ the drawing destination. ## # ------------------------------------------------------------------------------ +#Subtopic Pixels +#Populate +#Line # read and write pixel values ## +## #Method bool peekPixels(SkPixmap* pixmap) - +#In Pixels #Line # returns if Canvas has direct access to its pixels ## Returns true if Canvas has direct access to its pixels. @@ -893,6 +910,7 @@ Canvas or Surface call may invalidate the pixmap values. #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) +#In Pixels #Line # copies and converts rectangle of pixels from Canvas ## Copies Rect of pixels from Canvas into dstPixels. Matrix and Clip are @@ -1112,7 +1130,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method bool writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, int x, int y) - +#In Pixels #Line # copies and converts rectangle of pixels to Canvas ## Copies Rect from pixels to Canvas. Matrix and Clip are ignored. Source Rect corners are (0, 0) and (info.width(), info.height()). @@ -2972,9 +2990,13 @@ Unlike getLocalClipBounds, bounds is not outset. #Subtopic Clip ## # ------------------------------------------------------------------------------ +#Subtopic Draw +#Populate +#Line # draws into Canvas ## +## #Method void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver) - +#In Draw #Line # fills Clip with Color and Blend_Mode ## Fill Clip with Color color. mode determines how Color_ARGB is combined with destination. @@ -2997,7 +3019,7 @@ mode determines how Color_ARGB is combined with destination. # ------------------------------------------------------------------------------ #Method void clear(SkColor color) - +#In Draw #Line # fills Clip with Color ## Fill Clip with Color color using SkBlendMode::kSrc. This has the effect of replacing all pixels contained by Clip with color. @@ -3026,7 +3048,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void discard() - +#In Utility #Line # makes Canvas contents undefined ## Make Canvas contents undefined. Subsequent calls that read Canvas pixels, such as drawing with SkBlendMode, return undefined results. discard() does @@ -3051,7 +3073,7 @@ any cached data is deleted when owning Surface or Device is deleted. # ------------------------------------------------------------------------------ #Method void drawPaint(const SkPaint& paint) - +#In Draw #Line # fills Clip with Paint ## Fill Clip with Paint paint. Paint components Mask_Filter, Shader, Color_Filter, Image_Filter, and Blend_Mode affect drawing; @@ -3134,7 +3156,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) - +#In Draw #Line # draws array as points, lines, polygon ## Draw pts using Clip, Matrix and Paint paint. count is the number of points; if count is less than one, has no effect. @@ -3215,7 +3237,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint) - +#In Draw #Line # draws point at (x, y) position ## Draw point at (x, y) using Clip, Matrix and Paint paint. @@ -3285,7 +3307,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint& paint) - +#In Draw #Line # draws line segment between two points ## Draws line segment from (x0, y0) to (x1, y1) using Clip, Matrix, and Paint paint. In paint: Paint_Stroke_Width describes the line thickness; @@ -3342,7 +3364,7 @@ Paint_Style is ignored, as if were set to SkPaint::kStroke_Style. # ------------------------------------------------------------------------------ #Method void drawRect(const SkRect& rect, const SkPaint& paint) - +#In Draw #Line # draws Rect using Clip, Matrix, and Paint ## Draw Rect rect using Clip, Matrix, and Paint paint. In paint: Paint_Style determines if rectangle is stroked or filled; @@ -3379,7 +3401,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawIRect(const SkIRect& rect, const SkPaint& paint) - +#In Draw #Line # draws IRect using Clip, Matrix, and Paint ## Draw IRect rect using Clip, Matrix, and Paint paint. In paint: Paint_Style determines if rectangle is stroked or filled; @@ -3410,7 +3432,7 @@ Paint_Stroke_Join draws the corners rounded or square. # ------------------------------------------------------------------------------ #Method void drawRegion(const SkRegion& region, const SkPaint& paint) - +#In Draw #Line # draws Region using Clip, Matrix, and Paint ## Draw Region region using Clip, Matrix, and Paint paint. In paint: Paint_Style determines if rectangle is stroked or filled; @@ -3441,7 +3463,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawOval(const SkRect& oval, const SkPaint& paint) - +#In Draw #Line # draws Oval using Clip, Matrix, and Paint ## Draw Oval oval using Clip, Matrix, and Paint. In paint: Paint_Style determines if Oval is stroked or filled; @@ -3473,7 +3495,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawRRect(const SkRRect& rrect, const SkPaint& paint) - +#In Draw #Line # draws Round_Rect using Clip, Matrix, and Paint ## Draw Round_Rect rrect using Clip, Matrix, and Paint paint. In paint: Paint_Style determines if rrect is stroked or filled; @@ -3513,7 +3535,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) - +#In Draw #Line # draws double Round_Rect stroked or filled ## Draw Round_Rect outer and inner using Clip, Matrix, and Paint paint. @@ -3568,7 +3590,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint) - +#In Draw #Line # draws Circle using Clip, Matrix, and Paint ## Draw Circle at (cx, cy) with radius using Clip, Matrix, and Paint paint. If radius is zero or less, nothing is drawn. @@ -3627,6 +3649,7 @@ if stroked, Paint_Stroke_Width describes the line thickness. #Method void drawArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint& paint) +#In Draw #Line # draws Arc using Clip, Matrix, and Paint ## Draw Arc using Clip, Matrix, and Paint paint. @@ -3691,7 +3714,7 @@ If Rect oval is empty or sweepAngle is zero, nothing is drawn. # ------------------------------------------------------------------------------ #Method void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, const SkPaint& paint) - +#In Draw #Line # draws Round_Rect using Clip, Matrix, and Paint ## Draw Round_Rect bounded by Rect rect, with corner radii (rx, ry) using Clip, Matrix, and Paint paint. @@ -3739,7 +3762,7 @@ Paint_Stroke_Join. # ------------------------------------------------------------------------------ #Method void drawPath(const SkPath& path, const SkPaint& paint) - +#In Draw #Line # draws Path using Clip, Matrix, and Paint ## Draw Path path using Clip, Matrix, and Paint paint. Path contains an array of Path_Contour, each of which may be open or closed. @@ -3808,8 +3831,8 @@ drawImage, drawImageRect, and drawImageNine can be called with a bare pointer or a smart pointer as a convenience. The pairs of calls are otherwise identical. #Method void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) - #In Draw_Image +#In Draw #Line # draws Image at (x, y) position ## Draw Image image, with its top-left corner at (left, top), using Clip, Matrix, and optional Paint paint. @@ -3850,7 +3873,6 @@ void draw(SkCanvas* canvas) { #Method void drawImage(const sk_sp<SkImage>& image, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) -#In Draw_Image Draw Image image, with its top-left corner at (left, top), using Clip, Matrix, and optional Paint paint. @@ -3961,6 +3983,7 @@ void draw(SkCanvas* canvas) { const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image +#In Draw #Line # draws Image, source Rect to destination Rect ## Draw Rect src of Image image, scaled and translated to fill Rect dst. @@ -4027,6 +4050,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageRect(const SkImage* image, const SkIRect& isrc, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image +#In Draw Draw IRect isrc of Image image, scaled and translated to fill Rect dst. Note that isrc is on integer pixel boundaries; dst may include fractional @@ -4073,6 +4097,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageRect(const SkImage* image, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image +#In Draw Draw Image image, scaled and translated to fill Rect dst, using Clip, Matrix, and optional Paint paint. @@ -4116,7 +4141,7 @@ void draw(SkCanvas* canvas) { const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image - +#In Draw Draw Rect src of Image image, scaled and translated to fill Rect dst. Additionally transform draw using Clip, Matrix, and optional Paint paint. @@ -4172,7 +4197,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageRect(const sk_sp<SkImage>& image, const SkIRect& isrc, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image - +#In Draw Draw IRect isrc of Image image, scaled and translated to fill Rect dst. isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. @@ -4225,7 +4250,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageRect(const sk_sp<SkImage>& image, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image - +#In Draw Draw Image image, scaled and translated to fill Rect dst, using Clip, Matrix, and optional Paint paint. @@ -4276,6 +4301,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint* paint = nullptr) #In Draw_Image +#In Draw #Line # draws Nine_Patch Image ## Draw Image image stretched proportionally to fit into Rect dst. @@ -4344,7 +4370,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageNine(const sk_sp<SkImage>& image, const SkIRect& center, const SkRect& dst, const SkPaint* paint = nullptr) #In Draw_Image - +#In Draw Draw Image image stretched proportionally to fit into Rect dst. IRect center divides the image into nine sections: four sides, four corners, and the center. Corners are not scaled, or scaled down proportionately if their sides @@ -4412,6 +4438,7 @@ void draw(SkCanvas* canvas) { #Method void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) #In Draw_Image +#In Draw #Line # draws Bitmap at (x, y) position ## Draw Bitmap bitmap, with its top-left corner at (left, top), @@ -4466,6 +4493,7 @@ void draw(SkCanvas* canvas) { #Method void drawBitmapRect(const SkBitmap& bitmap, const SkRect& src, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image +#In Draw #Line # draws Bitmap, source Rect to destination Rect ## Draw Rect src of Bitmap bitmap, scaled and translated to fill Rect dst. @@ -4525,7 +4553,7 @@ void draw(SkCanvas* canvas) { #Method void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image - +#In Draw Draw IRect isrc of Bitmap bitmap, scaled and translated to fill Rect dst. isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. @@ -4584,7 +4612,7 @@ void draw(SkCanvas* canvas) { #Method void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint) #In Draw_Image - +#In Draw Draw Bitmap bitmap, scaled and translated to fill Rect dst. bitmap bounds is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. @@ -4636,6 +4664,7 @@ void draw(SkCanvas* canvas) { #Method void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint* paint = nullptr) #In Draw_Image +#In Draw #Line # draws Nine_Patch Bitmap ## Draw Bitmap bitmap stretched proportionally to fit into Rect dst. @@ -4813,6 +4842,7 @@ void draw(SkCanvas* canvas) { #Method void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst, const SkPaint* paint = nullptr) #In Draw_Image +#In Draw #Line # draws proportionally stretched Bitmap ## Draw Bitmap bitmap stretched proportionally to fit into Rect dst. @@ -4893,6 +4923,7 @@ void draw(SkCanvas* canvas) { #Method void drawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst, const SkPaint* paint = nullptr) #In Draw_Image +#In Draw #Line # draws proportionally stretched Image ## Draw Image image stretched proportionally to fit into Rect dst. @@ -4971,9 +5002,15 @@ void draw(SkCanvas* canvas) { #Subtopic Draw_Image ## # ------------------------------------------------------------------------------ +#Subtopic Draw_Text +#Populate +#Line # draws text into Canvas ## +## #Method void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, const SkPaint& paint) +#In Draw_Text +#In Draw #Line # draws text at (x, y), using font advance ## Draw text, with origin at (x, y), using Clip, Matrix, and Paint paint. @@ -5029,7 +5066,8 @@ void draw(SkCanvas* canvas) { ## #Method void drawString(const char* string, SkScalar x, SkScalar y, const SkPaint& paint) - +#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. @@ -5100,6 +5138,8 @@ filled 12 point black Glyphs. #Method void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkPaint& paint) +#In Draw_Text +#In Draw #Line # draws text at array of (x, y) positions ## Draw each glyph in text with the origin in pos array, using Clip, Matrix, and @@ -5144,6 +5184,8 @@ void draw(SkCanvas* canvas) { #Method void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkPaint& paint) +#In Draw_Text +#In Draw #Line # draws text at x positions with common baseline ## Draw each glyph in text with its (x, y) origin composed from xpos array and @@ -5187,6 +5229,8 @@ baseline. #Method void drawTextOnPathHV(const void* text, size_t byteLength, const SkPath& path, SkScalar hOffset, SkScalar vOffset, const SkPaint& paint) +#In Draw_Text +#In Draw #Line # draws text following Path with offsets ## Draw text on Path path, using Clip, Matrix, and Paint paint. @@ -5236,6 +5280,8 @@ filled 12 point black Glyphs. #Method void drawTextOnPath(const void* text, size_t byteLength, const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) +#In Draw_Text +#In Draw #Line # draws text following Path contour ## Draw text on Path path, using Clip, Matrix, and Paint paint. @@ -5291,6 +5337,8 @@ filled 12 point black Glyphs. #Method void drawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[], const SkRect* cullRect, const SkPaint& paint) +#In Draw_Text +#In Draw #Line # draws text with array of RSXform ## Draw text, transforming each glyph by the corresponding SkRSXform, @@ -5341,7 +5389,8 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) - +#In Draw_Text +#In Draw #Line # draws text with arrays of positions and Paint ## Draw Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint. @@ -5443,7 +5492,7 @@ Paint attributes related to text, like text size, have no effect on paint passed # ------------------------------------------------------------------------------ #Method void drawPicture(const SkPicture* picture) - +#In Draw #Line # draws Picture using Clip and Matrix ## Draw Picture picture, using Clip and Matrix. Clip and Matrix are unchanged by picture contents, as if @@ -5598,7 +5647,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) - +#In Draw #Line # draws Vertices, a triangle mesh ## Draw Vertices vertices, a triangle mesh, using Clip and Matrix. If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint @@ -5657,6 +5706,7 @@ void draw(SkCanvas* canvas) { #Method void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint& paint) +#In Draw #Line # draws Coons_Patch ## Draws a Coons_Patch: the interpolation of four cubics with shared corners, @@ -5800,6 +5850,7 @@ void draw(SkCanvas* canvas) { #Method void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, const SkPaint* paint) +#In Draw #Line # draws sprites using Clip, Matrix, and Paint ## Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint. @@ -5955,7 +6006,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr) - +#In Draw #Line # draws Drawable, encapsulated drawing commands ## Draw Drawable drawable using Clip and Matrix, concatenated with optional matrix. @@ -6046,9 +6097,10 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method void drawAnnotation(const SkRect& rect, const char key[], SkData* value) - +#In Draw +#In Utility #Line # associates a Rect with a key-value pair ## -Associate Rect on Canvas when an annotation; a key-value pair, where the key is +Associate Rect on Canvas with an annotation; a key-value pair, where the key is a null-terminated utf8 string, and optional value is stored as Data. Only some canvas implementations, such as recording to Picture, or drawing to @@ -6115,7 +6167,7 @@ Document_PDF, use annotations. # ------------------------------------------------------------------------------ #Method virtual bool isClipEmpty() const - +#In Property #Line # returns if Clip is empty ## Returns true if Clip is empty; that is, nothing will draw. @@ -6145,7 +6197,7 @@ work until Clip changes. # ------------------------------------------------------------------------------ #Method virtual bool isClipRect() const - +#In Property #Line # returns if Clip is Rect and not empty ## Returns true if Clip is Rect and not empty. Returns false if the clip is empty, or if it is not Rect. diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh index 9106715e96..bdaa4a69d4 100644 --- a/docs/SkIRect_Reference.bmh +++ b/docs/SkIRect_Reference.bmh @@ -734,6 +734,10 @@ equal to or larger than -32768 and equal to or smaller than 32767. ## # ------------------------------------------------------------------------------ +#Subtopic Set +#Line # replaces all values ## +#Populate +## #Method void setEmpty() diff --git a/docs/SkImageInfo_Reference.bmh b/docs/SkImageInfo_Reference.bmh index 856725a512..6ea97440b9 100644 --- a/docs/SkImageInfo_Reference.bmh +++ b/docs/SkImageInfo_Reference.bmh @@ -193,19 +193,19 @@ range. See http://en.wikipedia.org/wiki/Rec._709 for details. Describes Image dimensions and pixel type. Used for both source images and render-targets (surfaces). -#Subtopic Operator +#Subtopic Member_Function #Populate ## -#Subtopic Member_Function +#Subtopic Related_Function #Populate ## +# ------------------------------------------------------------------------------ #Subtopic Constructor #Populate ## -# ------------------------------------------------------------------------------ #Method SkImageInfo() @@ -384,9 +384,13 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ +#Subtopic Property +#Populate +#Line # metrics and attributes ## +## #Method int width() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -401,7 +405,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method int height() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -416,7 +420,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method SkColorType colorType() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -431,7 +435,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method SkAlphaType alphaType() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -446,7 +450,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method SkColorSpace* colorSpace() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -461,7 +465,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method sk_sp<SkColorSpace> refColorSpace() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -476,7 +480,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method bool isEmpty() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -491,7 +495,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method bool isOpaque() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -506,7 +510,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method SkISize dimensions() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -521,7 +525,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method SkIRect bounds() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -536,7 +540,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method bool gammaCloseToSRGB() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -551,7 +555,7 @@ Sets Color_Type to kN32_SkColorType, and the Alpha_Type to kPremul_SkAlphaType. # ------------------------------------------------------------------------------ #Method SkImageInfo makeWH(int newWidth, int newHeight) const - +#In Constructor #Line # creates Image_Info with changed dimensions ## Creates Image_Info with the same Color_Type and Alpha_Type as this info, but with the specified width and height. @@ -572,7 +576,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const - +#In Constructor #Line # creates Image_Info with changed Alpha_Type ## #Param newAlphaType incomplete ## @@ -589,7 +593,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method SkImageInfo makeColorType(SkColorType newColorType) const - +#In Constructor #Line # creates Image_Info with changed Color_Type ## #Param newColorType incomplete ## @@ -606,7 +610,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const - +#In Constructor #Line # creates Image_Info with changed Color_Space ## #Param cs incomplete ## @@ -623,7 +627,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method int bytesPerPixel() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -638,7 +642,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method int shiftPerPixel() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -653,7 +657,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method uint64_t minRowBytes64() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -668,7 +672,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method size_t minRowBytes() const - +#In Property #Line # incomplete ## #Return incomplete ## @@ -683,7 +687,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method size_t computeOffset(int x, int y, size_t rowBytes) const - +#In Utility #Line # incomplete ## #Param x incomplete ## #Param y incomplete ## @@ -700,6 +704,9 @@ but with the specified width and height. #Method ## # ------------------------------------------------------------------------------ +#Subtopic Operator +#Populate +## #Method bool operator==(const SkImageInfo& other)_const @@ -736,7 +743,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method void unflatten(SkReadBuffer& buffer) - +#In Utility #Line # incomplete ## #Param buffer incomplete ## @@ -751,7 +758,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method void flatten(SkWriteBuffer& buffer) const - +#In Utility #Line # incomplete ## #Param buffer incomplete ## @@ -766,7 +773,7 @@ but with the specified width and height. # ------------------------------------------------------------------------------ #Method size_t computeByteSize(size_t rowBytes) const - +#In Utility #Line # incomplete ## Returns the size (in bytes) of the image buffer that this info needs, given the specified rowBytes. The rowBytes must be >= this->minRowBytes(). @@ -792,7 +799,7 @@ If the calculation overflows this returns SK_MaxSizeT. # ------------------------------------------------------------------------------ #Method size_t computeMinByteSize() const - +#In Utility #Line # incomplete ## Returns the minimum size (in bytes) of the image buffer that this info needs. If the calculation overflows, or if the height is 0, this returns 0. @@ -810,7 +817,7 @@ If the calculation overflows, or if the height is 0, this returns 0. # ------------------------------------------------------------------------------ #Method static bool ByteSizeOverflowed(size_t byteSize) - +#In Utility #Line # incomplete ## Returns true if the result of computeByteSize (or computeMinByteSize) overflowed @@ -829,7 +836,7 @@ Returns true if the result of computeByteSize (or computeMinByteSize) overflowed # ------------------------------------------------------------------------------ #Method bool validRowBytes(size_t rowBytes) const - +#In Utility #Line # incomplete ## #Param rowBytes incomplete ## @@ -846,7 +853,7 @@ Returns true if the result of computeByteSize (or computeMinByteSize) overflowed # ------------------------------------------------------------------------------ #Method void reset() - +#In Constructor #Line # incomplete ## #Example // incomplete @@ -857,9 +864,13 @@ Returns true if the result of computeByteSize (or computeMinByteSize) overflowed #Method ## # ------------------------------------------------------------------------------ +#Subtopic Utility +#Populate +#Line # rarely called management functions ## +## #Method void validate() const - +#In Utility #Line # incomplete ## #Example // incomplete diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh index 0280b317fb..d933a072ee 100644 --- a/docs/SkImage_Reference.bmh +++ b/docs/SkImage_Reference.bmh @@ -1273,9 +1273,13 @@ canvas->drawPaint(paint); #Method ## # ------------------------------------------------------------------------------ +#Subtopic Pixels +#Populate +#Line # read and write pixel values ## +## #Method bool peekPixels(SkPixmap* pixmap) const - +#In Pixels #Line # returns Pixmap if possible ## Copies Image pixel address, row bytes, and Image_Info to pixmap, if address is available, and returns true. If pixel address is not available, return @@ -1332,7 +1336,7 @@ false and leave pixmap unchanged. # ------------------------------------------------------------------------------ #Method bool isTextureBacked() const -#In Property
+#In Property #Line # returns if Image was created from GPU_Texture ## Returns true the contents of Image was created on or uploaded to GPU memory, and is available as a GPU_Texture. @@ -1422,6 +1426,7 @@ drawImage(textureImage, "backEndTexture"); #Method GrBackendObject getTextureHandle(bool flushPendingGrContextIO, GrSurfaceOrigin* origin = nullptr) const +#In Property #Line # returns GPU reference to Image as texture ## Retrieves the back-end API handle of texture. If flushPendingGrContextIO is true, @@ -1528,6 +1533,7 @@ Disallows Skia from internally caching decoded and copied pixels. #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint = kAllow_CachingHint) const +#In Pixels #Line # copies and converts pixels ## Copies Rect of pixels from Image to dstPixels. Copy starts at offset (srcX, srcY), @@ -1675,6 +1681,7 @@ If cachingHint is kDisallow_CachingHint, pixels are not added to the local cache #Method bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality, CachingHint cachingHint = kAllow_CachingHint) const +#In Pixels #Line # scales and converts one Image to another ## Copies Image to dst, scaling pixels to fit dst.width() and dst.height(), and @@ -1734,7 +1741,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. @@ -1805,7 +1812,7 @@ encoding fails. # ------------------------------------------------------------------------------ #Method sk_sp<SkData> refEncodedData() const - +#In Utility #Line # returns Image encoded in SkData if present ## Returns encoded Image pixels as SkData, if Image was created from supported encoded stream format. Platform support for formats vary and may require building diff --git a/docs/SkMatrix_Reference.bmh b/docs/SkMatrix_Reference.bmh index 433466a90c..57648ad805 100644 --- a/docs/SkMatrix_Reference.bmh +++ b/docs/SkMatrix_Reference.bmh @@ -22,20 +22,19 @@ initializes all Matrix elements with the corresponding mapping. 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 Constructor +#Subtopic Member_Function #Populate ## -#Subtopic Operator +#Subtopic Related_Function #Populate ## -#Subtopic Member_Function +# ------------------------------------------------------------------------------ +#Subtopic Constructor #Populate ## -# ------------------------------------------------------------------------------ - #Method static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy) #In Constructor #Line # constructs from scale in x and y ## @@ -737,6 +736,9 @@ vertical translation ## # ------------------------------------------------------------------------------ +#Subtopic Operator +#Populate +## #Method SkScalar operator[](int index)_const diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh index 60c74d19ab..94e9798343 100644 --- a/docs/SkPaint_Reference.bmh +++ b/docs/SkPaint_Reference.bmh @@ -765,7 +765,7 @@ at compile time. ## #Method bool isAntiAlias() const -#In Anti-alias +#In Anti_alias #Line # returns true if Anti-alias is set ## If true, pixels on the active edges of Path may be drawn with partial transparency. @@ -791,7 +791,7 @@ at compile time. #Method void setAntiAlias(bool aa) -#In Anti-alias +#In Anti_alias #Line # sets or clears Anti-alias ## Requests, but does not require, that Path edge pixels draw opaque or with partial transparency. @@ -4376,6 +4376,7 @@ FontMetrics::fTop, FontMetrics::fXMax, FontMetrics::fBottom }. #Method int textToGlyphs(const void* text, size_t byteLength, SkGlyphID glyphs[]) const +#In Utility #Line # converts text into glyph indices ## Converts text into glyph indices. @@ -4415,7 +4416,7 @@ text contains an invalid UTF-8 sequence, zero is returned. ## #Method int countText(const void* text, size_t byteLength) const - +#In Utility #Line # returns number of Glyphs in text ## Returns the number of Glyphs in text. Uses Text_Encoding to count the Glyphs. @@ -4440,7 +4441,7 @@ text contains an invalid UTF-8 sequence, zero is returned. # ------------------------------------------------------------------------------ #Method bool containsText(const void* text, size_t byteLength) const - +#In Utility #Line # returns if all text corresponds to Glyphs ## Returns true if all text corresponds to a non-zero glyph index. Returns false if any characters in text are not supported in @@ -4509,6 +4510,7 @@ text contains an invalid UTF-8 sequence, zero is returned. #Method void glyphsToUnichars(const SkGlyphID glyphs[], int count, SkUnichar text[]) const +#In Utility #Line # converts Glyphs into text ## Converts glyphs into text if possible. @@ -5047,7 +5049,7 @@ void draw(SkCanvas* canvas) { # ------------------------------------------------------------------------------ #Method bool nothingToDraw() const - +#In Utility #Line # returns true if Paint prevents all drawing ## Returns true if Paint prevents all drawing; otherwise, the Paint may or may not allow drawing. @@ -5179,8 +5181,13 @@ Paint may draw to. #Subtopic Fast_Bounds Fast_Bounds ## # ------------------------------------------------------------------------------ -#Method void toString(SkString* str) const +#Subtopic Utility +#Populate +#Line # rarely called management functions ## +## +#Method void toString(SkString* str) const +#In Utility #Line # converts Paint to machine readable form ## #DefinedBy SK_TO_STRING_NONVIRT() ## diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh index 5091d3af99..8659e055ea 100644 --- a/docs/SkPath_Reference.bmh +++ b/docs/SkPath_Reference.bmh @@ -2357,7 +2357,7 @@ void draw(SkCanvas* canvas) { ## # ------------------------------------------------------------------------------ -#Topic Quad +#Subtopic Quad #Alias Quad #Alias Quads #Alias Quadratic_Bezier @@ -2527,11 +2527,11 @@ void draw(SkCanvas* canvas) { ## -#Topic Quad ## +#Subtopic Quad ## # ------------------------------------------------------------------------------ -#Topic Conic +#Subtopic Conic #Line # conic section defined by three points and a weight ## #Alias Conics @@ -2823,10 +2823,10 @@ void draw(SkCanvas* canvas) { ## -#Topic Conic ## +#Subtopic Conic ## # ------------------------------------------------------------------------------ -#Topic Cubic +#Subtopic Cubic #Alias Cubic #Alias Cubics #Alias Cubic_Bezier @@ -2988,7 +2988,7 @@ to Point_Array. ## -#Topic Cubic ## +#Subtopic Cubic ## # ------------------------------------------------------------------------------ @@ -3643,7 +3643,7 @@ void draw(SkCanvas* canvas) { ## -#Topic Arc ## +#Subtopic Arc ## # ------------------------------------------------------------------------------ @@ -5295,7 +5295,7 @@ length = 68; returned by readFromMemory = 64 ## # ------------------------------------------------------------------------------ -#Topic Generation_ID +#Subtopic Generation_ID #Alias Generation_IDs #Line # value reflecting contents change ## Generation_ID provides a quick way to check if Verb_Array, Point_Array, or @@ -5341,7 +5341,7 @@ empty genID = 1 ## -#Topic ## +#Subtopic ## # ------------------------------------------------------------------------------ diff --git a/docs/SkPixmap_Reference.bmh b/docs/SkPixmap_Reference.bmh index fc4d8dc51d..7c4326b919 100644 --- a/docs/SkPixmap_Reference.bmh +++ b/docs/SkPixmap_Reference.bmh @@ -1493,14 +1493,16 @@ is drawn after overwriting bottom half float color with top half float color. #Subtopic Writable_Address ## -#Subtopic Writer -#Line # copy to pixel values ## +#Subtopic Pixels +#Populate +#Line # read and write pixel values ## +## # ------------------------------------------------------------------------------ #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, SkTransferFunctionBehavior behavior) const -#In Writer +#In Pixels #Line # copies and converts pixels ## Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not @@ -1581,7 +1583,7 @@ void draw(SkCanvas* canvas) { #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const -#In Writer +#In Pixels Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not exceed Pixmap (width(), height()). @@ -1644,7 +1646,6 @@ creates visible banding. #Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY) const -#In Writer Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not exceed Pixmap (width(), height()). @@ -1711,7 +1712,6 @@ void draw(SkCanvas* canvas) { #Method bool readPixels(const SkPixmap& dst, int srcX, int srcY) const -#In Writer 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, Alpha_Type, and Color_Space of destination. Returns true if pixels are copied. @@ -1773,7 +1773,6 @@ void draw(SkCanvas* canvas) { #Method bool readPixels(const SkPixmap& dst) const -#In Writer Copies pixels inside bounds() to dst. dst specifies width, height, Color_Type, Alpha_Type, and Color_Space of destination. Returns true if pixels are copied. Returns false if dst.addr() equals nullptr, or dst.rowBytes is less than @@ -1822,7 +1821,7 @@ void draw(SkCanvas* canvas) { #Method bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality) const -#In Writer +#In Pixels #Line # scales and converts pixels ## Copies Bitmap to dst, scaling pixels to fit dst.width() and dst.height(), and converting pixels to match dst.colorType and dst.alphaType. Returns true if @@ -1884,7 +1883,7 @@ void draw(SkCanvas* canvas) { #Method bool erase(SkColor color, const SkIRect& subset) const -#In Writer +#In Pixels #Line # writes Color to pixels ## Writes color to pixels bounded by subset; returns true on success. Returns false if colorType is kUnknown_SkColorType, or if subset does @@ -1916,7 +1915,6 @@ not intersect bounds(). #Method bool erase(SkColor color) const -#In Writer Writes color to pixels inside bounds(); returns true on success. Returns false if colorType is kUnknown_SkColorType, or if bounds() is empty. @@ -1945,7 +1943,6 @@ is empty. #Method bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const -#In Writer Writes color to pixels bounded by subset; returns true on success. if subset is nullptr, writes colors pixels inside bounds(). Returns false if colorType is kUnknown_SkColorType, if subset is not nullptr and does @@ -1975,9 +1972,6 @@ not intersect bounds(), or if subset is nullptr and bounds() is empty. ## - -#Subtopic Writer ## - #Class SkPixmap ## #Topic Pixmap ## diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh index 5807f0a281..a363de2497 100644 --- a/docs/SkRect_Reference.bmh +++ b/docs/SkRect_Reference.bmh @@ -899,7 +899,6 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false #Subtopic Set #Line # replaces all values ## - #Populate # ------------------------------------------------------------------------------ |