generate tables instead of manual entry
- make descriptions of table entries phrases instead of sentences; lower case start, no ending period (not enforced, yet) - add #Line markup to move one line descriptions to the #Method body. Later, will generate tables like Member_Functions from this - add #In markup to associate a #Method with a #Subtopic. Later, will generate tables of related methods from this - remove return type from operator overloads in tables - add new colorTypes to examples that index into arrays of strings to name them Docs-Preview: https://skia.org/?cl=100422 TBR=caryclark@google.com Bug: skia:6898 Change-Id: I8558048866369f419f1944832b99c05da3fd52bb Reviewed-on: https://skia-review.googlesource.com/100422 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
This commit is contained in:
parent
bbbcb94722
commit
ab2621d3e2
@ -24,8 +24,8 @@ state.
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# SkAutoCanvasRestore(SkCanvas* canvas, bool doSave) # Preserves Canvas save count. ##
|
||||
# ~SkAutoCanvasRestore() # Restores Canvas to saved state. ##
|
||||
# SkAutoCanvasRestore(SkCanvas* canvas, bool doSave) # preserves Canvas save count ##
|
||||
# ~SkAutoCanvasRestore() # restores Canvas to saved state ##
|
||||
#Table ##
|
||||
#Subtopic ##
|
||||
|
||||
@ -34,7 +34,7 @@ state.
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# restore() # Restores Canvas to saved state. ##
|
||||
# restore() # restores Canvas to saved state ##
|
||||
#Table ##
|
||||
#Subtopic ##
|
||||
|
||||
@ -42,6 +42,7 @@ state.
|
||||
|
||||
#Method SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)
|
||||
|
||||
#Line # preserves Canvas save count ##
|
||||
Preserves Canvas save count. Optionally saves Canvas_Clip and Canvas_Matrix.
|
||||
|
||||
#Param canvas Canvas to guard ##
|
||||
@ -70,6 +71,7 @@ Preserves Canvas save count. Optionally saves Canvas_Clip and Canvas_Matrix.
|
||||
|
||||
#Method ~SkAutoCanvasRestore()
|
||||
|
||||
#Line # restores Canvas to saved state ##
|
||||
Restores Canvas to saved state. Destructor is called when container goes out of
|
||||
scope.
|
||||
|
||||
@ -82,6 +84,7 @@ scope.
|
||||
|
||||
#Method void restore()
|
||||
|
||||
#Line # restores Canvas to saved state ##
|
||||
Restores Canvas to saved state immediately. Subsequent calls and
|
||||
~SkAutoCanvasRestore have no effect.
|
||||
|
||||
|
@ -74,8 +74,8 @@ is useful to position one or more Bitmaps within a shared pixel array.
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# SkBitmap& operator=(SkBitmap&& src) # takes ownership of pixels ##
|
||||
# SkBitmap& operator=(const SkBitmap& src) # shares ownership of pixels ##
|
||||
# operator=(SkBitmap&& src) # takes ownership of pixels ##
|
||||
# operator=(const SkBitmap& src) # shares ownership of pixels ##
|
||||
#Table ##
|
||||
#Subtopic ##
|
||||
|
||||
@ -242,6 +242,7 @@ pixel address = 0x560ddd0ac670
|
||||
|
||||
#Method SkBitmap()
|
||||
|
||||
#Line # constructs with default values ##
|
||||
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.
|
||||
@ -254,8 +255,8 @@ after Bitmap has been created.
|
||||
#Example
|
||||
void draw(SkCanvas* canvas) {
|
||||
const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444", "RGBA_8888", "BGRA_8888",
|
||||
"Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkBitmap bitmap;
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
SkDebugf("width: %2d height: %2d", bitmap.width(), bitmap.height());
|
||||
@ -279,6 +280,7 @@ width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType
|
||||
|
||||
#Method SkBitmap(const SkBitmap& src)
|
||||
|
||||
#Line # shares ownership of pixels ##
|
||||
Copies settings from src to returned Bitmap. Shares pixels if src has pixels
|
||||
allocated, so both bitmaps reference the same pixels.
|
||||
|
||||
@ -310,6 +312,7 @@ copy has pixels: true
|
||||
|
||||
#Method SkBitmap(SkBitmap&& src)
|
||||
|
||||
#Line # takes ownership of pixels ##
|
||||
Copies settings from src to returned Bitmap. Moves ownership of src pixels to
|
||||
Bitmap.
|
||||
|
||||
@ -341,6 +344,7 @@ copy has pixels: true
|
||||
|
||||
#Method ~SkBitmap()
|
||||
|
||||
#Line # releases ownership of pixels ##
|
||||
Decrements Pixel_Ref reference count, if Pixel_Ref is not nullptr.
|
||||
|
||||
#NoExample
|
||||
@ -354,6 +358,7 @@ Decrements Pixel_Ref reference count, if Pixel_Ref is not nullptr.
|
||||
|
||||
#Method SkBitmap& operator=(const SkBitmap& src)
|
||||
|
||||
#Line # shares ownership of pixels ##
|
||||
Copies settings from src to returned Bitmap. Shares pixels if src has pixels
|
||||
allocated, so both bitmaps reference the same pixels.
|
||||
|
||||
@ -385,6 +390,7 @@ copy has pixels: true
|
||||
|
||||
#Method SkBitmap& operator=(SkBitmap&& src)
|
||||
|
||||
#Line # takes ownership of pixels ##
|
||||
Copies settings from src to returned Bitmap. Moves ownership of src pixels to
|
||||
Bitmap.
|
||||
|
||||
@ -416,6 +422,7 @@ copy has pixels: true
|
||||
|
||||
#Method void swap(SkBitmap& other)
|
||||
|
||||
#Line # exchanges Bitmap pair ##
|
||||
Swaps the fields of the two bitmaps.
|
||||
|
||||
#Param other Bitmap exchanged with original ##
|
||||
@ -424,8 +431,8 @@ Swaps the fields of the two bitmaps.
|
||||
void draw(SkCanvas* canvas) {
|
||||
auto debugster = [](const char* prefix, const SkBitmap& b) -> void {
|
||||
const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444", "RGBA_8888", "BGRA_8888",
|
||||
"Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkDebugf("%s width:%d height:%d colorType:k%s_SkColorType alphaType:k%s_SkAlphaType\n",
|
||||
prefix, b.width(), b.height(), colors[b.colorType()], alphas[b.alphaType()]);
|
||||
};
|
||||
@ -454,6 +461,7 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT
|
||||
|
||||
#Method const SkPixmap& pixmap() const
|
||||
|
||||
#Line # returns Pixmap ##
|
||||
Returns a constant reference to the Pixmap holding the Bitmap pixel
|
||||
address, row bytes, and Image_Info.
|
||||
|
||||
@ -500,6 +508,7 @@ address, row bytes, and Image_Info.
|
||||
|
||||
#Method const SkImageInfo& info() const
|
||||
|
||||
#Line # returns Image_Info ##
|
||||
Returns width, height, Alpha_Type, Color_Type, and Color_Space.
|
||||
|
||||
#Return reference to Image_Info ##
|
||||
@ -510,8 +519,8 @@ void draw(SkCanvas* canvas) {
|
||||
// SkBitmap source; // pre-populated with soccer ball by fiddle.skia.org
|
||||
const SkImageInfo& info = source.info();
|
||||
const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkDebugf("width: %d height: %d color: %s alpha: %s\n", info.width(), info.height(),
|
||||
colors[info.colorType()], alphas[info.alphaType()]);
|
||||
#StdOut
|
||||
@ -528,6 +537,7 @@ width: 56 height: 56 color: BGRA_8888 alpha: Opaque
|
||||
|
||||
#Method int width() const
|
||||
|
||||
#Line # returns pixel column count ##
|
||||
Returns pixel count in each row. Should be equal or less than:
|
||||
|
||||
#Formula
|
||||
@ -558,6 +568,7 @@ bitmap width: 16 info width: 16
|
||||
|
||||
#Method int height() const
|
||||
|
||||
#Line # returns pixel row count ##
|
||||
Returns pixel row count.
|
||||
|
||||
Maybe be less than pixelRef().height(). Will not exceed pixelRef().height() less
|
||||
@ -583,6 +594,7 @@ bitmap height: 32 info height: 32
|
||||
|
||||
#Method SkColorType colorType() const
|
||||
|
||||
#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,
|
||||
kBGRA_8888_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType.
|
||||
@ -590,13 +602,13 @@ kBGRA_8888_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType.
|
||||
#Return Color_Type in Image_Info ##
|
||||
|
||||
#Example
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkBitmap bitmap;
|
||||
bitmap.setInfo(SkImageInfo::MakeA8(16, 32));
|
||||
SkDebugf("color type: k" "%s" "_SkColorType\n", colors[bitmap.colorType()]);
|
||||
#StdOut
|
||||
color type: kAlpha_SkColorType
|
||||
color type: kAlpha_8_SkColorType
|
||||
##
|
||||
##
|
||||
|
||||
@ -608,6 +620,7 @@ color type: kAlpha_SkColorType
|
||||
|
||||
#Method SkAlphaType alphaType() const
|
||||
|
||||
#Line # returns Image_Info Alpha_Type ##
|
||||
Returns Alpha_Type, one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType,
|
||||
kPremul_SkAlphaType, kUnpremul_SkAlphaType.
|
||||
|
||||
@ -630,6 +643,7 @@ alpha type: kPremul_SkAlphaType
|
||||
|
||||
#Method SkColorSpace* colorSpace() const
|
||||
|
||||
#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
|
||||
immutable.
|
||||
@ -662,6 +676,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
|
||||
|
||||
#Method sk_sp<SkColorSpace> refColorSpace() const
|
||||
|
||||
#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
|
||||
Color_Space reference so the memory is released when the owners destruct.
|
||||
@ -694,28 +709,30 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
|
||||
|
||||
#Method int bytesPerPixel() const
|
||||
|
||||
#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.
|
||||
|
||||
#Return bytes in pixel ##
|
||||
|
||||
#Example
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkImageInfo info = SkImageInfo::MakeA8(1, 1);
|
||||
SkBitmap bitmap;
|
||||
for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,
|
||||
kRGB_565_SkColorType, kARGB_4444_SkColorType,
|
||||
kRGBA_8888_SkColorType, kBGRA_8888_SkColorType,
|
||||
kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {
|
||||
kRGBA_8888_SkColorType,
|
||||
kBGRA_8888_SkColorType, kGray_8_SkColorType,
|
||||
kRGBA_F16_SkColorType } ) {
|
||||
bitmap.setInfo(info.makeColorType(colorType));
|
||||
SkDebugf("color: k" "%s" "_SkColorType" "%*s" "bytesPerPixel: %d\n",
|
||||
colors[colorType], 10 - strlen(colors[colorType]), " ",
|
||||
colors[colorType], 13 - strlen(colors[colorType]), " ",
|
||||
bitmap.bytesPerPixel());
|
||||
}
|
||||
#StdOut
|
||||
color: kUnknown_SkColorType bytesPerPixel: 0
|
||||
color: kAlpha_SkColorType bytesPerPixel: 1
|
||||
color: kAlpha_8_SkColorType bytesPerPixel: 1
|
||||
color: kRGB_565_SkColorType bytesPerPixel: 2
|
||||
color: kARGB_4444_SkColorType bytesPerPixel: 2
|
||||
color: kRGBA_8888_SkColorType bytesPerPixel: 4
|
||||
@ -733,6 +750,7 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8
|
||||
|
||||
#Method int rowBytesAsPixels() const
|
||||
|
||||
#Line # returns interval between rows in pixels ##
|
||||
Returns number of pixels that fit on row. Should be greater than or equal to
|
||||
width().
|
||||
|
||||
@ -761,14 +779,15 @@ rowBytes: 8 rowBytesAsPixels: 2
|
||||
|
||||
#Method int shiftPerPixel() const
|
||||
|
||||
#Line # returns bit shift from pixels to bytes ##
|
||||
Returns bit shift converting row bytes to row pixels.
|
||||
Returns zero for kUnknown_SkColorType.
|
||||
|
||||
#Return one of: 0, 1, 2, 3; left shift to convert pixels to bytes ##
|
||||
|
||||
#Example
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkImageInfo info = SkImageInfo::MakeA8(1, 1);
|
||||
SkBitmap bitmap;
|
||||
for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,
|
||||
@ -782,7 +801,7 @@ Returns zero for kUnknown_SkColorType.
|
||||
}
|
||||
#StdOut
|
||||
color: kUnknown_SkColorType shiftPerPixel: 0
|
||||
color: kAlpha_SkColorType shiftPerPixel: 0
|
||||
color: kAlpha_8_SkColorType shiftPerPixel: 0
|
||||
color: kRGB_565_SkColorType shiftPerPixel: 1
|
||||
color: kARGB_4444_SkColorType shiftPerPixel: 1
|
||||
color: kRGBA_8888_SkColorType shiftPerPixel: 2
|
||||
@ -800,6 +819,7 @@ color: kRGBA_F16_SkColorType shiftPerPixel: 3
|
||||
|
||||
#Method bool empty() const
|
||||
|
||||
#Line # returns true if Image_Info has zero width() or height() ##
|
||||
Returns true if either width() or height() are zero.
|
||||
|
||||
Does not check if Pixel_Ref is nullptr; call drawsNothing to check width(),
|
||||
@ -832,6 +852,7 @@ width: 2 height: 2 empty: false
|
||||
|
||||
#Method bool isNull() const
|
||||
|
||||
#Line # returns true if Pixel_Ref is nullptr ##
|
||||
Return true if Pixel_Ref is nullptr.
|
||||
|
||||
Does not check if width() or height() are zero; call drawsNothing to check
|
||||
@ -861,6 +882,7 @@ allocated bitmap does have pixels
|
||||
|
||||
#Method bool drawsNothing() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -892,6 +914,7 @@ empty:false isNull:false drawsNothing:false
|
||||
|
||||
#Method size_t rowBytes() const
|
||||
|
||||
#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
|
||||
#Formula
|
||||
@ -924,6 +947,7 @@ setInfo returned:true rowBytes:8
|
||||
|
||||
#Method bool setAlphaType(SkAlphaType alphaType)
|
||||
|
||||
#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
|
||||
is not kUnknown_SkAlphaType.
|
||||
@ -955,10 +979,9 @@ are affected.
|
||||
|
||||
#Example
|
||||
void draw(SkCanvas* canvas) {
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
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"};
|
||||
|
||||
SkBitmap bitmap;
|
||||
SkAlphaType alphaTypes[] = { kUnknown_SkAlphaType, kOpaque_SkAlphaType,
|
||||
kPremul_SkAlphaType, kUnpremul_SkAlphaType };
|
||||
@ -988,6 +1011,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void* getPixels() const
|
||||
|
||||
#Line # returns address of pixels ##
|
||||
Returns pixel address, the base address corresponding to the pixel origin.
|
||||
|
||||
#Return pixel address ##
|
||||
@ -1017,6 +1041,7 @@ bitmap.getColor(0, 0) == 0xFFFFFFFF
|
||||
|
||||
#Method size_t computeByteSize() const
|
||||
|
||||
#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().
|
||||
Returns zero if result does not fit in size_t.
|
||||
@ -1056,6 +1081,7 @@ width: 1000000 height: 1000000 computeByteSize: 4999999000000
|
||||
|
||||
#Method bool isImmutable() const
|
||||
|
||||
#Line # returns true if pixels will not change ##
|
||||
Returns true if pixels can not change.
|
||||
|
||||
Most immutable Bitmap checks trigger an assert only on debug builds.
|
||||
@ -1086,6 +1112,7 @@ copy is immutable
|
||||
|
||||
#Method void setImmutable()
|
||||
|
||||
#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.
|
||||
Once Pixel_Ref is marked immutable, the setting cannot be cleared.
|
||||
@ -1115,6 +1142,7 @@ Triggers assert if SK_DEBUG is true, runs fine otherwise.
|
||||
|
||||
#Method bool isOpaque() const
|
||||
|
||||
#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
|
||||
transparency.
|
||||
@ -1153,6 +1181,7 @@ isOpaque: true
|
||||
|
||||
#Method bool isVolatile() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -1184,6 +1213,7 @@ copy is not volatile
|
||||
|
||||
#Method void setIsVolatile(bool isVolatile)
|
||||
|
||||
#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
|
||||
accessed repeatedly. Marking temporary Bitmaps as volatile provides a hint to
|
||||
@ -1216,6 +1246,7 @@ consumption on Device.
|
||||
|
||||
#Method void reset()
|
||||
|
||||
#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().
|
||||
|
||||
@ -1248,6 +1279,7 @@ width:0 height:0 isNull:true
|
||||
|
||||
#Method static bool ComputeIsOpaque(const SkBitmap& bm)
|
||||
|
||||
#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
|
||||
without alpha in each pixel; for other Color_Types, returns true if all
|
||||
@ -1293,6 +1325,7 @@ computeIsOpaque: true
|
||||
|
||||
#Method void getBounds(SkRect* bounds) const
|
||||
|
||||
#Line # returns width() and height() as Rectangle ##
|
||||
Returns Rect { 0, 0, width(), height() }.
|
||||
|
||||
#Param bounds container for floating point rectangle ##
|
||||
@ -1341,6 +1374,7 @@ Returns IRect { 0, 0, width(), height() }.
|
||||
|
||||
#Method SkIRect bounds() const
|
||||
|
||||
#Line # returns width() and height() as Rectangle ##
|
||||
Returns IRect { 0, 0, width(), height() }.
|
||||
|
||||
#Return integral rectangle from origin to width() and height() ##
|
||||
@ -1365,6 +1399,7 @@ Returns IRect { 0, 0, width(), height() }.
|
||||
|
||||
#Method SkISize dimensions() const
|
||||
|
||||
#Line # returns width() and height() ##
|
||||
Returns ISize { width(), height() }.
|
||||
|
||||
#Return integral size of width() and height() ##
|
||||
@ -1387,6 +1422,7 @@ Returns ISize { width(), height() }.
|
||||
|
||||
#Method SkIRect getSubset() const
|
||||
|
||||
#Line # returns bounds offset by origin ##
|
||||
Returns the bounds of this bitmap, offset by its Pixel_Ref origin.
|
||||
|
||||
#Return bounds within Pixel_Ref bounds ##
|
||||
@ -1416,6 +1452,7 @@ subset: 100, 100, 412, 412
|
||||
|
||||
#Method bool setInfo(const SkImageInfo& imageInfo, size_t rowBytes = 0)
|
||||
|
||||
#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.
|
||||
|
||||
@ -1493,6 +1530,7 @@ AllocFlags provides the option to zero pixel memory when allocated.
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixelsFlags(const SkImageInfo& info, uint32_t flags)
|
||||
|
||||
#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.
|
||||
|
||||
@ -1534,6 +1572,7 @@ bitmap allocation succeeded!
|
||||
|
||||
#Method void allocPixelsFlags(const SkImageInfo& info, uint32_t flags)
|
||||
|
||||
#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.
|
||||
|
||||
@ -1581,6 +1620,7 @@ canvas->drawBitmap(bitmap, 8, 8);
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info, size_t rowBytes)
|
||||
|
||||
#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
|
||||
I'm not so sure it makes sense to put the indirection in for .h either unless
|
||||
@ -1628,6 +1668,7 @@ if (bitmap.tryAllocPixels(info, 0)) {
|
||||
|
||||
#Method void allocPixels(const SkImageInfo& info, size_t rowBytes)
|
||||
|
||||
#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(),
|
||||
or equal zero. Pass in zero for rowBytes to compute the minimum valid value.
|
||||
@ -1735,6 +1776,7 @@ for (int y : { 0, 64, 128, 192 } ) {
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT tryAllocN32Pixels(int width, int height, bool isOpaque = false)
|
||||
|
||||
#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;
|
||||
otherwise, sets to kPremul_SkAlphaType.
|
||||
@ -1776,6 +1818,7 @@ the platform. Bitmap drawn to output device skips converting its pixel format.
|
||||
|
||||
#Method void allocN32Pixels(int width, int height, bool isOpaque = false)
|
||||
|
||||
#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;
|
||||
otherwise, sets to kOpaque_SkAlphaType.
|
||||
@ -1817,6 +1860,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)
|
||||
#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
|
||||
@ -1965,6 +2009,7 @@ Draw a five by five bitmap, and draw it again with a center white pixel.
|
||||
|
||||
#Method bool installMaskPixels(const SkMask& mask)
|
||||
|
||||
#Line # creates Pixel_Ref from Mask ##
|
||||
Sets Image_Info to mask width, mask height, kAlpha_8_SkColorType, and
|
||||
kPremul_SkAlphaType. Sets Pixel_Ref to mask image and mask rowBytes.
|
||||
|
||||
@ -2010,6 +2055,7 @@ Draw a five by five bitmap, and draw it again with a center white pixel.
|
||||
|
||||
#Method void setPixels(void* 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).
|
||||
|
||||
@ -2237,6 +2283,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkPixelRef* pixelRef() const
|
||||
|
||||
#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
|
||||
reference count. Pixel_Ref may be shared by multiple bitmaps.
|
||||
@ -2261,6 +2308,7 @@ If Pixel_Ref has not been set, returns nullptr.
|
||||
|
||||
#Method SkIPoint pixelRefOrigin() const
|
||||
|
||||
#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
|
||||
can share the same Pixel_Ref, where each Bitmap has different bounds.
|
||||
@ -2294,6 +2342,7 @@ subset origin: 32, 64
|
||||
|
||||
#Method void setPixelRef(sk_sp<SkPixelRef> pixelRef, int dx, int dy)
|
||||
|
||||
#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.
|
||||
|
||||
@ -2328,6 +2377,7 @@ Treating 32 bit data as 8 bit data is unlikely to produce useful results.
|
||||
|
||||
#Method bool readyToDraw() const
|
||||
|
||||
#Line # returns true if address of pixels is not nullptr ##
|
||||
Returns true if Bitmap is can be drawn.
|
||||
|
||||
#Return true if getPixels() is not nullptr ##
|
||||
@ -2348,6 +2398,7 @@ Returns true if Bitmap is can be drawn.
|
||||
|
||||
#Method uint32_t getGenerationID() const
|
||||
|
||||
#Line # returns unique ID ##
|
||||
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.
|
||||
@ -2379,6 +2430,7 @@ erase id 6
|
||||
|
||||
#Method void notifyPixelsChanged() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -2405,6 +2457,7 @@ getGenerationID() return a different value.
|
||||
|
||||
#Method void eraseColor(SkColor c) const
|
||||
|
||||
#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
|
||||
is ignored; Color_RGB is treated as opaque. If colorType is kAlpha_8_SkColorType,
|
||||
@ -2429,6 +2482,7 @@ then Color_RGB is ignored.
|
||||
|
||||
#Method void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const
|
||||
|
||||
#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.
|
||||
If the colorType is kGray_8_SkColorType or k565_SkColorType, then a
|
||||
@ -2458,6 +2512,7 @@ then r, g, and b are ignored.
|
||||
|
||||
#Method void eraseRGB(U8CPU r, U8CPU g, U8CPU b) const
|
||||
|
||||
#Line # deprecated ##
|
||||
Deprecated. Use eraseARGB or eraseColor.
|
||||
|
||||
#Param r amount of red ##
|
||||
@ -2475,6 +2530,7 @@ Deprecated. Use eraseARGB or eraseColor.
|
||||
|
||||
#Method void erase(SkColor c, const SkIRect& area) const
|
||||
|
||||
#Line # writes Color to rectangle of pixels ##
|
||||
Replaces pixel values inside area with c. If area does not intersect bounds(),
|
||||
call has no effect.
|
||||
|
||||
@ -2507,6 +2563,7 @@ then Color_RGB is ignored.
|
||||
|
||||
#Method void eraseArea(const SkIRect& area, SkColor c) const
|
||||
|
||||
#Line # deprecated ##
|
||||
Legacy call to be deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -2518,6 +2575,7 @@ Legacy call to be deprecated.
|
||||
|
||||
#Method SkColor getColor(int x, int y) const
|
||||
|
||||
#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.
|
||||
|
||||
@ -2583,6 +2641,7 @@ Unpremultiplied:
|
||||
|
||||
#Method void* getAddr(int x, int y) const
|
||||
|
||||
#Line # returns readable pixel address as void pointer ##
|
||||
Returns pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y, or kUnknown_SkColorType,
|
||||
@ -2615,6 +2674,7 @@ addr interval == rowBytes
|
||||
|
||||
#Method inline uint32_t* getAddr32(int x, int y) const
|
||||
|
||||
#Line # returns readable pixel address as 32-bit pointer ##
|
||||
Returns address at (x, y).
|
||||
|
||||
Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
|
||||
@ -2649,6 +2709,7 @@ addr interval == rowBytes
|
||||
|
||||
#Method inline uint16_t* getAddr16(int x, int y) const
|
||||
|
||||
#Line # returns readable pixel address as 16-bit pointer ##
|
||||
Returns address at (x, y).
|
||||
|
||||
Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
|
||||
@ -2689,6 +2750,7 @@ addr interval == rowBytes
|
||||
|
||||
#Method inline uint8_t* getAddr8(int x, int y) const
|
||||
|
||||
#Line # returns readable pixel address as 8-bit pointer ##
|
||||
Returns address at (x, y).
|
||||
|
||||
Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
|
||||
@ -2727,6 +2789,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
|
||||
|
||||
#Method bool extractSubset(SkBitmap* dst, const SkIRect& subset) const
|
||||
|
||||
#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
|
||||
and the original bounds().
|
||||
@ -2794,6 +2857,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
|
||||
#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()).
|
||||
@ -3068,6 +3132,7 @@ false if pixel conversion is not possible.
|
||||
|
||||
#Method bool writePixels(const SkPixmap& src, int dstX, int dstY)
|
||||
|
||||
#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()).
|
||||
|
||||
@ -3246,6 +3311,7 @@ pixels are treated as if they are linear, regardless of how they are encoded.
|
||||
|
||||
#Method bool hasHardwareMipMap() const
|
||||
|
||||
#Line # returns Mip_Map support present; Android only ##
|
||||
#Private
|
||||
Android framework only.
|
||||
##
|
||||
@ -3263,6 +3329,7 @@ Android framework only.
|
||||
|
||||
#Method void setHasHardwareMipMap(bool hasHardwareMipMap)
|
||||
|
||||
#Line # sets Mip_Map support present; Android only ##
|
||||
#Private
|
||||
Android framework only.
|
||||
##
|
||||
@ -3280,6 +3347,7 @@ Android framework only.
|
||||
|
||||
#Method bool extractAlpha(SkBitmap* dst) const
|
||||
|
||||
#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.
|
||||
|
||||
@ -3410,6 +3478,7 @@ mask.
|
||||
|
||||
#Method bool peekPixels(SkPixmap* pixmap) const
|
||||
|
||||
#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
|
||||
false and leave pixmap unchanged.
|
||||
@ -3461,6 +3530,7 @@ x---x-
|
||||
|
||||
#Method void validate() const;
|
||||
|
||||
#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.
|
||||
|
||||
@ -3475,6 +3545,7 @@ SK_DEBUG is defined at compile time.
|
||||
|
||||
#Method void toString(SkString* str) const;
|
||||
|
||||
#Line # converts Bitmap to machine readable form ##
|
||||
#DefinedBy SK_TO_STRING_NONVIRT() ##
|
||||
|
||||
#Private
|
||||
|
@ -86,10 +86,11 @@ when no Surface is required, and some helpers implicitly create Raster_Surface.
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# MakeRasterDirect # creates Canvas from SkImageInfo and pixel data ##
|
||||
# MakeRasterDirectN32 # creates Canvas from image specifications and pixel data ##
|
||||
# MakeRasterDirect # creates from SkImageInfo and Pixel_Storage ##
|
||||
# MakeRasterDirectN32 # creates from image data and Pixel_Storage ##
|
||||
# accessTopLayerPixels # returns writable pixel access if available ##
|
||||
# accessTopRasterHandle # returns context that tracks Clip and Matrix ##
|
||||
# androidFramework_setDeviceClipRestriction # for use by Android framework ##
|
||||
# clear() # fills Clip with Color ##
|
||||
# clipPath # combines Clip with Path ##
|
||||
# clipRRect # combines Clip with Round_Rect ##
|
||||
@ -163,7 +164,7 @@ when no Surface is required, and some helpers implicitly create Raster_Surface.
|
||||
# setAllowSimplifyClip # experimental ##
|
||||
# setDrawFilter # legacy; to be deprecated ##
|
||||
# setMatrix # sets Matrix ##
|
||||
# skew() # skews Matrix. #
|
||||
# skew() # skews Matrix ##
|
||||
# translate() # translates Matrix ##
|
||||
# writePixels # copies and converts rectangle of pixels to Canvas ##
|
||||
#Table ##
|
||||
@ -176,6 +177,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)
|
||||
#Line # creates from SkImageInfo and Pixel_Storage ##
|
||||
|
||||
Allocates raster Canvas that will draw directly into pixels.
|
||||
|
||||
@ -249,6 +251,7 @@ void draw(SkCanvas* ) {
|
||||
|
||||
#Method static std::unique_ptr<SkCanvas> MakeRasterDirectN32(int width, int height, SkPMColor* pixels,
|
||||
size_t rowBytes)
|
||||
#Line # creates from image data and Pixel_Storage ##
|
||||
|
||||
Allocates raster Canvas specified by inline image specification. Subsequent Canvas
|
||||
calls draw into pixels.
|
||||
@ -322,6 +325,7 @@ void draw(SkCanvas* ) {
|
||||
|
||||
#Method SkCanvas()
|
||||
|
||||
#Line # creates with no Surface, no dimensions ##
|
||||
Creates an empty Canvas with no backing device or pixels, with
|
||||
a width and height of zero.
|
||||
|
||||
@ -374,6 +378,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr)
|
||||
|
||||
#Line # no Surface, set dimensions, Surface_Properties ##
|
||||
Creates Canvas of the specified dimensions without a Surface.
|
||||
Used by Subclasses with custom implementations for draw methods.
|
||||
|
||||
@ -409,6 +414,7 @@ different characteristics, it is best not to rely on this legacy behavior.
|
||||
|
||||
#Method explicit SkCanvas(SkBaseDevice* device)
|
||||
|
||||
#Line # to be deprecated ##
|
||||
Construct a canvas that draws into device.
|
||||
Used by child classes of SkCanvas.
|
||||
|
||||
@ -434,6 +440,7 @@ Used by child classes of SkCanvas.
|
||||
|
||||
#Method explicit SkCanvas(const SkBitmap& bitmap)
|
||||
|
||||
#Line # uses existing Bitmap ##
|
||||
Construct a canvas that draws into bitmap.
|
||||
Sets SkSurfaceProps::kLegacyFontHost_InitType in constructed Surface.
|
||||
|
||||
@ -511,6 +518,7 @@ Android framework only.
|
||||
|
||||
#Method SkCanvas(const SkBitmap& bitmap, ColorBehavior behavior)
|
||||
|
||||
#Line # Android framework only ##
|
||||
#Private
|
||||
Android framework only.
|
||||
##
|
||||
@ -527,6 +535,7 @@ Android framework only.
|
||||
|
||||
#Method SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
|
||||
|
||||
#Line # uses existing Bitmap and Surface_Properties ##
|
||||
Construct a canvas that draws into bitmap.
|
||||
Use props to match the device characteristics, like LCD striping.
|
||||
|
||||
@ -589,6 +598,7 @@ The actual output depends on the installed fonts.
|
||||
|
||||
#Method virtual ~SkCanvas()
|
||||
|
||||
#Line # draws saved Layers, frees resources ##
|
||||
Draws saved Layers, if any.
|
||||
Frees up resources used by Canvas.
|
||||
|
||||
@ -624,6 +634,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkMetaData& getMetaData()
|
||||
|
||||
#Line # associates additional data with the canvas ##
|
||||
Returns storage to associate additional data with the canvas.
|
||||
The storage is freed when Canvas is deleted.
|
||||
|
||||
@ -654,6 +665,7 @@ The storage is freed when Canvas is deleted.
|
||||
|
||||
#Method SkImageInfo imageInfo() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -678,6 +690,7 @@ GPU_Surface, returned Color_Type is set to kUnknown_SkColorType.
|
||||
|
||||
#Method bool getProps(SkSurfaceProps* props) const
|
||||
|
||||
#Line # copies Surface_Properties if available ##
|
||||
If Canvas is associated with Raster_Surface or
|
||||
GPU_Surface, copies Surface_Properties and returns true. Otherwise,
|
||||
return false and leave props unchanged.
|
||||
@ -712,6 +725,7 @@ return false and leave props unchanged.
|
||||
|
||||
#Method void flush()
|
||||
|
||||
#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.
|
||||
If Canvas is associated with Raster_Surface, has no effect; raster draw
|
||||
@ -746,6 +760,7 @@ for posterity: this doesn't show a difference: fiddle.skia.org/c/@flushfail
|
||||
|
||||
#Method virtual SkISize getBaseLayerSize() const
|
||||
|
||||
#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
|
||||
smaller (due to clipping or saveLayer).
|
||||
@ -781,6 +796,7 @@ smaller (due to clipping or saveLayer).
|
||||
|
||||
#Method sk_sp<SkSurface> makeSurface(const SkImageInfo& info, const SkSurfaceProps* props = nullptr)
|
||||
|
||||
#Line # creates Surface matching SkImageInfo and SkSurfaceProps ##
|
||||
Creates Surface matching info and props, and associates it with Canvas.
|
||||
Returns nullptr if no match found.
|
||||
|
||||
@ -814,6 +830,7 @@ does not have Surface_Properties, creates Surface with default Surface_Propertie
|
||||
|
||||
#Method virtual GrContext* getGrContext()
|
||||
|
||||
#Line # returns GPU_Context of the GPU_Surface ##
|
||||
Returns GPU_Context of the GPU_Surface associated with Canvas.
|
||||
|
||||
#Return GPU_Context, if available; nullptr otherwise ##
|
||||
@ -838,6 +855,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* origin = nullptr)
|
||||
|
||||
#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
|
||||
while Canvas is in scope and unchanged. Any Canvas call or Surface call
|
||||
@ -920,6 +938,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkRasterHandleAllocator::Handle accessTopRasterHandle() const
|
||||
|
||||
#Line # returns context that tracks Clip and Matrix ##
|
||||
Returns custom context that tracks the Matrix and Clip.
|
||||
|
||||
Use Raster_Handle_Allocator to blend Skia drawing with custom drawing, typically performed
|
||||
@ -979,6 +998,7 @@ the drawing destination.
|
||||
|
||||
#Method bool peekPixels(SkPixmap* pixmap)
|
||||
|
||||
#Line # returns if Canvas has direct access to its pixels ##
|
||||
Returns true if Canvas has direct access to its pixels.
|
||||
|
||||
Pixels are readable when Device is raster. Pixels are not readable when Canvas
|
||||
@ -1011,6 +1031,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)
|
||||
#Line # copies and converts rectangle of pixels from Canvas ##
|
||||
|
||||
Copies Rect of pixels from Canvas into dstPixels. Matrix and Clip are
|
||||
ignored.
|
||||
@ -1230,6 +1251,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, int x, int y)
|
||||
|
||||
#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()).
|
||||
Destination Rect corners are (x, y) and
|
||||
@ -1421,6 +1443,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method int save()
|
||||
|
||||
#In State_Stack
|
||||
#Line # saves Clip and Matrix on stack ##
|
||||
Saves Matrix, Clip, and Draw_Filter (Draw_Filter deprecated on most platforms).
|
||||
Calling restore() discards changes to Matrix, Clip, and Draw_Filter,
|
||||
restoring the Matrix, Clip, and Draw_Filter to their state when save() was called.
|
||||
@ -1463,6 +1487,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void restore()
|
||||
|
||||
#In State_Stack
|
||||
#Line # restores changes to Clip and Matrix, pops save stack ##
|
||||
Removes changes to Matrix, Clip, and Draw_Filter since Canvas state was
|
||||
last saved. The state is removed from the stack.
|
||||
|
||||
@ -1485,6 +1511,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method int getSaveCount() const
|
||||
|
||||
#In State_Stack
|
||||
#Line # returns depth of stack containing Clip and Matrix ##
|
||||
Returns the number of saved states, each containing: Matrix, Clip, and Draw_Filter.
|
||||
Equals the number of save() calls less the number of restore() calls plus one.
|
||||
The save count of a new canvas is one.
|
||||
@ -1515,6 +1543,8 @@ depth = 1
|
||||
|
||||
#Method void restoreToCount(int saveCount)
|
||||
|
||||
#In State_Stack
|
||||
#Line # restores changes to Clip and Matrix to given depth ##
|
||||
Restores state to Matrix, Clip, and Draw_Filter values when save(), saveLayer,
|
||||
saveLayerPreserveLCDTextRequests, or saveLayerAlpha returned saveCount.
|
||||
|
||||
@ -1563,6 +1593,8 @@ Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode.
|
||||
|
||||
#Method int saveLayer(const SkRect* bounds, const SkPaint* paint)
|
||||
|
||||
#In Layer
|
||||
#Line # saves Clip and Matrix on stack; creates Layer ##
|
||||
Saves Matrix, Clip, and Draw_Filter (Draw_Filter deprecated on most platforms),
|
||||
and allocates a Bitmap for subsequent drawing.
|
||||
Calling restore() discards changes to Matrix, Clip, and Draw_Filter,
|
||||
@ -1610,6 +1642,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method int saveLayer(const SkRect& bounds, const SkPaint* paint)
|
||||
|
||||
#In Layer
|
||||
Saves Matrix, Clip, and Draw_Filter (Draw_Filter deprecated on most platforms),
|
||||
and allocates a Bitmap for subsequent drawing.
|
||||
Calling restore() discards changes to Matrix, Clip, and Draw_Filter,
|
||||
@ -1658,6 +1691,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method int saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint)
|
||||
|
||||
#In Layer
|
||||
#Line # saves Clip and Matrix on stack; creates Layer for LCD text ##
|
||||
Saves Matrix, Clip, and Draw_Filter (Draw_Filter deprecated on most platforms),
|
||||
and allocates a Bitmap for subsequent drawing.
|
||||
LCD_Text is preserved when the Layer is drawn to the prior Layer.
|
||||
@ -1715,6 +1750,8 @@ incorrect blending.
|
||||
|
||||
#Method int saveLayerAlpha(const SkRect* bounds, U8CPU alpha)
|
||||
|
||||
#In Layer
|
||||
#Line # saves Clip and Matrix on stack; creates Layer; sets opacity ##
|
||||
Saves Matrix, Clip, and Draw_Filter (Draw_Filter deprecated on most platforms),
|
||||
and allocates Bitmap for subsequent drawing.
|
||||
|
||||
@ -2013,6 +2050,7 @@ Implementation is not complete; has no effect if Device is GPU-backed.
|
||||
|
||||
#Method int saveLayer(const SaveLayerRec& layerRec)
|
||||
|
||||
#In Layer
|
||||
Saves Matrix, Clip, and Draw_Filter (Draw_Filter deprecated on most platforms),
|
||||
and allocates Bitmap for subsequent drawing.
|
||||
|
||||
@ -2065,6 +2103,8 @@ Outside of the circle the mandrill is brightened.
|
||||
|
||||
#Method void translate(SkScalar dx, SkScalar dy)
|
||||
|
||||
#In Matrix
|
||||
#Line # translates Matrix ##
|
||||
Translate Matrix by dx along the x-axis and dy along the y-axis.
|
||||
|
||||
Mathematically, replace Matrix with a translation matrix
|
||||
@ -2115,6 +2155,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void scale(SkScalar sx, SkScalar sy)
|
||||
|
||||
#In Matrix
|
||||
#Line # scales Matrix ##
|
||||
Scale Matrix by sx on the x-axis and sy on the y-axis.
|
||||
|
||||
Mathematically, replace Matrix with a scale matrix
|
||||
@ -2147,6 +2189,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void rotate(SkScalar degrees)
|
||||
|
||||
#In Matrix
|
||||
#Line # rotates Matrix ##
|
||||
Rotate Matrix by degrees. Positive degrees rotates clockwise.
|
||||
|
||||
Mathematically, replace Matrix with a rotation matrix
|
||||
@ -2184,6 +2228,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void rotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
|
||||
#In Matrix
|
||||
Rotate Matrix by degrees about a point at (px, py). Positive degrees rotates
|
||||
clockwise.
|
||||
|
||||
@ -2217,6 +2262,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void skew(SkScalar sx, SkScalar sy)
|
||||
|
||||
#In Matrix
|
||||
#Line # skews Matrix ##
|
||||
Skew Matrix by sx on the x-axis and sy on the y-axis. A positive value of sx
|
||||
skews the drawing right as y increases; a positive value of sy skews the drawing
|
||||
down as x increases.
|
||||
@ -2262,6 +2309,8 @@ the result with Matrix.
|
||||
|
||||
#Method void concat(const SkMatrix& matrix)
|
||||
|
||||
#In Matrix
|
||||
#Line # multiplies Matrix by Matrix ##
|
||||
Replace Matrix with matrix Premultiplied with existing Matrix.
|
||||
|
||||
This has the effect of transforming the drawn geometry by matrix, before
|
||||
@ -2294,6 +2343,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setMatrix(const SkMatrix& matrix)
|
||||
|
||||
#In Matrix
|
||||
#Line # sets Matrix ##
|
||||
Replace Matrix with matrix.
|
||||
Unlike concat(), any prior matrix state is overwritten.
|
||||
|
||||
@ -2320,6 +2371,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void resetMatrix()
|
||||
|
||||
#In Matrix
|
||||
#Line # resets Matrix to identity ##
|
||||
Sets Matrix to the identity matrix.
|
||||
Any prior matrix state is overwritten.
|
||||
|
||||
@ -2343,6 +2396,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method const SkMatrix& getTotalMatrix() const
|
||||
|
||||
#In Matrix
|
||||
#Line # returns Matrix ##
|
||||
Returns Matrix.
|
||||
This does not account for translation by Device or Surface.
|
||||
|
||||
@ -2423,6 +2478,8 @@ and is unaffected by Matrix.
|
||||
|
||||
#Method void clipRect(const SkRect& rect, SkClipOp op, bool doAntiAlias)
|
||||
|
||||
#In Clip
|
||||
#Line # combines Clip with Rect ##
|
||||
Replace Clip with the intersection or difference of Clip and rect,
|
||||
with an Aliased or Anti-aliased clip edge. rect is transformed by Matrix
|
||||
before it is combined with Clip.
|
||||
@ -2453,6 +2510,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipRect(const SkRect& rect, SkClipOp op)
|
||||
|
||||
#In Clip
|
||||
Replace Clip with the intersection or difference of Clip and rect.
|
||||
Resulting Clip is Aliased; pixels are fully contained by the clip.
|
||||
rect is transformed by Matrix before it is combined with Clip.
|
||||
@ -2481,6 +2539,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipRect(const SkRect& rect, bool doAntiAlias = false)
|
||||
|
||||
#In Clip
|
||||
Replace Clip with the intersection of Clip and rect.
|
||||
Resulting Clip is Aliased; pixels are fully contained by the clip.
|
||||
rect is transformed by Matrix
|
||||
@ -2522,6 +2581,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void androidFramework_setDeviceClipRestriction(const SkIRect& rect)
|
||||
|
||||
#In Clip
|
||||
#Line # 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.
|
||||
@ -2540,6 +2601,8 @@ This is private API to be used only by Android framework.
|
||||
|
||||
#Method void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias)
|
||||
|
||||
#In Clip
|
||||
#Line # combines Clip with Round_Rect ##
|
||||
Replace Clip with the intersection or difference of Clip and rrect,
|
||||
with an Aliased or Anti-aliased clip edge.
|
||||
rrect is transformed by Matrix
|
||||
@ -2569,6 +2632,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipRRect(const SkRRect& rrect, SkClipOp op)
|
||||
|
||||
#In Clip
|
||||
Replace Clip with the intersection or difference of Clip and rrect.
|
||||
Resulting Clip is Aliased; pixels are fully contained by the clip.
|
||||
rrect is transformed by Matrix before it is combined with Clip.
|
||||
@ -2593,6 +2657,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipRRect(const SkRRect& rrect, bool doAntiAlias = false)
|
||||
|
||||
#In Clip
|
||||
Replace Clip with the intersection of Clip and rrect,
|
||||
with an Aliased or Anti-aliased clip edge.
|
||||
rrect is transformed by Matrix before it is combined with Clip.
|
||||
@ -2617,6 +2682,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipPath(const SkPath& path, SkClipOp op, bool doAntiAlias)
|
||||
|
||||
#In Clip
|
||||
#Line # combines Clip with Path ##
|
||||
Replace Clip with the intersection or difference of Clip and path,
|
||||
with an Aliased or Anti-aliased clip edge. Path_Fill_Type determines if path
|
||||
describes the area inside or outside its contours; and if Path_Contour overlaps
|
||||
@ -2658,6 +2725,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipPath(const SkPath& path, SkClipOp op)
|
||||
|
||||
#In Clip
|
||||
Replace Clip with the intersection or difference of Clip and path.
|
||||
Resulting Clip is Aliased; pixels are fully contained by the clip.
|
||||
Path_Fill_Type determines if path
|
||||
@ -2699,6 +2767,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void clipPath(const SkPath& path, bool doAntiAlias = false)
|
||||
|
||||
#In Clip
|
||||
Replace Clip with the intersection of Clip and path.
|
||||
Resulting Clip is Aliased; pixels are fully contained by the clip.
|
||||
Path_Fill_Type determines if path
|
||||
@ -2743,6 +2812,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setAllowSimplifyClip(bool allow)
|
||||
|
||||
#In Clip
|
||||
#Line # experimental ##
|
||||
#Experimental
|
||||
Only used for testing.
|
||||
##
|
||||
@ -2755,6 +2826,8 @@ Set to simplify clip stack using PathOps.
|
||||
|
||||
#Method void clipRegion(const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect)
|
||||
|
||||
#In Clip
|
||||
#Line # combines Clip with Region ##
|
||||
Replace Clip with the intersection or difference of Clip and Region deviceRgn.
|
||||
Resulting Clip is Aliased; pixels are fully contained by the clip.
|
||||
deviceRgn is unaffected by Matrix.
|
||||
@ -2790,6 +2863,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool quickReject(const SkRect& rect) const
|
||||
|
||||
#In Clip
|
||||
#Line # returns if Rect is outside Clip ##
|
||||
Return true if Rect rect, transformed by Matrix, can be quickly determined to be
|
||||
outside of Clip. May return false even though rect is outside of Clip.
|
||||
|
||||
@ -2823,6 +2898,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool quickReject(const SkPath& path) const
|
||||
|
||||
#In Clip
|
||||
Return true if path, transformed by Matrix, can be quickly determined to be
|
||||
outside of Clip. May return false even though path is outside of Clip.
|
||||
|
||||
@ -2859,6 +2935,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkRect getLocalClipBounds() const
|
||||
|
||||
#In Clip
|
||||
#Line # returns Clip bounds in source coordinates ##
|
||||
Return bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
|
||||
return SkRect::MakeEmpty, where all Rect sides equal zero.
|
||||
|
||||
@ -2904,6 +2982,7 @@ is Anti-aliased.
|
||||
|
||||
#Method bool getLocalClipBounds(SkRect* bounds) const
|
||||
|
||||
#In Clip
|
||||
Return bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
|
||||
return false, and set bounds to SkRect::MakeEmpty, where all Rect sides equal zero.
|
||||
|
||||
@ -2940,6 +3019,8 @@ is Anti-aliased.
|
||||
|
||||
#Method SkIRect getDeviceClipBounds() const
|
||||
|
||||
#In Clip
|
||||
#Line # returns IRect bounds of Clip ##
|
||||
Return IRect bounds of Clip, unaffected by Matrix. If Clip is empty,
|
||||
return SkRect::MakeEmpty, where all Rect sides equal zero.
|
||||
|
||||
@ -2991,6 +3072,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool getDeviceClipBounds(SkIRect* bounds) const
|
||||
|
||||
#In Clip
|
||||
Return IRect bounds of Clip, unaffected by Matrix. If Clip is empty,
|
||||
return false, and set bounds to SkRect::MakeEmpty, where all Rect sides equal zero.
|
||||
|
||||
@ -3026,6 +3108,7 @@ Unlike getLocalClipBounds, bounds is not outset.
|
||||
|
||||
#Method void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver)
|
||||
|
||||
#Line # fills Clip with Color and Blend_Mode ##
|
||||
Fill Clip with Color color.
|
||||
mode determines how Color_ARGB is combined with destination.
|
||||
|
||||
@ -3048,6 +3131,7 @@ mode determines how Color_ARGB is combined with destination.
|
||||
|
||||
#Method void clear(SkColor color)
|
||||
|
||||
#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.
|
||||
|
||||
@ -3076,6 +3160,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void discard()
|
||||
|
||||
#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
|
||||
not change Clip or Matrix.
|
||||
@ -3100,6 +3185,7 @@ any cached data is deleted when owning Surface or Device is deleted.
|
||||
|
||||
#Method void drawPaint(const SkPaint& paint)
|
||||
|
||||
#Line # fills Clip with Paint ##
|
||||
Fill Clip with Paint paint. Paint components Mask_Filter, Shader,
|
||||
Color_Filter, Image_Filter, and Blend_Mode affect drawing;
|
||||
Path_Effect in paint is ignored.
|
||||
@ -3181,6 +3267,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint)
|
||||
|
||||
#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.
|
||||
mode may be one of: kPoints_PointMode, kLines_PointMode, or kPolygon_PointMode.
|
||||
@ -3261,6 +3348,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint)
|
||||
|
||||
#Line # draws point at (x, y) position ##
|
||||
Draw point at (x, y) using Clip, Matrix and Paint paint.
|
||||
|
||||
The shape of point drawn depends on paint Paint_Stroke_Cap.
|
||||
@ -3330,6 +3418,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint& paint)
|
||||
|
||||
#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;
|
||||
Paint_Stroke_Cap draws the end rounded or square;
|
||||
@ -3386,6 +3475,7 @@ Paint_Style is ignored, as if were set to SkPaint::kStroke_Style.
|
||||
|
||||
#Method void drawRect(const SkRect& rect, const SkPaint& paint)
|
||||
|
||||
#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;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness, and
|
||||
@ -3422,6 +3512,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawIRect(const SkIRect& rect, const SkPaint& paint)
|
||||
|
||||
#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;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness, and
|
||||
@ -3452,6 +3543,7 @@ Paint_Stroke_Join draws the corners rounded or square.
|
||||
|
||||
#Method void drawRegion(const SkRegion& region, const SkPaint& paint)
|
||||
|
||||
#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;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness, and
|
||||
@ -3482,6 +3574,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawOval(const SkRect& oval, const SkPaint& paint)
|
||||
|
||||
#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;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness.
|
||||
@ -3513,6 +3606,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawRRect(const SkRRect& rrect, const SkPaint& paint)
|
||||
|
||||
#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;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness.
|
||||
@ -3552,6 +3646,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint)
|
||||
|
||||
#Line # draws double Round_Rect stroked or filled ##
|
||||
Draw Round_Rect outer and inner
|
||||
using Clip, Matrix, and Paint paint.
|
||||
outer must contain inner or the drawing is undefined.
|
||||
@ -3606,6 +3701,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint)
|
||||
|
||||
#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.
|
||||
In paint: Paint_Style determines if Circle is stroked or filled;
|
||||
@ -3663,6 +3759,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)
|
||||
#Line # draws Arc using Clip, Matrix, and Paint ##
|
||||
|
||||
Draw Arc using Clip, Matrix, and Paint paint.
|
||||
|
||||
@ -3727,6 +3824,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)
|
||||
|
||||
#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.
|
||||
|
||||
@ -3774,6 +3872,7 @@ Paint_Stroke_Join.
|
||||
|
||||
#Method void drawPath(const SkPath& path, const SkPaint& paint)
|
||||
|
||||
#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.
|
||||
|
||||
@ -3841,6 +3940,8 @@ 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
|
||||
#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.
|
||||
|
||||
@ -3880,6 +3981,7 @@ 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.
|
||||
@ -3988,6 +4090,8 @@ void draw(SkCanvas* canvas) {
|
||||
#Method void drawImageRect(const SkImage* image, const SkRect& src, const SkRect& dst,
|
||||
const SkPaint* paint,
|
||||
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
|
||||
#In Draw_Image
|
||||
#Line # draws Image, source Rect to destination Rect ##
|
||||
|
||||
Draw Rect src of Image image, scaled and translated to fill Rect dst.
|
||||
Additionally transform draw using Clip, Matrix, and optional Paint paint.
|
||||
@ -4052,6 +4156,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
|
||||
|
||||
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
|
||||
@ -4097,6 +4202,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawImageRect(const SkImage* image, const SkRect& dst, const SkPaint* paint,
|
||||
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
|
||||
#In Draw_Image
|
||||
|
||||
Draw Image image, scaled and translated to fill Rect dst, using Clip, Matrix,
|
||||
and optional Paint paint.
|
||||
@ -4139,6 +4245,7 @@ void draw(SkCanvas* canvas) {
|
||||
#Method void drawImageRect(const sk_sp<SkImage>& image, const SkRect& src, const SkRect& dst,
|
||||
const SkPaint* paint,
|
||||
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
|
||||
#In Draw_Image
|
||||
|
||||
Draw Rect src of Image image, scaled and translated to fill Rect dst.
|
||||
Additionally transform draw using Clip, Matrix, and optional Paint paint.
|
||||
@ -4194,6 +4301,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
|
||||
|
||||
Draw IRect isrc of Image image, scaled and translated to fill Rect dst.
|
||||
isrc is on integer pixel boundaries; dst may include fractional boundaries.
|
||||
@ -4246,6 +4354,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
|
||||
|
||||
Draw Image image, scaled and translated to fill Rect dst,
|
||||
using Clip, Matrix, and optional Paint paint.
|
||||
@ -4296,6 +4405,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
|
||||
const SkPaint* paint = nullptr)
|
||||
#In Draw_Image
|
||||
#Line # draws Nine_Patch Image ##
|
||||
|
||||
Draw Image image stretched proportionally to fit into Rect dst.
|
||||
IRect center divides the image into nine sections: four sides, four corners, and
|
||||
@ -4362,6 +4473,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
|
||||
|
||||
Draw Image image stretched proportionally to fit into Rect dst.
|
||||
IRect center divides the image into nine sections: four sides, four corners, and
|
||||
@ -4429,6 +4541,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
|
||||
const SkPaint* paint = nullptr)
|
||||
#In Draw_Image
|
||||
#Line # draws Bitmap at (x, y) position ##
|
||||
|
||||
Draw Bitmap bitmap, with its top-left corner at (left, top),
|
||||
using Clip, Matrix, and optional Paint paint.
|
||||
@ -4481,6 +4595,8 @@ 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
|
||||
#Line # draws Bitmap, source Rect to destination Rect ##
|
||||
|
||||
Draw Rect src of Bitmap bitmap, scaled and translated to fill Rect dst.
|
||||
Additionally transform draw using Clip, Matrix, and optional Paint paint.
|
||||
@ -4538,6 +4654,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
|
||||
|
||||
Draw IRect isrc of Bitmap bitmap, scaled and translated to fill Rect dst.
|
||||
isrc is on integer pixel boundaries; dst may include fractional boundaries.
|
||||
@ -4596,6 +4713,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint* paint,
|
||||
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
|
||||
#In Draw_Image
|
||||
|
||||
Draw Bitmap bitmap, scaled and translated to fill Rect dst.
|
||||
bitmap bounds is on integer pixel boundaries; dst may include fractional boundaries.
|
||||
@ -4647,6 +4765,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
|
||||
const SkPaint* paint = nullptr)
|
||||
#In Draw_Image
|
||||
#Line # draws Nine_Patch Bitmap ##
|
||||
|
||||
Draw Bitmap bitmap stretched proportionally to fit into Rect dst.
|
||||
IRect center divides the bitmap into nine sections: four sides, four corners,
|
||||
@ -4822,6 +4942,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst,
|
||||
const SkPaint* paint = nullptr)
|
||||
#In Draw_Image
|
||||
#Line # draws proportionally stretched Bitmap ##
|
||||
|
||||
Draw Bitmap bitmap stretched proportionally to fit into Rect dst.
|
||||
|
||||
@ -4900,6 +5022,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst,
|
||||
const SkPaint* paint = nullptr)
|
||||
#In Draw_Image
|
||||
#Line # draws proportionally stretched Image ##
|
||||
|
||||
Draw Image image stretched proportionally to fit into Rect dst.
|
||||
|
||||
@ -4980,6 +5104,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
||||
const SkPaint& paint)
|
||||
#Line # draws text at (x, y), using font advance ##
|
||||
|
||||
Draw text, with origin at (x, y), using Clip, Matrix, and Paint paint.
|
||||
|
||||
@ -5035,6 +5160,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawString(const char* string, SkScalar x, SkScalar y, const SkPaint& paint)
|
||||
|
||||
#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.
|
||||
|
||||
@ -5104,6 +5230,7 @@ filled 12 point black Glyphs.
|
||||
|
||||
#Method void drawPosText(const void* text, size_t byteLength, const SkPoint pos[],
|
||||
const SkPaint& paint)
|
||||
#Line # draws text at array of (x, y) positions ##
|
||||
|
||||
Draw each glyph in text with the origin in pos array, using Clip, Matrix, and
|
||||
Paint paint. The number of entries in pos array must match the number of Glyphs
|
||||
@ -5147,6 +5274,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY,
|
||||
const SkPaint& paint)
|
||||
#Line # draws text at x positions with common baseline ##
|
||||
|
||||
Draw each glyph in text with its (x, y) origin composed from xpos array and
|
||||
constY, using Clip, Matrix, and Paint paint. The number of entries in xpos array
|
||||
@ -5189,6 +5317,7 @@ baseline.
|
||||
|
||||
#Method void drawTextOnPathHV(const void* text, size_t byteLength, const SkPath& path, SkScalar hOffset,
|
||||
SkScalar vOffset, const SkPaint& paint)
|
||||
#Line # draws text following Path with offsets ##
|
||||
|
||||
Draw text on Path path, using Clip, Matrix, and Paint paint.
|
||||
|
||||
@ -5237,6 +5366,7 @@ filled 12 point black Glyphs.
|
||||
|
||||
#Method void drawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
|
||||
const SkMatrix* matrix, const SkPaint& paint)
|
||||
#Line # draws text following Path contour ##
|
||||
|
||||
Draw text on Path path, using Clip, Matrix, and Paint paint.
|
||||
|
||||
@ -5291,6 +5421,7 @@ filled 12 point black Glyphs.
|
||||
|
||||
#Method void drawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
|
||||
const SkRect* cullRect, const SkPaint& paint)
|
||||
#Line # draws text with array of RSXform ##
|
||||
|
||||
Draw text, transforming each glyph by the corresponding SkRSXform,
|
||||
using Clip, Matrix, and Paint paint.
|
||||
@ -5341,6 +5472,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint)
|
||||
|
||||
#Line # draws text with arrays of positions and Paint ##
|
||||
Draw Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
|
||||
|
||||
blob contains Glyphs, their positions, and paint attributes specific to text:
|
||||
@ -5442,6 +5574,7 @@ Paint attributes related to text, like text size, have no effect on paint passed
|
||||
|
||||
#Method void drawPicture(const SkPicture* picture)
|
||||
|
||||
#Line # draws Picture using Clip and Matrix ##
|
||||
Draw Picture picture, using Clip and Matrix.
|
||||
Clip and Matrix are unchanged by picture contents, as if
|
||||
save() was called before and restore() was called after drawPicture.
|
||||
@ -5596,6 +5729,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint)
|
||||
|
||||
#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
|
||||
contains Shader, Blend_Mode mode combines Vertices_Colors with Shader.
|
||||
@ -5653,6 +5787,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)
|
||||
#Line # draws Coons_Patch ##
|
||||
|
||||
Draws a Coons_Patch: the interpolation of four cubics with shared corners,
|
||||
associating a color, and optionally a texture coordinate, with each corner.
|
||||
@ -5795,6 +5930,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)
|
||||
#Line # draws sprites using Clip, Matrix, and Paint ##
|
||||
|
||||
Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
|
||||
paint uses Anti-alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
|
||||
@ -5950,6 +6086,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr)
|
||||
|
||||
#Line # draws Drawable, encapsulated drawing commands ##
|
||||
Draw Drawable drawable using Clip and Matrix, concatenated with
|
||||
optional matrix.
|
||||
|
||||
@ -6040,6 +6177,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void drawAnnotation(const SkRect& rect, const char key[], SkData* value)
|
||||
|
||||
#Line # associates a Rect with a key-value pair ##
|
||||
Associate Rect on Canvas when an annotation; a key-value pair, where the key is
|
||||
a null-terminated utf8 string, and optional value is stored as Data.
|
||||
|
||||
@ -6098,6 +6236,7 @@ Document_PDF, use annotations.
|
||||
|
||||
#Method SkDrawFilter* getDrawFilter() const
|
||||
|
||||
#Line # legacy; to be deprecated ##
|
||||
Legacy call to be deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -6107,6 +6246,7 @@ Legacy call to be deprecated.
|
||||
|
||||
#Method virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter)
|
||||
|
||||
#Line # legacy; to be deprecated ##
|
||||
Legacy call to be deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -6118,6 +6258,7 @@ Legacy call to be deprecated.
|
||||
|
||||
#Method virtual bool isClipEmpty() const
|
||||
|
||||
#Line # returns if Clip is empty ##
|
||||
Returns true if Clip is empty; that is, nothing will draw.
|
||||
|
||||
May do work when called; it should not be called
|
||||
@ -6147,6 +6288,7 @@ work until Clip changes.
|
||||
|
||||
#Method virtual bool isClipRect() const
|
||||
|
||||
#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.
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#Struct SkIPoint16
|
||||
|
||||
SkIPoint holds two 16 bit integer coordinates.
|
||||
SkIPoint16 holds two 16 bit integer coordinates.
|
||||
|
||||
#Topic Overview
|
||||
|
||||
@ -53,6 +53,7 @@ y-axis value used by IPoint16
|
||||
|
||||
#Method static constexpr SkIPoint16 Make(int x, int y)
|
||||
|
||||
#Line # constructs from integer inputs ##
|
||||
Sets fX to x, fY to y. If SK_DEBUG is defined, asserts
|
||||
if x or y does not fit in 16 bits.
|
||||
|
||||
@ -80,6 +81,7 @@ pt1.fY == pt2.fY
|
||||
|
||||
#Method int16_t x() const
|
||||
|
||||
#Line # returns fX ##
|
||||
Returns x-axis value of IPoint16.
|
||||
|
||||
#Return fX ##
|
||||
@ -100,6 +102,7 @@ pt1.fX == pt1.x()
|
||||
|
||||
#Method int16_t y() const
|
||||
|
||||
#Line # returns fY ##
|
||||
Returns y-axis value of IPoint.
|
||||
|
||||
#Return fY ##
|
||||
@ -120,6 +123,7 @@ pt1.fY == pt1.y()
|
||||
|
||||
#Method void set(int x, int y)
|
||||
|
||||
#Line # sets to integer input ##
|
||||
Sets fX to x and fY to y.
|
||||
|
||||
#Param x new value for fX ##
|
||||
|
@ -34,13 +34,13 @@ SkIPoint holds two 32 bit integer coordinates.
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# SkIPoint operator+(const SkIPoint& a, const SkIVector& b) # returns IPoint offset by IVector ##
|
||||
# SkIPoint operator-()_const # reverses sign of IPoint ##
|
||||
# SkIVector operator-(const SkIPoint& a, const SkIPoint& b) # returns IVector between IPoints ##
|
||||
# bool operator!=(const SkIPoint& a, const SkIPoint& b) # returns true if IPoints are unequal ##
|
||||
# bool operator==(const SkIPoint& a, const SkIPoint& b) # returns true if IPoints are equal ##
|
||||
# void operator+=(const SkIVector& v) # adds IVector to IPoint ##
|
||||
# void operator-=(const SkIVector& v) # subtracts IVector from IPoint ##
|
||||
# operator+(const SkIPoint& a, const SkIVector& b) # returns IPoint offset by IVector ##
|
||||
# operator-()_const # reverses sign of IPoint ##
|
||||
# operator-(const SkIPoint& a, const SkIPoint& b) # returns IVector between IPoints ##
|
||||
# operator!=(const SkIPoint& a, const SkIPoint& b) # returns true if IPoints are unequal ##
|
||||
# operator==(const SkIPoint& a, const SkIPoint& b) # returns true if IPoints are equal ##
|
||||
# operator+=(const SkIVector& v) # adds IVector to IPoint ##
|
||||
# operator-=(const SkIVector& v) # subtracts IVector from IPoint ##
|
||||
#Table ##
|
||||
#Subtopic ##
|
||||
|
||||
@ -72,6 +72,7 @@ y-axis value used by IPoint.
|
||||
|
||||
#Method static constexpr SkIPoint Make(int32_t x, int32_t y)
|
||||
|
||||
#Line # constructs from integer inputs ##
|
||||
Sets fX to x, fY to y.
|
||||
|
||||
#Param x integer x-axis value of constructed IPoint ##
|
||||
@ -96,6 +97,7 @@ pt1 == pt2
|
||||
|
||||
#Method int32_t x() const
|
||||
|
||||
#Line # returns fX ##
|
||||
Returns x-axis value of IPoint.
|
||||
|
||||
#Return fX ##
|
||||
@ -116,6 +118,7 @@ pt1.fX == pt1.x()
|
||||
|
||||
#Method int32_t y() const
|
||||
|
||||
#Line # returns fY ##
|
||||
Returns y-axis value of IPoint.
|
||||
|
||||
#Return fY ##
|
||||
@ -136,6 +139,7 @@ pt1.fY == pt1.y()
|
||||
|
||||
#Method bool isZero() const
|
||||
|
||||
#Line # returns true if both members equal zero ##
|
||||
Returns true if fX and fY are both zero.
|
||||
|
||||
#Return true if fX is zero and fY is zero ##
|
||||
@ -156,6 +160,7 @@ pt.isZero() == true
|
||||
|
||||
#Method void set(int32_t x, int32_t y)
|
||||
|
||||
#Line # sets to integer input ##
|
||||
Sets fX to x and fY to y.
|
||||
|
||||
#Param x new value for fX ##
|
||||
@ -178,6 +183,7 @@ pt1 == pt2
|
||||
|
||||
#Method SkIPoint operator-()_const
|
||||
|
||||
#Line # reverses sign of IPoint ##
|
||||
Returns IPoint changing the signs of fX and fY.
|
||||
|
||||
#Return IPoint as (-fX, -fY) ##
|
||||
@ -206,6 +212,7 @@ pt: -2147483648, -2147483648 negate: -2147483648, -2147483648
|
||||
|
||||
#Method void operator+=(const SkIVector& v)
|
||||
|
||||
#Line # adds IVector to IPoint ##
|
||||
Offsets IPoint by IVector v. Sets IPoint to
|
||||
#Formula
|
||||
(fX + v.fX, fY + v.fY)
|
||||
@ -244,6 +251,7 @@ Offsets IPoint by IVector v. Sets IPoint to
|
||||
|
||||
#Method void operator-=(const SkIVector& v)
|
||||
|
||||
#Line # subtracts IVector from IPoint ##
|
||||
Subtracts IVector v from IPoint. Sets IPoint to:
|
||||
#Formula
|
||||
(fX - v.fX, fY - v.fY)
|
||||
@ -282,6 +290,7 @@ Subtracts IVector v from IPoint. Sets IPoint to:
|
||||
|
||||
#Method bool equals(int32_t x, int32_t y) const
|
||||
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if IPoint is equivalent to IPoint constructed from (x, y).
|
||||
|
||||
#Param x value compared with fX ##
|
||||
@ -310,6 +319,7 @@ pt: -2147483648, -1 == pt
|
||||
|
||||
#Method bool operator==(const SkIPoint& a, const SkIPoint& b)
|
||||
|
||||
#Line # returns true if IPoints are equal ##
|
||||
Returns true if a is equivalent to b.
|
||||
|
||||
#Param a IPoint to compare ##
|
||||
@ -338,6 +348,7 @@ pt: -2147483648, -1 == pt
|
||||
|
||||
#Method bool operator!=(const SkIPoint& a, const SkIPoint& b)
|
||||
|
||||
#Line # returns true if IPoints are unequal ##
|
||||
Returns true if a is not equivalent to b.
|
||||
|
||||
#Param a IPoint to compare ##
|
||||
@ -366,6 +377,7 @@ pt: -2147483648, -1 == pt
|
||||
|
||||
#Method SkIVector operator-(const SkIPoint& a, const SkIPoint& b)
|
||||
|
||||
#Line # returns IVector between IPoints ##
|
||||
Returns IVector from b to a; computed as
|
||||
#Formula
|
||||
(a.fX - b.fX, a.fY - b.fY)
|
||||
@ -409,6 +421,7 @@ Can also be used to subtract IVector from IVector, returning IVector.
|
||||
|
||||
#Method SkIPoint operator+(const SkIPoint& a, const SkIVector& b)
|
||||
|
||||
#Line # returns IPoint offset by IVector ##
|
||||
Returns IPoint resulting from IPoint a offset by IVector b, computed as:
|
||||
#Formula
|
||||
(a.fX + b.fX, a.fY + b.fY)
|
||||
|
@ -139,6 +139,8 @@ When equal to or less than fTop, IRect is empty.
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeEmpty()
|
||||
|
||||
#In Constructors
|
||||
#Line # returns bounds of (0, 0, 0, 0) ##
|
||||
Returns constructed IRect 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
|
||||
@ -171,6 +173,8 @@ outset rect isEmpty: false
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeWH(int32_t w, int32_t h)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from int input returning (0, 0, width, height) ##
|
||||
Returns constructed IRect set to (0, 0, w, h). Does not validate input; w or h
|
||||
may be negative.
|
||||
|
||||
@ -199,6 +203,8 @@ all equal
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeSize(const SkISize& size)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from ISize returning (0, 0, width, height) ##
|
||||
Returns constructed IRect set to (0, 0, size.width(), size.height()).
|
||||
Does not validate input; size.width() or size.height() may be negative.
|
||||
|
||||
@ -226,6 +232,8 @@ floor width: 25 height: 35
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from int left, top, right, bottom ##
|
||||
Returns constructed IRect set to (l, t, r, b). Does not sort input; IRect may
|
||||
result in fLeft greater than fRight, or fTop greater than fBottom.
|
||||
|
||||
@ -257,6 +265,8 @@ rect: 5, 25, 15, 35 isEmpty: false
|
||||
|
||||
#Method static constexpr SkIRect SK_WARN_UNUSED_RESULT MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from int input returning (x, y, width, height) ##
|
||||
Returns constructed IRect set to:
|
||||
#Formula
|
||||
(x, y, x + w, y + h)
|
||||
@ -295,6 +305,7 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
#Method int32_t left() const
|
||||
|
||||
#Line # returns smaller bounds in x, if sorted ##
|
||||
Returns left edge of IRect, if sorted.
|
||||
Call sort() to reverse fLeft and fRight if needed.
|
||||
|
||||
@ -319,6 +330,7 @@ sorted.fLeft: 10 sorted.left(): 10
|
||||
|
||||
#Method int32_t top() const
|
||||
|
||||
#Line # returns smaller bounds in y, if sorted ##
|
||||
Returns top edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
|
||||
and sort() to reverse fTop and fBottom if needed.
|
||||
|
||||
@ -343,6 +355,7 @@ sorted.fTop: 5 sorted.top(): 5
|
||||
|
||||
#Method int32_t right() const
|
||||
|
||||
#Line # returns larger bounds in x, if sorted ##
|
||||
Returns right edge of IRect, if sorted.
|
||||
Call sort() to reverse fLeft and fRight if needed.
|
||||
|
||||
@ -367,6 +380,7 @@ sorted.fRight: 15 sorted.right(): 15
|
||||
|
||||
#Method int32_t bottom() const
|
||||
|
||||
#Line # returns larger bounds in y, if sorted ##
|
||||
Returns bottom edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
|
||||
and sort() to reverse fTop and fBottom if needed.
|
||||
|
||||
@ -391,6 +405,7 @@ sorted.fBottom: 25 sorted.bottom(): 25
|
||||
|
||||
#Method int32_t x() const
|
||||
|
||||
#Line # returns bounds left ##
|
||||
Returns left edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
|
||||
and sort() to reverse fLeft and fRight if needed.
|
||||
|
||||
@ -415,6 +430,7 @@ sorted.fLeft: 10 sorted.x(): 10
|
||||
|
||||
#Method int32_t y() const
|
||||
|
||||
#Line # returns bounds top ##
|
||||
Returns top edge of IRect, if sorted. Call isEmpty to see if IRect may be invalid,
|
||||
and sort() to reverse fTop and fBottom if needed.
|
||||
|
||||
@ -439,6 +455,7 @@ sorted.fTop: 5 sorted.y(): 5
|
||||
|
||||
#Method int32_t width() const
|
||||
|
||||
#Line # returns span in x ##
|
||||
Returns span on the x-axis. This does not check if IRect is sorted, or if
|
||||
result fits in 32-bit signed integer; result may be negative.
|
||||
|
||||
@ -463,6 +480,7 @@ large width: -5
|
||||
|
||||
#Method int64_t width64() const
|
||||
|
||||
#Line # returns span in y as int64_t ##
|
||||
Returns span on the x-axis. This does not check if IRect is sorted, so the
|
||||
result may be negative. This is safer than calling width() since width() might
|
||||
overflow in its calculation.
|
||||
@ -487,6 +505,7 @@ width: -5 width64: 4294967291
|
||||
|
||||
#Method int32_t height() const
|
||||
|
||||
#Line # returns span in y ##
|
||||
Returns span on the y-axis. This does not check if IRect is sorted, or if
|
||||
result fits in 32-bit signed integer; result may be negative.
|
||||
|
||||
@ -511,6 +530,7 @@ large height: -5
|
||||
|
||||
#Method int64_t height64() const
|
||||
|
||||
#Line # returns span in y as int64_t ##
|
||||
Returns span on the y-axis. This does not check if IRect is sorted, so the
|
||||
result may be negative. This is safer than calling height() since height() might
|
||||
overflow in its calculation.
|
||||
@ -535,6 +555,7 @@ height: -5 height64: 4294967291
|
||||
|
||||
#Method SkISize size() const
|
||||
|
||||
#Line # returns ISize (width, height) ##
|
||||
Returns spans on the x-axis and y-axis. This does not check if IRect is sorted,
|
||||
or if result fits in 32-bit signed integer; result may be negative.
|
||||
|
||||
@ -568,6 +589,7 @@ original rect: 20, 30, 40, 50 size: 20, 20
|
||||
|
||||
#Method int32_t centerX() const
|
||||
|
||||
#Line # returns midpoint in x ##
|
||||
Returns average of left edge and right edge. Result does not change if IRect
|
||||
is sorted. Result may be incorrect if IRect is far from the origin.
|
||||
|
||||
@ -599,6 +621,7 @@ left: -10 right: 11 centerX: 0 div2: 0
|
||||
|
||||
#Method int32_t centerY() const
|
||||
|
||||
#Line # returns midpoint in y ##
|
||||
Returns average of top edge and bottom edge. Result does not change if IRect
|
||||
is sorted. Result may be incorrect if IRect is far from the origin.
|
||||
|
||||
@ -624,6 +647,7 @@ left: 1073741824 right: 1073741826 centerX: -1073741823 safe mid x: 1073741825
|
||||
|
||||
#Method bool isEmpty() const
|
||||
|
||||
#Line # returns true if width or height are zero or negative or they exceed int32_t ##
|
||||
Returns true if width() or height() .
|
||||
|
||||
#Return true if width() or height() are zero or negative ##
|
||||
@ -653,6 +677,7 @@ sorted: {20, 40, 20, 50} is empty
|
||||
|
||||
#Method bool isEmpty64() const
|
||||
|
||||
#Line # returns true if width or height are zero or negative ##
|
||||
Returns true if fLeft is equal to or greater than fRight, or if fTop is equal
|
||||
to or greater than fBottom. Call sort() to reverse rectangles with negative
|
||||
width64() or height64().
|
||||
@ -687,14 +712,16 @@ sorted: {20, 40, 20, 50} is empty
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# bool operator!=(const SkIRect& a, const SkIRect& b) # returns true if members are unequal ##
|
||||
# bool operator==(const SkIRect& a, const SkIRect& b) # returns true if members are equal ##
|
||||
# operator!=(const SkIRect& a, const SkIRect& b) # returns true if members are unequal ##
|
||||
# operator==(const SkIRect& a, const SkIRect& b) # returns true if members are equal ##
|
||||
#Table ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Operators
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
|
||||
identical to corresponding members in b.
|
||||
|
||||
@ -720,6 +747,8 @@ test == sorted
|
||||
|
||||
#Method bool operator!=(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Operators
|
||||
#Line # returns true if members are unequal ##
|
||||
Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not
|
||||
identical to the corresponding member in b.
|
||||
|
||||
@ -747,6 +776,7 @@ test != sorted
|
||||
|
||||
#Method bool is16Bit() const
|
||||
|
||||
#Line # returns true if members fit in 16-bit word ##
|
||||
Returns true if all members: fLeft, fTop, fRight, and fBottom; values are
|
||||
equal to or larger than -32768 and equal to or smaller than 32767.
|
||||
|
||||
@ -772,6 +802,7 @@ equal to or larger than -32768 and equal to or smaller than 32767.
|
||||
|
||||
#Method void setEmpty()
|
||||
|
||||
#Line # sets to (0, 0, 0, 0) ##
|
||||
Sets IRect to (0, 0, 0, 0).
|
||||
|
||||
Many other rectangles are empty; if left is equal to or greater than right,
|
||||
@ -799,6 +830,7 @@ rect: {0, 0, 0, 0} is empty
|
||||
|
||||
#Method void set(int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
|
||||
#Line # sets to (left, top, right, bottom) ##
|
||||
Sets IRect 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.
|
||||
@ -828,6 +860,7 @@ rect2: {3, 4, 1, 2}
|
||||
|
||||
#Method void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
|
||||
#Line # sets to SkScalar input (left, top, right, bottom) ##
|
||||
Sets IRect 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.
|
||||
@ -857,6 +890,7 @@ rect2: {3, 4, 1, 2}
|
||||
|
||||
#Method void setXYWH(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
|
||||
#Line # sets to (x, y, width, height) ##
|
||||
Sets IRect to:
|
||||
#Formula
|
||||
(x, y, x + width, y + height)
|
||||
@ -908,6 +942,8 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
#Method SkIRect makeOffset(int32_t dx, int32_t dy) const
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # constructs from translated sides ##
|
||||
Returns IRect offset by (dx, dy).
|
||||
|
||||
If dx is negative, IRect returned is moved to the left.
|
||||
@ -941,6 +977,8 @@ rect: 25, 82, 35, 92 isEmpty: false
|
||||
|
||||
#Method SkIRect makeInset(int32_t dx, int32_t dy) const
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # constructs from sides moved symmetrically about the center ##
|
||||
Returns IRect, inset by (dx, dy).
|
||||
|
||||
If dx is negative, IRect returned is wider.
|
||||
@ -974,6 +1012,8 @@ rect: 25, 82, 5, 28 isEmpty: true
|
||||
|
||||
#Method SkIRect makeOutset(int32_t dx, int32_t dy) const
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # constructs from sides moved symmetrically about the center ##
|
||||
Returns IRect, outset by (dx, dy).
|
||||
|
||||
If dx is negative, IRect returned is narrower.
|
||||
@ -1007,6 +1047,8 @@ rect: -5, 18, 35, 92 isEmpty: false
|
||||
|
||||
#Method void offset(int32_t dx, int32_t dy)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # translates sides without changing width and height ##
|
||||
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.
|
||||
@ -1034,6 +1076,7 @@ rect: 15, 27, 55, 86
|
||||
|
||||
#Method void offset(const SkIPoint& delta)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
Offsets IRect by adding delta.fX to fLeft, fRight; and by adding delta.fY to
|
||||
fTop, fBottom.
|
||||
|
||||
@ -1061,6 +1104,8 @@ rect: 15, 27, 55, 86
|
||||
|
||||
#Method void offsetTo(int32_t newX, int32_t newY)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # translates to (x, y) without changing width and height ##
|
||||
Offsets IRect so that fLeft equals newX, and fTop equals newY. width and height
|
||||
are unchanged.
|
||||
|
||||
@ -1084,6 +1129,8 @@ rect: 15, 27, 55, 86
|
||||
|
||||
#Method void inset(int32_t dx, int32_t dy)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # moves the sides symmetrically about the center ##
|
||||
Insets IRect by (dx,dy).
|
||||
|
||||
If dx is positive, makes IRect narrower.
|
||||
@ -1111,6 +1158,8 @@ rect: 15, 27, 45, 60
|
||||
|
||||
#Method void outset(int32_t dx, int32_t dy)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # moves the sides symmetrically about the center ##
|
||||
Outsets IRect by (dx, dy).
|
||||
|
||||
If dx is positive, makes IRect wider.
|
||||
@ -1174,6 +1223,8 @@ describes an area: fLeft is less than fRight, and fTop is less than fBottom.
|
||||
|
||||
#Method bool quickReject(int l, int t, int r, int b) const
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if rectangles do not intersect ##
|
||||
Constructs IRect (l, t, r, b) and returns true if constructed IRect does not
|
||||
intersect IRect. Does not check to see if construction or IRect is empty.
|
||||
|
||||
@ -1216,6 +1267,8 @@ rect (7, 11, 13, 17) test(12, 16, 14, 18) quickReject false; intersects true
|
||||
|
||||
#Method bool contains(int32_t x, int32_t y) const
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if points are equal or inside ##
|
||||
Returns true if:
|
||||
#Formula
|
||||
fLeft <= x < fRight && fTop <= y < fBottom
|
||||
@ -1258,6 +1311,7 @@ rect: (30, 50, 40, 60) does not contain (30, 60)
|
||||
|
||||
#Method bool contains(int32_t left, int32_t top, int32_t right, int32_t bottom) const
|
||||
|
||||
#In Intersection
|
||||
Constructs IRect to intersect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
|
||||
@ -1297,6 +1351,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool contains(const SkIRect& r) const
|
||||
|
||||
#In Intersection
|
||||
Returns true if IRect contains r.
|
||||
Returns false if IRect is empty or r is empty.
|
||||
|
||||
@ -1330,6 +1385,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool contains(const SkRect& r) const
|
||||
|
||||
#In Intersection
|
||||
Returns true if IRect contains r.
|
||||
Returns false if IRect is empty or r is empty.
|
||||
|
||||
@ -1363,6 +1419,8 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool containsNoEmptyCheck(int32_t left, int32_t top,
|
||||
int32_t right, int32_t bottom) const
|
||||
#In Intersection
|
||||
#Line # returns true if points are equal or inside skips empty check ##
|
||||
|
||||
Constructs IRect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
@ -1405,6 +1463,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool containsNoEmptyCheck(const SkIRect& r) const
|
||||
|
||||
#In Intersection
|
||||
Returns true if IRect contains construction.
|
||||
Asserts if IRect is empty or construction is empty, and if SK_DEBUG is defined.
|
||||
|
||||
@ -1438,6 +1497,8 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool intersect(const SkIRect& r)
|
||||
|
||||
#In Intersection
|
||||
#Line # sets to shared area; returns true if not empty ##
|
||||
Returns true if IRect intersects r, and sets IRect to intersection.
|
||||
Returns false if IRect does not intersect r, and leaves IRect unchanged.
|
||||
|
||||
@ -1471,6 +1532,7 @@ be before or after the call to intersect.
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Intersection
|
||||
Returns true if a intersects b, and sets IRect to intersection.
|
||||
Returns false if a does not intersect b, and leaves IRect unchanged.
|
||||
|
||||
@ -1499,6 +1561,8 @@ Returns false if either a or b is empty, leaving IRect unchanged.
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT intersectNoEmptyCheck(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Intersection
|
||||
#Line # sets to shared area; returns true if not empty skips empty check ##
|
||||
Returns true if a intersects b, and sets IRect to intersection.
|
||||
Returns false if a does not intersect b, and leaves IRect unchanged.
|
||||
|
||||
@ -1527,6 +1591,7 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
|
||||
|
||||
#Method bool intersect(int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
|
||||
#In Intersection
|
||||
Constructs IRect to intersect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
|
||||
@ -1565,6 +1630,8 @@ be before or after the call to intersect.
|
||||
|
||||
#Method static bool Intersects(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if areas overlap ##
|
||||
Returns true if a intersects b.
|
||||
Returns false if either a or b is empty, or do not intersect.
|
||||
|
||||
@ -1588,6 +1655,8 @@ Returns false if either a or b is empty, or do not intersect.
|
||||
|
||||
#Method static bool IntersectsNoEmptyCheck(const SkIRect& a, const SkIRect& b)
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if areas overlap skips empty check ##
|
||||
Returns true if a intersects b.
|
||||
Asserts if either a or b is empty, and if SK_DEBUG is defined.
|
||||
|
||||
@ -1614,6 +1683,7 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
|
||||
|
||||
#Method void join(int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
|
||||
#Line # sets to union of bounds ##
|
||||
Constructs IRect to intersect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
|
||||
@ -1667,6 +1737,7 @@ Has no effect if r is empty. Otherwise, if IRect is empty, sets IRect to r.
|
||||
|
||||
#Method void sort()
|
||||
|
||||
#Line # orders sides from smaller to larger ##
|
||||
Swaps fLeft and fRight if fLeft is greater than fRight; and swaps
|
||||
fTop and fBottom if fTop is greater than fBottom. Result may be empty,
|
||||
and width() and height() will be zero or positive.
|
||||
@ -1690,6 +1761,7 @@ sorted: 20, 10, 30, 50
|
||||
|
||||
#Method SkIRect makeSorted() const
|
||||
|
||||
#Line # constructs, 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.
|
||||
@ -1715,6 +1787,7 @@ sorted: 20, 10, 30, 50
|
||||
|
||||
#Method static const SkIRect& SK_WARN_UNUSED_RESULT EmptyIRect()
|
||||
|
||||
#Line # returns immutable bounds of (0, 0, 0, 0) ##
|
||||
Returns a reference to immutable empty IRect, set to (0, 0, 0, 0).
|
||||
|
||||
#Return global IRect set to all zeroes ##
|
||||
@ -1733,6 +1806,7 @@ rect: 0, 0, 0, 0
|
||||
|
||||
#Method static SkIRect SK_WARN_UNUSED_RESULT MakeLargest()
|
||||
|
||||
#Line # deprecated ##
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
|
@ -113,12 +113,19 @@ for 32 bit pixels.
|
||||
##
|
||||
#Const kRGBA_8888_SkColorType 4
|
||||
##
|
||||
#Const kBGRA_8888_SkColorType 5
|
||||
#Const kRGB_888x_SkColorType 5
|
||||
##
|
||||
#Const kGray_8_SkColorType 6
|
||||
#Const kBGRA_8888_SkColorType 6
|
||||
##
|
||||
#Const kRGBA_F16_SkColorType 7
|
||||
#Const kRGBA_1010102_SkColorType 7
|
||||
##
|
||||
#Const kRGB_101010x_SkColorType 8
|
||||
##
|
||||
#Const kGray_8_SkColorType 9
|
||||
##
|
||||
#Const kRGBA_F16_SkColorType 10
|
||||
##
|
||||
#ToDo can be 4 or 6; how to document? ##
|
||||
#Const kN32_SkColorType 4
|
||||
##
|
||||
|
||||
@ -200,8 +207,8 @@ Used for both src images and render-targets (surfaces).
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# bool operator!=(const SkImageInfo& other)_const # ##
|
||||
# bool operator==(const SkImageInfo& other)_const # ##
|
||||
# operator!=(const SkImageInfo& other)_const # ##
|
||||
# operator==(const SkImageInfo& other)_const # ##
|
||||
#Table ##
|
||||
#Subtopic ##
|
||||
|
||||
@ -270,6 +277,8 @@ Used for both src images and render-targets (surfaces).
|
||||
|
||||
#Method SkImageInfo()
|
||||
|
||||
#In Constructors
|
||||
#Line # creates with zero dimensions, kUnknown_SkColorType, kUnknown_SkAlphaType ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -284,6 +293,8 @@ Used for both src images and render-targets (surfaces).
|
||||
|
||||
#Method static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at,
|
||||
sk_sp<SkColorSpace> cs = nullptr)
|
||||
#In Constructors
|
||||
#Line # creates Image_Info from dimensions, Color_Type, Alpha_Type, Color_Space ##
|
||||
|
||||
#Param width incomplete ##
|
||||
#Param height incomplete ##
|
||||
@ -305,6 +316,8 @@ Used for both src images and render-targets (surfaces).
|
||||
|
||||
#Method static SkImageInfo MakeN32(int width, int height, SkAlphaType at,
|
||||
sk_sp<SkColorSpace> cs = nullptr)
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with Native_Color_Type ##
|
||||
|
||||
Sets colortype to kN32_SkColorType.
|
||||
|
||||
@ -327,6 +340,8 @@ Sets colortype to kN32_SkColorType.
|
||||
|
||||
#Method static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
|
||||
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with Native_Color_Type, sRGB Color_Space ##
|
||||
Creates Image_Info marked as sRGB with kN32_SkColorType swizzle.
|
||||
|
||||
#Param width incomplete ##
|
||||
@ -347,6 +362,8 @@ Creates Image_Info marked as sRGB with kN32_SkColorType swizzle.
|
||||
|
||||
#Method static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr)
|
||||
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with Native_Color_Type, kPremul_SkAlphaType ##
|
||||
Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Param width incomplete ##
|
||||
@ -367,6 +384,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method static SkImageInfo MakeN32Premul(const SkISize& size)
|
||||
|
||||
#In Constructors
|
||||
#Param size incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -383,6 +401,8 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method static SkImageInfo MakeA8(int width, int height)
|
||||
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with kAlpha_8_SkColorType, kPremul_SkAlphaType ##
|
||||
#Param width incomplete ##
|
||||
#Param height incomplete ##
|
||||
|
||||
@ -400,6 +420,8 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method static SkImageInfo MakeUnknown(int width, int height)
|
||||
|
||||
#In Constructors
|
||||
#Line # creates Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType ##
|
||||
#Param width incomplete ##
|
||||
#Param height incomplete ##
|
||||
|
||||
@ -417,6 +439,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method static SkImageInfo MakeUnknown()
|
||||
|
||||
#In Constructors
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -434,6 +457,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method int width() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -448,6 +472,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method int height() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -462,6 +487,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method SkColorType colorType() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -476,6 +502,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method SkAlphaType alphaType() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -490,6 +517,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method SkColorSpace* colorSpace() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -504,6 +532,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method sk_sp<SkColorSpace> refColorSpace() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -518,6 +547,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method bool isEmpty() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -532,6 +562,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method bool isOpaque() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -546,6 +577,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method SkISize dimensions() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -560,6 +592,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method SkIRect bounds() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -574,6 +607,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method bool gammaCloseToSRGB() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -588,6 +622,7 @@ Sets colortype to kN32_SkColorType, and the alphatype to premul.
|
||||
|
||||
#Method SkImageInfo makeWH(int newWidth, int newHeight) const
|
||||
|
||||
#Line # creates Image_Info with changed dimensions ##
|
||||
Creates Image_Info with the same colortype and alphatype as this info,
|
||||
but with the specified width and height.
|
||||
|
||||
@ -608,6 +643,7 @@ but with the specified width and height.
|
||||
|
||||
#Method SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
|
||||
|
||||
#Line # creates Image_Info with changed Alpha_Type ##
|
||||
#Param newAlphaType incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -624,6 +660,7 @@ but with the specified width and height.
|
||||
|
||||
#Method SkImageInfo makeColorType(SkColorType newColorType) const
|
||||
|
||||
#Line # creates Image_Info with changed Color_Type ##
|
||||
#Param newColorType incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -640,6 +677,7 @@ but with the specified width and height.
|
||||
|
||||
#Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
|
||||
|
||||
#Line # creates Image_Info with changed Color_Space ##
|
||||
#Param cs incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -656,6 +694,7 @@ but with the specified width and height.
|
||||
|
||||
#Method int bytesPerPixel() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -670,6 +709,7 @@ but with the specified width and height.
|
||||
|
||||
#Method int shiftPerPixel() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -684,6 +724,7 @@ but with the specified width and height.
|
||||
|
||||
#Method uint64_t minRowBytes64() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -698,6 +739,7 @@ but with the specified width and height.
|
||||
|
||||
#Method size_t minRowBytes() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Return incomplete ##
|
||||
|
||||
#Example
|
||||
@ -712,6 +754,7 @@ but with the specified width and height.
|
||||
|
||||
#Method size_t computeOffset(int x, int y, size_t rowBytes) const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Param x incomplete ##
|
||||
#Param y incomplete ##
|
||||
#Param rowBytes incomplete ##
|
||||
@ -730,6 +773,7 @@ but with the specified width and height.
|
||||
|
||||
#Method bool operator==(const SkImageInfo& other)_const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Param other incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -746,6 +790,7 @@ but with the specified width and height.
|
||||
|
||||
#Method bool operator!=(const SkImageInfo& other)_const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Param other incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -762,6 +807,7 @@ but with the specified width and height.
|
||||
|
||||
#Method void unflatten(SkReadBuffer& buffer)
|
||||
|
||||
#Line # incomplete ##
|
||||
#Param buffer incomplete ##
|
||||
|
||||
#Example
|
||||
@ -776,6 +822,7 @@ but with the specified width and height.
|
||||
|
||||
#Method void flatten(SkWriteBuffer& buffer) const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Param buffer incomplete ##
|
||||
|
||||
#Example
|
||||
@ -790,6 +837,7 @@ but with the specified width and height.
|
||||
|
||||
#Method size_t computeByteSize(size_t rowBytes) const
|
||||
|
||||
#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().
|
||||
if (height == 0) {
|
||||
@ -815,6 +863,7 @@ If the calculation overflows this returns SK_MaxSizeT.
|
||||
|
||||
#Method size_t computeMinByteSize() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -832,6 +881,7 @@ If the calculation overflows, or if the height is 0, this returns 0.
|
||||
|
||||
#Method static bool ByteSizeOverflowed(size_t byteSize)
|
||||
|
||||
#Line # incomplete ##
|
||||
Returns true if the result of computeByteSize (or computeMinByteSize) overflowed
|
||||
|
||||
#Param byteSize incomplete ##
|
||||
@ -850,6 +900,7 @@ Returns true if the result of computeByteSize (or computeMinByteSize) overflowed
|
||||
|
||||
#Method bool validRowBytes(size_t rowBytes) const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Param rowBytes incomplete ##
|
||||
|
||||
#Return incomplete ##
|
||||
@ -866,6 +917,7 @@ Returns true if the result of computeByteSize (or computeMinByteSize) overflowed
|
||||
|
||||
#Method void reset()
|
||||
|
||||
#Line # incomplete ##
|
||||
#Example
|
||||
// incomplete
|
||||
##
|
||||
@ -878,6 +930,7 @@ Returns true if the result of computeByteSize (or computeMinByteSize) overflowed
|
||||
|
||||
#Method void validate() const
|
||||
|
||||
#Line # incomplete ##
|
||||
#Example
|
||||
// incomplete
|
||||
##
|
||||
|
@ -144,6 +144,7 @@ drawing.
|
||||
|
||||
#Method static sk_sp<SkImage> MakeRasterCopy(const SkPixmap& pixmap)
|
||||
|
||||
#Line # Creates Image from Pixmap and copied pixels. ##
|
||||
Creates Image from Pixmap and copy of pixels. Since pixels are copied, Pixmap
|
||||
pixels may be modified or deleted without affecting Image.
|
||||
|
||||
@ -189,6 +190,7 @@ contains a copy of the pixels.
|
||||
|
||||
#Method static sk_sp<SkImage> MakeRasterData(const Info& info, sk_sp<SkData> pixels, size_t rowBytes)
|
||||
|
||||
#Line # Creates Image from Image_Info and shared pixels. ##
|
||||
Creates Image from Image_Info, sharing pixels.
|
||||
|
||||
Image is returned if Image_Info is valid. Valid Image_Info parameters include:
|
||||
@ -243,6 +245,7 @@ provided by caller when Image is created, and may be nullptr.
|
||||
#Method static sk_sp<SkImage> MakeFromRaster(const SkPixmap& pixmap,
|
||||
RasterReleaseProc rasterReleaseProc,
|
||||
ReleaseContext releaseContext)
|
||||
#Line # Creates Image from Pixmap, with release. ##
|
||||
|
||||
Creates Image from pixmap, sharing Pixmap pixels. Pixels must remain valid and
|
||||
unchanged until rasterReleaseProc is called. rasterReleaseProc is passed
|
||||
@ -296,6 +299,7 @@ after reset: 1
|
||||
|
||||
#Method static sk_sp<SkImage> MakeFromBitmap(const SkBitmap& bitmap)
|
||||
|
||||
#Line # Creates Image from Bitmap, sharing or copying pixels. ##
|
||||
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.
|
||||
@ -345,6 +349,7 @@ memory does not alter the second Image.
|
||||
|
||||
#Method static sk_sp<SkImage> MakeFromGenerator(std::unique_ptr<SkImageGenerator> imageGenerator,
|
||||
const SkIRect* subset = nullptr)
|
||||
#Line # Creates Image from a stream of data. ##
|
||||
|
||||
Creates Image from data returned by imageGenerator. Generated data is owned by Image and may not
|
||||
be shared or accessed.
|
||||
@ -384,6 +389,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)
|
||||
|
||||
#Line # 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.
|
||||
@ -422,6 +428,7 @@ for (int quality : { 100, 50, 10, 1} ) {
|
||||
GrSurfaceOrigin origin,
|
||||
SkAlphaType alphaType,
|
||||
sk_sp<SkColorSpace> colorSpace)
|
||||
#Line # Creates Image from GPU_Texture, managed externally. ##
|
||||
|
||||
#Deprecated
|
||||
Deprecated.
|
||||
@ -590,6 +597,7 @@ for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
|
||||
#Method static sk_sp<SkImage> MakeCrossContextFromEncoded(GrContext* context, sk_sp<SkData> data,
|
||||
bool buildMips,
|
||||
SkColorSpace* dstColorSpace)
|
||||
#Line # Creates Image from encoded data, and uploads to GPU. ##
|
||||
|
||||
Creates Image from encoded data. Image is uploaded to GPU back-end using context.
|
||||
|
||||
@ -635,6 +643,7 @@ canvas->drawImage(image, 0, 0);
|
||||
#Method static sk_sp<SkImage> MakeCrossContextFromPixmap(GrContext* context, const SkPixmap& pixmap,
|
||||
bool buildMips,
|
||||
SkColorSpace* dstColorSpace)
|
||||
#Line # Creates Image from Pixmap, and uploads to GPU. ##
|
||||
|
||||
Creates Image from pixmap. Image is uploaded to GPU back-end using context.
|
||||
|
||||
@ -684,6 +693,7 @@ if (source.peekPixels(&pixmap)) {
|
||||
GrSurfaceOrigin surfaceOrigin,
|
||||
SkAlphaType alphaType = kPremul_SkAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace = nullptr)
|
||||
#Line # Creates Image from GPU_Texture, managed internally. ##
|
||||
|
||||
Deprecated.
|
||||
|
||||
@ -767,6 +777,7 @@ Recognized formats vary by GPU back-end.
|
||||
const SkISize yuvSizes[3],
|
||||
GrSurfaceOrigin surfaceOrigin,
|
||||
sk_sp<SkColorSpace> colorSpace = nullptr)
|
||||
#Line # Creates Image from YUV_ColorSpace data in three planes. ##
|
||||
|
||||
Creates Image from copy of yuvTextureHandles, an array of textures on GPU.
|
||||
yuvTextureHandles contain pixels for YUV planes of Image.
|
||||
@ -842,6 +853,7 @@ should this be moved to chrome only?
|
||||
const SkISize nv12Sizes[2],
|
||||
GrSurfaceOrigin surfaceOrigin,
|
||||
sk_sp<SkColorSpace> colorSpace = nullptr)
|
||||
#Line # Creates Image from YUV_ColorSpace data in two planes. ##
|
||||
|
||||
Creates Image from copy of nv12TextureHandles, an array of textures on GPU.
|
||||
nv12TextureHandles[0] contains pixels for YUV_Component_Y plane.
|
||||
@ -949,6 +961,7 @@ Use 16 bits per Color_ARGB component using half-precision floating point format.
|
||||
const SkMatrix* matrix, const SkPaint* paint,
|
||||
BitDepth bitDepth,
|
||||
sk_sp<SkColorSpace> colorSpace)
|
||||
#Line # Creates Image from Picture. ##
|
||||
|
||||
Creates Image from picture. Returned Image width and height are set by dimensions.
|
||||
Image draws picture with matrix and paint, set to bitDepth and colorSpace.
|
||||
@ -996,6 +1009,7 @@ with default Paint. colorSpace may be nullptr.
|
||||
#Method static sk_sp<SkImage> MakeFromAHardwareBuffer(AHardwareBuffer* hardwareBuffer,
|
||||
SkAlphaType alphaType = kPremul_SkAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace = nullptr)
|
||||
#Line # Creates Image from Android hardware buffer. ##
|
||||
|
||||
#Bug 7447 ##
|
||||
|
||||
@ -1023,6 +1037,7 @@ Only available on Android, when __ANDROID_API__ is defined to be 26 or greater.
|
||||
|
||||
#Method int width() const
|
||||
|
||||
#Line # Returns pixel column count. ##
|
||||
Returns pixel count in each row.
|
||||
|
||||
#Return pixel width in Image ##
|
||||
@ -1047,6 +1062,7 @@ Returns pixel count in each row.
|
||||
|
||||
#Method int height() const
|
||||
|
||||
#Line # Returns pixel row count. ##
|
||||
Returns pixel row count.
|
||||
|
||||
#Return pixel height in Image ##
|
||||
@ -1072,6 +1088,7 @@ Returns pixel row count.
|
||||
|
||||
#Method SkISize dimensions() const
|
||||
|
||||
#Line # Returns width() and height(). ##
|
||||
Returns ISize { width(), height() }.
|
||||
|
||||
#Return integral size of width() and height() ##
|
||||
@ -1092,6 +1109,7 @@ Returns ISize { width(), height() }.
|
||||
|
||||
#Method SkIRect bounds() const
|
||||
|
||||
#Line # Returns width() and height() as Rectangle. ##
|
||||
Returns IRect { 0, 0, width(), height() }.
|
||||
|
||||
#Return integral rectangle from origin to width() and height() ##
|
||||
@ -1115,6 +1133,7 @@ Returns IRect { 0, 0, width(), height() }.
|
||||
|
||||
#Method uint32_t uniqueID() const
|
||||
|
||||
#Line # 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.
|
||||
@ -1143,6 +1162,7 @@ unique number.
|
||||
|
||||
#Method SkAlphaType alphaType() const
|
||||
|
||||
#Line # Returns Alpha_Type. ##
|
||||
Returns Alpha_Type, one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType,
|
||||
kPremul_SkAlphaType, kUnpremul_SkAlphaType.
|
||||
|
||||
@ -1169,6 +1189,7 @@ or was parsed from encoded data.
|
||||
|
||||
#Method SkColorSpace* colorSpace() const
|
||||
|
||||
#Line # Returns Color_Space. ##
|
||||
Returns Color_Space, the range of colors, associated with Image. The
|
||||
reference count of Color_Space is unchanged. The returned Color_Space is
|
||||
immutable.
|
||||
@ -1209,6 +1230,7 @@ is drawn, depending on the capabilities of the Surface receiving the drawing.
|
||||
|
||||
#Method sk_sp<SkColorSpace> refColorSpace() const
|
||||
|
||||
#Line # Returns Image_Info Color_Space. ##
|
||||
Returns a smart pointer to Color_Space, the range of colors, associated with
|
||||
Image. The smart pointer tracks the number of objects sharing this
|
||||
SkColorSpace reference so the memory is released when the owners destruct.
|
||||
@ -1251,6 +1273,7 @@ is drawn, depending on the capabilities of the Surface receiving the drawing.
|
||||
|
||||
#Method bool isAlphaOnly() const
|
||||
|
||||
#Line # Returns if pixels represent a transparency mask. ##
|
||||
Returns true if Image pixels represent transparency only. If true, each pixel
|
||||
is packed in 8 bits as defined by kAlpha_8_SkColorType.
|
||||
|
||||
@ -1273,6 +1296,7 @@ alphaOnly = true
|
||||
|
||||
#Method bool isOpaque() const
|
||||
|
||||
#Line # Returns if Alpha_Type is kOpaque_SkAlphaType. ##
|
||||
Returns true if pixels ignore their Alpha value and are treated as fully opaque.
|
||||
|
||||
#Return true if Alpha_Type is kOpaque_SkAlphaType ##
|
||||
@ -1300,6 +1324,7 @@ isOpaque = true
|
||||
|
||||
#Method sk_sp<SkShader> makeShader(SkShader::TileMode tileMode1, SkShader::TileMode tileMode2,
|
||||
const SkMatrix* localMatrix = nullptr) const
|
||||
#Line # Creates Shader, Paint element that can tile Image. ##
|
||||
|
||||
Creates Shader from Image. Shader dimensions are taken from Image. Shader uses
|
||||
SkShader::TileMode rules to fill drawn area outside Image. localMatrix permits
|
||||
@ -1359,6 +1384,7 @@ canvas->drawPaint(paint);
|
||||
|
||||
#Method bool peekPixels(SkPixmap* pixmap) const
|
||||
|
||||
#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
|
||||
false and leave pixmap unchanged.
|
||||
@ -1409,6 +1435,7 @@ false and leave pixmap unchanged.
|
||||
|
||||
#Method GrTexture* getTexture() const
|
||||
|
||||
#Line # Deprecated. ##
|
||||
Deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -1424,6 +1451,7 @@ Currently used by Canvas2DLayerBridge in Chromium.
|
||||
|
||||
#Method bool isTextureBacked() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -1462,6 +1490,7 @@ drawImage(textureImage, "backEndTexture");
|
||||
|
||||
#Method bool isValid(GrContext* context) const
|
||||
|
||||
#Line # Returns if Image can draw to Raster_Surface or GPU_Context. ##
|
||||
Returns true if Image can be drawn on either Raster_Surface or GPU_Surface.
|
||||
If context is nullptr, tests if Image draws on Raster_Surface;
|
||||
otherwise, tests if Image draws on GPU_Surface associated with context.
|
||||
@ -1511,6 +1540,7 @@ drawImage(textureImage, "backEndTexture");
|
||||
|
||||
#Method GrBackendObject getTextureHandle(bool flushPendingGrContextIO,
|
||||
GrSurfaceOrigin* origin = nullptr) const
|
||||
#Line # Returns GPU reference to Image as texture. ##
|
||||
|
||||
Retrieves the back-end API handle of texture. If flushPendingGrContextIO is true,
|
||||
complete deferred I/O operations.
|
||||
@ -1616,6 +1646,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
|
||||
#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()).
|
||||
@ -1762,6 +1793,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
|
||||
#Line # Scales and converts one Image to another. ##
|
||||
|
||||
Copies Image to dst, scaling pixels to fit dst.width() and dst.height(), and
|
||||
converting pixels to match dst.colorType and dst.alphaType. Returns true if
|
||||
@ -1821,6 +1853,7 @@ If cachingHint is kDisallow_CachingHint, pixels are not added to the local cache
|
||||
|
||||
#Method sk_sp<SkData> encodeToData(SkEncodedImageFormat encodedImageFormat, int quality) const
|
||||
|
||||
#Line # Returns encoded Image as SkData. ##
|
||||
Encodes Image pixels, returning result as SkData.
|
||||
|
||||
Returns nullptr if encoding fails, or if encodedImageFormat is not supported.
|
||||
@ -1891,6 +1924,7 @@ encoding fails.
|
||||
|
||||
#Method sk_sp<SkData> refEncodedData() const
|
||||
|
||||
#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
|
||||
with one or more of: SK_HAS_JPEG_LIBRARY, SK_HAS_PNG_LIBRARY, SK_HAS_WEBP_LIBRARY.
|
||||
@ -1929,6 +1963,7 @@ Returns nullptr if Image contents are not encoded.
|
||||
|
||||
#Method const char* toString(SkString* string) const
|
||||
|
||||
#Line # Converts Image to machine readable form. ##
|
||||
Appends Image description to string, including unique ID, width, height, and
|
||||
whether the image is opaque.
|
||||
|
||||
@ -1962,6 +1997,7 @@ whether the image is opaque.
|
||||
|
||||
#Method sk_sp<SkImage> makeSubset(const SkIRect& subset) const
|
||||
|
||||
#Line # Creates Image containing part of original. ##
|
||||
Returns subset of Image. subset must be fully contained by Image dimensions().
|
||||
The implementation may share pixels, or may copy them.
|
||||
|
||||
@ -1993,6 +2029,7 @@ pixels in Image could not be read or copied.
|
||||
|
||||
#Method sk_sp<SkImage> makeTextureImage(GrContext* context, SkColorSpace* dstColorSpace) const
|
||||
|
||||
#Line # Creates Image matching Color_Space if possible. ##
|
||||
Returns Image backed by GPU_Texture associated with context. Returned Image is
|
||||
compatible with Surface created with dstColorSpace. Returns original
|
||||
Image if context and dstColorSpace match.
|
||||
@ -2038,6 +2075,7 @@ GrContext.
|
||||
|
||||
#Method sk_sp<SkImage> makeNonTextureImage() const
|
||||
|
||||
#Line # Creates Image without dependency on GPU_Texture. ##
|
||||
Returns Raster_Image or Lazy_Image. Copies Image backed by GPU_Texture into
|
||||
CPU memory if needed. Returns original Image if unencoded in Raster_Bitmap,
|
||||
or if encoded in a stream.
|
||||
@ -2078,6 +2116,7 @@ Returns nullptr if backed by GPU_Texture and copy fails.
|
||||
|
||||
#Method sk_sp<SkImage> makeRasterImage() const
|
||||
|
||||
#Line # Creates Image compatible with Raster_Surface if possible. ##
|
||||
Returns Raster_Image. Copies Image backed by GPU_Texture into CPU memory,
|
||||
or decodes Image from Lazy_Image. Returns original Image if unencoded in
|
||||
Raster_Bitmap.
|
||||
@ -2120,6 +2159,7 @@ Returns nullptr if copy, decode, or pixel read fails.
|
||||
#Method sk_sp<SkImage> makeWithFilter(const SkImageFilter* filter, const SkIRect& subset,
|
||||
const SkIRect& clipBounds, SkIRect* outSubset,
|
||||
SkIPoint* offset) const
|
||||
#Line # Creates filtered, clipped Image. ##
|
||||
|
||||
Creates filtered Image. filter processes original Image, potentially changing
|
||||
color, position, and size. subset is the bounds of original Image processed
|
||||
@ -2235,6 +2275,7 @@ Used only by Chrome; to be deprecated.
|
||||
void* buffer,
|
||||
SkColorSpace* dstColorSpace = nullptr,
|
||||
SkColorType dstColorType = kN32_SkColorType) const
|
||||
#Line # To be deprecated. ##
|
||||
|
||||
Used only by Chrome; to be deprecated.
|
||||
|
||||
@ -2303,6 +2344,7 @@ then dstColorSpace must be null.
|
||||
|
||||
#Method static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext* context, const void* data,
|
||||
SkBudgeted budgeted)
|
||||
#Line # To be deprecated. ##
|
||||
|
||||
Used only by Chrome; to be deprecated.
|
||||
|
||||
@ -2336,6 +2378,7 @@ getDeferredTextureImageData.
|
||||
sk_sp<SkImage> image,
|
||||
GrBackendTexture* backendTexture,
|
||||
BackendTextureReleaseProc* backendTextureReleaseProc)
|
||||
#Line # Creates GPU_Texture from Image. ##
|
||||
|
||||
Creates a GrBackendTexture from the provided SkImage. Returns true on success. The
|
||||
GrBackendTexture and BackendTextureReleaseProc are populated on success. It is the callers
|
||||
@ -2396,6 +2439,7 @@ Helper functions to convert to SkBitmap
|
||||
|
||||
#Method bool asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode legacyBitmapMode) const
|
||||
|
||||
#Line # Returns as Raster_Bitmap. ##
|
||||
Creates raster Bitmap with same pixels as Image. If legacyBitmapMode is
|
||||
kRO_LegacyBitmapMode, returned bitmap is read-only and immutable.
|
||||
Returns true if Bitmap is stored in bitmap. Returns false and resets bitmap if
|
||||
@ -2418,6 +2462,7 @@ Bitmap write did not succeed.
|
||||
|
||||
#Method bool isLazyGenerated() const
|
||||
|
||||
#Line # Returns if Image is created as needed. ##
|
||||
Returns true if Image is backed by an image-generator or other service that creates
|
||||
and caches its pixels or texture on-demand.
|
||||
|
||||
@ -2491,6 +2536,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method sk_sp<SkImage> makeColorSpace(sk_sp<SkColorSpace> target,
|
||||
SkTransferFunctionBehavior premulBehavior) const
|
||||
#Line # Creates Image matching Color_Space if possible. ##
|
||||
|
||||
Creates Image in target Color_Space.
|
||||
Returns nullptr if Image could not be created.
|
||||
|
@ -149,6 +149,7 @@ improve performance. Matrix is not thread safe unless getType is called first.
|
||||
|
||||
#Method static SkMatrix SK_WARN_UNUSED_RESULT MakeScale(SkScalar sx, SkScalar sy)
|
||||
|
||||
#Line # Constructs from scale in x and y. ##
|
||||
Sets Matrix to scale by (sx, sy). Returned matrix is:
|
||||
|
||||
#Code
|
||||
@ -204,6 +205,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method static SkMatrix SK_WARN_UNUSED_RESULT MakeTrans(SkScalar dx, SkScalar dy)
|
||||
|
||||
#Line # Constructs from translate in x and y. ##
|
||||
Sets Matrix to translate by (dx, dy). Returned matrix is:
|
||||
|
||||
#Code
|
||||
@ -236,6 +238,7 @@ for (int i = 0; i < 4; ++i) {
|
||||
#Method 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)
|
||||
#Line # Constructs all nine values. ##
|
||||
|
||||
|
||||
Sets Matrix to:
|
||||
@ -350,6 +353,7 @@ after setPolyToPoly: kTranslate_Mask kScale_Mask kAffine_Mask kPerspective_Mask
|
||||
|
||||
#Method TypeMask getType() const
|
||||
|
||||
#Line # Returns transform complexity. ##
|
||||
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 kPerspective_Mask is set, all
|
||||
@ -379,6 +383,7 @@ set all flags hex: f decimal: 15
|
||||
|
||||
#Method bool isIdentity() const
|
||||
|
||||
#Line # Returns if matrix equals the identity Matrix . ##
|
||||
Returns true if Matrix is identity. Identity matrix is:
|
||||
|
||||
#Code
|
||||
@ -410,6 +415,7 @@ is identity: false
|
||||
|
||||
#Method bool isScaleTranslate() const
|
||||
|
||||
#Line # Returns if transform is limited to scale and translate. ##
|
||||
Returns true if Matrix at most scales and translates. Matrix may be identity,
|
||||
contain only scale elements, only translate elements, or both. Matrix form is:
|
||||
|
||||
@ -446,6 +452,7 @@ is scale-translate: true
|
||||
|
||||
#Method bool isTranslate() const
|
||||
|
||||
#Line # Returns if transform is limited to translate. ##
|
||||
Returns true if Matrix is identity, or translates. Matrix form is:
|
||||
|
||||
#Code
|
||||
@ -481,6 +488,7 @@ is translate: false
|
||||
|
||||
#Method bool rectStaysRect() const
|
||||
|
||||
#Line # Returns if mapped Rect can be represented by another Rect. ##
|
||||
Returns true Matrix maps Rect to another Rect. If true, Matrix is identity,
|
||||
or scales, or rotates a multiple of 90 degrees, or mirrors in x or y. In all
|
||||
cases, Matrix may also have translation. Matrix form is either:
|
||||
@ -530,6 +538,7 @@ rectStaysRect: true
|
||||
|
||||
#Method bool preservesAxisAlignment() const
|
||||
|
||||
#Line # Returns if mapping restricts to 90 degree multiples and mirroring. ##
|
||||
|
||||
Returns true Matrix maps Rect to another Rect. If true, Matrix is identity,
|
||||
or scales, or rotates a multiple of 90 degrees, or mirrors in x or y. In all
|
||||
@ -580,6 +589,7 @@ preservesAxisAlignment: true
|
||||
|
||||
#Method bool hasPerspective() const
|
||||
|
||||
#Line # Returns if transform includes perspective. ##
|
||||
Returns true if the matrix contains perspective elements. Matrix form is:
|
||||
|
||||
#Code
|
||||
@ -618,6 +628,7 @@ canvas->drawString(string, 0, source.bounds().height() + 48, paint);
|
||||
|
||||
#Method bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const
|
||||
|
||||
#Line # Returns if transform is limited to square scale and rotation. ##
|
||||
Returns true if Matrix contains only translation, rotation, reflection, and
|
||||
uniform scale.
|
||||
Returns false if Matrix contains different scales, skewing, perspective, or
|
||||
@ -669,6 +680,7 @@ with isSimilarity false reveals the pair not visible through the matrix.
|
||||
|
||||
#Method bool preservesRightAngles(SkScalar tol = SK_ScalarNearlyZero) const
|
||||
|
||||
#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
|
||||
@ -834,6 +846,7 @@ vertical translation
|
||||
|
||||
#Method SkScalar operator[](int index)_const
|
||||
|
||||
#Line # Returns Matrix value. ##
|
||||
Returns one matrix value. Asserts if index is out of range and SK_DEBUG is
|
||||
defined.
|
||||
|
||||
@ -862,6 +875,7 @@ matrix[SkMatrix::kMScaleY] == 24
|
||||
|
||||
#Method SkScalar get(int index) const
|
||||
|
||||
#Line # Returns one of nine Matrix values. ##
|
||||
Returns one matrix value. Asserts if index is out of range and SK_DEBUG is
|
||||
defined.
|
||||
|
||||
@ -892,6 +906,7 @@ matrix.get(SkMatrix::kMSkewY) == 24
|
||||
|
||||
#Method SkScalar getScaleX() const
|
||||
|
||||
#Line # Returns horizontal scale factor. ##
|
||||
Returns scale factor multiplied by x input, contributing to x output.
|
||||
With mapPoints, scales Points along the x-axis.
|
||||
|
||||
@ -914,6 +929,7 @@ matrix.getScaleX() == 42
|
||||
|
||||
#Method SkScalar getScaleY() const
|
||||
|
||||
#Line # Returns vertical scale factor. ##
|
||||
Returns scale factor multiplied by y input, contributing to y output.
|
||||
With mapPoints, scales Points along the y-axis.
|
||||
|
||||
@ -936,6 +952,7 @@ matrix.getScaleY() == 24
|
||||
|
||||
#Method SkScalar getSkewY() const
|
||||
|
||||
#Line # Returns vertical skew factor. ##
|
||||
Returns scale factor multiplied by x input, contributing to y output.
|
||||
With mapPoints, skews Points along the y-axis.
|
||||
Skew x and y together can rotate Points.
|
||||
@ -959,6 +976,7 @@ matrix.getSkewY() == 24
|
||||
|
||||
#Method SkScalar getSkewX() const
|
||||
|
||||
#Line # Returns horizontal skew factor. ##
|
||||
Returns scale factor multiplied by y input, contributing to x output.
|
||||
With mapPoints, skews Points along the x-axis.
|
||||
Skew x and y together can rotate Points.
|
||||
@ -982,6 +1000,7 @@ matrix.getSkewX() == 42
|
||||
|
||||
#Method SkScalar getTranslateX() const
|
||||
|
||||
#Line # Returns horizontal translation. ##
|
||||
Returns translation contributing to x output.
|
||||
With mapPoints, moves Points along the x-axis.
|
||||
|
||||
@ -1004,6 +1023,7 @@ matrix.getTranslateX() == 42
|
||||
|
||||
#Method SkScalar getTranslateY() const
|
||||
|
||||
#Line # Returns vertical translation. ##
|
||||
Returns translation contributing to y output.
|
||||
With mapPoints, moves Points along the y-axis.
|
||||
|
||||
@ -1026,6 +1046,7 @@ matrix.getTranslateY() == 24
|
||||
|
||||
#Method SkScalar getPerspX() const
|
||||
|
||||
#Line # Returns input x perspective factor. ##
|
||||
Returns factor scaling input x relative to input y.
|
||||
|
||||
#Return input x perspective factor ##
|
||||
@ -1056,6 +1077,7 @@ Returns factor scaling input x relative to input y.
|
||||
|
||||
#Method SkScalar getPerspY() const
|
||||
|
||||
#Line # Returns input y perspective factor. ##
|
||||
|
||||
Returns factor scaling input y relative to input x.
|
||||
|
||||
@ -1087,6 +1109,7 @@ Returns factor scaling input y relative to input x.
|
||||
|
||||
#Method SkScalar& operator[](int index)
|
||||
|
||||
#Line # Returns writable reference to Matrix value. ##
|
||||
Returns writable Matrix value. Asserts if index is out of range and SK_DEBUG is
|
||||
defined. Clears internal cache anticipating that caller will change Matrix value.
|
||||
|
||||
@ -1126,6 +1149,7 @@ after dirty cache: x = 66
|
||||
|
||||
#Method void set(int index, SkScalar value)
|
||||
|
||||
#Line # Sets one value. ##
|
||||
Sets Matrix value. Asserts if index is out of range and SK_DEBUG is
|
||||
defined. Safer than operator[]; internal cache is always maintained.
|
||||
|
||||
@ -1157,6 +1181,7 @@ after 2nd skew x mod: x = 66
|
||||
|
||||
#Method void setScaleX(SkScalar v)
|
||||
|
||||
#Line # Sets horizontal scale factor. ##
|
||||
Sets horizontal scale factor.
|
||||
|
||||
#Param v horizontal scale factor to store ##
|
||||
@ -1182,6 +1207,7 @@ canvas->drawString("x scale", 0, 48, paint);
|
||||
|
||||
#Method void setScaleY(SkScalar v)
|
||||
|
||||
#Line # Sets vertical scale factor ##
|
||||
Sets vertical scale factor.
|
||||
|
||||
#Param v vertical scale factor to store ##
|
||||
@ -1207,6 +1233,7 @@ canvas->drawString("y scale", 12, 48, paint);
|
||||
|
||||
#Method void setSkewY(SkScalar v)
|
||||
|
||||
#Line # Sets vertical skew factor. ##
|
||||
Sets vertical skew factor.
|
||||
|
||||
#Param v vertical skew factor to store ##
|
||||
@ -1232,6 +1259,7 @@ canvas->drawString("y skew", 12, 48, paint);
|
||||
|
||||
#Method void setSkewX(SkScalar v)
|
||||
|
||||
#Line # Sets horizontal skew factor. ##
|
||||
Sets horizontal skew factor.
|
||||
|
||||
#Param v horizontal skew factor to store ##
|
||||
@ -1257,6 +1285,7 @@ canvas->drawString("x skew", 36, 48, paint);
|
||||
|
||||
#Method void setTranslateX(SkScalar v)
|
||||
|
||||
#Line # Sets horizontal translation. ##
|
||||
Sets horizontal translation.
|
||||
|
||||
#Param v horizontal translation to store ##
|
||||
@ -1282,6 +1311,7 @@ canvas->drawString("x translate", 8, 24, paint);
|
||||
|
||||
#Method void setTranslateY(SkScalar v)
|
||||
|
||||
#Line # Sets vertical translation. ##
|
||||
Sets vertical translation.
|
||||
|
||||
#Param v vertical translation to store ##
|
||||
@ -1307,6 +1337,7 @@ canvas->drawString("y translate", 8, 24, paint);
|
||||
|
||||
#Method void setPerspX(SkScalar v)
|
||||
|
||||
#Line # Sets input x perspective factor. ##
|
||||
Sets input x perspective factor, which causes mapXY to vary input x inversely
|
||||
proportional to input y.
|
||||
|
||||
@ -1334,6 +1365,7 @@ for (SkScalar perspX : { -.003f, 0.f, .003f, .012f } ) {
|
||||
|
||||
#Method void setPerspY(SkScalar v)
|
||||
|
||||
#Line # Sets input y perspective factor. ##
|
||||
Sets input y perspective factor, which causes mapXY to vary input y inversely
|
||||
proportional to input x.
|
||||
|
||||
@ -1362,6 +1394,7 @@ for (SkScalar perspX : { -.003f, 0.f, .003f, .012f } ) {
|
||||
#Method void setAll(SkScalar scaleX, SkScalar skewX, SkScalar transX,
|
||||
SkScalar skewY, SkScalar scaleY, SkScalar transY,
|
||||
SkScalar persp0, SkScalar persp1, SkScalar persp2)
|
||||
#Line # Sets all values from parameters. ##
|
||||
|
||||
Sets all values from parameters. Sets matrix to:
|
||||
|
||||
@ -1406,6 +1439,7 @@ Sets all values from parameters. Sets matrix to:
|
||||
|
||||
#Method void get9(SkScalar buffer[9]) const
|
||||
|
||||
#Line # Returns all nine Matrix values. ##
|
||||
Copies nine Scalar values contained by Matrix into buffer, in member value
|
||||
ascending order: kMScaleX, kMSkewX, kMTransX, kMSkewY, kMScaleY, kMTransY,
|
||||
kMPersp0, kMPersp1, kMPersp2.
|
||||
@ -1434,6 +1468,7 @@ SkDebugf("{%g, %g, %g},\n{%g, %g, %g},\n{%g, %g, %g}\n", b[0], b[1], b[2],
|
||||
|
||||
#Method void set9(const SkScalar buffer[9])
|
||||
|
||||
#Line # Sets all values from Scalar array. ##
|
||||
Sets Matrix to nine Scalar values in buffer, in member value ascending order:
|
||||
kMScaleX, kMSkewX, kMTransX, kMSkewY, kMScaleY, kMTransY, kMPersp0, kMPersp1,
|
||||
kMPersp2.
|
||||
@ -1470,6 +1505,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void reset()
|
||||
|
||||
#Line # Sets Matrix to identity. ##
|
||||
Sets Matrix to identity; which has no effect on mapped Points. Sets Matrix to:
|
||||
|
||||
#Code
|
||||
@ -1499,6 +1535,7 @@ m.isIdentity(): true
|
||||
|
||||
#Method void setIdentity()
|
||||
|
||||
#Line # Sets Matrix to identity. ##
|
||||
Sets Matrix to identity; which has no effect on mapped Points. Sets Matrix to:
|
||||
|
||||
#Code
|
||||
@ -1528,6 +1565,7 @@ m.isIdentity(): true
|
||||
|
||||
#Method void setTranslate(SkScalar dx, SkScalar dy)
|
||||
|
||||
#Line # Sets to translate in x and y. ##
|
||||
Sets Matrix to translate by (dx, dy).
|
||||
|
||||
#Param dx horizontal translation ##
|
||||
@ -1577,6 +1615,7 @@ canvas->drawString("translate", 8, 24, paint);
|
||||
|
||||
#Method void setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Sets to scale about a point. ##
|
||||
Sets Matrix to scale by sx and sy, about a pivot point at (px, py).
|
||||
The pivot point is unchanged when mapped with Matrix.
|
||||
|
||||
@ -1639,6 +1678,7 @@ Sets Matrix to scale by sx and sy about at pivot point at (0, 0).
|
||||
|
||||
#Method void setRotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Sets to rotate about a point. ##
|
||||
Sets Matrix to rotate by degrees about a pivot point at (px, py).
|
||||
The pivot point is unchanged when mapped with Matrix.
|
||||
|
||||
@ -1699,6 +1739,7 @@ Positive degrees rotates clockwise.
|
||||
|
||||
#Method void setSinCos(SkScalar sinValue, SkScalar cosValue,
|
||||
SkScalar px, SkScalar py)
|
||||
#Line # Sets to rotate and scale about a point. ##
|
||||
|
||||
Sets Matrix to rotate by sinValue and cosValue, about a pivot point at (px, py).
|
||||
The pivot point is unchanged when mapped with Matrix.
|
||||
@ -1768,6 +1809,7 @@ Canvas needs offset after applying Matrix to pivot about Rect center.
|
||||
|
||||
#Method SkMatrix& setRSXform(const SkRSXform& rsxForm)
|
||||
|
||||
#Line # Sets to rotate, scale, and translate. ##
|
||||
Sets Matrix to rotate, scale, and translate using a compressed matrix form.
|
||||
|
||||
Vector (rsxForm.fSSin, rsxForm.fSCos) describes the angle of rotation relative
|
||||
@ -1804,6 +1846,7 @@ Canvas needs offset after applying Matrix to pivot about Rect center.
|
||||
|
||||
#Method void setSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Sets to skew about a point. ##
|
||||
Sets Matrix to skew by kx and ky, about a pivot point at (px, py).
|
||||
The pivot point is unchanged when mapped with Matrix.
|
||||
|
||||
@ -1864,6 +1907,7 @@ Sets Matrix to skew by kx and ky, about a pivot point at (0, 0).
|
||||
|
||||
#Method void setConcat(const SkMatrix& a, const SkMatrix& b)
|
||||
|
||||
#Line # Sets to Matrix parameter multiplied by Matrix parameter. ##
|
||||
Sets Matrix to Matrix a multiplied by Matrix b. Either a or b may be this.
|
||||
|
||||
Given:
|
||||
@ -1911,6 +1955,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preTranslate(SkScalar dx, SkScalar dy)
|
||||
|
||||
#Line # Pre-multiplies Matrix by translation. ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from translation (dx, dy).
|
||||
This can be thought of as moving the point to be mapped before applying Matrix.
|
||||
|
||||
@ -1967,6 +2012,7 @@ Matrix * T(dx, dy) = | D E F | | 0 1 dy | = | D E D*dx+E*dy+F |
|
||||
|
||||
#Method void preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Pre-multiplies Matrix by scale. ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from scaling by (sx, sy)
|
||||
about pivot point (px, py).
|
||||
This can be thought of as scaling about a pivot point before applying Matrix.
|
||||
@ -2065,6 +2111,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preRotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Pre-multiplies Matrix by rotation. ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from rotating by degrees
|
||||
about pivot point (px, py).
|
||||
This can be thought of as rotating about a pivot point before applying Matrix.
|
||||
@ -2175,6 +2222,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Pre-multiplies Matrix by skew. ##
|
||||
Sets Matrix to Matrix multiplied by Matrix constructed from skewing by (kx, ky)
|
||||
about pivot point (px, py).
|
||||
This can be thought of as skewing about a pivot point before applying Matrix.
|
||||
@ -2273,6 +2321,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void preConcat(const SkMatrix& other)
|
||||
|
||||
#Line # Pre-multiplies Matrix by Matrix parameter. ##
|
||||
Sets Matrix to Matrix multiplied by Matrix other.
|
||||
This can be thought of mapping by other before applying Matrix.
|
||||
|
||||
@ -2320,6 +2369,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postTranslate(SkScalar dx, SkScalar dy)
|
||||
|
||||
#Line # Post-multiplies Matrix by translation. ##
|
||||
Sets Matrix to Matrix constructed from translation (dx, dy) multiplied by Matrix.
|
||||
This can be thought of as moving the point to be mapped after applying Matrix.
|
||||
|
||||
@ -2379,6 +2429,7 @@ Compare with preTranslate example.
|
||||
|
||||
#Method void postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Post-multiplies Matrix by scale. ##
|
||||
Sets Matrix to Matrix constructed from scaling by (sx, sy) about pivot point
|
||||
(px, py), multiplied by Matrix.
|
||||
This can be thought of as scaling about a pivot point after applying Matrix.
|
||||
@ -2477,6 +2528,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method bool postIDiv(int divx, int divy)
|
||||
|
||||
#Line # Post-multiplies Matrix by inverse scale. ##
|
||||
Sets Matrix to Matrix constructed from scaling by
|
||||
#Formula
|
||||
(1/divx, 1/divy)
|
||||
@ -2535,6 +2587,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postRotate(SkScalar degrees, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Post-multiplies Matrix by rotation. ##
|
||||
Sets Matrix to Matrix constructed from rotating by degrees about pivot point
|
||||
(px, py), multiplied by Matrix.
|
||||
This can be thought of as rotating about a pivot point after applying Matrix.
|
||||
@ -2645,6 +2698,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postSkew(SkScalar kx, SkScalar ky, SkScalar px, SkScalar py)
|
||||
|
||||
#Line # Post-multiplies Matrix by skew. ##
|
||||
Sets Matrix to Matrix constructed from skewing by (kx, ky) about pivot point
|
||||
(px, py), multiplied by Matrix.
|
||||
This can be thought of as skewing about a pivot point after applying Matrix.
|
||||
@ -2743,6 +2797,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void postConcat(const SkMatrix& other)
|
||||
|
||||
#Line # Post-multiplies Matrix by Matrix parameter. ##
|
||||
Sets Matrix to Matrix other multiplied by Matrix.
|
||||
This can be thought of mapping by other after applying Matrix.
|
||||
|
||||
@ -2853,6 +2908,7 @@ how Matrix maps to the side or center of the destination Rect.
|
||||
|
||||
#Method bool setRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf)
|
||||
|
||||
#Line # Sets to map one Rect to another. ##
|
||||
Sets Matrix to scale and translate src Rect to dst Rect. stf selects whether
|
||||
mapping completely fills dst or preserves the aspect ratio, and how to align
|
||||
src within dst. Returns false if src is empty, and sets Matrix to identity.
|
||||
@ -2907,6 +2963,7 @@ src: 1, 2, 3, 4 dst: 5, 6, 8, 9 success: true
|
||||
|
||||
#Method static SkMatrix MakeRectToRect(const SkRect& src, const SkRect& dst, ScaleToFit stf)
|
||||
|
||||
#Line # Constructs from source Rect to destination Rect. ##
|
||||
Returns Matrix set to scale and translate src Rect to dst Rect. stf selects
|
||||
whether mapping completely fills dst or preserves the aspect ratio, and how to
|
||||
align src within dst. Returns the identity Matrix if src is empty. If dst is
|
||||
@ -2959,6 +3016,7 @@ src: 1, 2, 3, 4 dst: 5, 6, 8, 9
|
||||
|
||||
#Method bool setPolyToPoly(const SkPoint src[], const SkPoint dst[], int count)
|
||||
|
||||
#Line # Sets to map one to four points to an equal array of points. ##
|
||||
Sets Matrix to map src to dst. count must be zero or greater, and four or less.
|
||||
|
||||
If count is zero, sets Matrix to identity and returns true.
|
||||
@ -3009,6 +3067,7 @@ perspective.
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT invert(SkMatrix* inverse) const
|
||||
|
||||
#Line # Returns inverse, if possible. ##
|
||||
Sets inverse to reciprocal matrix, returning true if Matrix can be inverted.
|
||||
Geometrically, if Matrix maps from source to destination, inverse Matrix
|
||||
maps from destination to source. If Matrix can not be inverted, inverse is
|
||||
@ -3045,6 +3104,7 @@ unchanged.
|
||||
|
||||
#Method static void SetAffineIdentity(SkScalar affine[6])
|
||||
|
||||
#Line # Sets 3x2 array to identity. ##
|
||||
Fills affine with identity values in column major order.
|
||||
Sets affine to:
|
||||
|
||||
@ -3079,6 +3139,7 @@ ScaleX: 1 SkewY: 0 SkewX: 0 ScaleY: 1 TransX: 0 TransY: 0
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT asAffine(SkScalar affine[6]) const
|
||||
|
||||
#Line # Copies to 3x2 array. ##
|
||||
Fills affine in column major order. Sets affine to:
|
||||
|
||||
#Code
|
||||
@ -3116,6 +3177,7 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
|
||||
|
||||
#Method void setAffine(const SkScalar affine[6])
|
||||
|
||||
#Line # Sets left two columns. ##
|
||||
Sets Matrix to affine values, passed in column major order. Given affine,
|
||||
column, then row, as:
|
||||
|
||||
@ -3163,6 +3225,7 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
|
||||
|
||||
#Method void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
|
||||
|
||||
#Line # Maps Point array. ##
|
||||
Maps src Point array of length count to dst Point array of equal or greater
|
||||
length. Points are mapped by multiplying each Point by Matrix. Given:
|
||||
|
||||
@ -3276,6 +3339,7 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|
||||
|
||||
#Method void mapHomogeneousPoints(SkPoint3 dst[], const SkPoint3 src[], int count) const
|
||||
|
||||
#Line # Maps Point3 array. ##
|
||||
Maps src Point3 array of length count to dst Point3 array, which must of length count or
|
||||
greater. Point3 array is mapped by multiplying each Point3 by Matrix. Given:
|
||||
|
||||
@ -3333,6 +3397,7 @@ Matrix * src = |D E F| |y| = |Ax+By+Cz Dx+Ey+Fz Gx+Hy+Iz|
|
||||
|
||||
#Method void mapXY(SkScalar x, SkScalar y, SkPoint* result) const
|
||||
|
||||
#Line # Maps Point. ##
|
||||
Maps Point (x, y) to result. Point is mapped by multiplying by Matrix. Given:
|
||||
|
||||
#Code
|
||||
@ -3427,6 +3492,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void mapVectors(SkVector dst[], const SkVector src[], int count) const
|
||||
|
||||
#Line # Maps Vector array. ##
|
||||
Maps src Vector array of length count to Vector Point array of equal or greater
|
||||
length. Vectors are mapped by multiplying each Vector by Matrix, treating
|
||||
Matrix translation as zero. Given:
|
||||
@ -3545,6 +3611,7 @@ Matrix * vec = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+I| = ------- , -------
|
||||
|
||||
#Method void mapVector(SkScalar dx, SkScalar dy, SkVector* result) const
|
||||
|
||||
#Line # Maps Vector. ##
|
||||
Maps Vector (x, y) to result. Vector is mapped by multiplying by Matrix,
|
||||
treating Matrix translation as zero. Given:
|
||||
|
||||
@ -3644,6 +3711,7 @@ Matrix * vec = |D E 0| |dy| = |A*dx+B*dy D*dx+E*dy G*dx+H*dy+I| = ----------- ,
|
||||
|
||||
#Method bool mapRect(SkRect* dst, const SkRect& src) const
|
||||
|
||||
#Line # Returns bounds of mapped Rect. ##
|
||||
Sets dst to bounds of src corners mapped by Matrix.
|
||||
Returns true if mapped corners are dst corners.
|
||||
|
||||
@ -3707,6 +3775,7 @@ Returned value is the same as calling rectStaysRect.
|
||||
|
||||
#Method void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const
|
||||
|
||||
#Line # Maps Rect to Point array. ##
|
||||
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),
|
||||
@ -3763,6 +3832,7 @@ Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|
||||
|
||||
#Method void mapRectScaleTranslate(SkRect* dst, const SkRect& src) const
|
||||
|
||||
#Line # Returns bounds of mapped Rect. ##
|
||||
Sets dst to bounds of src corners mapped by Matrix. If matrix contains
|
||||
elements other than scale or translate: asserts if SK_DEBUG is defined;
|
||||
otherwise, results are undefined.
|
||||
@ -3791,6 +3861,7 @@ otherwise, results are undefined.
|
||||
|
||||
#Method SkScalar mapRadius(SkScalar radius) const
|
||||
|
||||
#Line # Returns mean radius of mapped Circle. ##
|
||||
Returns geometric mean radius of ellipse formed by constructing Circle of
|
||||
size radius, and mapping constructed Circle with Matrix. The result squared is
|
||||
equal to the major axis length times the minor axis length.
|
||||
@ -3846,6 +3917,7 @@ the area enclosed by the ellipse major and minor axes.
|
||||
|
||||
#Method bool isFixedStepInX() const
|
||||
|
||||
#Line # Returns if transformation supports fixed step in x. ##
|
||||
Returns true if a unit step in x at some y mapped through Matrix can be
|
||||
represented by a constant Vector. Returns true if getType returns kIdentity_Mask,
|
||||
or combinations of: kTranslate_Mask, kScale_Mask, and kAffine_Mask.
|
||||
@ -3894,6 +3966,7 @@ isFixedStepInX: false
|
||||
|
||||
#Method SkVector fixedStepInX(SkScalar y) const
|
||||
|
||||
#Line # Returns step in x for a position in y. ##
|
||||
Returns Vector representing a unit step in x at y mapped through Matrix.
|
||||
If isFixedStepInX is false, returned value is undefined.
|
||||
|
||||
@ -3933,6 +4006,7 @@ If isFixedStepInX is false, returned value is undefined.
|
||||
|
||||
#Method bool cheapEqualTo(const SkMatrix& m) const
|
||||
|
||||
#Line # Compares Matrix pair using memcmp(). ##
|
||||
Returns true if Matrix equals m, using an efficient comparison.
|
||||
|
||||
Returns false when the sign of zero values is the different; when one
|
||||
@ -3978,6 +4052,7 @@ both NaN: a != b a.cheapEqualTo(b): true
|
||||
|
||||
#Method bool operator==(const SkMatrix& a, const SkMatrix& b)
|
||||
|
||||
#Line # Returns true if members are equal. ##
|
||||
Compares a and b; returns true if a and b are numerically equal. Returns true
|
||||
even if sign of zero values are different. Returns false if either Matrix
|
||||
contains NaN, even if the other Matrix also contains NaN.
|
||||
@ -4010,6 +4085,7 @@ identity: a == b a.cheapEqualTo(b): true
|
||||
|
||||
#Method bool operator!=(const SkMatrix& a, const SkMatrix& b)
|
||||
|
||||
#Line # Returns true if members are unequal. ##
|
||||
Compares a and b; returns true if a and b are not numerically equal. Returns false
|
||||
even if sign of zero values are different. Returns true if either Matrix
|
||||
contains NaN, even if the other Matrix also contains NaN.
|
||||
@ -4038,6 +4114,7 @@ contains NaN, even if the other Matrix also contains NaN.
|
||||
|
||||
#Method void dump() const
|
||||
|
||||
#Line # Sends text representation using floats to standard output. ##
|
||||
Writes text representation of Matrix to standard output. Floating point values
|
||||
are written with limited precision; it may not be possible to reconstruct
|
||||
original Matrix from output.
|
||||
@ -4065,6 +4142,7 @@ matrix != nearlyEqual
|
||||
|
||||
#Method void toString(SkString* str) const
|
||||
|
||||
#Line # Converts Matrix to machine readable form. ##
|
||||
Creates string representation of Matrix. Floating point values
|
||||
are written with limited precision; it may not be possible to reconstruct
|
||||
original Matrix from output.
|
||||
@ -4097,6 +4175,7 @@ matrix != nearlyEqual
|
||||
|
||||
#Method SkScalar getMinScale() const
|
||||
|
||||
#Line # Returns minimum scaling, if possible. ##
|
||||
Returns the minimum scaling factor of Matrix by decomposing the scaling and
|
||||
skewing elements.
|
||||
Returns -1 if scale factor overflows or Matrix contains perspective.
|
||||
@ -4121,6 +4200,7 @@ matrix.getMinScale() 24
|
||||
|
||||
#Method SkScalar getMaxScale() const
|
||||
|
||||
#Line # Returns maximum scaling, if possible. ##
|
||||
Returns the maximum scaling factor of Matrix by decomposing the scaling and
|
||||
skewing elements.
|
||||
Returns -1 if scale factor overflows or Matrix contains perspective.
|
||||
@ -4145,6 +4225,7 @@ matrix.getMaxScale() 42
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT getMinMaxScales(SkScalar scaleFactors[2]) const
|
||||
|
||||
#Line # Returns minimum and maximum scaling, if possible. ##
|
||||
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.
|
||||
@ -4176,6 +4257,7 @@ matrix.getMinMaxScales() false 2 2
|
||||
|
||||
#Method bool decomposeScale(SkSize* scale, SkMatrix* remaining = nullptr) const
|
||||
|
||||
#Line # Separates scale if possible. ##
|
||||
Decomposes Matrix into scale components and whatever remains. Returns false if
|
||||
Matrix could not be decomposed.
|
||||
|
||||
@ -4229,6 +4311,7 @@ success: true scale: 0.5, 0.25
|
||||
|
||||
#Method static const SkMatrix& I()
|
||||
|
||||
#Line # Returns a reference to a const identity Matrix. ##
|
||||
Returns reference to const identity Matrix. Returned Matrix is set to:
|
||||
|
||||
#Code
|
||||
@ -4261,6 +4344,7 @@ m2 == m3
|
||||
|
||||
#Method static const SkMatrix& InvalidMatrix()
|
||||
|
||||
#Line # Returns a reference to a const invalid Matrix. ##
|
||||
Returns reference to a const Matrix with invalid values. Returned Matrix is set
|
||||
to:
|
||||
|
||||
@ -4288,6 +4372,7 @@ scaleX 3.40282e+38
|
||||
|
||||
#Method static SkMatrix Concat(const SkMatrix& a, const SkMatrix& b)
|
||||
|
||||
#Line # Returns the concatenation of Matrix pair. ##
|
||||
Returns Matrix a multiplied by Matrix b.
|
||||
|
||||
Given:
|
||||
@ -4338,6 +4423,7 @@ canvas->drawBitmap(source, 0, 0);
|
||||
|
||||
#Method void dirtyMatrixTypeCache()
|
||||
|
||||
#Line # Sets internal cache to unknown state. ##
|
||||
Sets internal cache to unknown state. Use to force update after repeated
|
||||
modifications to Matrix element reference returned by operator[](int index).
|
||||
|
||||
@ -4368,6 +4454,7 @@ after dirty cache: x = 66
|
||||
|
||||
#Method void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty)
|
||||
|
||||
#Line # Sets to scale and translate. ##
|
||||
Initializes Matrix with scale and translate elements.
|
||||
|
||||
#Code
|
||||
@ -4399,6 +4486,7 @@ matrix.dump();
|
||||
|
||||
#Method bool isFinite() const
|
||||
|
||||
#Line # Returns if all Matrix values are not infinity, NaN. ##
|
||||
Returns true if all elements of the matrix are finite. Returns false if any
|
||||
element is infinity, or NaN.
|
||||
|
||||
|
@ -256,6 +256,8 @@ Shader attached to Paint.
|
||||
|
||||
#Method SkPaint()
|
||||
|
||||
#In Initializers
|
||||
#Line # constructs with default values ##
|
||||
Constructs Paint with default values.
|
||||
|
||||
#Table
|
||||
@ -323,6 +325,8 @@ $$$# # restore original markup character
|
||||
|
||||
#Method SkPaint(const SkPaint& paint)
|
||||
|
||||
#In Initializers
|
||||
#Line # makes a shallow copy ##
|
||||
Makes a shallow copy of Paint. Typeface, Path_Effect, Shader,
|
||||
Mask_Filter, Color_Filter, Draw_Looper, and Image_Filter are shared
|
||||
between the original paint and the copy. Objects containing Reference_Count increment
|
||||
@ -355,6 +359,8 @@ This prevents objects with Reference_Count from being modified once Paint refers
|
||||
|
||||
#Method SkPaint(SkPaint&& paint)
|
||||
|
||||
#In Initializers
|
||||
#Line # moves paint without copying it ##
|
||||
Implements a move constructor to avoid increasing the reference counts
|
||||
of objects referenced by the paint.
|
||||
|
||||
@ -382,6 +388,8 @@ This prevents objects with Reference_Count from being modified once Paint refers
|
||||
|
||||
#Method void reset()
|
||||
|
||||
#In Initializers
|
||||
#Line # sets to default values ##
|
||||
Sets all Paint contents to their initial values. This is equivalent to replacing
|
||||
Paint with the result of SkPaint().
|
||||
|
||||
@ -405,6 +413,8 @@ Paint with the result of SkPaint().
|
||||
|
||||
#Method ~SkPaint()
|
||||
|
||||
#In Destructor
|
||||
#Line # decreases Reference_Count of owned objects ##
|
||||
Decreases Paint Reference_Count of owned objects: Typeface, Path_Effect, Shader,
|
||||
Mask_Filter, Color_Filter, Draw_Looper, and Image_Filter. If the
|
||||
objects containing Reference_Count go to zero, they are deleted.
|
||||
@ -420,6 +430,8 @@ objects containing Reference_Count go to zero, they are deleted.
|
||||
|
||||
#Method SkPaint& operator=(const SkPaint& paint)
|
||||
|
||||
#In Management
|
||||
#Line # makes a shallow copy ##
|
||||
Makes a shallow copy of Paint. Typeface, Path_Effect, Shader,
|
||||
Mask_Filter, Color_Filter, Draw_Looper, and Image_Filter are shared
|
||||
between the original paint and the copy. Objects containing Reference_Count in the
|
||||
@ -450,6 +462,8 @@ are increased by one. paint is unmodified.
|
||||
|
||||
#Method SkPaint& operator=(SkPaint&& paint)
|
||||
|
||||
#In Management
|
||||
#Line # moves paint without copying it ##
|
||||
Moves the paint to avoid increasing the reference counts
|
||||
of objects referenced by the paint parameter. Objects containing Reference_Count in the
|
||||
prior destination are decreased by one; those objects are deleted if the resulting count
|
||||
@ -478,6 +492,8 @@ After the call, paint is undefined, and can be safely destructed.
|
||||
|
||||
#Method bool operator==(const SkPaint& a, const SkPaint& b)
|
||||
|
||||
#In Management
|
||||
#Line # compares paints for equality ##
|
||||
Compares a and b, and returns true if a and b are equivalent. May return false
|
||||
if Typeface, Path_Effect, Shader, Mask_Filter, Color_Filter,
|
||||
Draw_Looper, or Image_Filter have identical contents but different pointers.
|
||||
@ -509,6 +525,8 @@ After the call, paint is undefined, and can be safely destructed.
|
||||
|
||||
#Method bool operator!=(const SkPaint& a, const SkPaint& b)
|
||||
|
||||
#In Management
|
||||
#Line # compares paints for inequality ##
|
||||
Compares a and b, and returns true if a and b are not equivalent. May return true
|
||||
if Typeface, Path_Effect, Shader, Mask_Filter, Color_Filter,
|
||||
Draw_Looper, or Image_Filter have identical contents but different pointers.
|
||||
@ -537,6 +555,8 @@ After the call, paint is undefined, and can be safely destructed.
|
||||
|
||||
#Method uint32_t getHash() const
|
||||
|
||||
#In Management
|
||||
#Line # returns a shallow hash for equality checks ##
|
||||
Returns a hash generated from Paint values and pointers.
|
||||
Identical hashes guarantee that the paints are
|
||||
equivalent, but differing hashes do not guarantee that the paints have differing
|
||||
@ -569,6 +589,8 @@ The hash returned is platform and implementation specific.
|
||||
|
||||
#Method void flatten(SkWriteBuffer& buffer) const
|
||||
|
||||
#In Management
|
||||
#Line # serializes into a buffer ##
|
||||
Serializes Paint into a buffer. A companion unflatten() call
|
||||
can reconstitute the paint at a later time.
|
||||
|
||||
@ -586,6 +608,8 @@ can reconstitute the paint at a later time.
|
||||
|
||||
#Method bool unflatten(SkReadBuffer& buffer)
|
||||
|
||||
#In Management
|
||||
#Line # populates from a serialized stream ##
|
||||
Populates Paint, typically from a serialized stream, created by calling
|
||||
flatten() at an earlier time.
|
||||
|
||||
@ -680,6 +704,8 @@ Set SkPaintDefaults_Hinting at compile time to change the default setting.
|
||||
|
||||
#Method Hinting getHinting() const
|
||||
|
||||
#In Hinting
|
||||
#Line # returns Hinting, glyph outline adjustment level ##
|
||||
Returns level of glyph outline adjustment.
|
||||
|
||||
#Return one of: kNo_Hinting, kSlight_Hinting, kNormal_Hinting, kFull_Hinting ##
|
||||
@ -697,6 +723,8 @@ Set SkPaintDefaults_Hinting at compile time to change the default setting.
|
||||
|
||||
#Method void setHinting(Hinting hintingLevel)
|
||||
|
||||
#In Hinting
|
||||
#Line # sets Hinting, glyph outline adjustment level ##
|
||||
Sets level of glyph outline adjustment.
|
||||
Does not check for valid values of hintingLevel.
|
||||
|
||||
@ -825,6 +853,8 @@ To be deprecated; only valid for Android framework.
|
||||
|
||||
#Method uint32_t getFlags() const
|
||||
|
||||
#In Flags
|
||||
#Line # returns Flags stored in a bit field ##
|
||||
Returns paint settings described by Flags. Each setting uses one
|
||||
bit, and can be tested with Flags members.
|
||||
|
||||
@ -845,6 +875,8 @@ bit, and can be tested with Flags members.
|
||||
|
||||
#Method void setFlags(uint32_t flags)
|
||||
|
||||
#In Flags
|
||||
#Line # sets multiple Flags in a bit field ##
|
||||
Replaces Flags with flags, the union of the Flags members.
|
||||
All Flags members may be cleared, or one or more may be set.
|
||||
|
||||
@ -868,6 +900,8 @@ All Flags members may be cleared, or one or more may be set.
|
||||
# ------------------------------------------------------------------------------
|
||||
#Topic Anti-alias
|
||||
#Alias Anti-alias # permit hyphen in topic name, should probably not substitute hyphen with _
|
||||
#In Related_Functions
|
||||
#Line # approximating coverage with transparency ##
|
||||
|
||||
Anti-alias drawing approximates partial pixel coverage with transparency.
|
||||
If kAntiAlias_Flag is clear, pixel centers contained by the shape edge are drawn opaque.
|
||||
@ -923,6 +957,8 @@ at compile time.
|
||||
##
|
||||
|
||||
#Method bool isAntiAlias() const
|
||||
#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.
|
||||
|
||||
@ -947,6 +983,8 @@ at compile time.
|
||||
|
||||
#Method void setAntiAlias(bool aa)
|
||||
|
||||
#In Anti-alias
|
||||
#Line # sets or clears Anti-alias ##
|
||||
Requests, but does not require, that Path edge pixels draw opaque or with
|
||||
partial transparency.
|
||||
|
||||
@ -1049,6 +1087,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isDither() const
|
||||
|
||||
#In Dither
|
||||
#Line # returns true if Dither is set ##
|
||||
If true, color error may be distributed to smooth color transition.
|
||||
|
||||
Equivalent to getFlags masked with kDither_Flag.
|
||||
@ -1073,6 +1113,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setDither(bool dither)
|
||||
|
||||
#In Dither
|
||||
#Line # sets or clears Dither ##
|
||||
Requests, but does not require, to distribute color error.
|
||||
|
||||
Sets kDither_Flag if dither is true.
|
||||
@ -1154,6 +1196,7 @@ If kLinearText_Flag is clear, it is the same as setting Hinting to kNo_Hinting.
|
||||
|
||||
#Method bool isLinearText() const
|
||||
|
||||
#In Linear_Text
|
||||
If true, text is converted to Path before drawing and measuring.
|
||||
|
||||
Equivalent to getFlags masked with kLinearText_Flag.
|
||||
@ -1184,6 +1227,7 @@ If kLinearText_Flag is clear, it is the same as setting Hinting to kNo_Hinting.
|
||||
|
||||
#Method void setLinearText(bool linearText)
|
||||
|
||||
#In Linear_Text
|
||||
If true, text is converted to Path before drawing and measuring.
|
||||
By default, kLinearText_Flag is clear.
|
||||
|
||||
@ -1226,6 +1270,8 @@ of the color increases, the edge of the glyph appears to move towards the outsid
|
||||
|
||||
#Method bool isSubpixelText() const
|
||||
|
||||
#In Subpixel_Text
|
||||
#Line # returns true if Subpixel_Text is set ##
|
||||
If true, Glyphs at different sub-pixel positions may differ on pixel edge coverage.
|
||||
|
||||
Equivalent to getFlags masked with kSubpixelText_Flag.
|
||||
@ -1250,6 +1296,8 @@ SkDebugf("paint.isSubpixelText() %c= !!(paint.getFlags() & SkPaint::kSubpixelTex
|
||||
|
||||
#Method void setSubpixelText(bool subpixelText)
|
||||
|
||||
#In Subpixel_Text
|
||||
#Line # sets or clears Subpixel_Text ##
|
||||
Requests, but does not require, that Glyphs respect sub-pixel positioning.
|
||||
|
||||
Sets kSubpixelText_Flag if subpixelText is true.
|
||||
@ -1283,6 +1331,8 @@ the color components as Color_RGB or Color_RBG.
|
||||
|
||||
#Method bool isLCDRenderText() const
|
||||
|
||||
#In LCD_Text
|
||||
#Line # returns true if LCD_Text is set ##
|
||||
If true, Glyphs may use LCD striping to improve glyph edges.
|
||||
|
||||
Returns true if Flags kLCDRenderText_Flag is set.
|
||||
@ -1307,6 +1357,8 @@ SkDebugf("paint.isLCDRenderText() %c= !!(paint.getFlags() & SkPaint::kLCDRenderT
|
||||
|
||||
#Method void setLCDRenderText(bool lcdText)
|
||||
|
||||
#In LCD_Text
|
||||
#Line # sets or clears LCD_Text ##
|
||||
Requests, but does not require, that Glyphs use LCD striping for glyph edges.
|
||||
|
||||
Sets kLCDRenderText_Flag if lcdText is true.
|
||||
@ -1379,6 +1431,8 @@ kEmbeddedBitmapText_Flag at compile time.
|
||||
|
||||
#Method bool isEmbeddedBitmapText() const
|
||||
|
||||
#In Font_Embedded_Bitmaps
|
||||
#Line # returns true if Font_Embedded_Bitmaps is set ##
|
||||
If true, Font_Engine may return Glyphs from font bitmaps instead of from outlines.
|
||||
|
||||
Equivalent to getFlags masked with kEmbeddedBitmapText_Flag.
|
||||
@ -1407,6 +1461,8 @@ kEmbeddedBitmapText_Flag at compile time.
|
||||
|
||||
#Method void setEmbeddedBitmapText(bool useEmbeddedBitmapText)
|
||||
|
||||
#In Font_Embedded_Bitmaps
|
||||
#Line # sets or clears Font_Embedded_Bitmaps ##
|
||||
Requests, but does not require, to use bitmaps in fonts instead of outlines.
|
||||
|
||||
Sets kEmbeddedBitmapText_Flag if useEmbeddedBitmapText is true.
|
||||
@ -1441,6 +1497,8 @@ Automatic_Hinting only affects platforms that use FreeType as the Font_Manager.
|
||||
|
||||
#Method bool isAutohinted() const
|
||||
|
||||
#In Automatic_Hinting
|
||||
#Line # returns true if Glyphs are always hinted ##
|
||||
If true, and if Hinting is set to kNormal_Hinting or kFull_Hinting, and if
|
||||
platform uses FreeType as the Font_Manager, instruct the Font_Manager to always hint
|
||||
Glyphs.
|
||||
@ -1470,6 +1528,8 @@ Automatic_Hinting only affects platforms that use FreeType as the Font_Manager.
|
||||
|
||||
#Method void setAutohinted(bool useAutohinter)
|
||||
|
||||
#In Automatic_Hinting
|
||||
#Line # sets Glyphs to always be hinted ##
|
||||
If Hinting is set to kNormal_Hinting or kFull_Hinting and useAutohinter is set,
|
||||
instruct the Font_Manager to always hint Glyphs.
|
||||
Automatic_Hinting has no effect if Hinting is set to kNo_Hinting or
|
||||
@ -1546,6 +1606,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isVerticalText() const
|
||||
|
||||
#In Vertical_Text
|
||||
#Line # returns true if Vertical_Text is set ##
|
||||
If true, Glyphs are drawn top to bottom instead of left to right.
|
||||
|
||||
Equivalent to getFlags masked with kVerticalText_Flag.
|
||||
@ -1570,6 +1632,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setVerticalText(bool verticalText)
|
||||
|
||||
#In Vertical_Text
|
||||
#Line # sets or clears Vertical_Text ##
|
||||
If true, text advance positions the next glyph below the previous glyph instead of to the
|
||||
right of previous glyph.
|
||||
|
||||
@ -1628,6 +1692,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isFakeBoldText() const
|
||||
|
||||
#In Fake_Bold
|
||||
#Line # returns true if Fake_Bold is set ##
|
||||
If true, approximate bold by increasing the stroke width when creating glyph bitmaps
|
||||
from outlines.
|
||||
|
||||
@ -1653,6 +1719,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setFakeBoldText(bool fakeBoldText)
|
||||
|
||||
#In Fake_Bold
|
||||
#Line # sets or clears Fake_Bold ##
|
||||
Use increased stroke width when creating glyph bitmaps to approximate a bold typeface.
|
||||
|
||||
Sets kFakeBoldText_Flag if fakeBoldText is true.
|
||||
@ -1689,6 +1757,8 @@ a specific pair of characters is adjusted using data in the font Kerning tables.
|
||||
|
||||
#Method bool isDevKernText() const
|
||||
|
||||
#In Full_Hinting_Spacing
|
||||
#Line # returns true if Full_Hinting_Spacing is set ##
|
||||
Returns if character spacing may be adjusted by the hinting difference.
|
||||
|
||||
Equivalent to getFlags masked with kDevKernText_Flag.
|
||||
@ -1708,6 +1778,8 @@ a specific pair of characters is adjusted using data in the font Kerning tables.
|
||||
|
||||
#Method void setDevKernText(bool devKernText)
|
||||
|
||||
#In Full_Hinting_Spacing
|
||||
#Line # sets or clears Full_Hinting_Spacing ##
|
||||
Requests, but does not require, to use hinting to adjust glyph spacing.
|
||||
|
||||
Sets kDevKernText_Flag if devKernText is true.
|
||||
@ -1767,6 +1839,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkFilterQuality getFilterQuality() const
|
||||
|
||||
#In Filter_Quality_Methods
|
||||
#Line # returns Filter_Quality, image filtering level ##
|
||||
Returns Filter_Quality, the image filtering level. A lower setting
|
||||
draws faster; a higher setting looks better when the image is scaled.
|
||||
|
||||
@ -1789,6 +1863,8 @@ draws faster; a higher setting looks better when the image is scaled.
|
||||
|
||||
#Method void setFilterQuality(SkFilterQuality quality)
|
||||
|
||||
#In Filter_Quality_Methods
|
||||
#Line # sets Filter_Quality, the image filtering level ##
|
||||
Sets Filter_Quality, 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 quality is valid.
|
||||
@ -1816,16 +1892,25 @@ Does not check to see if quality is valid.
|
||||
# ------------------------------------------------------------------------------
|
||||
#Topic Color_Methods
|
||||
|
||||
Color specifies the Color_RGB_Red, Color_RGB_Blue, Color_RGB_Green, and Color_Alpha 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.
|
||||
#Table
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# getColor # returns Color_Alpha and Color_RGB, one drawing color ##
|
||||
# setColor # sets Color_Alpha and Color_RGB, one drawing color ##
|
||||
#Table ##
|
||||
|
||||
Color is not Premultiplied;
|
||||
Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color_RGB_Blue, and Color_RGB_Green.
|
||||
Color specifies the Color_RGB_Red, Color_RGB_Blue, Color_RGB_Green, and Color_Alpha
|
||||
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.
|
||||
|
||||
The bit positions of Color_Alpha and Color_RGB are independent of the bit positions
|
||||
on the output device, which may have more or fewer bits, and may have a different arrangement.
|
||||
Color is not Premultiplied; Color_Alpha sets the transparency independent of
|
||||
Color_RGB: Color_RGB_Red, Color_RGB_Blue, and Color_RGB_Green.
|
||||
|
||||
The bit positions of Color_Alpha and Color_RGB are independent of the bit
|
||||
positions on the output device, which may have more or fewer bits, and may have
|
||||
a different arrangement.
|
||||
|
||||
#Table
|
||||
#Legend
|
||||
@ -1850,6 +1935,8 @@ on the output device, which may have more or fewer bits, and may have a differen
|
||||
|
||||
#Method SkColor getColor() const
|
||||
|
||||
#In Color_Methods
|
||||
#Line # returns Color_Alpha and Color_RGB, one drawing color ##
|
||||
Retrieves Alpha and Color_RGB, Unpremultiplied, packed into 32 bits.
|
||||
Use helpers SkColorGetA, SkColorGetR, SkColorGetG, and SkColorGetB to extract
|
||||
a color component.
|
||||
@ -1874,6 +1961,8 @@ on the output device, which may have more or fewer bits, and may have a differen
|
||||
|
||||
#Method void setColor(SkColor color)
|
||||
|
||||
#In Color_Methods
|
||||
#Line # sets Color_Alpha and Color_RGB, one drawing color ##
|
||||
Sets Alpha and Color_RGB used when stroking and filling. The color is a 32-bit value,
|
||||
Unpremultiplied, packing 8-bit components for Alpha, Red, Blue, and Green.
|
||||
|
||||
@ -1904,6 +1993,8 @@ Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color
|
||||
|
||||
#Method uint8_t getAlpha() const
|
||||
|
||||
#In Alpha_Methods
|
||||
#Line # returns Color_Alpha, color opacity ##
|
||||
Retrieves Alpha from the Color used when stroking and filling.
|
||||
|
||||
#Return Alpha ranging from zero, fully transparent, to 255, fully opaque ##
|
||||
@ -1921,6 +2012,8 @@ Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color
|
||||
|
||||
#Method void setAlpha(U8CPU a)
|
||||
|
||||
#In Alpha_Methods
|
||||
#Line # sets Color_Alpha, color opacity ##
|
||||
Replaces Alpha, leaving Color_RGB
|
||||
unchanged. An out of range value triggers an assert in the debug
|
||||
build. a is a value from zero to 255.
|
||||
@ -1946,6 +2039,8 @@ Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color
|
||||
|
||||
#Method void setARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
|
||||
|
||||
#In Color_Methods
|
||||
#Line # sets color by component ##
|
||||
Sets Color used when drawing solid fills. The color components range from 0 to 255.
|
||||
The color is Unpremultiplied; Alpha sets the transparency independent of Color_RGB.
|
||||
|
||||
@ -2078,6 +2173,8 @@ May be used to verify that Style is a legal value.
|
||||
|
||||
#Method Style getStyle() const
|
||||
|
||||
#In Style
|
||||
#Line # returns Style: stroke, fill, or both ##
|
||||
Whether the geometry is filled, stroked, or filled and stroked.
|
||||
|
||||
#Return one of:kFill_Style, kStroke_Style, kStrokeAndFill_Style ##
|
||||
@ -2097,6 +2194,8 @@ May be used to verify that Style is a legal value.
|
||||
|
||||
#Method void setStyle(Style style)
|
||||
|
||||
#In Style
|
||||
#Line # sets Style: stroke, fill, or both ##
|
||||
Sets whether the geometry is filled, stroked, or filled and stroked.
|
||||
Has no effect if style is not a legal Style value.
|
||||
|
||||
@ -2177,6 +2276,8 @@ The default width for the paint is zero.
|
||||
|
||||
#Method SkScalar getStrokeWidth() const
|
||||
|
||||
#In Stroke_Width
|
||||
#Line # returns thickness of the stroke ##
|
||||
Returns the thickness of the pen used by Paint to
|
||||
outline the shape.
|
||||
|
||||
@ -2195,6 +2296,8 @@ The default width for the paint is zero.
|
||||
|
||||
#Method void setStrokeWidth(SkScalar width)
|
||||
|
||||
#In Stroke_Width
|
||||
#Line # sets thickness of the stroke ##
|
||||
Sets the thickness of the pen used by the paint to
|
||||
outline the shape.
|
||||
Has no effect if width is less than zero.
|
||||
@ -2298,6 +2401,8 @@ Here are some miter limits and the angles that triggers them.
|
||||
|
||||
#Method SkScalar getStrokeMiter() const
|
||||
|
||||
#In Miter_Limit
|
||||
#Line # returns Miter_Limit, angles with sharp corners ##
|
||||
The limit at which a sharp corner is drawn beveled.
|
||||
|
||||
#Return zero and greater Miter_Limit ##
|
||||
@ -2317,6 +2422,8 @@ Here are some miter limits and the angles that triggers them.
|
||||
|
||||
#Method void setStrokeMiter(SkScalar miter)
|
||||
|
||||
#In Miter_Limit
|
||||
#Line # sets Miter_Limit, angles with sharp corners ##
|
||||
The limit at which a sharp corner is drawn beveled.
|
||||
Valid values are zero and greater.
|
||||
Has no effect if miter is less than zero.
|
||||
@ -2421,6 +2528,8 @@ Stroke_Cap is kButt_Cap by default.
|
||||
|
||||
#Method Cap getStrokeCap() const
|
||||
|
||||
#In Stroke_Cap
|
||||
#Line # returns Cap, the area drawn at path ends ##
|
||||
The geometry drawn at the beginning and end of strokes.
|
||||
|
||||
#Return one of: kButt_Cap, kRound_Cap, kSquare_Cap ##
|
||||
@ -2440,6 +2549,8 @@ Stroke_Cap is kButt_Cap by default.
|
||||
|
||||
#Method void setStrokeCap(Cap cap)
|
||||
|
||||
#In Stroke_Cap
|
||||
#Line # sets Cap, the area drawn at path ends ##
|
||||
The geometry drawn at the beginning and end of strokes.
|
||||
|
||||
#Param cap one of: kButt_Cap, kRound_Cap, kSquare_Cap;
|
||||
@ -2570,6 +2681,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method Join getStrokeJoin() const
|
||||
|
||||
#In Stroke_Join
|
||||
#Line # returns Join, geometry on path corners ##
|
||||
The geometry drawn at the corners of strokes.
|
||||
|
||||
#Return one of: kMiter_Join, kRound_Join, kBevel_Join ##
|
||||
@ -2589,6 +2702,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setStrokeJoin(Join join)
|
||||
|
||||
#In Stroke_Join
|
||||
#Line # sets Join, geometry on path corners ##
|
||||
The geometry drawn at the corners of strokes.
|
||||
|
||||
#Param join one of: kMiter_Join, kRound_Join, kBevel_Join;
|
||||
@ -2636,6 +2751,8 @@ returns false since Hairline has no filled equivalent.
|
||||
|
||||
#Method bool getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect,
|
||||
SkScalar resScale = 1) const
|
||||
#In Fill_Path
|
||||
#Line # returns fill path equivalent to stroke ##
|
||||
|
||||
The filled equivalent of the stroked path.
|
||||
|
||||
@ -2683,6 +2800,7 @@ returns false since Hairline has no filled equivalent.
|
||||
|
||||
#Method bool getFillPath(const SkPath& src, SkPath* dst) const
|
||||
|
||||
#In Fill_Path
|
||||
The filled equivalent of the stroked path.
|
||||
|
||||
Replaces dst with the src path modified by Path_Effect and Style_Stroke.
|
||||
@ -2765,6 +2883,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkShader* getShader() const
|
||||
|
||||
#In Shader_Methods
|
||||
#Line # returns Shader, multiple drawing colors; gradients ##
|
||||
Optional colors used when filling a path, such as a gradient.
|
||||
|
||||
Does not alter Shader Reference_Count.
|
||||
@ -2789,6 +2909,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method sk_sp<SkShader> refShader() const
|
||||
|
||||
#In Shader_Methods
|
||||
#Line # references Shader, multiple drawing colors; gradients ##
|
||||
Optional colors used when filling a path, such as a gradient.
|
||||
|
||||
Increases Shader Reference_Count by one.
|
||||
@ -2814,6 +2936,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setShader(sk_sp<SkShader> shader)
|
||||
|
||||
#In Shader_Methods
|
||||
#Line # sets Shader, multiple drawing colors; gradients ##
|
||||
Optional colors used when filling a path, such as a gradient.
|
||||
|
||||
Sets Shader to shader, decreasing Reference_Count of the previous Shader.
|
||||
@ -2863,6 +2987,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkColorFilter* getColorFilter() const
|
||||
|
||||
#In Color_Filter_Methods
|
||||
#Line # returns Color_Filter, how colors are altered ##
|
||||
Returns Color_Filter if set, or nullptr.
|
||||
Does not alter Color_Filter Reference_Count.
|
||||
|
||||
@ -2885,6 +3011,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method sk_sp<SkColorFilter> refColorFilter() const
|
||||
|
||||
#In Color_Filter_Methods
|
||||
#Line # references Color_Filter, how colors are altered ##
|
||||
Returns Color_Filter if set, or nullptr.
|
||||
Increases Color_Filter Reference_Count by one.
|
||||
|
||||
@ -2908,6 +3036,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setColorFilter(sk_sp<SkColorFilter> colorFilter)
|
||||
|
||||
#In Color_Filter_Methods
|
||||
#Line # sets Color_Filter, alters color ##
|
||||
Sets Color_Filter to filter, decreasing Reference_Count of the previous
|
||||
Color_Filter. Pass nullptr to clear Color_Filter.
|
||||
|
||||
@ -2957,6 +3087,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkBlendMode getBlendMode() const
|
||||
|
||||
#In Blend_Mode_Methods
|
||||
#Line # returns Blend_Mode, how colors combine with Device ##
|
||||
Returns Blend_Mode.
|
||||
By default, returns SkBlendMode::kSrcOver.
|
||||
|
||||
@ -2982,6 +3114,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isSrcOver() const
|
||||
|
||||
#In Blend_Mode_Methods
|
||||
#Line # returns true if Blend_Mode is SkBlendMode::kSrcOver ##
|
||||
Returns true if Blend_Mode is SkBlendMode::kSrcOver, the default.
|
||||
|
||||
#Return true if Blend_Mode is SkBlendMode::kSrcOver ##
|
||||
@ -3004,6 +3138,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setBlendMode(SkBlendMode mode)
|
||||
|
||||
#In Blend_Mode_Methods
|
||||
#Line # sets Blend_Mode, how colors combine with destination ##
|
||||
Sets Blend_Mode to mode.
|
||||
Does not check for valid input.
|
||||
|
||||
@ -3049,6 +3185,8 @@ If Paint has no Path_Effect, the path geometry is unaltered when filled or strok
|
||||
|
||||
#Method SkPathEffect* getPathEffect() const
|
||||
|
||||
#In Path_Effect_Methods
|
||||
#Line # returns Path_Effect, modifications to path geometry; dashing ##
|
||||
Returns Path_Effect if set, or nullptr.
|
||||
Does not alter Path_Effect Reference_Count.
|
||||
|
||||
@ -3073,6 +3211,8 @@ If Paint has no Path_Effect, the path geometry is unaltered when filled or strok
|
||||
|
||||
#Method sk_sp<SkPathEffect> refPathEffect() const
|
||||
|
||||
#In Path_Effect_Methods
|
||||
#Line # references Path_Effect, modifications to path geometry; dashing ##
|
||||
Returns Path_Effect if set, or nullptr.
|
||||
Increases Path_Effect Reference_Count by one.
|
||||
|
||||
@ -3099,6 +3239,8 @@ If Paint has no Path_Effect, the path geometry is unaltered when filled or strok
|
||||
|
||||
#Method void setPathEffect(sk_sp<SkPathEffect> pathEffect)
|
||||
|
||||
#In Path_Effect_Methods
|
||||
#Line # sets Path_Effect, modifications to path geometry; dashing ##
|
||||
Sets Path_Effect to pathEffect, decreasing Reference_Count of the previous
|
||||
Path_Effect. Pass nullptr to leave the path geometry unaltered.
|
||||
|
||||
@ -3137,6 +3279,8 @@ modifying the draw.
|
||||
|
||||
#Method SkMaskFilter* getMaskFilter() const
|
||||
|
||||
#In Mask_Filter_Methods
|
||||
#Line # returns Mask_Filter, alterations to Mask_Alpha ##
|
||||
Returns Mask_Filter if set, or nullptr.
|
||||
Does not alter Mask_Filter Reference_Count.
|
||||
|
||||
@ -3160,6 +3304,8 @@ modifying the draw.
|
||||
|
||||
#Method sk_sp<SkMaskFilter> refMaskFilter() const
|
||||
|
||||
#In Mask_Filter_Methods
|
||||
#Line # references Mask_Filter, alterations to Mask_Alpha ##
|
||||
Returns Mask_Filter if set, or nullptr.
|
||||
|
||||
Increases Mask_Filter Reference_Count by one.
|
||||
@ -3185,6 +3331,8 @@ modifying the draw.
|
||||
|
||||
#Method void setMaskFilter(sk_sp<SkMaskFilter> maskFilter)
|
||||
|
||||
#In Mask_Filter_Methods
|
||||
#Line # sets Mask_Filter, alterations to Mask_Alpha ##
|
||||
Sets Mask_Filter to maskFilter, decreasing Reference_Count of the previous
|
||||
Mask_Filter. Pass nullptr to clear Mask_Filter and leave Mask_Filter effect on
|
||||
Mask_Alpha unaltered.
|
||||
@ -3230,6 +3378,8 @@ implementation.
|
||||
|
||||
#Method SkTypeface* getTypeface() const
|
||||
|
||||
#In Typeface_Methods
|
||||
#Line # returns Typeface, font description ##
|
||||
Returns Typeface if set, or nullptr.
|
||||
Increments Typeface Reference_Count by one.
|
||||
|
||||
@ -3253,6 +3403,8 @@ implementation.
|
||||
|
||||
#Method sk_sp<SkTypeface> refTypeface() const
|
||||
|
||||
#In Typeface_Methods
|
||||
#Line # references Typeface, font description ##
|
||||
Increases Typeface Reference_Count by one.
|
||||
|
||||
#Return Typeface if previously set, nullptr otherwise ##
|
||||
@ -3280,6 +3432,8 @@ implementation.
|
||||
|
||||
#Method void setTypeface(sk_sp<SkTypeface> typeface)
|
||||
|
||||
#In Typeface_Methods
|
||||
#Line # sets Typeface, font description ##
|
||||
Sets Typeface to typeface, decreasing Reference_Count of the previous Typeface.
|
||||
Pass nullptr to clear Typeface and use the default typeface. Increments
|
||||
typeface Reference_Count by one.
|
||||
@ -3332,6 +3486,8 @@ Mask_Filter.
|
||||
|
||||
#Method SkImageFilter* getImageFilter() const
|
||||
|
||||
#In Image_Filter_Methods
|
||||
#Line # returns Image_Filter, alter pixels; blur ##
|
||||
Returns Image_Filter if set, or nullptr.
|
||||
Does not alter Image_Filter Reference_Count.
|
||||
|
||||
@ -3355,6 +3511,8 @@ Mask_Filter.
|
||||
|
||||
#Method sk_sp<SkImageFilter> refImageFilter() const
|
||||
|
||||
#In Image_Filter_Methods
|
||||
#Line # references Image_Filter, alter pixels; blur ##
|
||||
Returns Image_Filter if set, or nullptr.
|
||||
Increases Image_Filter Reference_Count by one.
|
||||
|
||||
@ -3379,6 +3537,8 @@ Mask_Filter.
|
||||
|
||||
#Method void setImageFilter(sk_sp<SkImageFilter> imageFilter)
|
||||
|
||||
#In Image_Filter_Methods
|
||||
#Line # sets Image_Filter, alter pixels; blur ##
|
||||
Sets Image_Filter to imageFilter, decreasing Reference_Count of the previous
|
||||
Image_Filter. Pass nullptr to clear Image_Filter, and remove Image_Filter effect
|
||||
on drawing.
|
||||
@ -3440,6 +3600,8 @@ Set Draw_Looper to nullptr to prevent Draw_Looper from modifying the draw.
|
||||
|
||||
#Method SkDrawLooper* getDrawLooper() const
|
||||
|
||||
#In Draw_Looper_Methods
|
||||
#Line # returns Draw_Looper, multiple layers ##
|
||||
Returns Draw_Looper if set, or nullptr.
|
||||
Does not alter Draw_Looper Reference_Count.
|
||||
|
||||
@ -3464,6 +3626,8 @@ Set Draw_Looper to nullptr to prevent Draw_Looper from modifying the draw.
|
||||
|
||||
#Method sk_sp<SkDrawLooper> refDrawLooper() const
|
||||
|
||||
#In Draw_Looper_Methods
|
||||
#Line # references Draw_Looper, multiple layers ##
|
||||
Returns Draw_Looper if set, or nullptr.
|
||||
Increases Draw_Looper Reference_Count by one.
|
||||
|
||||
@ -3489,6 +3653,7 @@ Set Draw_Looper to nullptr to prevent Draw_Looper from modifying the draw.
|
||||
|
||||
#Method SkDrawLooper* getLooper() const
|
||||
|
||||
#In Draw_Looper_Methods
|
||||
Deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -3500,6 +3665,8 @@ Deprecated.
|
||||
|
||||
#Method void setDrawLooper(sk_sp<SkDrawLooper> drawLooper)
|
||||
|
||||
#In Draw_Looper_Methods
|
||||
#Line # sets Draw_Looper, multiple layers ##
|
||||
Sets Draw_Looper to drawLooper, decreasing Reference_Count of the previous
|
||||
drawLooper. Pass nullptr to clear Draw_Looper and leave Draw_Looper effect on
|
||||
drawing unaltered.
|
||||
@ -3525,6 +3692,7 @@ Increments drawLooper Reference_Count by one.
|
||||
|
||||
#Method void setLooper(sk_sp<SkDrawLooper> drawLooper)
|
||||
|
||||
#In Draw_Looper_Methods
|
||||
Deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -3635,6 +3803,8 @@ Align defaults to kLeft_Align.
|
||||
|
||||
#Method Align getTextAlign() const
|
||||
|
||||
#In Text_Align
|
||||
#Line # returns Align: left, center, or right ##
|
||||
Returns Text_Align.
|
||||
Returns kLeft_Align if Text_Align has not been set.
|
||||
|
||||
@ -3652,6 +3822,8 @@ Align defaults to kLeft_Align.
|
||||
|
||||
#Method void setTextAlign(Align align)
|
||||
|
||||
#In Text_Align
|
||||
#Line # sets Align: left, center, or right ##
|
||||
Sets Text_Align to align.
|
||||
Has no effect if align is an invalid value.
|
||||
|
||||
@ -3699,6 +3871,8 @@ Set SkPaintDefaults_TextSize at compile time to change the default setting.
|
||||
|
||||
#Method SkScalar getTextSize() const
|
||||
|
||||
#In Text_Size
|
||||
#Line # returns text size in points ##
|
||||
Returns Text_Size in points.
|
||||
|
||||
#Return typographic height of text ##
|
||||
@ -3712,6 +3886,8 @@ Set SkPaintDefaults_TextSize at compile time to change the default setting.
|
||||
|
||||
#Method void setTextSize(SkScalar textSize)
|
||||
|
||||
#In Text_Size
|
||||
#Line # sets text size in points ##
|
||||
Sets Text_Size in points.
|
||||
Has no effect if textSize is not greater than or equal to zero.
|
||||
|
||||
@ -3753,6 +3929,8 @@ Text_Scale_X defaults to 1.
|
||||
|
||||
#Method SkScalar getTextScaleX() const
|
||||
|
||||
#In Text_Scale_X
|
||||
#Line # returns the text horizontal scale; condensed text ##
|
||||
Returns Text_Scale_X.
|
||||
Default value is 1.
|
||||
|
||||
@ -3768,6 +3946,8 @@ Text_Scale_X defaults to 1.
|
||||
|
||||
#Method void setTextScaleX(SkScalar scaleX)
|
||||
|
||||
#In Text_Scale_X
|
||||
#Line # sets the text horizontal scale; condensed text ##
|
||||
Sets Text_Scale_X.
|
||||
Default value is 1.
|
||||
|
||||
@ -3809,6 +3989,8 @@ Text_Skew_X defaults to 0.
|
||||
|
||||
#Method SkScalar getTextSkewX() const
|
||||
|
||||
#In Text_Skew_X
|
||||
#Line # returns the text horizontal skew; oblique text ##
|
||||
Returns Text_Skew_X.
|
||||
Default value is zero.
|
||||
|
||||
@ -3823,6 +4005,8 @@ Text_Skew_X defaults to 0.
|
||||
|
||||
#Method void setTextSkewX(SkScalar skewX)
|
||||
|
||||
#In Text_Skew_X
|
||||
#Line # sets the text horizontal skew; oblique text ##
|
||||
Sets Text_Skew_X.
|
||||
Default value is zero.
|
||||
|
||||
@ -3918,6 +4102,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method TextEncoding getTextEncoding() const
|
||||
|
||||
#In Text_Encoding
|
||||
#Line # returns character or glyph encoded size ##
|
||||
Returns Text_Encoding.
|
||||
Text_Encoding determines how character code points are mapped to font glyph indices.
|
||||
|
||||
@ -3944,6 +4130,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setTextEncoding(TextEncoding encoding)
|
||||
|
||||
#In Text_Encoding
|
||||
#Line # sets character or glyph encoded size ##
|
||||
Sets Text_Encoding to encoding.
|
||||
Text_Encoding determines how character code points are mapped to font glyph indices.
|
||||
Invalid values for encoding are ignored.
|
||||
@ -4247,6 +4435,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkScalar getFontMetrics(FontMetrics* metrics, SkScalar scale = 0) const
|
||||
|
||||
#In Font_Metrics
|
||||
#Line # returns Typeface metrics scaled by text size ##
|
||||
Returns Font_Metrics associated with Typeface.
|
||||
The return value is the recommended spacing between lines: the sum of metrics
|
||||
descent, ascent, and leading.
|
||||
@ -4285,6 +4475,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkScalar getFontSpacing() const
|
||||
|
||||
#In Font_Metrics
|
||||
#Line # returns recommended spacing between lines ##
|
||||
Returns the recommended spacing between lines: the sum of metrics
|
||||
descent, ascent, and leading.
|
||||
Result is scaled by Text_Size but does not take into account
|
||||
@ -4313,6 +4505,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkRect getFontBounds() const
|
||||
|
||||
#In Font_Metrics
|
||||
#Line # returns union all glyph bounds ##
|
||||
Returns the union of bounds of all Glyphs.
|
||||
Returned dimensions are computed by Font_Manager from font data,
|
||||
ignoring Hinting. Includes Text_Size, Text_Scale_X,
|
||||
@ -4345,6 +4539,7 @@ FontMetrics::fTop, FontMetrics::fXMax, FontMetrics::fBottom }.
|
||||
|
||||
#Method int textToGlyphs(const void* text, size_t byteLength,
|
||||
SkGlyphID glyphs[]) const
|
||||
#Line # converts text into glyph indices ##
|
||||
|
||||
Converts text into glyph indices.
|
||||
Returns the number of glyph indices represented by text.
|
||||
@ -4384,6 +4579,7 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method int countText(const void* text, size_t byteLength) const
|
||||
|
||||
#Line # returns number of Glyphs in text ##
|
||||
Returns the number of Glyphs in text.
|
||||
Uses Text_Encoding to count the Glyphs.
|
||||
Returns the same result as textToGlyphs.
|
||||
@ -4408,6 +4604,7 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method bool containsText(const void* text, size_t byteLength) const
|
||||
|
||||
#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
|
||||
Typeface.
|
||||
@ -4475,6 +4672,7 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method void glyphsToUnichars(const SkGlyphID glyphs[],
|
||||
int count, SkUnichar text[]) const
|
||||
#Line # converts Glyphs into text ##
|
||||
|
||||
Converts glyphs into text if possible.
|
||||
Glyph values without direct Unicode equivalents are mapped to zero.
|
||||
@ -4514,6 +4712,8 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method SkScalar measureText(const void* text, size_t length, SkRect* bounds) const
|
||||
|
||||
#In Measure_Text
|
||||
#Line # returns advance width and bounds of text ##
|
||||
Returns the advance width of text if kVerticalText_Flag is clear,
|
||||
and the height of text if kVerticalText_Flag is set.
|
||||
The advance is the normal distance to move before drawing additional text.
|
||||
@ -4550,6 +4750,7 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method SkScalar measureText(const void* text, size_t length) const
|
||||
|
||||
#In Measure_Text
|
||||
Returns the advance width of text if kVerticalText_Flag is clear,
|
||||
and the height of text if kVerticalText_Flag is set.
|
||||
The advance is the normal distance to move before drawing additional text.
|
||||
@ -4578,6 +4779,8 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method size_t breakText(const void* text, size_t length, SkScalar maxWidth,
|
||||
SkScalar* measuredWidth = nullptr) const
|
||||
#In Measure_Text
|
||||
#Line # returns text that fits in a width ##
|
||||
|
||||
Returns the bytes of text that fit within maxWidth.
|
||||
If kVerticalText_Flag is clear, the text fragment fits if its advance width is less than or
|
||||
@ -4622,6 +4825,8 @@ text contains an invalid UTF-8 sequence, zero is returned.
|
||||
|
||||
#Method int getTextWidths(const void* text, size_t byteLength, SkScalar widths[],
|
||||
SkRect bounds[] = nullptr) const
|
||||
#In Measure_Text
|
||||
#Line # returns advance and bounds for each glyph in text ##
|
||||
|
||||
Retrieves the advance and bounds for each glyph in text, and returns
|
||||
the glyph count in text.
|
||||
@ -4689,6 +4894,8 @@ Text_Path describes the geometry of Glyphs used to draw text.
|
||||
|
||||
#Method void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y,
|
||||
SkPath* path) const
|
||||
#In Text_Path
|
||||
#Line # returns Path equivalent to text ##
|
||||
|
||||
Returns the geometry as Path equivalent to the drawn text.
|
||||
Uses Text_Encoding to decode text, Typeface to get the glyph paths,
|
||||
@ -4725,6 +4932,8 @@ Uses x, y, and Text_Align to position path.
|
||||
|
||||
#Method void getPosTextPath(const void* text, size_t length,
|
||||
const SkPoint pos[], SkPath* path) const
|
||||
#In Text_Path
|
||||
#Line # returns Path equivalent to positioned text ##
|
||||
|
||||
Returns the geometry as Path equivalent to the drawn text.
|
||||
Uses Text_Encoding to decode text, Typeface to get the glyph paths,
|
||||
@ -4767,6 +4976,8 @@ underline that skips Descenders.
|
||||
|
||||
#Method int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar y,
|
||||
const SkScalar bounds[2], SkScalar* intervals) const
|
||||
#In Text_Intercepts
|
||||
#Line # returns where lines intersect text; underlines ##
|
||||
|
||||
Returns the number of intervals that intersect bounds.
|
||||
bounds describes a pair of lines parallel to the text advance.
|
||||
@ -4820,6 +5031,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[],
|
||||
const SkScalar bounds[2], SkScalar* intervals) const
|
||||
#In Text_Intercepts
|
||||
#Line # returns where lines intersect positioned text; underlines ##
|
||||
|
||||
Returns the number of intervals that intersect bounds.
|
||||
bounds describes a pair of lines parallel to the text advance.
|
||||
@ -4873,6 +5086,8 @@ void draw(SkCanvas* canvas) {
|
||||
#Method int getPosTextHIntercepts(const void* text, size_t length, const SkScalar xpos[],
|
||||
SkScalar constY, const SkScalar bounds[2],
|
||||
SkScalar* intervals) const
|
||||
#In Text_Intercepts
|
||||
#Line # returns where lines intersect horizontally positioned text; underlines ##
|
||||
|
||||
Returns the number of intervals that intersect bounds.
|
||||
bounds describes a pair of lines parallel to the text advance.
|
||||
@ -4931,6 +5146,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method int getTextBlobIntercepts(const SkTextBlob* blob, const SkScalar bounds[2],
|
||||
SkScalar* intervals) const
|
||||
#In Text_Intercepts
|
||||
#Line # returns where lines intersect Text_Blob; underlines ##
|
||||
|
||||
Returns the number of intervals that intersect bounds.
|
||||
bounds describes a pair of lines parallel to the text advance.
|
||||
@ -4991,6 +5208,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool nothingToDraw() const
|
||||
|
||||
#Line # returns true if Paint prevents all drawing ##
|
||||
Returns true if Paint prevents all drawing;
|
||||
otherwise, the Paint may or may not allow drawing.
|
||||
|
||||
@ -5035,7 +5253,9 @@ Fast_Bounds methods conservatively outset a drawing bounds by additional area
|
||||
Paint may draw to.
|
||||
|
||||
#Method bool canComputeFastBounds() const
|
||||
#Private
|
||||
|
||||
#In Fast_Bounds
|
||||
#Line # returns true if settings allow for fast bounds computation ###Private
|
||||
(to be made private)
|
||||
##
|
||||
|
||||
@ -5047,7 +5267,9 @@ Paint may draw to.
|
||||
##
|
||||
|
||||
#Method const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const
|
||||
#Private
|
||||
|
||||
#In Fast_Bounds
|
||||
#Line # returns fill bounds for quick reject tests ###Private
|
||||
(to be made private)
|
||||
##
|
||||
|
||||
@ -5082,6 +5304,8 @@ Paint may draw to.
|
||||
|
||||
#Method const SkRect& computeFastStrokeBounds(const SkRect& orig,
|
||||
SkRect* storage) const
|
||||
#In Fast_Bounds
|
||||
#Line # returns stroke bounds for quick reject tests ##
|
||||
#Private
|
||||
(to be made private)
|
||||
##
|
||||
@ -5094,6 +5318,8 @@ Paint may draw to.
|
||||
|
||||
#Method const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage,
|
||||
Style style) const
|
||||
#In Fast_Bounds
|
||||
#Line # returns bounds for quick reject tests ##
|
||||
#Private
|
||||
(to be made private)
|
||||
##
|
||||
@ -5114,6 +5340,7 @@ Paint may draw to.
|
||||
# ------------------------------------------------------------------------------
|
||||
#Method void toString(SkString* str) const
|
||||
|
||||
#Line # converts Paint to machine readable form ##
|
||||
#DefinedBy SK_TO_STRING_NONVIRT() ##
|
||||
|
||||
#Private
|
||||
|
@ -518,6 +518,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkPath()
|
||||
|
||||
#Line # constructs with default values ##
|
||||
By default, Path has no Verbs, no Points, and no Weights.
|
||||
Fill_Type is set to kWinding_FillType.
|
||||
|
||||
@ -539,6 +540,7 @@ path is empty
|
||||
|
||||
#Method SkPath(const SkPath& path)
|
||||
|
||||
#Line # makes a shallow copy ##
|
||||
Copy constructor makes two paths identical by value. Internally, path and
|
||||
the returned result share pointer values. The underlying Verb_Array, Point_Array
|
||||
and Weights are copied when modified.
|
||||
@ -582,6 +584,7 @@ path2 verbs: 3
|
||||
|
||||
#Method ~SkPath()
|
||||
|
||||
#Line # decreases Reference_Count of owned objects ##
|
||||
Releases ownership of any shared data and deletes data if Path is sole owner.
|
||||
|
||||
#Example
|
||||
@ -605,6 +608,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method SkPath& operator=(const SkPath& path)
|
||||
|
||||
#Line # makes a shallow copy ##
|
||||
Path assignment makes two paths identical by value. Internally, assignment
|
||||
shares pointer values. The underlying Verb_Array, Point_Array and Weights
|
||||
are copied when modified.
|
||||
@ -639,6 +643,7 @@ path2 bounds = 10, 20, 30, 40
|
||||
|
||||
#Method bool operator==(const SkPath& a, const SkPath& b)
|
||||
|
||||
#Line # compares paths for equality ##
|
||||
Compares a and b; returns true if Fill_Type, Verb_Array, Point_Array, and Weights
|
||||
are equivalent.
|
||||
|
||||
@ -681,6 +686,7 @@ reset one == two
|
||||
|
||||
#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
|
||||
are not equivalent.
|
||||
|
||||
@ -721,6 +727,7 @@ convexity !=
|
||||
|
||||
#Method bool isInterpolatable(const SkPath& compare) const
|
||||
|
||||
#Line # returns if pair contains equal counts of Verb_Array and Weights ##
|
||||
Return true if Paths contain equal Verbs and equal Weights.
|
||||
If Paths contain one or more Conics, the Weights must match.
|
||||
|
||||
@ -754,6 +761,7 @@ paths are interpolatable
|
||||
|
||||
#Method bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const
|
||||
|
||||
#Line # interpolates between Path pair ##
|
||||
Interpolate between Paths with Point_Array of equal size.
|
||||
Copy Verb_Array and Weights to out, and set out Point_Array to a weighted
|
||||
average of this Point_Array and ending Point_Array, using the formula:
|
||||
@ -808,6 +816,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool unique() const
|
||||
|
||||
#Line # returns if data has single owner ##
|
||||
#Private
|
||||
To be deprecated; only valid for Android framework.
|
||||
##
|
||||
@ -924,6 +933,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#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.
|
||||
|
||||
@ -951,6 +962,8 @@ default path fill type is kWinding_FillType
|
||||
|
||||
#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.
|
||||
|
||||
@ -978,6 +991,8 @@ If empty Path is set to inverse FillType, it fills all pixels.
|
||||
|
||||
#Method bool isInverseFillType() const
|
||||
|
||||
#In Fill_Type
|
||||
#Line # returns if Fill_Type fills outside geometry ##
|
||||
Returns if FillType describes area outside Path geometry. The inverse fill area
|
||||
extends indefinitely.
|
||||
|
||||
@ -1000,6 +1015,8 @@ default path fill type is inverse: false
|
||||
|
||||
#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.
|
||||
|
||||
@ -1092,6 +1109,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method Convexity getConvexity() const
|
||||
|
||||
#In Convexity
|
||||
#Line # returns geometry convexity, computing if necessary ##
|
||||
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.
|
||||
@ -1123,6 +1142,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method Convexity getConvexityOrUnknown() const
|
||||
|
||||
#In Convexity
|
||||
#Line # returns geometry convexity if known ##
|
||||
Returns last computed Convexity, or kUnknown_Convexity if
|
||||
Path has been altered since Convexity was computed or set.
|
||||
|
||||
@ -1159,6 +1180,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setConvexity(Convexity convexity)
|
||||
|
||||
#In Convexity
|
||||
#Line # sets if geometry is convex to avoid future computation ##
|
||||
Stores convexity so that it is later returned by getConvexity or getConvexityOrUnknown.
|
||||
convexity may differ from getConvexity, although setting an incorrect value may
|
||||
cause incorrect or inefficient drawing.
|
||||
@ -1197,6 +1220,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isConvex() const
|
||||
|
||||
#In Convexity
|
||||
#Line # returns if geometry is convex ##
|
||||
Computes Convexity if required, and returns true if value is kConvex_Convexity.
|
||||
If setConvexity was called with kConvex_Convexity or kConcave_Convexity, and
|
||||
the path has not been altered, Convexity is not recomputed.
|
||||
@ -1231,6 +1256,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setIsConvex(bool isConvex)
|
||||
|
||||
#In Convexity
|
||||
#Line # deprecated ##
|
||||
Deprecated. Use setConvexity.
|
||||
|
||||
#Deprecated
|
||||
@ -1249,6 +1276,7 @@ Deprecated. Use setConvexity.
|
||||
|
||||
#Method bool isOval(SkRect* rect, Direction* dir = nullptr,
|
||||
unsigned* start = nullptr) const
|
||||
#Line # returns if describes Oval ##
|
||||
|
||||
Returns true if constructed by addCircle, addOval; and in some cases,
|
||||
addRoundRect, addRRect. Path constructed with conicTo or rConicTo will not
|
||||
@ -1304,6 +1332,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isRRect(SkRRect* rrect, Direction* dir = nullptr,
|
||||
unsigned* start = nullptr) const
|
||||
#Line # returns if describes Round_Rect ##
|
||||
|
||||
Returns true if constructed by addRoundRect, addRRect; and if construction
|
||||
is not empty, not Rect, and not Oval. Path constructed with other calls
|
||||
@ -1364,6 +1393,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void reset()
|
||||
|
||||
#Line # removes Verb_Array, Point_Array, and Weights; frees memory ##
|
||||
Sets Path to its initial state.
|
||||
Removes Verb_Array, Point_Array, and Weights, and sets FillType to kWinding_FillType.
|
||||
Internal storage associated with Path is released.
|
||||
@ -1385,6 +1415,7 @@ Internal storage associated with Path is released.
|
||||
|
||||
#Method void rewind()
|
||||
|
||||
#Line # removes Verb_Array, Point_Array, and Weights, keeping memory ##
|
||||
Sets Path to its initial state, preserving internal storage.
|
||||
Removes Verb_Array, Point_Array, and Weights, and sets FillType to kWinding_FillType.
|
||||
Internal storage associated with Path is retained.
|
||||
@ -1413,6 +1444,7 @@ a newly initialized path.
|
||||
|
||||
#Method bool isEmpty() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -1451,6 +1483,7 @@ after reset path is empty
|
||||
|
||||
#Method bool isLastContourClosed() const
|
||||
|
||||
#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.
|
||||
|
||||
@ -1491,6 +1524,7 @@ after close last contour is closed
|
||||
|
||||
#Method bool isFinite() const
|
||||
|
||||
#Line # returns if all Point values are finite ##
|
||||
Returns true for finite Point array values between negative SK_ScalarMax and
|
||||
positive SK_ScalarMax. Returns false for any Point array value of
|
||||
SK_ScalarInfinity, SK_ScalarNegativeInfinity, or SK_ScalarNaN.
|
||||
@ -1525,6 +1559,7 @@ after scale path is not finite
|
||||
|
||||
#Method bool isVolatile() const
|
||||
|
||||
#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
|
||||
Surface to attach a cache of data which speeds repeated drawing. If true, Surface
|
||||
@ -1548,6 +1583,7 @@ volatile by default is false
|
||||
|
||||
#Method void setIsVolatile(bool isVolatile)
|
||||
|
||||
#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
|
||||
Device to attach a cache of data which speeds repeated drawing.
|
||||
@ -1588,6 +1624,7 @@ 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)
|
||||
|
||||
#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.
|
||||
@ -1633,6 +1670,7 @@ line from (100,100) to (100.0001,100.0001) is not degenerate, exactly
|
||||
|
||||
#Method static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2,
|
||||
const SkPoint& p3, bool exact)
|
||||
#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
|
||||
@ -1685,6 +1723,7 @@ quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly
|
||||
|
||||
#Method static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2,
|
||||
const SkPoint& p3, const SkPoint& p4, bool exact)
|
||||
#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
|
||||
@ -1731,6 +1770,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isLine(SkPoint line[2]) const
|
||||
|
||||
#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
|
||||
@ -1788,6 +1828,8 @@ getPoint, with Iter, or with RawIter.
|
||||
|
||||
#Method int getPoints(SkPoint points[], int max) const
|
||||
|
||||
#In Point_Array
|
||||
#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.
|
||||
@ -1829,6 +1871,8 @@ just right point count: 3 (0,0) (20,20) (-10,-10)
|
||||
|
||||
#Method int countPoints() const
|
||||
|
||||
#In Point_Array
|
||||
#Line # returns Point_Array length ##
|
||||
Returns the number of points in Path.
|
||||
Point count is initially zero.
|
||||
|
||||
@ -1863,6 +1907,8 @@ second move point count: 3
|
||||
|
||||
#Method SkPoint getPoint(int index) const
|
||||
|
||||
#In Point_Array
|
||||
#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.
|
||||
@ -1909,6 +1955,8 @@ 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,
|
||||
kCubic_Verb, and kClose_Verb; added to Path.
|
||||
|
||||
@ -1931,6 +1979,8 @@ round rect verb count: 10
|
||||
|
||||
#Method int getVerbs(uint8_t verbs[], int max) const
|
||||
|
||||
#In Verb_Array
|
||||
#Line # returns Verb_Array ##
|
||||
Returns the number of verbs in the path. Up to max verbs are copied. The
|
||||
verbs are copied as one byte per verb.
|
||||
|
||||
@ -1976,6 +2026,7 @@ just right verb count: 3 move line line
|
||||
|
||||
#Method void swap(SkPath& other)
|
||||
|
||||
#Line # exchanges Path pair ##
|
||||
Exchanges the Verb_Array, Point_Array, Weights, and Fill_Type with other.
|
||||
Cached state is also exchanged. swap() internally exchanges pointers, so
|
||||
it is lightweight and does not allocate memory.
|
||||
@ -2008,6 +2059,7 @@ path2 bounds = 10, 20, 30, 40
|
||||
|
||||
#Method const SkRect& getBounds() const
|
||||
|
||||
#Line # returns maximum and minimum 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.
|
||||
@ -2050,6 +2102,7 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553
|
||||
|
||||
#Method void updateBoundsCache() const
|
||||
|
||||
#Line # refreshes result of getBounds ##
|
||||
Update internal bounds so that subsequent calls to getBounds are instantaneous.
|
||||
Unaltered copies of Path may also access cached bounds through getBounds.
|
||||
|
||||
@ -2090,6 +2143,7 @@ cached avg: 0.182784 ms
|
||||
|
||||
#Method SkRect computeTightBounds() const
|
||||
|
||||
#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
|
||||
@ -2134,6 +2188,7 @@ rotated circle bounds = 25, 20, 75, 70
|
||||
|
||||
#Method bool conservativelyContainsRect(const SkRect& rect) const
|
||||
|
||||
#Line # returns true if Rect may be inside ##
|
||||
Returns true if rect is contained by Path.
|
||||
May return false when rect is contained by Path.
|
||||
|
||||
@ -2180,6 +2235,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void incReserve(unsigned extraPtCount)
|
||||
|
||||
#Line # reserves space for additional data ##
|
||||
grows Path Verb_Array and Point_Array to contain extraPtCount additional Points.
|
||||
May improve performance and use less memory by
|
||||
reducing the number and size of allocations when creating Path.
|
||||
@ -2219,6 +2275,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void moveTo(SkScalar x, SkScalar y)
|
||||
|
||||
#Line # starts Contour ##
|
||||
Adds beginning of Contour at Point (x, y).
|
||||
|
||||
#Param x x-coordinate of Contour start ##
|
||||
@ -2275,6 +2332,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void rMoveTo(SkScalar dx, SkScalar dy)
|
||||
|
||||
#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).
|
||||
@ -2307,6 +2365,7 @@ Function name stands for "relative move to".
|
||||
|
||||
#Method void lineTo(SkScalar x, SkScalar y)
|
||||
|
||||
#Line # appends Line ##
|
||||
Adds Line from Last_Point to (x, y). If Path is empty, or last Verb is
|
||||
kClose_Verb, Last_Point is set to (0, 0) before adding Line.
|
||||
|
||||
@ -2380,6 +2439,7 @@ lineTo then appends kLine_Verb to Verb_Array and Point p to Point_Array.
|
||||
|
||||
#Method void rLineTo(SkScalar dx, SkScalar dy)
|
||||
|
||||
#Line # appends Line relative to Last_Point ##
|
||||
Adds Line from Last_Point to Vector (dx, dy). If Path is empty, or last Verb is
|
||||
kClose_Verb, Last_Point is set to (0, 0) before adding Line.
|
||||
|
||||
@ -2474,6 +2534,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
|
||||
|
||||
#In Quad
|
||||
#Line # appends Quad ##
|
||||
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.
|
||||
@ -2511,6 +2573,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void quadTo(const SkPoint& p1, const SkPoint& p2)
|
||||
|
||||
#In Quad
|
||||
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.
|
||||
@ -2543,6 +2606,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void rQuadTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2)
|
||||
|
||||
#In Quad
|
||||
#Line # appends Quad relative to Last_Point ##
|
||||
Adds Quad from Last_Point towards Vector (dx1, dy1), to Vector (dx2, dy2).
|
||||
If Path is empty, or last Verb
|
||||
is kClose_Verb, Last_Point is set to (0, 0) before adding Quad.
|
||||
@ -2709,6 +2774,8 @@ done
|
||||
|
||||
#Method void conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2,
|
||||
SkScalar w)
|
||||
#In Conic
|
||||
#Line # appends Conic ##
|
||||
|
||||
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)
|
||||
@ -2765,6 +2832,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void conicTo(const SkPoint& p1, const SkPoint& p2, SkScalar w)
|
||||
|
||||
#In Conic
|
||||
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.
|
||||
@ -2821,6 +2889,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2,
|
||||
SkScalar w)
|
||||
#In Conic
|
||||
#Line # appends Conic relative to Last_Point ##
|
||||
|
||||
Adds Conic from Last_Point towards Vector (dx1, dy1), to Vector (dx2, dy2),
|
||||
weighted by w. If Path is empty, or last Verb
|
||||
@ -2907,6 +2977,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2,
|
||||
SkScalar x3, SkScalar y3)
|
||||
#In Cubic
|
||||
#Line # appends Cubic ##
|
||||
|
||||
Adds Cubic from Last_Point towards (x1, y1), then towards (x2, y2), ending at
|
||||
(x3, y3). If Path is empty, or last Verb is kClose_Verb, Last_Point is set to
|
||||
@ -2950,6 +3022,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void cubicTo(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3)
|
||||
|
||||
#In Cubic
|
||||
Adds Cubic from Last_Point towards Point p1, then towards Point p2, ending at
|
||||
Point p3. If Path is empty, or last Verb is kClose_Verb, Last_Point is set to
|
||||
(0, 0) before adding Cubic.
|
||||
@ -2982,6 +3055,8 @@ to Point_Array.
|
||||
|
||||
#Method void rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2,
|
||||
SkScalar x3, SkScalar y3)
|
||||
#In Cubic
|
||||
#Line # appends Cubic relative to Last_Point ##
|
||||
|
||||
Adds Cubic from Last_Point towards Vector (dx1, dy1), then towards
|
||||
Vector (dx2, dy2), to Vector (dx3, dy3).
|
||||
@ -3215,6 +3290,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
|
||||
|
||||
#In Arc
|
||||
#Line # appends Arc ##
|
||||
Append Arc to Path. Arc added is part of ellipse
|
||||
bounded by oval, from startAngle through sweepAngle. Both startAngle and
|
||||
sweepAngle are measured in degrees, where zero degrees is aligned with the
|
||||
@ -3261,6 +3338,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)
|
||||
|
||||
#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 (x0, y0) to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc
|
||||
@ -3409,6 +3487,7 @@ conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683
|
||||
|
||||
#Method void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius)
|
||||
|
||||
#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
|
||||
@ -3521,6 +3600,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc,
|
||||
Direction sweep, SkScalar x, SkScalar y)
|
||||
#In Arc
|
||||
|
||||
Append Arc to Path. Arc is implemented by one or more Conics weighted to
|
||||
describe part of Oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc
|
||||
@ -3574,6 +3654,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep,
|
||||
const SkPoint xy)
|
||||
#In Arc
|
||||
|
||||
Append Arc to Path. Arc is implemented by one or more Conic weighted to describe part of Oval
|
||||
with radii (r.fX, r.fY) rotated by xAxisRotate degrees. Arc curves from last Path Point to
|
||||
@ -3617,6 +3698,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc,
|
||||
Direction sweep, SkScalar dx, SkScalar dy)
|
||||
#In Arc
|
||||
#Line # appends Arc relative to Last_Point ##
|
||||
|
||||
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
|
||||
@ -3671,6 +3754,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void close()
|
||||
|
||||
#Line # makes last Contour a loop ##
|
||||
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
|
||||
@ -3708,6 +3792,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method static bool IsInverseFillType(FillType fill)
|
||||
|
||||
#Line # returns if Fill_Type represents outside geometry ##
|
||||
Returns true if fill is inverted and Path with fill represents area outside
|
||||
of its geometric bounds.
|
||||
|
||||
@ -3763,6 +3848,7 @@ IsInverseFillType(kInverseEvenOdd_FillType) == true
|
||||
|
||||
#Method static FillType ConvertToNonInverseFillType(FillType fill)
|
||||
|
||||
#Line # returns Fill_Type representing inside geometry ##
|
||||
Returns equivalent Fill_Type representing Path fill inside its bounds.
|
||||
.
|
||||
|
||||
@ -3822,6 +3908,7 @@ ConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType
|
||||
|
||||
#Method static int ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2,
|
||||
SkScalar w, SkPoint pts[], int pow2)
|
||||
#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.
|
||||
@ -3891,6 +3978,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool isRect(SkRect* rect, bool* isClosed = nullptr, Direction* direction = nullptr) const
|
||||
|
||||
#Line # returns if describes Rect ##
|
||||
Returns true if Path is equivalent to Rect when filled.
|
||||
If false: rect, isClosed, and direction are unchanged.
|
||||
If true: rect, isClosed, and direction are written to if not nullptr.
|
||||
@ -3951,6 +4039,7 @@ addPoly is rect (0, 0, 80, 80); is not closed; direction CCW
|
||||
|
||||
#Method bool isNestedFillRects(SkRect rect[2], Direction dirs[2] = nullptr) const
|
||||
|
||||
#Line # returns if describes Rect pair, one inside the other ##
|
||||
Returns true if Path is equivalent to nested Rect pair when filled.
|
||||
If false, rect and dirs are unchanged.
|
||||
If true, rect and dirs are written to if not nullptr:
|
||||
@ -3997,6 +4086,7 @@ inner (12.5, 22.5, 27.5, 37.5); direction CCW
|
||||
|
||||
#Method void addRect(const SkRect& rect, Direction dir = kCW_Direction)
|
||||
|
||||
#Line # adds one Contour containing Rect ##
|
||||
Add Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,
|
||||
starting with top-left corner of Rect; followed by top-right, bottom-right,
|
||||
and bottom-left if dir is kCW_Direction; or followed by bottom-left,
|
||||
@ -4135,6 +4225,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void addOval(const SkRect& oval, Direction dir = kCW_Direction)
|
||||
|
||||
#Line # adds one Contour containing Oval ##
|
||||
Add Oval to path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
|
||||
Oval is upright ellipse bounded by Rect oval with radii equal to half oval width
|
||||
and half oval height. Oval begins at (oval.fRight, oval.centerY()) and continues
|
||||
@ -4219,6 +4310,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void addCircle(SkScalar x, SkScalar y, SkScalar radius,
|
||||
Direction dir = kCW_Direction)
|
||||
#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:
|
||||
@ -4257,6 +4349,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle)
|
||||
|
||||
#Line # adds one Contour containing Arc ##
|
||||
Append Arc to Path, as the start of new Contour. Arc added is part of ellipse
|
||||
bounded by oval, from startAngle through sweepAngle. Both startAngle and
|
||||
sweepAngle are measured in degrees, where zero degrees is aligned with the
|
||||
@ -4298,6 +4391,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry,
|
||||
Direction dir = kCW_Direction)
|
||||
#Line # adds one Contour containing Round_Rect with common corner radii ##
|
||||
|
||||
Append Round_Rect to Path, creating a new closed Contour. Round_Rect has bounds
|
||||
equal to rect; each corner is 90 degrees of an ellipse with radii (rx, ry). If
|
||||
@ -4406,6 +4500,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction)
|
||||
|
||||
#Line # adds one Contour containing Round_Rect ##
|
||||
Add rrect to Path, creating a new closed Contour. If
|
||||
dir is kCW_Direction, rrect starts at top-left of the lower-left corner and
|
||||
winds clockwise. If dir is kCCW_Direction, rrect starts at the bottom-left
|
||||
@ -4491,6 +4586,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void addPoly(const SkPoint pts[], int count, bool close)
|
||||
|
||||
#Line # adds one Contour containing connected lines ##
|
||||
Add Contour created from Line array, adding (count - 1) Line segments.
|
||||
Contour added starts at pts[0], then adds a line for every additional Point
|
||||
in pts array. If close is true,appends kClose_Verb to Path, connecting
|
||||
@ -4588,6 +4684,7 @@ The top right composition is made up of one contour; the other three have two.
|
||||
|
||||
#Method void addPath(const SkPath& src, SkScalar dx, SkScalar dy,
|
||||
AddPathMode mode = kAppend_AddPathMode)
|
||||
#Line # adds contents of Path ##
|
||||
|
||||
Append src to Path, offset by (dx, dy).
|
||||
|
||||
@ -4688,6 +4785,7 @@ Verbs, Points, and Conic_Weights.
|
||||
|
||||
#Method void reverseAddPath(const SkPath& src)
|
||||
|
||||
#Line # adds contents of Path back to front ##
|
||||
Append src to Path, from back to front.
|
||||
Reversed src always appends a new Contour to Path.
|
||||
|
||||
@ -4726,6 +4824,7 @@ Reversed src always appends a new Contour to Path.
|
||||
|
||||
#Method void offset(SkScalar dx, SkScalar dy, SkPath* dst) const
|
||||
|
||||
#Line # translates Point_Array ##
|
||||
Offset Point_Array by (dx, dy). Offset Path replaces dst.
|
||||
If dst is nullptr, Path is replaced by offset data.
|
||||
|
||||
@ -4783,6 +4882,7 @@ Offset Point_Array by (dx, dy). Path is replaced by offset data.
|
||||
|
||||
#Method void transform(const SkMatrix& matrix, SkPath* dst) const
|
||||
|
||||
#Line # applies Matrix to Point_Array and Weights ##
|
||||
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
|
||||
@ -4851,6 +4951,8 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
|
||||
|
||||
#Method bool getLastPt(SkPoint* lastPt) const
|
||||
|
||||
#In Last_Point
|
||||
#Line # returns Last_Point ##
|
||||
Returns Last_Point on Path in lastPt. Returns false if Point_Array is empty,
|
||||
storing (0, 0) if lastPt is not nullptr.
|
||||
|
||||
@ -4879,6 +4981,8 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
|
||||
|
||||
#Method void setLastPt(SkScalar x, SkScalar y)
|
||||
|
||||
#In Last_Point
|
||||
#Line # replaces Last_Point ##
|
||||
Set Last_Point to (x, y). If Point_Array is empty, append kMove_Verb to
|
||||
Verb_Array and (x, y) to Point_Array.
|
||||
|
||||
@ -4901,6 +5005,7 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
|
||||
|
||||
#Method void setLastPt(const SkPoint& p)
|
||||
|
||||
#In Last_Point
|
||||
Set the last point on the path. If no points have been added, moveTo(p)
|
||||
is automatically called.
|
||||
|
||||
@ -4982,6 +5087,7 @@ Path kQuad_SegmentMask is set
|
||||
|
||||
#Method uint32_t getSegmentMasks() const
|
||||
|
||||
#Line # returns types in Verb_Array ##
|
||||
Returns a mask, where each set bit corresponds to a SegmentMask constant
|
||||
if Path contains one or more Verbs of that type.
|
||||
Returns zero if Path contains no Lines, or Curves: Quads, Conics, or Cubics.
|
||||
@ -5016,6 +5122,7 @@ mask quad set
|
||||
|
||||
#Method bool contains(SkScalar x, SkScalar y) const
|
||||
|
||||
#Line # returns if Point is in fill area ##
|
||||
Returns true if the point (x, y) is contained by Path, taking into
|
||||
account FillType.
|
||||
|
||||
@ -5061,6 +5168,7 @@ for (int y = 2; y < 256; y += 9) {
|
||||
|
||||
#Method void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const
|
||||
|
||||
#Line # sends text representation using floats to standard output ##
|
||||
Writes text representation of Path to stream. If stream is nullptr, writes to
|
||||
standard output. Set forceClose to true to get edges used to fill Path.
|
||||
Set dumpAsHex true to generate exact binary representations
|
||||
@ -5139,6 +5247,7 @@ path is not equal to copy
|
||||
|
||||
#Method void dumpHex() const
|
||||
|
||||
#Line # sends text representation using hexadecimal to standard output ##
|
||||
Writes text representation of Path 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
|
||||
@ -5172,6 +5281,7 @@ path is equal to copy
|
||||
|
||||
#Method size_t writeToMemory(void* buffer) const
|
||||
|
||||
#Line # copies data to buffer ##
|
||||
Writes Path to buffer, returning the number of bytes written.
|
||||
Pass nullptr to obtain the storage size.
|
||||
|
||||
@ -5207,6 +5317,7 @@ path is equal to copy
|
||||
|
||||
#Method sk_sp<SkData> serialize() const
|
||||
|
||||
#Line # copies data to buffer ##
|
||||
Write Path to buffer, returning the buffer written to, wrapped in Data.
|
||||
|
||||
serialize() writes Fill_Type, Verb_Array, Point_Array, Conic_Weight, and
|
||||
@ -5237,6 +5348,7 @@ path is equal to copy
|
||||
|
||||
#Method size_t readFromMemory(const void* buffer, size_t length)
|
||||
|
||||
#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.
|
||||
|
||||
@ -5288,6 +5400,8 @@ Empty Paths have a Generation_ID of one.
|
||||
|
||||
#Method uint32_t getGenerationID() const
|
||||
|
||||
#In Generation_ID
|
||||
#Line # returns unique ID ##
|
||||
Returns a non-zero, globally unique value. A different value is returned
|
||||
if Verb_Array, Point_Array, or Conic_Weight changes.
|
||||
|
||||
@ -5328,6 +5442,7 @@ empty genID = 1
|
||||
|
||||
#Method bool isValid() const
|
||||
|
||||
#Line # returns if data is internally consistent ##
|
||||
Returns if Path data is consistent. Corrupt Path data is detected if
|
||||
internal values are out of range or internal storage does not match
|
||||
array dimensions.
|
||||
@ -5341,6 +5456,7 @@ empty genID = 1
|
||||
|
||||
#Method bool pathRefIsValid() const
|
||||
|
||||
#Line # to be deprecated ##
|
||||
Returns if Path data is consistent.
|
||||
|
||||
#Deprecated
|
||||
|
@ -99,6 +99,8 @@ to manage pixel memory; Pixel_Ref is safe across threads.
|
||||
|
||||
#Method SkPixmap()
|
||||
|
||||
#In Initialization
|
||||
#Line # constructs with default values ##
|
||||
Creates an empty Pixmap without pixels, with kUnknown_SkColorType, with
|
||||
kUnknown_SkAlphaType, and with a width and height of zero. Use
|
||||
reset() to associate pixels, SkColorType, SkAlphaType, width, and height
|
||||
@ -109,8 +111,8 @@ after Pixmap has been created.
|
||||
#Example
|
||||
void draw(SkCanvas* canvas) {
|
||||
const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444", "RGBA_8888", "BGRA_8888",
|
||||
"Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkPixmap pixmap;
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
SkDebugf("width: %2d height: %2d", pixmap.width(), pixmap.height());
|
||||
@ -134,6 +136,8 @@ 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.
|
||||
addr points to pixels, or nullptr. rowBytes should be info.width() times
|
||||
info.bytesPerPixel(), or larger.
|
||||
@ -179,6 +183,8 @@ copy alpha only = true
|
||||
|
||||
#Method void reset()
|
||||
|
||||
#In Initialization
|
||||
#Line # reuses existing Pixmap with replacement values ##
|
||||
Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to
|
||||
kUnknown_SkColorType; and SkAlphaType to kUnknown_SkAlphaType.
|
||||
|
||||
@ -188,8 +194,8 @@ memory if desired.
|
||||
#Example
|
||||
void draw(SkCanvas* canvas) {
|
||||
const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444", "RGBA_8888", "BGRA_8888",
|
||||
"Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkPixmap pixmap(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),
|
||||
nullptr, 0);
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
@ -213,6 +219,7 @@ width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType
|
||||
|
||||
#Method void reset(const SkImageInfo& info, const void* addr, size_t rowBytes)
|
||||
|
||||
#In Initialization
|
||||
Sets width, height, SkAlphaType, and SkColorType from info.
|
||||
Sets pixel address from addr, which may be nullptr.
|
||||
Sets row bytes from rowBytes, which should be info.width() times
|
||||
@ -257,6 +264,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method void setColorSpace(sk_sp<SkColorSpace> colorSpace)
|
||||
|
||||
#In Initialization
|
||||
#Line # sets Image_Info Color_Space ##
|
||||
|
||||
Changes Color_Space in Image_Info; preserves width, height, SkAlphaType, and
|
||||
SkColorType in Image, and leaves pixel address and row bytes unchanged.
|
||||
@ -287,6 +296,7 @@ is not unique
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask)
|
||||
|
||||
#In Initialization
|
||||
Sets width, height, pixel address, and row bytes to Mask properties, if Mask
|
||||
format is SkMask::kA8_Format; and returns true. Otherwise sets width, height,
|
||||
row bytes to zero; pixel address to nullptr; SkColorType to kUnknown_SkColorType;
|
||||
@ -329,6 +339,8 @@ success: false width: 0 height: 0
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT extractSubset(SkPixmap* subset, const SkIRect& area) const
|
||||
|
||||
#In Initialization
|
||||
#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.
|
||||
@ -370,6 +382,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method const SkImageInfo& info() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns Image_Info ##
|
||||
Returns width, height, Alpha_Type, Color_Type, and Color_Space.
|
||||
|
||||
#Return reference to ImageInfo ##
|
||||
@ -385,8 +399,8 @@ Returns width, height, Alpha_Type, Color_Type, and Color_Space.
|
||||
if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {
|
||||
const SkImageInfo& info = inset.info();
|
||||
const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888",
|
||||
"RGB_888x", "BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkDebugf("width: %d height: %d color: %s alpha: %s\n", info.width(), info.height(),
|
||||
colors[info.colorType()], alphas[info.alphaType()]);
|
||||
}
|
||||
@ -403,6 +417,8 @@ width: 384 height: 384 color: BGRA_8888 alpha: Opaque
|
||||
|
||||
#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:
|
||||
#Formula
|
||||
@ -436,6 +452,8 @@ rowBytes: 8 minRowBytes: 4
|
||||
|
||||
#Method const void* addr() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns readable pixel address as void pointer ##
|
||||
Returns pixel address, the base address corresponding to the pixel origin.
|
||||
|
||||
It is up to the Pixmap creator to ensure that pixel address is a useful value.
|
||||
@ -469,6 +487,8 @@ inset address: 0x7f2a440fb210
|
||||
|
||||
#Method int width() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns pixel column count ##
|
||||
Returns pixel count in each pixel row. Should be equal or less than:
|
||||
|
||||
#Formula
|
||||
@ -495,6 +515,8 @@ pixmap width: 16 info width: 16
|
||||
|
||||
#Method int height() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns pixel row count ##
|
||||
Returns pixel row count.
|
||||
|
||||
#Return pixel height in Image_Info ##
|
||||
@ -515,19 +537,22 @@ pixmap height: 32 info height: 32
|
||||
|
||||
#Method SkColorType colorType() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#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,
|
||||
kBGRA_8888_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType.
|
||||
kRGB_888x_SkColorType, kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType,
|
||||
kRGB_101010x_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType.
|
||||
|
||||
#Return Color_Type in Image_Info ##
|
||||
|
||||
#Example
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
|
||||
SkPixmap pixmap(SkImageInfo::MakeA8(16, 32), nullptr, 64);
|
||||
SkDebugf("color type: k" "%s" "_SkColorType\n", colors[pixmap.colorType()]);
|
||||
#StdOut
|
||||
color type: kAlpha_SkColorType
|
||||
color type: kAlpha_8_SkColorType
|
||||
##
|
||||
##
|
||||
|
||||
@ -539,6 +564,8 @@ color type: kAlpha_SkColorType
|
||||
|
||||
#Method SkAlphaType alphaType() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns Image_Info Alpha_Type ##
|
||||
Returns Alpha_Type, one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType,
|
||||
kPremul_SkAlphaType, kUnpremul_SkAlphaType.
|
||||
|
||||
@ -561,6 +588,8 @@ alpha type: kPremul_SkAlphaType
|
||||
|
||||
#Method SkColorSpace* colorSpace() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns Image_Info Color_Space ##
|
||||
Returns Color_Space associated with Image_Info. The
|
||||
reference count of Color_Space is unchanged. The returned Color_Space is
|
||||
immutable.
|
||||
@ -592,6 +621,8 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
|
||||
|
||||
#Method bool isOpaque() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#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
|
||||
transparency.
|
||||
@ -632,6 +663,8 @@ isOpaque: true
|
||||
|
||||
#Method SkIRect bounds() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns width and height as Rectangle ##
|
||||
Returns IRect { 0, 0, width(), height() }.
|
||||
|
||||
#Return integral rectangle from origin to width() and height() ##
|
||||
@ -660,6 +693,8 @@ width: 2 height: 2 empty: false
|
||||
|
||||
#Method int rowBytesAsPixels() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns interval between rows in pixels ##
|
||||
|
||||
Returns number of pixels that fit on row. Should be greater than or equal to
|
||||
width().
|
||||
@ -688,14 +723,16 @@ rowBytes: 8 rowBytesAsPixels: 2
|
||||
|
||||
#Method int shiftPerPixel() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#Line # returns bit shift from pixels to bytes ##
|
||||
Returns bit shift converting row bytes to row pixels.
|
||||
Returns zero for kUnknown_SkColorType.
|
||||
|
||||
#Return one of: 0, 1, 2, 3; left shift to convert pixels to bytes ##
|
||||
|
||||
#Example
|
||||
const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
|
||||
"RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
|
||||
const char* colors[] = {"Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
|
||||
"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,
|
||||
@ -708,7 +745,7 @@ Returns zero for kUnknown_SkColorType.
|
||||
}
|
||||
#StdOut
|
||||
color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0
|
||||
color: kAlpha_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
|
||||
color: kAlpha_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
|
||||
color: kRGB_565_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
|
||||
color: kARGB_4444_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
|
||||
color: kRGBA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2
|
||||
@ -726,6 +763,8 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3
|
||||
|
||||
#Method size_t computeByteSize() const
|
||||
|
||||
#In Image_Info_Access
|
||||
#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().
|
||||
Returns zero if result does not fit in size_t.
|
||||
@ -769,6 +808,8 @@ width: 1000000 height: 1000000 computeByteSize: 4999999000000
|
||||
|
||||
#Method bool computeIsOpaque() const
|
||||
|
||||
#In Reader
|
||||
#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
|
||||
without alpha in each pixel; for other Color_Types, returns true if all
|
||||
@ -816,6 +857,8 @@ computeIsOpaque: true
|
||||
|
||||
#Method SkColor getColor(int x, int y) const
|
||||
|
||||
#In Reader
|
||||
#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.
|
||||
|
||||
@ -881,6 +924,7 @@ Unpremultiplied:
|
||||
|
||||
#Method const void* addr(int x, int y) const
|
||||
|
||||
#In Readable_Address
|
||||
Returns readable pixel address at (x, y). Returns nullptr if Pixel_Ref is nullptr.
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -915,6 +959,8 @@ pixmap.addr(1, 2) == &storage[1 + 2 * w]
|
||||
|
||||
#Method const uint8_t* addr8() const
|
||||
|
||||
#In Readable_Address
|
||||
#Line # returns readable pixel address as 8-bit pointer ##
|
||||
Returns readable base pixel address. Result is addressable as unsigned 8-bit bytes.
|
||||
Will trigger an assert() if Color_Type is not kAlpha_8_SkColorType or
|
||||
kGray_8_SkColorType, and is built with SK_DEBUG defined.
|
||||
@ -944,6 +990,8 @@ pixmap.addr8() == storage
|
||||
|
||||
#Method const uint16_t* addr16() const
|
||||
|
||||
#In Readable_Address
|
||||
#Line # returns readable pixel address as 16-bit pointer ##
|
||||
Returns readable base pixel address. Result is addressable as unsigned 16-bit words.
|
||||
Will trigger an assert() if Color_Type is not kRGB_565_SkColorType or
|
||||
kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
|
||||
@ -973,6 +1021,8 @@ pixmap.addr16() == storage
|
||||
|
||||
#Method const uint32_t* addr32() const
|
||||
|
||||
#In Readable_Address
|
||||
#Line # returns readable pixel address as 32-bit pointer ##
|
||||
Returns readable base pixel address. Result is addressable as unsigned 32-bit words.
|
||||
Will trigger an assert() if Color_Type is not kRGBA_8888_SkColorType or
|
||||
kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
|
||||
@ -1002,6 +1052,8 @@ pixmap.addr32() == storage
|
||||
|
||||
#Method const uint64_t* addr64() const
|
||||
|
||||
#In Readable_Address
|
||||
#Line # returns readable pixel address as 64-bit pointer ##
|
||||
Returns readable base pixel address. Result is addressable as unsigned 64-bit words.
|
||||
Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
|
||||
with SK_DEBUG defined.
|
||||
@ -1031,6 +1083,8 @@ pixmap.addr64() == storage
|
||||
|
||||
#Method const uint16_t* addrF16() const
|
||||
|
||||
#In Readable_Address
|
||||
#Line # returns readable pixel component address as 16-bit pointer ##
|
||||
Returns readable base pixel address. Result is addressable as unsigned 16-bit words.
|
||||
Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
|
||||
with SK_DEBUG defined.
|
||||
@ -1061,6 +1115,7 @@ pixmap.addrF16() == storage
|
||||
|
||||
#Method const uint8_t* addr8(int x, int y) const
|
||||
|
||||
#In Readable_Address
|
||||
Returns readable pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -1095,6 +1150,7 @@ pixmap.addr8(1, 2) == &storage[1 + 2 * w]
|
||||
|
||||
#Method const uint16_t* addr16(int x, int y) const
|
||||
|
||||
#In Readable_Address
|
||||
Returns readable pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -1129,6 +1185,7 @@ pixmap.addr16(1, 2) == &storage[1 + 2 * w]
|
||||
|
||||
#Method const uint32_t* addr32(int x, int y) const
|
||||
|
||||
#In Readable_Address
|
||||
Returns readable pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -1163,6 +1220,7 @@ pixmap.addr32(1, 2) == &storage[1 + 2 * w]
|
||||
|
||||
#Method const uint64_t* addr64(int x, int y) const
|
||||
|
||||
#In Readable_Address
|
||||
Returns readable pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -1197,6 +1255,7 @@ pixmap.addr64(1, 2) == &storage[1 + 2 * w]
|
||||
|
||||
#Method const uint16_t* addrF16(int x, int y) const
|
||||
|
||||
#In Readable_Address
|
||||
Returns readable pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -1240,6 +1299,8 @@ pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords]
|
||||
|
||||
#Method void* writable_addr() const
|
||||
|
||||
#In Writable_Address
|
||||
#Line # returns writable pixel address as void pointer ##
|
||||
Returns writable base pixel address.
|
||||
|
||||
#Return writable generic base pointer to pixels ##
|
||||
@ -1272,6 +1333,7 @@ pixmap.getColor(0, 0) == 0xFFFFFFFF
|
||||
|
||||
#Method void* writable_addr(int x, int y) const
|
||||
|
||||
#In Writable_Address
|
||||
Returns writable pixel address at (x, y).
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
@ -1310,6 +1372,8 @@ pixmap.getColor(1, 2) == 0xFFFFFFFF
|
||||
|
||||
#Method uint8_t* writable_addr8(int x, int y) const
|
||||
|
||||
#In Writable_Address
|
||||
#Line # returns writable pixel address as 8-bit pointer ##
|
||||
Returns writable pixel address at (x, y). Result is addressable as unsigned
|
||||
8-bit bytes. Will trigger an assert() if Color_Type is not kAlpha_8_SkColorType
|
||||
or kGray_8_SkColorType, and is built with SK_DEBUG defined.
|
||||
@ -1354,6 +1418,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method uint16_t* writable_addr16(int x, int y) const
|
||||
|
||||
#In Writable_Address
|
||||
#Line # returns writable pixel address as 16-bit pointer ##
|
||||
Returns writable_addr pixel address at (x, y). Result is addressable as unsigned
|
||||
16-bit words. Will trigger an assert() if Color_Type is not kRGB_565_SkColorType
|
||||
or kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
|
||||
@ -1395,6 +1461,8 @@ The low nibble of the 16-bit word is Alpha.
|
||||
|
||||
#Method uint32_t* writable_addr32(int x, int y) const
|
||||
|
||||
#In Writable_Address
|
||||
#Line # returns writable pixel address as 32-bit pointer ##
|
||||
Returns writable pixel address at (x, y). Result is addressable as unsigned
|
||||
32-bit words. Will trigger an assert() if Color_Type is not
|
||||
kRGBA_8888_SkColorType or kBGRA_8888_SkColorType, and is built with SK_DEBUG
|
||||
@ -1436,6 +1504,8 @@ One word corresponds to one pixel.
|
||||
|
||||
#Method uint64_t* writable_addr64(int x, int y) const
|
||||
|
||||
#In Writable_Address
|
||||
#Line # returns writable pixel address as 64-bit pointer ##
|
||||
Returns writable pixel address at (x, y). Result is addressable as unsigned
|
||||
64-bit words. Will trigger an assert() if Color_Type is not
|
||||
kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
|
||||
@ -1471,6 +1541,8 @@ One word corresponds to one pixel.
|
||||
|
||||
#Method uint16_t* writable_addrF16(int x, int y) const
|
||||
|
||||
#In Writable_Address
|
||||
#Line # returns writable pixel component address as 16-bit pointer ##
|
||||
Returns writable pixel address at (x, y). Result is addressable as unsigned
|
||||
16-bit words. Will trigger an assert() if Color_Type is not
|
||||
kRGBA_F16_SkColorType and is built with SK_DEBUG defined.
|
||||
@ -1520,6 +1592,8 @@ is drawn after overwriting bottom half float color with top half float color.
|
||||
|
||||
#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
|
||||
int srcX, int srcY, SkTransferFunctionBehavior behavior) const
|
||||
#In Writer
|
||||
#Line # copies and converts pixels ##
|
||||
|
||||
Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not
|
||||
exceed Pixmap (width(), height()).
|
||||
@ -1599,6 +1673,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
|
||||
|
||||
#In Writer
|
||||
Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not
|
||||
exceed Pixmap (width(), height()).
|
||||
|
||||
@ -1661,6 +1736,7 @@ 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()).
|
||||
@ -1727,6 +1803,7 @@ 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.
|
||||
@ -1788,6 +1865,7 @@ 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
|
||||
@ -1836,6 +1914,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality) const
|
||||
|
||||
#In Writer
|
||||
#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
|
||||
pixels are copied. Returns false if dst.addr() is nullptr, or dst.rowBytes is
|
||||
@ -1896,6 +1976,8 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
#Method bool erase(SkColor color, const SkIRect& subset) const
|
||||
|
||||
#In Writer
|
||||
#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
|
||||
not intersect bounds().
|
||||
@ -1926,6 +2008,7 @@ 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.
|
||||
@ -1954,6 +2037,7 @@ 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
|
||||
|
@ -90,6 +90,7 @@ infinities and NaN.
|
||||
|
||||
#Method static constexpr SkPoint Make(SkScalar x, SkScalar y)
|
||||
|
||||
#Line # Constructs from SkScalar inputs. ##
|
||||
Sets fX to x, fY to y. Used both to set Point and Vector.
|
||||
|
||||
#Param x SkScalar x-axis value of constructed Point or Vector ##
|
||||
@ -116,6 +117,7 @@ all equal
|
||||
|
||||
#Method SkScalar x() const
|
||||
|
||||
#Line # Returns fX. ##
|
||||
Returns x-axis value of Point or Vector.
|
||||
|
||||
#Return fX ##
|
||||
@ -136,6 +138,7 @@ pt1.fX == pt1.x()
|
||||
|
||||
#Method SkScalar y() const
|
||||
|
||||
#Line # Returns fY. ##
|
||||
Returns y-axis value of Point or Vector.
|
||||
|
||||
#Return fY ##
|
||||
@ -156,6 +159,7 @@ pt1.fY == pt1.y()
|
||||
|
||||
#Method bool isZero() const
|
||||
|
||||
#Line # Returns true if both members equal zero. ##
|
||||
Returns true if fX and fY are both zero.
|
||||
|
||||
#Return true if fX is zero and fY is zero ##
|
||||
@ -179,6 +183,7 @@ pt.isZero() == true
|
||||
|
||||
#Method void set(SkScalar x, SkScalar y)
|
||||
|
||||
#Line # Sets to SkScalar input. ##
|
||||
Sets fX to x and fY to y.
|
||||
|
||||
#Param x new value for fX ##
|
||||
@ -201,6 +206,7 @@ pt1 == pt2
|
||||
|
||||
#Method void iset(int32_t x, int32_t y)
|
||||
|
||||
#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
|
||||
@ -252,6 +258,7 @@ fPt: -2.14748e+09, 2.14748e+09
|
||||
|
||||
#Method void setAbs(const SkPoint& pt)
|
||||
|
||||
#Line # Sets sign of both members to positive. ##
|
||||
Sets fX to absolute value of pt.fX; and fY to absolute value of pt.fY.
|
||||
|
||||
#Param pt members providing magnitude for fX and fY ##
|
||||
@ -281,6 +288,7 @@ pt: nan, -nan abs: nan, nan
|
||||
|
||||
#Method static void Offset(SkPoint points[], int count, const SkVector& offset)
|
||||
|
||||
#Line # Translates Point array. ##
|
||||
Adds offset to each Point in points array with count entries.
|
||||
|
||||
#Param points Point array ##
|
||||
@ -338,6 +346,7 @@ Adds offset (dx, dy) to each Point in points array of length count.
|
||||
|
||||
#Method void offset(SkScalar dx, SkScalar dy)
|
||||
|
||||
#Line # Translates Point. ##
|
||||
Adds offset (dx, dy) to Point.
|
||||
|
||||
#Param dx added to fX ##
|
||||
@ -367,6 +376,7 @@ Adds offset (dx, dy) to Point.
|
||||
|
||||
#Method SkScalar length() const
|
||||
|
||||
#Line # Returns straight-line distance to origin. ##
|
||||
Returns the Euclidean_Distance from origin, computed as:
|
||||
#Code
|
||||
#Literal
|
||||
@ -401,6 +411,7 @@ sqrt(fX * fX + fY * fY)
|
||||
|
||||
#Method SkScalar distanceToOrigin() const
|
||||
|
||||
#Line # Returns straight-line distance to origin. ##
|
||||
Returns the Euclidean_Distance from origin, computed as:
|
||||
#Code
|
||||
#Literal
|
||||
@ -436,6 +447,7 @@ sqrt(fX * fX + fY * fY)
|
||||
|
||||
#Method bool normalize()
|
||||
|
||||
#Line # Sets length to one, preserving direction. ##
|
||||
Scales (fX, fY) so that length() returns one, while preserving ratio of fX to fY,
|
||||
if possible. If prior length is nearly zero, sets Vector to (0, 0) and returns
|
||||
false; otherwise returns true.
|
||||
@ -467,6 +479,7 @@ false; otherwise returns true.
|
||||
|
||||
#Method bool setNormalize(SkScalar x, SkScalar y)
|
||||
|
||||
#Line # Sets length to one, in direction of (x, y). ##
|
||||
Sets Vector to (x, y) scaled so length() returns one, and so that
|
||||
(fX, fY) is proportional to (x, y). If (x, y) length is nearly zero,
|
||||
sets Vector to (0, 0) and returns false; otherwise returns true.
|
||||
@ -503,6 +516,7 @@ sets Vector to (0, 0) and returns false; otherwise returns true.
|
||||
|
||||
#Method bool setLength(SkScalar length)
|
||||
|
||||
#Line # Sets straight-line distance to origin. ##
|
||||
Scales Vector so that distanceToOrigin returns length, if possible. If former
|
||||
length is nearly zero, sets Vector to (0, 0) and return false; otherwise returns
|
||||
true.
|
||||
@ -575,6 +589,7 @@ true.
|
||||
|
||||
#Method void scale(SkScalar scale, SkPoint* dst) const
|
||||
|
||||
#Line # Multiplies Point by scale factor. ##
|
||||
Sets dst to Point times scale. dst may be Point to modify Point in place.
|
||||
|
||||
#Param scale factor to multiply Point by ##
|
||||
@ -626,6 +641,7 @@ Scales Point in place by scale.
|
||||
|
||||
#Method void negate()
|
||||
|
||||
#Line # Reverses the sign of both members. ##
|
||||
Changes the sign of fX and fY.
|
||||
|
||||
#Example
|
||||
@ -814,6 +830,7 @@ Multiplies Point by scale. Sets Point to:
|
||||
|
||||
#Method bool isFinite() const
|
||||
|
||||
#Line # Returns true if no member is infinite or NaN. ##
|
||||
Returns true if both fX and fY are measurable values.
|
||||
|
||||
#Return true for values other than infinities and NaN ##
|
||||
@ -839,6 +856,7 @@ pt: nan, -1 finite: false
|
||||
|
||||
#Method bool equals(SkScalar x, SkScalar y) const
|
||||
|
||||
#Line # Returns true if Points are equal. ##
|
||||
Returns true if Point is equivalent to Point constructed from (x, y).
|
||||
|
||||
#Param x value compared with fX ##
|
||||
@ -1003,6 +1021,7 @@ Can also be used to add Vector to Vector, returning Vector.
|
||||
|
||||
#Method static SkScalar Length(SkScalar x, SkScalar y)
|
||||
|
||||
#Line # Returns straight-line distance to origin. ##
|
||||
Returns the Euclidean_Distance from origin, computed as:
|
||||
#Code
|
||||
#Literal
|
||||
@ -1040,6 +1059,7 @@ sqrt(x * x + y * y)
|
||||
|
||||
#Method static SkScalar Normalize(SkVector* vec)
|
||||
|
||||
#Line # Sets length to one, and returns prior length. ##
|
||||
Scales (vec->fX, vec->fY) so that length() returns one, while preserving ratio of vec->fX to vec->fY,
|
||||
if possible. If original length is nearly zero, sets vec to (0, 0) and returns zero;
|
||||
otherwise, returns length of vec before vec is scaled.
|
||||
@ -1079,6 +1099,7 @@ Note that normalize() is faster if prior length is not required.
|
||||
|
||||
#Method static SkScalar Distance(const SkPoint& a, const SkPoint& b)
|
||||
|
||||
#Line # Returns straight-line distance between points. ##
|
||||
Returns the Euclidean_Distance between a and b.
|
||||
|
||||
#Param a line end point ##
|
||||
@ -1113,6 +1134,7 @@ Returns the Euclidean_Distance between a and b.
|
||||
|
||||
#Method static SkScalar DotProduct(const SkVector& a, const SkVector& b)
|
||||
|
||||
#Line # Returns dot product. ##
|
||||
Returns the dot product of Vector a and Vector b.
|
||||
|
||||
#Param a left side of dot product ##
|
||||
@ -1144,6 +1166,7 @@ Returns the dot product of Vector a and Vector b.
|
||||
|
||||
#Method static SkScalar CrossProduct(const SkVector& a, const SkVector& b)
|
||||
|
||||
#Line # Returns cross product. ##
|
||||
Returns the cross product of Vector a and Vector b.
|
||||
|
||||
a and b form three-dimensional vectors with z equal to zero. The cross product
|
||||
@ -1183,6 +1206,7 @@ term equals the returned value.
|
||||
|
||||
#Method SkScalar cross(const SkVector& vec) const
|
||||
|
||||
#Line # Returns cross product. ##
|
||||
Returns the cross product of Vector and vec.
|
||||
|
||||
Vector and vec form three-dimensional vectors with z equal to zero. The
|
||||
@ -1221,6 +1245,7 @@ The cross product z term equals the returned value.
|
||||
|
||||
#Method SkScalar dot(const SkVector& vec) const
|
||||
|
||||
#Line # Returns dot product. ##
|
||||
Returns the dot product of Vector and Vector vec.
|
||||
|
||||
#Param vec right side of dot product ##
|
||||
|
@ -158,6 +158,8 @@ vertical values when sorted. When equal to or less than fTop, Rect is empty.
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty()
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from bounds of (0, 0, 0, 0) ##
|
||||
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
|
||||
@ -190,6 +192,8 @@ outset rect isEmpty: false
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeWH(SkScalar w, SkScalar h)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar input returning (0, 0, width, height) ##
|
||||
Returns constructed Rect set to SkScalar values (0, 0, w, h). Does not
|
||||
validate input; w or h may be negative.
|
||||
|
||||
@ -221,6 +225,8 @@ all equal
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT MakeIWH(int w, int h)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from int input returning (0, 0, width, height) ##
|
||||
Returns constructed Rect set to integer values (0, 0, w, h). Does not validate
|
||||
input; w or h may be negative.
|
||||
|
||||
@ -253,6 +259,8 @@ i_rect width: 125000111 f_rect width:125000112
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeSize(const SkSize& size)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from Size returning (0, 0, width, height) ##
|
||||
Returns constructed Rect set to (0, 0, size.width(), size.height()). Does not
|
||||
validate input; size.width() or size.height() may be negative.
|
||||
|
||||
@ -281,6 +289,8 @@ floor width: 25 height: 35
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeLTRB(SkScalar l, SkScalar t, SkScalar r,
|
||||
SkScalar b)
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar left, top, right, bottom ##
|
||||
|
||||
Returns constructed Rect set to (l, t, r, b). Does not sort input; Rect may
|
||||
result in fLeft greater than fRight, or fTop greater than fBottom.
|
||||
@ -313,6 +323,8 @@ rect: 5, 25, 15, 35 isEmpty: false
|
||||
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeXYWH(SkScalar x, SkScalar y, SkScalar w, SkScalar h)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from SkScalar input returning (x, y, width, height) ##
|
||||
Returns constructed Rect set to
|
||||
#Formula
|
||||
(x, y, x + w, y + h)
|
||||
@ -348,6 +360,8 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect)
|
||||
|
||||
#In Constructors
|
||||
#Line # deprecated ##
|
||||
Deprecated.
|
||||
|
||||
#Deprecated
|
||||
@ -368,6 +382,8 @@ Deprecated.
|
||||
|
||||
#Method static SkRect Make(const SkISize& size)
|
||||
|
||||
#In Constructors
|
||||
#Line # constructs from ISize returning (0, 0, width, height) ##
|
||||
Returns constructed IRect set to (0, 0, size.width(), size.height()).
|
||||
Does not validate input; size.width() or size.height() may be negative.
|
||||
|
||||
@ -392,6 +408,7 @@ rect1 == rect2
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT Make(const SkIRect& irect)
|
||||
|
||||
#In Constructors
|
||||
Returns constructed IRect set to irect, promoting integers to Scalar.
|
||||
Does not validate input; fLeft may be greater than fRight, fTop may be greater
|
||||
than fBottom.
|
||||
@ -440,6 +457,8 @@ than fBottom.
|
||||
|
||||
#Method bool isEmpty() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns true if width or height are zero or negative ##
|
||||
Returns true if fLeft is equal to or greater than fRight, or if fTop is equal
|
||||
to or greater than fBottom. Call sort() to reverse rectangles with negative
|
||||
width() or height().
|
||||
@ -471,6 +490,8 @@ sorted: {20, 40, 20, 50} is empty
|
||||
|
||||
#Method bool isSorted() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns true if width or height are zero or positive ##
|
||||
Returns true if fLeft is equal to or less than fRight, or if fTop is equal
|
||||
to or less than fBottom. Call sort() to reverse rectangles with negative
|
||||
width() or height().
|
||||
@ -502,6 +523,8 @@ sorted: {20, 40, 20, 50} is sorted
|
||||
|
||||
#Method bool isFinite() const
|
||||
|
||||
#In Properties
|
||||
#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.
|
||||
|
||||
@ -528,6 +551,8 @@ widest is finite: false
|
||||
|
||||
#Method SkScalar x() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns bounds left ##
|
||||
Returns left edge of Rect, if sorted. Call isSorted to see if Rect is valid.
|
||||
Call sort() to reverse fLeft and fRight if needed.
|
||||
|
||||
@ -552,6 +577,8 @@ sorted.fLeft: 10 sorted.x(): 10
|
||||
|
||||
#Method SkScalar y() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns bounds top ##
|
||||
Returns top edge of Rect, if sorted. Call isEmpty to see if Rect may be invalid,
|
||||
and sort() to reverse fTop and fBottom if needed.
|
||||
|
||||
@ -576,6 +603,8 @@ sorted.fTop: 5 sorted.y(): 5
|
||||
|
||||
#Method SkScalar left() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns smaller bounds in x, if sorted ##
|
||||
Returns left edge of Rect, if sorted. Call isSorted to see if Rect is valid.
|
||||
Call sort() to reverse fLeft and fRight if needed.
|
||||
|
||||
@ -600,6 +629,8 @@ sorted.fLeft: 10 sorted.left(): 10
|
||||
|
||||
#Method SkScalar top() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns smaller bounds in y, if sorted ##
|
||||
Returns top edge of Rect, if sorted. Call isEmpty to see if Rect may be invalid,
|
||||
and sort() to reverse fTop and fBottom if needed.
|
||||
|
||||
@ -624,6 +655,8 @@ sorted.fTop: 5 sorted.top(): 5
|
||||
|
||||
#Method SkScalar right() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns larger bounds in x, if sorted ##
|
||||
Returns right edge of Rect, if sorted. Call isSorted to see if Rect is valid.
|
||||
Call sort() to reverse fLeft and fRight if needed.
|
||||
|
||||
@ -648,6 +681,8 @@ sorted.fRight: 15 sorted.right(): 15
|
||||
|
||||
#Method SkScalar bottom() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns larger bounds in y, if sorted ##
|
||||
Returns bottom edge of Rect, if sorted. Call isEmpty to see if Rect may be invalid,
|
||||
and sort() to reverse fTop and fBottom if needed.
|
||||
|
||||
@ -672,6 +707,8 @@ sorted.fBottom: 25 sorted.bottom(): 25
|
||||
|
||||
#Method SkScalar width() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns span in x ##
|
||||
Returns span on the x-axis. This does not check if Rect is sorted, or if
|
||||
result fits in 32-bit float; result may be negative or infinity.
|
||||
|
||||
@ -699,6 +736,8 @@ large width: 4294967296
|
||||
|
||||
#Method SkScalar height() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns span in y ##
|
||||
Returns span on the y-axis. This does not check if IRect is sorted, or if
|
||||
result fits in 32-bit float; result may be negative or infinity.
|
||||
|
||||
@ -726,6 +765,8 @@ large height: 4294967296
|
||||
|
||||
#Method SkScalar centerX() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns midpoint in x ##
|
||||
Returns average of left edge and right edge. Result does not change if Rect
|
||||
is sorted. Result may overflow to infinity if Rect is far from the origin.
|
||||
|
||||
@ -754,6 +795,8 @@ left: -41 right: -20 centerX: -30.5
|
||||
|
||||
#Method SkScalar centerY() const
|
||||
|
||||
#In Properties
|
||||
#Line # returns midpoint in y ##
|
||||
Returns average of top edge and bottom edge. Result does not change if Rect
|
||||
is sorted. Result may overflow to infinity if Rect is far from the origin.
|
||||
|
||||
@ -780,14 +823,16 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38
|
||||
#Legend
|
||||
# name # description ##
|
||||
#Legend ##
|
||||
# bool operator!=(const SkRect& a, const SkRect& b) # returns true if members are unequal ##
|
||||
# bool operator==(const SkRect& a, const SkRect& b) # returns true if members are equal ##
|
||||
# operator!=(const SkRect& a, const SkRect& b) # returns true if members are unequal ##
|
||||
# operator==(const SkRect& a, const SkRect& b) # returns true if members are equal ##
|
||||
#Table ##
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method bool operator==(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Operators
|
||||
#Line # returns true if members are equal ##
|
||||
Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
|
||||
equal to the corresponding members in b.
|
||||
|
||||
@ -831,6 +876,8 @@ tests are equal
|
||||
|
||||
#Method bool operator!=(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Operators
|
||||
#Line # returns true if members are unequal ##
|
||||
Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not
|
||||
equal the corresponding members in b.
|
||||
|
||||
@ -871,6 +918,8 @@ test with NaN is not equal to itself
|
||||
|
||||
#Method void toQuad(SkPoint quad[4]) const
|
||||
|
||||
#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.
|
||||
|
||||
@ -904,6 +953,8 @@ corners: {1, 2} {3, 2} {3, 4} {1, 4}
|
||||
|
||||
#Method void setBounds(const SkPoint pts[], int count)
|
||||
|
||||
#In As_Points
|
||||
#Line # sets to upper and lower limits of Point array ##
|
||||
Sets to bounds of Point array with count entries. If count is zero or smaller,
|
||||
or if Point array contains an infinity or NaN, sets to (0, 0, 0, 0).
|
||||
|
||||
@ -943,6 +994,8 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0
|
||||
|
||||
#Method bool setBoundsCheck(const SkPoint pts[], int count)
|
||||
|
||||
#In As_Points
|
||||
#Line # sets to upper and lower limits of Point array ##
|
||||
Sets to bounds of Point array with count entries. Returns false if count is
|
||||
zero or smaller, or if Point array contains an infinity or NaN; in these cases
|
||||
sets Rect to (0, 0, 0, 0).
|
||||
@ -1006,6 +1059,8 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false
|
||||
|
||||
#Method void setEmpty()
|
||||
|
||||
#In Set
|
||||
#Line # sets to (0, 0, 0, 0) ##
|
||||
Sets Rect to (0, 0, 0, 0).
|
||||
|
||||
Many other rectangles are empty; if left is equal to or greater than right,
|
||||
@ -1033,6 +1088,8 @@ rect: {0, 0, 0, 0} is empty
|
||||
|
||||
#Method void set(const SkIRect& src)
|
||||
|
||||
#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.
|
||||
|
||||
@ -1058,6 +1115,7 @@ f_rect: {3, 4, 1, 2}
|
||||
|
||||
#Method void set(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
|
||||
|
||||
#In Set
|
||||
Sets Rect 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.
|
||||
@ -1087,6 +1145,8 @@ rect2: {3, 4, 1, 2}
|
||||
|
||||
#Method void setLTRB(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
|
||||
|
||||
#In Set
|
||||
#Line # sets to SkScalar input (left, top, right, bottom) ##
|
||||
Sets Rect 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.
|
||||
@ -1116,6 +1176,7 @@ rect2: {3, 4, 1, 2}
|
||||
|
||||
#Method void set(const SkPoint pts[], int count)
|
||||
|
||||
#In Set
|
||||
Sets to bounds of Point array with count entries. If count is zero or smaller,
|
||||
or if Point array contains an infinity or NaN, sets Rect to (0, 0, 0, 0).
|
||||
|
||||
@ -1155,6 +1216,7 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0
|
||||
|
||||
#Method void set(const SkPoint& p0, const SkPoint& p1)
|
||||
|
||||
#In Set
|
||||
Sets bounds to the smallest Rect enclosing Points p0 and p1. The result is
|
||||
sorted and may be empty. Does not check to see if values are finite.
|
||||
|
||||
@ -1182,6 +1244,8 @@ p0 and p1 may be swapped and have the same effect unless one contains NaN.
|
||||
|
||||
#Method void setXYWH(SkScalar x, SkScalar y, SkScalar width, SkScalar height)
|
||||
|
||||
#In Set
|
||||
#Line # sets to SkScalar input (x, y, width, height) ##
|
||||
Sets Rect to
|
||||
#Formula
|
||||
(x, y, x + width, y + height)
|
||||
@ -1216,6 +1280,8 @@ rect: -10, 35, 5, 60 isEmpty: false
|
||||
|
||||
#Method void setWH(SkScalar width, SkScalar height)
|
||||
|
||||
#In Set
|
||||
#Line # sets to SkScalar input (0, 0, width, height) ##
|
||||
Sets Rect to (0, 0, width, height). Does not validate input;
|
||||
width or height may be negative.
|
||||
|
||||
@ -1256,6 +1322,8 @@ rect: -15, 0, 0, 25 isEmpty: false
|
||||
|
||||
#Method void iset(int left, int top, int right, int bottom)
|
||||
|
||||
#In From_Integers
|
||||
#Line # sets to int input (left, top, right, bottom) ##
|
||||
Sets Rect to (left, top, right, bottom).
|
||||
All parameters are promoted from integer to Scalar.
|
||||
left and right are not sorted; left is not necessarily less than right.
|
||||
@ -1286,6 +1354,8 @@ rect2: {3, 4, 1, 2}
|
||||
|
||||
#Method void isetWH(int width, int height)
|
||||
|
||||
#In From_Integers
|
||||
#Line # sets to int input (0, 0, width, height) ##
|
||||
Sets Rect to (0, 0, width, height).
|
||||
width and height may be zero or negative. width and height are promoted from
|
||||
integer to SkScalar, large values may lose precision.
|
||||
@ -1332,6 +1402,8 @@ rect2: {0, 0, 1, 2}
|
||||
|
||||
#Method SkRect makeOffset(SkScalar dx, SkScalar dy) const
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # constructs from translated sides ##
|
||||
Returns Rect offset by (dx, dy).
|
||||
|
||||
If dx is negative, Rect returned is moved to the left.
|
||||
@ -1365,6 +1437,8 @@ rect: 25, 82, 35, 92 isEmpty: false
|
||||
|
||||
#Method SkRect makeInset(SkScalar dx, SkScalar dy) const
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # constructs from sides moved symmetrically about the center ##
|
||||
Returns Rect, inset by (dx, dy).
|
||||
|
||||
If dx is negative, Rect returned is wider.
|
||||
@ -1398,6 +1472,8 @@ rect: 25, 82, 5, 28 isEmpty: true
|
||||
|
||||
#Method SkRect makeOutset(SkScalar dx, SkScalar dy) const
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # constructs from sides moved symmetrically about the center ##
|
||||
Returns Rect, outset by (dx, dy).
|
||||
|
||||
If dx is negative, Rect returned is narrower.
|
||||
@ -1431,6 +1507,8 @@ rect: -5, 18, 35, 92 isEmpty: false
|
||||
|
||||
#Method void offset(SkScalar dx, SkScalar dy)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # translates sides without changing width and height ##
|
||||
Offsets Rect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
|
||||
|
||||
If dx is negative, moves Rect to the left.
|
||||
@ -1458,6 +1536,7 @@ rect: 15, 27, 55, 86
|
||||
|
||||
#Method void offset(const SkPoint& delta)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
Offsets Rect by adding delta.fX to fLeft, fRight; and by adding delta.fY to
|
||||
fTop, fBottom.
|
||||
|
||||
@ -1485,6 +1564,8 @@ rect: 15, 27, 55, 86
|
||||
|
||||
#Method void offsetTo(SkScalar newX, SkScalar newY)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # translates to (x, y) without changing width and height ##
|
||||
Offsets Rect so that fLeft equals newX, and fTop equals newY. width and height
|
||||
are unchanged.
|
||||
|
||||
@ -1508,6 +1589,8 @@ rect: 15, 27, 55, 86
|
||||
|
||||
#Method void inset(SkScalar dx, SkScalar dy)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # moves the sides symmetrically about the center ##
|
||||
Insets Rect by (dx, dy).
|
||||
|
||||
If dx is positive, makes Rect narrower.
|
||||
@ -1535,6 +1618,8 @@ rect: 15, 27, 45, 60
|
||||
|
||||
#Method void outset(SkScalar dx, SkScalar dy)
|
||||
|
||||
#In Inset_Outset_Offset
|
||||
#Line # moves the sides symmetrically about the center ##
|
||||
Outsets Rect by (dx, dy).
|
||||
|
||||
If dx is positive, makes Rect wider.
|
||||
@ -1596,6 +1681,8 @@ describes an area: fLeft is less than fRight, and fTop is less than fBottom.
|
||||
|
||||
#Method bool contains(const SkRect& r) const
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if points are equal or inside ##
|
||||
Returns true if Rect contains r.
|
||||
Returns false if Rect is empty or r is empty.
|
||||
|
||||
@ -1629,6 +1716,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool contains(const SkIRect& r) const
|
||||
|
||||
#In Intersection
|
||||
Returns true if Rect contains r.
|
||||
Returns false if Rect is empty or r is empty.
|
||||
|
||||
@ -1662,6 +1750,8 @@ rect: (30, 50, 40, 60) does not contain (29, 59, 30, 60)
|
||||
|
||||
#Method bool intersect(const SkRect& r)
|
||||
|
||||
#In Intersection
|
||||
#Line # sets to shared area; returns true if not empty ##
|
||||
Returns true if Rect intersects r, and sets Rect to intersection.
|
||||
Returns false if Rect does not intersect r, and leaves Rect unchanged.
|
||||
|
||||
@ -1695,6 +1785,7 @@ be before or after the call to intersect.
|
||||
|
||||
#Method bool intersect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
|
||||
|
||||
#In Intersection
|
||||
Constructs Rect to intersect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
|
||||
@ -1733,6 +1824,7 @@ be before or after the call to intersect.
|
||||
|
||||
#Method bool SK_WARN_UNUSED_RESULT intersect(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Intersection
|
||||
Returns true if a intersects b, and sets Rect to intersection.
|
||||
Returns false if a does not intersect b, and leaves Rect unchanged.
|
||||
|
||||
@ -1761,6 +1853,8 @@ Returns false if either a or b is empty, leaving Rect unchanged.
|
||||
|
||||
#Method bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) const
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if areas overlap ##
|
||||
Constructs Rect to intersect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
|
||||
@ -1790,6 +1884,7 @@ Returns false if either construction or Rect is empty, or do not intersect.
|
||||
|
||||
#Method bool intersects(const SkRect& r) const
|
||||
|
||||
#In Intersection
|
||||
Returns true if Rect intersects r.
|
||||
Returns false if either r or Rect is empty, or do not intersect.
|
||||
|
||||
@ -1813,6 +1908,8 @@ Returns false if either r or Rect is empty, or do not intersect.
|
||||
|
||||
#Method static bool Intersects(const SkRect& a, const SkRect& b)
|
||||
|
||||
#In Intersection
|
||||
#Line # returns true if areas overlap ##
|
||||
Returns true if a intersects b.
|
||||
Returns false if either a or b is empty, or do not intersect.
|
||||
|
||||
@ -1851,6 +1948,8 @@ Returns false if either a or b is empty, or do not intersect.
|
||||
|
||||
#Method void join(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
|
||||
|
||||
#In Join
|
||||
#Line # sets to union of bounds ##
|
||||
Constructs Rect to intersect from (left, top, right, bottom). Does not sort
|
||||
construction.
|
||||
|
||||
@ -1881,6 +1980,7 @@ Rect to construction.
|
||||
|
||||
#Method void join(const SkRect& r)
|
||||
|
||||
#In Join
|
||||
Sets Rect to the union of itself and r.
|
||||
|
||||
Has no effect if r is empty. Otherwise, if Rect is empty, sets
|
||||
@ -1905,6 +2005,8 @@ Rect to r.
|
||||
|
||||
#Method void joinNonEmptyArg(const SkRect& r)
|
||||
|
||||
#In Join
|
||||
#Line # sets to union of bounds, asserting that argument is not empty ##
|
||||
Sets Rect to the union of itself and r.
|
||||
|
||||
Asserts if r is empty and SK_DEBUG is defined.
|
||||
@ -1939,6 +2041,8 @@ sorted: 10, 0, 55, 100
|
||||
|
||||
#Method void joinPossiblyEmptyRect(const SkRect& r)
|
||||
|
||||
#In Join
|
||||
#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.
|
||||
@ -1986,6 +2090,8 @@ sorted: 10, 0, 55, 100
|
||||
|
||||
#Method void round(SkIRect* dst) const
|
||||
|
||||
#In Rounding
|
||||
#Line # sets members to nearest integer value ##
|
||||
Sets IRect by adding 0.5 and discarding the fractional portion of Rect
|
||||
members, using
|
||||
#Formula
|
||||
@ -2014,6 +2120,8 @@ round: 31, 51, 41, 61
|
||||
|
||||
#Method void roundOut(SkIRect* dst) const
|
||||
|
||||
#In Rounding
|
||||
#Line # sets members to nearest integer value away from opposite ##
|
||||
Sets IRect by discarding the fractional portion of fLeft and fTop; and
|
||||
rounding up fRight and FBottom, using
|
||||
#Formula
|
||||
@ -2042,6 +2150,7 @@ round: 30, 50, 41, 61
|
||||
|
||||
#Method void roundOut(SkRect* dst) const
|
||||
|
||||
#In Rounding
|
||||
Sets Rect by discarding the fractional portion of fLeft and fTop; and
|
||||
rounding up fRight and FBottom, using
|
||||
#Formula
|
||||
@ -2070,6 +2179,8 @@ round: 30, 50, 41, 61
|
||||
|
||||
#Method void roundIn(SkIRect* dst) const
|
||||
|
||||
#In Rounding
|
||||
#Line # sets members to nearest integer value towards opposite ##
|
||||
Sets Rect by rounding up fLeft and fTop; and
|
||||
discarding the fractional portion of fRight and FBottom, using
|
||||
|
||||
@ -2099,6 +2210,7 @@ round: 31, 51, 40, 60
|
||||
|
||||
#Method SkIRect round() const
|
||||
|
||||
#In Rounding
|
||||
Returns IRect by adding 0.5 and discarding the fractional portion of Rect
|
||||
members, using
|
||||
#Formula
|
||||
@ -2126,6 +2238,7 @@ round: 31, 51, 41, 61
|
||||
|
||||
#Method SkIRect roundOut() const
|
||||
|
||||
#In Rounding
|
||||
Sets IRect by discarding the fractional portion of fLeft and fTop; and
|
||||
rounding up fRight and FBottom, using
|
||||
#Formula
|
||||
@ -2165,6 +2278,8 @@ round: 30, 50, 41, 61
|
||||
|
||||
#Method void sort()
|
||||
|
||||
#In Sorting
|
||||
#Line # orders sides from smaller to larger ##
|
||||
Swaps fLeft and fRight if fLeft is greater than fRight; and swaps
|
||||
fTop and fBottom if fTop is greater than fBottom. Result may be empty;
|
||||
and width() and height() will be zero or positive.
|
||||
@ -2188,6 +2303,8 @@ sorted: 20.5, 10.5, 30.5, 50.5
|
||||
|
||||
#Method SkRect makeSorted() const
|
||||
|
||||
#In Sorting
|
||||
#Line # constructs, 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.
|
||||
@ -2215,6 +2332,7 @@ sorted: 20.5, 10.5, 30.5, 50.5
|
||||
|
||||
#Method const SkScalar* asScalars() const
|
||||
|
||||
#Line # returns pointer to members as array ##
|
||||
Returns pointer to first Scalar in Rect, to treat it as an array with four
|
||||
entries.
|
||||
|
||||
@ -2236,6 +2354,7 @@ rect.asScalars() == &rect.fLeft
|
||||
|
||||
#Method void dump(bool asHex) const
|
||||
|
||||
#Line # sends text representation to standard output using floats ##
|
||||
Writes text representation of Rect to standard output. Set asHex to true to
|
||||
generate exact binary representations of floating point numbers.
|
||||
|
||||
@ -2289,6 +2408,7 @@ rect is not equal to copy
|
||||
|
||||
#Method void dumpHex() const
|
||||
|
||||
#Line # sends text representation to standard output using hexadecimal ##
|
||||
Writes text representation of Rect 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
|
||||
@ -2321,6 +2441,7 @@ rect is equal to copy
|
||||
|
||||
#Method static SkRect SK_WARN_UNUSED_RESULT MakeLargest()
|
||||
|
||||
#Line # deprecated ##
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
|
@ -84,6 +84,7 @@ of the requested dimensions are zero, then nullptr will be returned.
|
||||
#Method static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo& imageInfo, void* pixels,
|
||||
size_t rowBytes,
|
||||
const SkSurfaceProps* surfaceProps = nullptr)
|
||||
#Line # creates Surface from SkImageInfo and Pixel_Storage ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
|
||||
@ -146,6 +147,7 @@ void draw(SkCanvas* ) {
|
||||
size_t rowBytes,
|
||||
void (*releaseProc)(void* pixels, void* context),
|
||||
void* context, const SkSurfaceProps* surfaceProps = nullptr)
|
||||
#Line # creates Surface from SkImageInfo and Pixel_Storage ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
releaseProc is called with pixels and context when Surface is deleted.
|
||||
@ -220,6 +222,7 @@ expected release context
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo, size_t rowBytes,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#Line # creates Surface from SkImageInfo ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
Allocates and zeroes pixel memory. Pixel memory size is imageInfo.height() times
|
||||
@ -335,6 +338,7 @@ void draw(SkCanvas* ) {
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height,
|
||||
const SkSurfaceProps* surfaceProps = nullptr)
|
||||
#Line # creates Surface from width, height matching output ##
|
||||
|
||||
Allocates raster Surface. Canvas returned by Surface draws directly into pixels.
|
||||
Allocates and zeroes pixel memory. Pixel memory size is height times width times
|
||||
@ -395,6 +399,7 @@ void draw(SkCanvas* ) {
|
||||
GrSurfaceOrigin origin, int sampleCnt,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#Line # creates Surface from GPU-backed texture ##
|
||||
|
||||
Wraps a GPU-backed texture into Surface. Caller must ensure the texture is
|
||||
valid for the lifetime of returned Surface. If sampleCnt greater than zero,
|
||||
@ -512,6 +517,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
|
||||
GrSurfaceOrigin origin,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#Line # creates Surface from GPU memory buffer ##
|
||||
|
||||
Wraps a GPU-backed buffer into Surface. Caller must ensure render target is
|
||||
valid for the lifetime of returned Surface.
|
||||
@ -626,6 +632,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
|
||||
int sampleCnt,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
const SkSurfaceProps* surfaceProps)
|
||||
#Line # creates Surface from GPU-backed texture ##
|
||||
|
||||
Used to wrap a GPU-backed texture as a SkSurface. Skia will treat the texture as
|
||||
a rendering target only, but unlike NewFromBackendRenderTarget, Skia will manage and own
|
||||
@ -733,6 +740,7 @@ If SK_SUPPORT_GPU is defined as zero, has no effect and returns nullptr.
|
||||
int sampleCount, GrSurfaceOrigin surfaceOrigin,
|
||||
const SkSurfaceProps* surfaceProps,
|
||||
bool shouldCreateWithMips = false)
|
||||
#Line # creates Surface pointing to new GPU memory buffer ##
|
||||
|
||||
Returns offscreen Surface on GPU indicated by context. Allocates memory for
|
||||
pixels, based on the width, height, and Color_Type in ImageInfo. budgeted
|
||||
@ -913,6 +921,7 @@ Surface bottom-left corner is pinned to the origin.
|
||||
|
||||
#Method static sk_sp<SkSurface> MakeNull(int width, int height)
|
||||
|
||||
#Line # creates Surface without backing pixels ##
|
||||
Returns Surface without backing pixels. Drawing to Canvas returned from Surface
|
||||
has no effect. Calling makeImageSnapshot() on returned Surface returns nullptr.
|
||||
|
||||
@ -945,6 +954,7 @@ surf->makeImageSnapshot() == nullptr
|
||||
|
||||
#Method int width() const
|
||||
|
||||
#Line # returns pixel column count ##
|
||||
Returns pixel count in each row; may be zero or greater.
|
||||
|
||||
#Return number of pixel columns ##
|
||||
@ -969,6 +979,7 @@ surface width=37 canvas width=37
|
||||
|
||||
#Method int height() const
|
||||
|
||||
#Line # returns pixel row count ##
|
||||
Returns pixel row count; may be zero or greater.
|
||||
|
||||
#Return number of pixel rows ##
|
||||
@ -993,6 +1004,7 @@ surface height=1000 canvas height=1000
|
||||
|
||||
#Method uint32_t generationID()
|
||||
|
||||
#Line # returns unique ID ##
|
||||
Returns unique value identifying the content of Surface. Returned value changes
|
||||
each time the content changes. Content is changed by drawing, or by calling
|
||||
notifyContentWillChange.
|
||||
@ -1050,6 +1062,7 @@ If a snapshot has been generated, this copies the Surface contents.
|
||||
|
||||
#Method void notifyContentWillChange(ContentChangeMode mode)
|
||||
|
||||
#Line # notifies that contents will be changed outside of Skia ##
|
||||
Notifies that Surface contents will be changed by code outside of Skia.
|
||||
Subsequent calls to generationID return a different value.
|
||||
|
||||
@ -1159,6 +1172,7 @@ Deprecated.
|
||||
|
||||
#Method GrBackendObject getTextureHandle(BackendHandleAccess backendHandleAccess)
|
||||
|
||||
#Line # returns the GPU reference to texture ##
|
||||
Returns the GPU back-end reference of the texture used by Surface, or zero
|
||||
if Surface is not backed by a GPU texture.
|
||||
|
||||
@ -1201,6 +1215,7 @@ or when Surface is deleted.
|
||||
|
||||
#Method bool getRenderTargetHandle(GrBackendObject* backendObject,
|
||||
BackendHandleAccess backendHandleAccess)
|
||||
#Line # returns the GPU reference to render target ##
|
||||
|
||||
Returns true and stores the GPU back-end reference of the render target used
|
||||
by Surface in backendObject.
|
||||
@ -1250,6 +1265,7 @@ In OpenGL this returns the frame buffer object ID.
|
||||
|
||||
#Method SkCanvas* getCanvas()
|
||||
|
||||
#Line # returns Canvas that draws into Surface ##
|
||||
Returns Canvas that draws into Surface. Subsequent calls return the same Canvas.
|
||||
Canvas returned is managed and owned by Surface, and is deleted when Surface
|
||||
is deleted.
|
||||
@ -1275,6 +1291,7 @@ is deleted.
|
||||
|
||||
#Method sk_sp<SkSurface> makeSurface(const SkImageInfo& imageInfo)
|
||||
|
||||
#Line # creates a compatible Surface ##
|
||||
Returns a compatible Surface, or nullptr. Returned Surface contains
|
||||
the same raster, GPU, or null properties as the original. Returned Surface
|
||||
does not share the same pixels.
|
||||
@ -1315,6 +1332,7 @@ is incompatible with Surface.
|
||||
|
||||
#Method sk_sp<SkImage> makeImageSnapshot()
|
||||
|
||||
#Line # creates Image capturing Surface contents ##
|
||||
Returns Image capturing Surface contents. Subsequent drawing to Surface contents
|
||||
are not captured. Image allocation is accounted for if Surface was created with
|
||||
SkBudgeted::kYes.
|
||||
@ -1342,6 +1360,7 @@ SkBudgeted::kYes.
|
||||
|
||||
#Method void draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint)
|
||||
|
||||
#Line # draws Surface contents to canvas ##
|
||||
Draws Surface contents to canvas, with its top-left corner at (x, y).
|
||||
|
||||
If Paint paint is not nullptr, apply Color_Filter, Color_Alpha, Image_Filter,
|
||||
@ -1377,6 +1396,7 @@ Blend_Mode, and Draw_Looper.
|
||||
|
||||
#Method bool peekPixels(SkPixmap* pixmap)
|
||||
|
||||
#Line # copies Surface parameters to Pixmap ##
|
||||
Copies Surface pixel address, row bytes, and Image_Info to Pixmap, if address
|
||||
is available, and returns true. If pixel address is not available, return
|
||||
false and leave Pixmap unchanged.
|
||||
@ -1411,6 +1431,7 @@ pixmap contents become invalid on any future change to Surface.
|
||||
|
||||
#Method bool readPixels(const SkPixmap& dst, int srcX, int srcY)
|
||||
|
||||
#Line # copies Rect of pixels ##
|
||||
Copies Rect of pixels to dst.
|
||||
|
||||
Source Rect corners are (srcX, srcY) and Surface (width(), height()).
|
||||
@ -1593,6 +1614,7 @@ Does not copy, and returns false if:
|
||||
|
||||
#Method const SkSurfaceProps& props() const
|
||||
|
||||
#Line # returns Surface_Properties ##
|
||||
Returns Surface_Properties for surface.
|
||||
|
||||
#Return LCD striping orientation and setting for device independent fonts ##
|
||||
@ -1614,6 +1636,7 @@ surf.props(): kRGB_H_SkPixelGeometry
|
||||
|
||||
#Method void prepareForExternalIO()
|
||||
|
||||
#Line # to be deprecated ##
|
||||
To be deprecated.
|
||||
|
||||
#NoExample
|
||||
@ -1625,6 +1648,7 @@ To be deprecated.
|
||||
|
||||
#Method void flush()
|
||||
|
||||
#Line # resolve 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
|
||||
@ -1642,6 +1666,7 @@ GPU calls.
|
||||
|
||||
#Method GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores,
|
||||
GrBackendSemaphore signalSemaphores[])
|
||||
#Line # resolve 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
|
||||
@ -1682,6 +1707,7 @@ Pending surface commands are flushed regardless of the return result.
|
||||
|
||||
#Method bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores)
|
||||
|
||||
#Line # rause 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.
|
||||
@ -1736,6 +1762,7 @@ and the client will still own the semaphores.
|
||||
|
||||
#Method bool characterize(SkSurfaceCharacterization* characterization) const
|
||||
|
||||
#Line # sets Surface_Characterization for threaded pre-processing ##
|
||||
Initializes Surface_Characterization that can be used to perform GPU back-end
|
||||
pre-processing in a separate thread. Typically this is used to divide drawing
|
||||
into multiple tiles. DeferredDisplayListRecorder records the drawing commands
|
||||
|
@ -132,11 +132,11 @@ $ ninja -C out/dir bookmaker
|
||||
Complete rebuilding of all bookmaker output looks like:
|
||||
|
||||
#Code
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -e fiddle.json
|
||||
$ ~/go/bin/fiddlecli.exe --input fiddle.json --output fiddleout.json
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -f fiddleout.json -r site/user/api -c
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -x
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -p
|
||||
$ ./out/skia/bookmaker -a docs/status.json -e fiddle.json
|
||||
$ ~/go/bin/fiddlecli --input fiddle.json --output fiddleout.json
|
||||
$ ./out/skia/bookmaker -a docs/status.json -f fiddleout.json -r site/user/api -c
|
||||
$ ./out/skia/bookmaker -a docs/status.json -x
|
||||
$ ./out/skia/bookmaker -a docs/status.json -p
|
||||
##
|
||||
|
||||
#Subtopic Regenerate ##
|
||||
|
@ -19,14 +19,14 @@ Stack helper class calls
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| <a href="#SkAutoCanvasRestore_SkCanvas_star">SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)</a> | Preserves <a href="SkCanvas_Reference#Canvas">Canvas</a> save count. |
|
||||
| | Restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state. |
|
||||
| <a href="#SkAutoCanvasRestore_SkCanvas_star">SkAutoCanvasRestore(SkCanvas* canvas, bool doSave)</a> | preserves <a href="SkCanvas_Reference#Canvas">Canvas</a> save count |
|
||||
| | restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state |
|
||||
|
||||
## <a name="Member_Functions"></a> Member Functions
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| <a href="#SkAutoCanvasRestore_restore">restore</a> | Restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state. |
|
||||
| <a href="#SkAutoCanvasRestore_restore">restore</a> | restores <a href="SkCanvas_Reference#Canvas">Canvas</a> to saved state |
|
||||
|
||||
<a name="SkAutoCanvasRestore_SkCanvas_star"></a>
|
||||
## SkAutoCanvasRestore
|
||||
|
@ -62,8 +62,8 @@ is useful to position one or more <a href="#Bitmap">Bitmaps</a> within a shared
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| <a href="#SkBitmap">SkBitmap</a>& <a href="#SkBitmap_move_operator">operator=(SkBitmap&& src)</a> | takes ownership of pixels |
|
||||
| <a href="#SkBitmap">SkBitmap</a>& <a href="#SkBitmap_copy_operator">operator=(const SkBitmap& src)</a> | shares ownership of pixels |
|
||||
| <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_Functions"></a> Member Functions
|
||||
|
||||
@ -247,7 +247,7 @@ empty <a href="#Bitmap">Bitmap</a>
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="8bf225da00df80970271722cd3d1ced4">
|
||||
<div><fiddle-embed name="6739d14ec0d6a373f2fcadc6b3077fd4">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -461,7 +461,7 @@ Swaps the fields of the two bitmaps.
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="aaf9157531f4969b4ec048e9edcdb069">
|
||||
<div><fiddle-embed name="274d02e5f33866b1a9a78423c5569e22">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -537,7 +537,7 @@ reference to <a href="SkImageInfo_Reference#Image_Info">Image Info</a>
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="2932fccfb074cf52b17cec238f70d888">
|
||||
<div><fiddle-embed name="ec47c4dc23e2925ad565eaba55a91553">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -640,12 +640,12 @@ Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, one of: <a hr
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="8aa2ab0565091082a874c23886ddb0c5">
|
||||
<div><fiddle-embed name="ceb77fab7326b57822a147b04aa0960e">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
color type: kAlpha_SkColorType
|
||||
color type: kAlpha_8_SkColorType
|
||||
~~~~
|
||||
|
||||
</fiddle-embed></div>
|
||||
@ -773,13 +773,13 @@ bytes in pixel
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="f09e181f3210d427e4b3d2ae6667ae6a">
|
||||
<div><fiddle-embed name="4bfe28ea3f70f3bfd73d956e913c1a20">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
color: kUnknown_SkColorType bytesPerPixel: 0
|
||||
color: kAlpha_SkColorType bytesPerPixel: 1
|
||||
color: kAlpha_8_SkColorType bytesPerPixel: 1
|
||||
color: kRGB_565_SkColorType bytesPerPixel: 2
|
||||
color: kARGB_4444_SkColorType bytesPerPixel: 2
|
||||
color: kRGBA_8888_SkColorType bytesPerPixel: 4
|
||||
@ -848,13 +848,13 @@ one of: 0, 1, 2, 3; left shift to convert pixels to bytes
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="8fa214f2b9a655d7b492181d2143538c">
|
||||
<div><fiddle-embed name="2c77d92f20b950154b9444d3b639b36c">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
color: kUnknown_SkColorType shiftPerPixel: 0
|
||||
color: kAlpha_SkColorType shiftPerPixel: 0
|
||||
color: kAlpha_8_SkColorType shiftPerPixel: 0
|
||||
color: kRGB_565_SkColorType shiftPerPixel: 1
|
||||
color: kARGB_4444_SkColorType shiftPerPixel: 1
|
||||
color: kRGBA_8888_SkColorType shiftPerPixel: 2
|
||||
@ -1059,7 +1059,7 @@ true if <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a> is set
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="786005ff582d0369c83e7d686d94138d"></fiddle-embed></div>
|
||||
<div><fiddle-embed name="9394975fa8a13204a5cc2e94f86737e5"></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
|
@ -73,10 +73,11 @@ when no <a href="SkSurface_Reference#Surface">Surface</a> is required, and some
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| <a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> | creates <a href="#Canvas">Canvas</a> from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and pixel data |
|
||||
| <a href="#SkCanvas_MakeRasterDirectN32">MakeRasterDirectN32</a> | creates <a href="#Canvas">Canvas</a> from image specifications and pixel data |
|
||||
| <a href="#SkCanvas_MakeRasterDirect">MakeRasterDirect</a> | creates from <a href="SkImageInfo_Reference#SkImageInfo">SkImageInfo</a> and <a href="#Storage">Pixel Storage</a> |
|
||||
| <a href="#SkCanvas_MakeRasterDirectN32">MakeRasterDirectN32</a> | creates from image data and <a href="#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="undocumented#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> |
|
||||
@ -150,7 +151,8 @@ when no <a href="SkSurface_Reference#Surface">Surface</a> is required, and some
|
||||
| <a href="#SkCanvas_setAllowSimplifyClip">setAllowSimplifyClip</a> | experimental |
|
||||
| <a href="#SkCanvas_setDrawFilter">setDrawFilter</a> | legacy; to be deprecated |
|
||||
| <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_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>
|
||||
|
@ -4,7 +4,7 @@ SkIPoint16 Reference
|
||||
# <a name="IPoint16"></a> IPoint16
|
||||
|
||||
# <a name="SkIPoint16"></a> Struct SkIPoint16
|
||||
<a href="SkIPoint_Reference#SkIPoint">SkIPoint</a> holds two 16 bit integer coordinates.
|
||||
<a href="#SkIPoint16">SkIPoint16</a> holds two 16 bit integer coordinates.
|
||||
|
||||
# <a name="Overview"></a> Overview
|
||||
|
||||
|
@ -26,13 +26,13 @@ SkIPoint Reference
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| <a href="#SkIPoint">SkIPoint</a> <a href="#SkIPoint_add_operator">operator+(const SkIPoint& a, const SkIVector& b)</a> | returns <a href="#IPoint">IPoint</a> offset by <a href="SkIPoint_Reference#IVector">IVector</a> |
|
||||
| <a href="#SkIPoint">SkIPoint</a> <a href="#SkIPoint_minus_operator">operator-() const</a> | reverses sign of <a href="#IPoint">IPoint</a> |
|
||||
| <a href="SkIPoint_Reference#SkIVector">SkIVector</a> <a href="#SkIPoint_subtract_operator">operator-(const SkIPoint& a, const SkIPoint& b)</a> | returns <a href="SkIPoint_Reference#IVector">IVector</a> between <a href="#IPoint">IPoints</a> |
|
||||
| bool <a href="#SkIPoint_notequal_operator">operator!=(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are unequal |
|
||||
| bool <a href="#SkIPoint_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are equal |
|
||||
| void <a href="#SkIPoint_addto_operator">operator+=(const SkIVector& v)</a> | adds <a href="SkIPoint_Reference#IVector">IVector</a> to <a href="#IPoint">IPoint</a> |
|
||||
| void <a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> | subtracts <a href="SkIPoint_Reference#IVector">IVector</a> from <a href="#IPoint">IPoint</a> |
|
||||
| <a href="#SkIPoint_add_operator">operator+(const SkIPoint& a, const SkIVector& b)</a> | returns <a href="#IPoint">IPoint</a> offset by <a href="SkIPoint_Reference#IVector">IVector</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="SkIPoint_Reference#IVector">IVector</a> between <a href="#IPoint">IPoints</a> |
|
||||
| <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_equal_operator">operator==(const SkIPoint& a, const SkIPoint& b)</a> | returns true if <a href="#IPoint">IPoints</a> are equal |
|
||||
| <a href="#SkIPoint_addto_operator">operator+=(const SkIVector& v)</a> | adds <a href="SkIPoint_Reference#IVector">IVector</a> to <a href="#IPoint">IPoint</a> |
|
||||
| <a href="#SkIPoint_subtractfrom_operator">operator-=(const SkIVector& v)</a> | subtracts <a href="SkIPoint_Reference#IVector">IVector</a> from <a href="#IPoint">IPoint</a> |
|
||||
|
||||
## <a name="Member_Functions"></a> Member Functions
|
||||
|
||||
|
@ -829,8 +829,8 @@ sorted: {20, 40, 20, 50} is empty
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| bool <a href="#SkIRect_notequal_operator">operator!=(const SkIRect& a, const SkIRect& b)</a> | returns true if members are unequal |
|
||||
| bool <a href="#SkIRect_equal_operator">operator==(const SkIRect& a, const SkIRect& b)</a> | returns true if members are equal |
|
||||
| <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>
|
||||
## operator==
|
||||
|
@ -114,14 +114,28 @@ for 32 bit pixels.
|
||||
<td><a name="kRGBA_8888_SkColorType"> <code><strong>kRGBA_8888_SkColorType </strong></code> </a></td><td>4</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="kBGRA_8888_SkColorType"> <code><strong>kBGRA_8888_SkColorType </strong></code> </a></td><td>5</td><td></td>
|
||||
<td><a name="kRGB_888x_SkColorType"> <code><strong>kRGB_888x_SkColorType </strong></code> </a></td><td>5</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="kGray_8_SkColorType"> <code><strong>kGray_8_SkColorType </strong></code> </a></td><td>6</td><td></td>
|
||||
<td><a name="kBGRA_8888_SkColorType"> <code><strong>kBGRA_8888_SkColorType </strong></code> </a></td><td>6</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="kRGBA_F16_SkColorType"> <code><strong>kRGBA_F16_SkColorType </strong></code> </a></td><td>7</td><td></td>
|
||||
<td><a name="kRGBA_1010102_SkColorType"> <code><strong>kRGBA_1010102_SkColorType </strong></code> </a></td><td>7</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="kRGB_101010x_SkColorType"> <code><strong>kRGB_101010x_SkColorType </strong></code> </a></td><td>8</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="kGray_8_SkColorType"> <code><strong>kGray_8_SkColorType </strong></code> </a></td><td>9</td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="kRGBA_F16_SkColorType"> <code><strong>kRGBA_F16_SkColorType </strong></code> </a></td><td>10</td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Constants
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><a name="kN32_SkColorType"> <code><strong>kN32_SkColorType </strong></code> </a></td><td>4</td><td></td>
|
||||
</tr>
|
||||
@ -212,8 +226,8 @@ Used for both src images and render-targets (surfaces).
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| bool <a href="#SkImageInfo_notequal1_operator">operator!=(const SkImageInfo& other) const</a> | |
|
||||
| bool <a href="#SkImageInfo_equal1_operator">operator==(const SkImageInfo& other) const</a> | |
|
||||
| <a href="#SkImageInfo_notequal1_operator">operator!=(const SkImageInfo& other) const</a> | |
|
||||
| <a href="#SkImageInfo_equal1_operator">operator==(const SkImageInfo& other) const</a> | |
|
||||
|
||||
## <a name="Member_Functions"></a> Member Functions
|
||||
|
||||
|
@ -787,8 +787,8 @@ zero but may differ from plane to plane. Returned <a href="#Image">Image</a> has
|
||||
<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="undocumented#YUV_ColorSpace">kJPEG SkYUVColorSpace</a>, <a href="undocumented#YUV_ColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="undocumented#YUV_ColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
one of: <a href="SkImageInfo_Reference#SkYUVColorSpace">kJPEG SkYUVColorSpace</a>, <a href="SkImageInfo_Reference#SkYUVColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="SkImageInfo_Reference#SkYUVColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_yuvTextureHandles"> <code><strong>yuvTextureHandles </strong></code> </a></td> <td>
|
||||
array of YUV textures on GPU</td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_yuvSizes"> <code><strong>yuvSizes </strong></code> </a></td> <td>
|
||||
@ -831,8 +831,8 @@ zero but may differ from plane to plane. Returned <a href="#Image">Image</a> has
|
||||
<table> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_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_MakeFromYUVTexturesCopy_2_yuvColorSpace"> <code><strong>yuvColorSpace </strong></code> </a></td> <td>
|
||||
one of: <a href="undocumented#YUV_ColorSpace">kJPEG SkYUVColorSpace</a>, <a href="undocumented#YUV_ColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="undocumented#YUV_ColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
one of: <a href="SkImageInfo_Reference#SkYUVColorSpace">kJPEG SkYUVColorSpace</a>, <a href="SkImageInfo_Reference#SkYUVColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="SkImageInfo_Reference#SkYUVColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_2_yuvTextureHandles"> <code><strong>yuvTextureHandles </strong></code> </a></td> <td>
|
||||
array of YUV textures on GPU</td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromYUVTexturesCopy_2_yuvSizes"> <code><strong>yuvSizes </strong></code> </a></td> <td>
|
||||
@ -878,8 +878,8 @@ zero but may differ from plane to plane. Returned <a href="#Image">Image</a> has
|
||||
<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="undocumented#YUV_ColorSpace">kJPEG SkYUVColorSpace</a>, <a href="undocumented#YUV_ColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="undocumented#YUV_ColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
one of: <a href="SkImageInfo_Reference#SkYUVColorSpace">kJPEG SkYUVColorSpace</a>, <a href="SkImageInfo_Reference#SkYUVColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="SkImageInfo_Reference#SkYUVColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_nv12TextureHandles"> <code><strong>nv12TextureHandles </strong></code> </a></td> <td>
|
||||
array of YUV textures on GPU</td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_nv12Sizes"> <code><strong>nv12Sizes </strong></code> </a></td> <td>
|
||||
@ -924,8 +924,8 @@ zero but may differ from plane to plane. Returned <a href="#Image">Image</a> has
|
||||
<table> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_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_MakeFromNV12TexturesCopy_2_yuvColorSpace"> <code><strong>yuvColorSpace </strong></code> </a></td> <td>
|
||||
one of: <a href="undocumented#YUV_ColorSpace">kJPEG SkYUVColorSpace</a>, <a href="undocumented#YUV_ColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="undocumented#YUV_ColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
one of: <a href="SkImageInfo_Reference#SkYUVColorSpace">kJPEG SkYUVColorSpace</a>, <a href="SkImageInfo_Reference#SkYUVColorSpace">kRec601 SkYUVColorSpace</a>,
|
||||
<a href="SkImageInfo_Reference#SkYUVColorSpace">kRec709 SkYUVColorSpace</a></td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_2_nv12TextureHandles"> <code><strong>nv12TextureHandles </strong></code> </a></td> <td>
|
||||
array of YUV textures on GPU</td>
|
||||
</tr> <tr> <td><a name="SkImage_MakeFromNV12TexturesCopy_2_nv12Sizes"> <code><strong>nv12Sizes </strong></code> </a></td> <td>
|
||||
|
@ -1851,16 +1851,23 @@ kHigh_SkFilterQuality == paint.getFilterQuality()
|
||||
---
|
||||
|
||||
# <a name="Color_Methods"></a> Color Methods
|
||||
<a href="undocumented#Color">Color</a> specifies the <a href="#RGB_Red">Color RGB Red</a>, <a href="#RGB_Blue">Color RGB Blue</a>, <a href="#RGB_Green">Color RGB Green</a>, and <a href="#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="undocumented#Color">Color</a> is not <a href="#Premultiply">Premultiplied</a>;
|
||||
<a href="#Alpha">Color Alpha</a> sets the transparency independent of <a href="#RGB">Color RGB</a>: <a href="#RGB_Red">Color RGB Red</a>, <a href="#RGB_Blue">Color RGB Blue</a>, and <a href="#RGB_Green">Color RGB Green</a>.
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| <a href="#SkPaint_getColor">getColor</a> | returns <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a>, one drawing color |
|
||||
| <a href="#SkPaint_setColor">setColor</a> | sets <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a>, one drawing color |
|
||||
|
||||
The bit positions of <a href="#Alpha">Color Alpha</a> and <a href="#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.
|
||||
<a href="undocumented#Color">Color</a> specifies the <a href="#RGB_Red">Color RGB Red</a>, <a href="#RGB_Blue">Color RGB Blue</a>, <a href="#RGB_Green">Color RGB Green</a>, and <a href="#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="undocumented#Color">Color</a> is not <a href="#Premultiply">Premultiplied</a>; <a href="#Alpha">Color Alpha</a> sets the transparency independent of
|
||||
<a href="#RGB">Color RGB</a>: <a href="#RGB_Red">Color RGB Red</a>, <a href="#RGB_Blue">Color RGB Blue</a>, and <a href="#RGB_Green">Color RGB Green</a>.
|
||||
|
||||
The bit positions of <a href="#Alpha">Color Alpha</a> and <a href="#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="#Alpha">Color Alpha</a> | <a href="#RGB_Red">Color RGB Red</a> | <a href="#RGB_Blue">Color RGB Blue</a> | <a href="#RGB_Green">Color RGB Green</a> |
|
||||
| --- | --- | --- | --- | --- |
|
||||
|
@ -100,7 +100,7 @@ empty <a href="#Pixmap">Pixmap</a>
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="7befb4876e17f4bfc89ae8c54aef8660">
|
||||
<div><fiddle-embed name="9547e74a9d37553a667b913ffd1312dd">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -187,7 +187,7 @@ memory if desired.
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="759feda9c22260f96567b9e2ccc1a118">
|
||||
<div><fiddle-embed name="d9eb583c39f4f0baea79896b89245c98">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -375,7 +375,7 @@ reference to ImageInfo
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="7294fbffeb15bf062b6ce989719b783f">
|
||||
<div><fiddle-embed name="6e0f558bf7fabc655041116288559134">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -536,7 +536,8 @@ SkColorType colorType() const
|
||||
|
||||
Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, one of: <a href="SkImageInfo_Reference#SkColorType">kUnknown SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kAlpha 8 SkColorType</a>,
|
||||
<a href="SkImageInfo_Reference#SkColorType">kRGB 565 SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kARGB 4444 SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kRGBA 8888 SkColorType</a>,
|
||||
<a href="SkImageInfo_Reference#SkColorType">kBGRA 8888 SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kGray 8 SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kRGBA F16 SkColorType</a>.
|
||||
<a href="SkImageInfo_Reference#SkColorType">kRGB 888x SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kBGRA 8888 SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kRGBA 1010102 SkColorType</a>,
|
||||
<a href="SkImageInfo_Reference#SkColorType">kRGB 101010x SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kGray 8 SkColorType</a>, <a href="SkImageInfo_Reference#SkColorType">kRGBA F16 SkColorType</a>.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -544,12 +545,12 @@ Returns <a href="SkImageInfo_Reference#Color_Type">Color Type</a>, one of: <a hr
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="57cebd9fc88c4dfe04b20d0ff34f77fd">
|
||||
<div><fiddle-embed name="0ab5c7af272685f2ce177cc79e6b9457">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
color type: kAlpha_SkColorType
|
||||
color type: kAlpha_8_SkColorType
|
||||
~~~~
|
||||
|
||||
</fiddle-embed></div>
|
||||
@ -748,13 +749,13 @@ one of: 0, 1, 2, 3; left shift to convert pixels to bytes
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="d91065811bb118dd686a2b94abe3360a">
|
||||
<div><fiddle-embed name="2e778ffd6edea51af4b07f5d322ceb6a">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0
|
||||
color: kAlpha_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
|
||||
color: kAlpha_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
|
||||
color: kRGB_565_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
|
||||
color: kARGB_4444_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
|
||||
color: kRGBA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2
|
||||
|
@ -952,8 +952,8 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| bool <a href="#SkRect_notequal_operator">operator!=(const SkRect& a, const SkRect& b)</a> | returns true if members are unequal |
|
||||
| bool <a href="#SkRect_equal_operator">operator==(const SkRect& a, const SkRect& b)</a> | returns true if members are equal |
|
||||
| <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>
|
||||
## operator==
|
||||
|
@ -57,11 +57,11 @@
|
||||
"stdout": "alpha type: kPremul_SkAlphaType\\n"
|
||||
},
|
||||
"SkBitmap_bytesPerPixel": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n SkImageInfo info = SkImageInfo::MakeA8(1, 1);\n SkBitmap bitmap;\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 bitmap.setInfo(info.makeColorType(colorType));\n SkDebugf(\"color: k\" \"%s\" \"_SkColorType\" \"%*s\" \"bytesPerPixel: %d\\n\",\n colors[colorType], 10 - strlen(colors[colorType]), \" \",\n bitmap.bytesPerPixel());\n }\n}",
|
||||
"hash": "f09e181f3210d427e4b3d2ae6667ae6a",
|
||||
"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 SkBitmap bitmap;\n for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,\n kRGB_565_SkColorType, kARGB_4444_SkColorType, \n kRGBA_8888_SkColorType,\n kBGRA_8888_SkColorType, kGray_8_SkColorType,\n kRGBA_F16_SkColorType } ) {\n bitmap.setInfo(info.makeColorType(colorType));\n SkDebugf(\"color: k\" \"%s\" \"_SkColorType\" \"%*s\" \"bytesPerPixel: %d\\n\",\n colors[colorType], 13 - strlen(colors[colorType]), \" \",\n bitmap.bytesPerPixel());\n }\n}",
|
||||
"hash": "4bfe28ea3f70f3bfd73d956e913c1a20",
|
||||
"file": "SkBitmap_Reference",
|
||||
"name": "SkBitmap::bytesPerPixel",
|
||||
"stdout": "color: kUnknown_SkColorType bytesPerPixel: 0\\ncolor: kAlpha_SkColorType bytesPerPixel: 1\\ncolor: kRGB_565_SkColorType bytesPerPixel: 2\\ncolor: kARGB_4444_SkColorType bytesPerPixel: 2\\ncolor: kRGBA_8888_SkColorType bytesPerPixel: 4\\ncolor: kBGRA_8888_SkColorType bytesPerPixel: 4\\ncolor: kGray_8_SkColorType bytesPerPixel: 1\\ncolor: kRGBA_F16_SkColorType bytesPerPixel: 8\\n"
|
||||
"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: kBGRA_8888_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}",
|
||||
@ -71,11 +71,11 @@
|
||||
"stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n"
|
||||
},
|
||||
"SkBitmap_colorType": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::MakeA8(16, 32));\n SkDebugf(\"color type: k\" \"%s\" \"_SkColorType\\n\", colors[bitmap.colorType()]);\n}",
|
||||
"hash": "8aa2ab0565091082a874c23886ddb0c5",
|
||||
"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 SkBitmap bitmap;\n bitmap.setInfo(SkImageInfo::MakeA8(16, 32));\n SkDebugf(\"color type: k\" \"%s\" \"_SkColorType\\n\", colors[bitmap.colorType()]);\n}",
|
||||
"hash": "ceb77fab7326b57822a147b04aa0960e",
|
||||
"file": "SkBitmap_Reference",
|
||||
"name": "SkBitmap::colorType",
|
||||
"stdout": "color type: kAlpha_SkColorType\\n"
|
||||
"stdout": "color type: kAlpha_8_SkColorType\\n"
|
||||
},
|
||||
"SkBitmap_computeByteSize": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkBitmap bitmap;\n for (int width : { 1, 1000, 1000000 } ) {\n for (int height: { 1, 1000, 1000000 } ) {\n SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);\n bitmap.setInfo(imageInfo, width * 5);\n SkDebugf(\"width: %7d height: %7d computeByteSize: %13lld\\n\", width, height,\n bitmap.computeByteSize());\n }\n }\n}",
|
||||
@ -120,8 +120,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"
|
||||
},
|
||||
"SkBitmap_empty_constructor": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"BGRA_8888\",\n \"Gray_8\", \"RGBA_F16\"};\n SkBitmap bitmap;\n for (int i = 0; i < 2; ++i) {\n SkDebugf(\"width: %2d height: %2d\", bitmap.width(), bitmap.height());\n SkDebugf(\" color: k%s_SkColorType\", colors[bitmap.colorType()]);\n SkDebugf(\" alpha: k%s_SkAlphaType\\n\", alphas[bitmap.alphaType()]);\n bitmap.setInfo(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),\n 0);\n }\n}\n",
|
||||
"hash": "8bf225da00df80970271722cd3d1ced4",
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\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 SkBitmap bitmap;\n for (int i = 0; i < 2; ++i) {\n SkDebugf(\"width: %2d height: %2d\", bitmap.width(), bitmap.height());\n SkDebugf(\" color: k%s_SkColorType\", colors[bitmap.colorType()]);\n SkDebugf(\" alpha: k%s_SkAlphaType\\n\", alphas[bitmap.alphaType()]);\n bitmap.setInfo(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),\n 0);\n }\n}\n",
|
||||
"hash": "6739d14ec0d6a373f2fcadc6b3077fd4",
|
||||
"file": "SkBitmap_Reference",
|
||||
"name": "SkBitmap::SkBitmap()",
|
||||
"stdout": "width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType\\nwidth: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType\\n"
|
||||
@ -197,8 +197,8 @@
|
||||
"stdout": "bitmap height: 32 info height: 32\\n"
|
||||
},
|
||||
"SkBitmap_info": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n // SkBitmap source; // pre-populated with soccer ball by fiddle.skia.org\n const SkImageInfo& info = source.info();\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n SkDebugf(\"width: %d height: %d color: %s alpha: %s\\n\", info.width(), info.height(),\n colors[info.colorType()], alphas[info.alphaType()]);\n}\n",
|
||||
"hash": "2932fccfb074cf52b17cec238f70d888",
|
||||
"code": "void draw(SkCanvas* canvas) {\n // SkBitmap source; // pre-populated with soccer ball by fiddle.skia.org\n const SkImageInfo& info = source.info();\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\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 SkDebugf(\"width: %d height: %d color: %s alpha: %s\\n\", info.width(), info.height(),\n colors[info.colorType()], alphas[info.alphaType()]);\n}\n",
|
||||
"hash": "ec47c4dc23e2925ad565eaba55a91553",
|
||||
"file": "SkBitmap_Reference",
|
||||
"name": "SkBitmap::info()",
|
||||
"stdout": "width: 56 height: 56 color: BGRA_8888 alpha: Opaque\\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\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n const char* alphas[] = {\"Unknown \", \"Opaque \", \"Premul \", \"Unpremul\"};\n SkBitmap bitmap;\n SkAlphaType alphaTypes[] = { kUnknown_SkAlphaType, kOpaque_SkAlphaType,\n kPremul_SkAlphaType, kUnpremul_SkAlphaType };\n SkDebugf(\"%88s\", \"Canonical Unknown Opaque Premul Unpremul\\n\");\n for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType,\n kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, \n kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {\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": "786005ff582d0369c83e7d686d94138d",
|
||||
"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,\n kPremul_SkAlphaType, kUnpremul_SkAlphaType };\n SkDebugf(\"%88s\", \"Canonical Unknown Opaque Premul Unpremul\\n\");\n for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType, kRGB_565_SkColorType,\n kARGB_4444_SkColorType, kRGBA_8888_SkColorType, kBGRA_8888_SkColorType, \n kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {\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": "9394975fa8a13204a5cc2e94f86737e5",
|
||||
"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 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 \\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"
|
||||
@ -323,15 +323,15 @@
|
||||
"stdout": "draw white\\ndraw black\\n"
|
||||
},
|
||||
"SkBitmap_shiftPerPixel": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n SkImageInfo info = SkImageInfo::MakeA8(1, 1);\n SkBitmap bitmap;\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 bitmap.setInfo(info.makeColorType(colorType));\n SkDebugf(\"color: k\" \"%s\" \"_SkColorType\" \"%*s\" \"shiftPerPixel: %d\\n\",\n colors[colorType], 10 - strlen(colors[colorType]), \" \",\n bitmap.shiftPerPixel());\n }\n}",
|
||||
"hash": "8fa214f2b9a655d7b492181d2143538c",
|
||||
"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 SkBitmap bitmap;\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 bitmap.setInfo(info.makeColorType(colorType));\n SkDebugf(\"color: k\" \"%s\" \"_SkColorType\" \"%*s\" \"shiftPerPixel: %d\\n\",\n colors[colorType], 10 - strlen(colors[colorType]), \" \",\n bitmap.shiftPerPixel());\n }\n}",
|
||||
"hash": "2c77d92f20b950154b9444d3b639b36c",
|
||||
"file": "SkBitmap_Reference",
|
||||
"name": "SkBitmap::shiftPerPixel",
|
||||
"stdout": "color: kUnknown_SkColorType shiftPerPixel: 0\\ncolor: kAlpha_SkColorType shiftPerPixel: 0\\ncolor: kRGB_565_SkColorType shiftPerPixel: 1\\ncolor: kARGB_4444_SkColorType shiftPerPixel: 1\\ncolor: kRGBA_8888_SkColorType shiftPerPixel: 2\\ncolor: kBGRA_8888_SkColorType shiftPerPixel: 2\\ncolor: kGray_8_SkColorType shiftPerPixel: 0\\ncolor: kRGBA_F16_SkColorType shiftPerPixel: 3\\n"
|
||||
"stdout": "color: kUnknown_SkColorType shiftPerPixel: 0\\ncolor: kAlpha_8_SkColorType shiftPerPixel: 0\\ncolor: kRGB_565_SkColorType shiftPerPixel: 1\\ncolor: kARGB_4444_SkColorType shiftPerPixel: 1\\ncolor: kRGBA_8888_SkColorType shiftPerPixel: 2\\ncolor: kBGRA_8888_SkColorType shiftPerPixel: 2\\ncolor: kGray_8_SkColorType shiftPerPixel: 0\\ncolor: kRGBA_F16_SkColorType shiftPerPixel: 3\\n"
|
||||
},
|
||||
"SkBitmap_swap": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkBitmap& b) -> void {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"BGRA_8888\",\n \"Gray_8\", \"RGBA_F16\"};\n SkDebugf(\"%s width:%d height:%d colorType:k%s_SkColorType alphaType:k%s_SkAlphaType\\n\",\n prefix, b.width(), b.height(), colors[b.colorType()], alphas[b.alphaType()]);\n };\n SkBitmap one, two;\n one.tryAllocPixels(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n two.tryAllocPixels(SkImageInfo::Make(2, 2, kBGRA_8888_SkColorType, kPremul_SkAlphaType));\n for (int index = 0; index < 2; ++index) {\n debugster(\"one\", one);\n debugster(\"two\", two);\n one.swap(two);\n }\n}\n",
|
||||
"hash": "aaf9157531f4969b4ec048e9edcdb069",
|
||||
"code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, const SkBitmap& b) -> void {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\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 SkDebugf(\"%s width:%d height:%d colorType:k%s_SkColorType alphaType:k%s_SkAlphaType\\n\",\n prefix, b.width(), b.height(), colors[b.colorType()], alphas[b.alphaType()]);\n };\n SkBitmap one, two;\n one.tryAllocPixels(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));\n two.tryAllocPixels(SkImageInfo::Make(2, 2, kBGRA_8888_SkColorType, kPremul_SkAlphaType));\n for (int index = 0; index < 2; ++index) {\n debugster(\"one\", one);\n debugster(\"two\", two);\n one.swap(two);\n }\n}\n",
|
||||
"hash": "274d02e5f33866b1a9a78423c5569e22",
|
||||
"file": "SkBitmap_Reference",
|
||||
"name": "SkBitmap::swap()",
|
||||
"stdout": "one width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaType\\ntwo width:2 height:2 colorType:kBGRA_8888_SkColorType alphaType:kPremul_SkAlphaType\\none width:2 height:2 colorType:kBGRA_8888_SkColorType alphaType:kPremul_SkAlphaType\\ntwo width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaType\\n"
|
||||
@ -2395,11 +2395,11 @@
|
||||
"stdout": "gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false\\n"
|
||||
},
|
||||
"SkPixmap_colorType": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n SkPixmap pixmap(SkImageInfo::MakeA8(16, 32), nullptr, 64);\n SkDebugf(\"color type: k\" \"%s\" \"_SkColorType\\n\", colors[pixmap.colorType()]);\n}",
|
||||
"hash": "57cebd9fc88c4dfe04b20d0ff34f77fd",
|
||||
"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 SkPixmap pixmap(SkImageInfo::MakeA8(16, 32), nullptr, 64);\n SkDebugf(\"color type: k\" \"%s\" \"_SkColorType\\n\", colors[pixmap.colorType()]);\n}",
|
||||
"hash": "0ab5c7af272685f2ce177cc79e6b9457",
|
||||
"file": "SkPixmap_Reference",
|
||||
"name": "SkPixmap::colorType",
|
||||
"stdout": "color type: kAlpha_SkColorType\\n"
|
||||
"stdout": "color type: kAlpha_8_SkColorType\\n"
|
||||
},
|
||||
"SkPixmap_computeByteSize": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkPixmap pixmap;\n for (int width : { 1, 1000, 1000000 } ) {\n for (int height: { 1, 1000, 1000000 } ) {\n SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);\n pixmap.reset(imageInfo, nullptr, width * 5);\n SkDebugf(\"width: %7d height: %7d computeByteSize: %13lld\\n\", width, height,\n pixmap.computeByteSize());\n }\n }\n}",
|
||||
@ -2423,8 +2423,8 @@
|
||||
"stdout": "image alpha only = false\\ncopy alpha only = true\\n"
|
||||
},
|
||||
"SkPixmap_empty_constructor": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"BGRA_8888\",\n \"Gray_8\", \"RGBA_F16\"};\n SkPixmap pixmap;\n for (int i = 0; i < 2; ++i) {\n SkDebugf(\"width: %2d height: %2d\", pixmap.width(), pixmap.height());\n SkDebugf(\" color: k%s_SkColorType\", colors[pixmap.colorType()]);\n SkDebugf(\" alpha: k%s_SkAlphaType\\n\", alphas[pixmap.alphaType()]);\n pixmap.reset(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),\n nullptr, 0);\n }\n}\n",
|
||||
"hash": "7befb4876e17f4bfc89ae8c54aef8660",
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\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 SkPixmap pixmap;\n for (int i = 0; i < 2; ++i) {\n SkDebugf(\"width: %2d height: %2d\", pixmap.width(), pixmap.height());\n SkDebugf(\" color: k%s_SkColorType\", colors[pixmap.colorType()]);\n SkDebugf(\" alpha: k%s_SkAlphaType\\n\", alphas[pixmap.alphaType()]);\n pixmap.reset(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),\n nullptr, 0);\n }\n}\n",
|
||||
"hash": "9547e74a9d37553a667b913ffd1312dd",
|
||||
"file": "SkPixmap_Reference",
|
||||
"name": "SkPixmap::SkPixmap()",
|
||||
"stdout": "width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType\\nwidth: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType\\n"
|
||||
@ -2444,8 +2444,8 @@
|
||||
"stdout": "pixmap height: 32 info height: 32\\n"
|
||||
},
|
||||
"SkPixmap_info": {
|
||||
"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 SkPixmap inset;\n if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {\n const SkImageInfo& info = inset.info();\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"Gray_8\", \"RGBA_F16\"};\n SkDebugf(\"width: %d height: %d color: %s alpha: %s\\n\", info.width(), info.height(),\n colors[info.colorType()], alphas[info.alphaType()]);\n }\n}",
|
||||
"hash": "7294fbffeb15bf062b6ce989719b783f",
|
||||
"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 SkPixmap inset;\n if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {\n const SkImageInfo& info = inset.info();\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha_8\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\",\n \"RGB_888x\", \"BGRA_8888\", \"RGBA_1010102\", \"RGB_101010x\", \"Gray_8\", \"RGBA_F16\"};\n SkDebugf(\"width: %d height: %d color: %s alpha: %s\\n\", info.width(), info.height(),\n colors[info.colorType()], alphas[info.alphaType()]);\n }\n}",
|
||||
"hash": "6e0f558bf7fabc655041116288559134",
|
||||
"file": "SkPixmap_Reference",
|
||||
"name": "SkPixmap::info()",
|
||||
"stdout": "width: 384 height: 384 color: BGRA_8888 alpha: Opaque\\n"
|
||||
@ -2458,8 +2458,8 @@
|
||||
"stdout": "isOpaque: false\\nisOpaque: false\\nisOpaque: true\\nisOpaque: true\\n"
|
||||
},
|
||||
"SkPixmap_reset": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\", \"RGBA_8888\", \"BGRA_8888\",\n \"Gray_8\", \"RGBA_F16\"};\n SkPixmap pixmap(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),\n nullptr, 0);\n for (int i = 0; i < 2; ++i) {\n SkDebugf(\"width: %2d height: %2d\", pixmap.width(), pixmap.height());\n SkDebugf(\" color: k%s_SkColorType\", colors[pixmap.colorType()]);\n SkDebugf(\" alpha: k%s_SkAlphaType\\n\", alphas[pixmap.alphaType()]);\n pixmap.reset();\n }\n}\n",
|
||||
"hash": "759feda9c22260f96567b9e2ccc1a118",
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* alphas[] = {\"Unknown\", \"Opaque\", \"Premul\", \"Unpremul\"};\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 SkPixmap pixmap(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),\n nullptr, 0);\n for (int i = 0; i < 2; ++i) {\n SkDebugf(\"width: %2d height: %2d\", pixmap.width(), pixmap.height());\n SkDebugf(\" color: k%s_SkColorType\", colors[pixmap.colorType()]);\n SkDebugf(\" alpha: k%s_SkAlphaType\\n\", alphas[pixmap.alphaType()]);\n pixmap.reset();\n }\n}\n",
|
||||
"hash": "d9eb583c39f4f0baea79896b89245c98",
|
||||
"file": "SkPixmap_Reference",
|
||||
"name": "SkPixmap::reset()",
|
||||
"stdout": "width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType\\nwidth: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType\\n"
|
||||
@ -2493,11 +2493,11 @@
|
||||
"stdout": "is unique\\nis not unique\\n"
|
||||
},
|
||||
"SkPixmap_shiftPerPixel": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n const char* colors[] = {\"Unknown\", \"Alpha\", \"RGB_565\", \"ARGB_4444\",\n \"RGBA_8888\", \"BGRA_8888\", \"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": "d91065811bb118dd686a2b94abe3360a",
|
||||
"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",
|
||||
"file": "SkPixmap_Reference",
|
||||
"name": "SkPixmap::shiftPerPixel",
|
||||
"stdout": "color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0\\ncolor: kAlpha_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"
|
||||
"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"
|
||||
},
|
||||
"SkPixmap_width": {
|
||||
"code": "void draw(SkCanvas* canvas) {\n SkImageInfo info = SkImageInfo::MakeA8(16, 32);\n SkPixmap pixmap(info, nullptr, 64);\n SkDebugf(\"pixmap width: %d info width: %d\\n\", pixmap.width(), info.width());\n}",
|
||||
|
@ -103,11 +103,11 @@ $ ninja -C out/dir bookmaker</pre>
|
||||
Complete rebuilding of all bookmaker output looks like:
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -e fiddle.json
|
||||
$ ~/go/bin/fiddlecli.exe --input fiddle.json --output fiddleout.json
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -f fiddleout.json -r site/user/api -c
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -x
|
||||
$ ./out/skia/bookmaker.exe -a docs/status.json -p</pre>
|
||||
$ ./out/skia/bookmaker -a docs/status.json -e fiddle.json
|
||||
$ ~/go/bin/fiddlecli --input fiddle.json --output fiddleout.json
|
||||
$ ./out/skia/bookmaker -a docs/status.json -f fiddleout.json -r site/user/api -c
|
||||
$ ./out/skia/bookmaker -a docs/status.json -x
|
||||
$ ./out/skia/bookmaker -a docs/status.json -p</pre>
|
||||
|
||||
## <a name="New_Documentation"></a> New Documentation
|
||||
|
||||
|
@ -194,9 +194,6 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
|
||||
}
|
||||
definition->fFiddle = parent ? parent->fFiddle + '_' : "";
|
||||
definition->fFiddle += Definition::NormalizedName(typeNameBuilder[0]);
|
||||
if (string::npos != typeNameBuilder[0].find("Member_Functions")) {
|
||||
SkDebugf("");
|
||||
}
|
||||
this->setAsParent(definition);
|
||||
}
|
||||
{
|
||||
@ -350,6 +347,8 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
|
||||
case MarkType::kFile:
|
||||
case MarkType::kHeight:
|
||||
case MarkType::kImage:
|
||||
case MarkType::kIn:
|
||||
case MarkType::kLine:
|
||||
case MarkType::kLiteral:
|
||||
case MarkType::kOutdent:
|
||||
case MarkType::kPlatform:
|
||||
@ -359,7 +358,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
|
||||
case MarkType::kTime:
|
||||
case MarkType::kVolatile:
|
||||
case MarkType::kWidth:
|
||||
if (hasEnd && MarkType::kAnchor != markType) {
|
||||
if (hasEnd && MarkType::kAnchor != markType && MarkType::kLine != markType) {
|
||||
return this->reportError<bool>("one liners omit end element");
|
||||
} else if (!hasEnd && MarkType::kAnchor == markType) {
|
||||
return this->reportError<bool>("anchor line must have end element last");
|
||||
@ -397,6 +396,23 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
|
||||
}
|
||||
fAliasMap[alias] = definition;
|
||||
}
|
||||
else if (MarkType::kLine == markType) {
|
||||
const char* nextLF = this->strnchr('\n', this->fEnd);
|
||||
const char* start = fChar;
|
||||
const char* end = this->trimmedBracketEnd(fMC);
|
||||
this->skipToEndBracket(fMC, nextLF);
|
||||
if (fMC != this->next() || fMC != this->next()) {
|
||||
return this->reportError<bool>("expected ## to delineate line");
|
||||
}
|
||||
fMarkup.emplace_front(MarkType::kText, start, fLineCount, definition);
|
||||
Definition* text = &fMarkup.front();
|
||||
text->fContentStart = start;
|
||||
text->fContentEnd = end;
|
||||
text->fTerminator = fChar;
|
||||
definition->fContentEnd = text->fContentEnd;
|
||||
definition->fTerminator = fChar;
|
||||
definition->fChildren.emplace_back(text);
|
||||
}
|
||||
break;
|
||||
case MarkType::kExternal:
|
||||
(void) this->collectExternals(); // FIXME: detect errors in external defs?
|
||||
@ -735,7 +751,8 @@ bool BmhParser::findDefinitions() {
|
||||
} else if (this->peek() == ' ') {
|
||||
if (!fParent || (MarkType::kTable != fParent->fMarkType
|
||||
&& MarkType::kLegend != fParent->fMarkType
|
||||
&& MarkType::kList != fParent->fMarkType)) {
|
||||
&& MarkType::kList != fParent->fMarkType
|
||||
&& MarkType::kLine != fParent->fMarkType)) {
|
||||
int endHashes = this->endHashCount();
|
||||
if (endHashes <= 1) {
|
||||
if (fParent) {
|
||||
@ -825,6 +842,9 @@ fail:
|
||||
return MarkType::kNone;
|
||||
}
|
||||
|
||||
// write #In to show containing #Topic
|
||||
// write #Line with one liner from Member_Functions, Constructors, Operators if method,
|
||||
// from Constants if enum, otherwise from #Subtopic containing match
|
||||
bool HackParser::hackFiles() {
|
||||
string filename(fFileName);
|
||||
size_t len = filename.length() - 1;
|
||||
@ -832,44 +852,156 @@ bool HackParser::hackFiles() {
|
||||
--len;
|
||||
}
|
||||
filename = filename.substr(len + 1);
|
||||
// remove trailing period from #Param and #Return
|
||||
FILE* out = fopen(filename.c_str(), "wb");
|
||||
if (!out) {
|
||||
if (filename.substr(0, 2) != "Sk") {
|
||||
return true;
|
||||
}
|
||||
size_t under = filename.find('_');
|
||||
SkASSERT(under);
|
||||
string className = filename.substr(0, under);
|
||||
fOut = fopen(filename.c_str(), "wb");
|
||||
if (!fOut) {
|
||||
SkDebugf("could not open output file %s\n", filename.c_str());
|
||||
return false;
|
||||
}
|
||||
const char* start = fStart;
|
||||
do {
|
||||
const char* match = this->strnchr('#', fEnd);
|
||||
if (!match) {
|
||||
break;
|
||||
}
|
||||
this->skipTo(match);
|
||||
this->next();
|
||||
if (!this->startsWith("Param") && !this->startsWith("Return")) {
|
||||
continue;
|
||||
}
|
||||
const char* end = this->strnstr("##", fEnd);
|
||||
while (true) {
|
||||
TextParser::Save lastPeriod(this);
|
||||
this->next();
|
||||
if (!this->skipToEndBracket('.', end)) {
|
||||
lastPeriod.restore();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ('.' == this->peek()) {
|
||||
fprintf(out, "%.*s", (int) (fChar - start), start);
|
||||
this->next();
|
||||
start = fChar;
|
||||
}
|
||||
} while (!this->eof());
|
||||
fprintf(out, "%.*s", (int) (fEnd - start), start);
|
||||
fclose(out);
|
||||
auto mapEntry = fBmhParser.fClassMap.find(className);
|
||||
SkASSERT(fBmhParser.fClassMap.end() != mapEntry);
|
||||
const Definition* classMarkup = &mapEntry->second;
|
||||
const Definition* root = classMarkup->fParent;
|
||||
SkASSERT(root);
|
||||
SkASSERT(root->fTerminator);
|
||||
SkASSERT('\n' == root->fTerminator[0]);
|
||||
SkASSERT(!root->fParent);
|
||||
fStart = root->fStart;
|
||||
fChar = fStart;
|
||||
fConstructors = nullptr;
|
||||
fOperators = nullptr;
|
||||
fMemberFunctions = nullptr;
|
||||
this->topicIter(root);
|
||||
fprintf(fOut, "%.*s\n", (int) (root->fTerminator - fChar), fChar);
|
||||
fclose(fOut);
|
||||
SkDebugf("wrote %s\n", filename.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
string HackParser::searchTable(const Definition* tableHolder, const Definition* match) {
|
||||
if (!tableHolder) {
|
||||
return "";
|
||||
}
|
||||
string bestMatch;
|
||||
string result;
|
||||
for (auto table : tableHolder->fChildren) {
|
||||
if (MarkType::kTable == table->fMarkType) {
|
||||
for (auto row : table->fChildren) {
|
||||
if (MarkType::kRow == row->fMarkType) {
|
||||
const Definition* col0 = row->fChildren[0];
|
||||
size_t len = col0->fContentEnd - col0->fContentStart;
|
||||
string method = string(col0->fContentStart, len);
|
||||
if (len - 2 == method.find("()") && islower(method[0])) {
|
||||
method = method.substr(0, len - 2);
|
||||
}
|
||||
if (string::npos == match->fName.find(method)) {
|
||||
continue;
|
||||
}
|
||||
if (bestMatch.length() < method.length()) {
|
||||
bestMatch = method;
|
||||
const Definition * col1 = row->fChildren[1];
|
||||
if (col1->fContentEnd <= col1->fContentStart) {
|
||||
SkASSERT(string::npos != col1->fFileName.find("SkImageInfo"));
|
||||
result = "incomplete";
|
||||
} else {
|
||||
result = string(col1->fContentStart, col1->fContentEnd -
|
||||
col1->fContentStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// returns true if topic has method
|
||||
void HackParser::topicIter(const Definition* topic) {
|
||||
if (string::npos != topic->fName.find("Member_Functions")) {
|
||||
SkASSERT(!fMemberFunctions);
|
||||
fMemberFunctions = topic;
|
||||
}
|
||||
if (string::npos != topic->fName.find("Constructors")) {
|
||||
SkASSERT(!fConstructors);
|
||||
fConstructors = topic;
|
||||
}
|
||||
if (string::npos != topic->fName.find("Operators")) {
|
||||
SkASSERT(!fOperators);
|
||||
fOperators = topic;
|
||||
}
|
||||
for (auto child : topic->fChildren) {
|
||||
if (MarkType::kMethod == child->fMarkType) {
|
||||
bool hasIn = MarkType::kTopic != topic->fMarkType &&
|
||||
MarkType::kSubtopic != topic->fMarkType; // don't write #In if parent is class
|
||||
bool hasLine = child->fClone;
|
||||
for (auto part : child->fChildren) {
|
||||
hasIn |= MarkType::kIn == part->fMarkType;
|
||||
hasLine |= MarkType::kLine == part->fMarkType;
|
||||
}
|
||||
string oneLiner;
|
||||
if (!hasLine) {
|
||||
// find member_functions, add entry 2nd column text to #Line
|
||||
for (auto tableHolder : { fMemberFunctions, fConstructors, fOperators }) {
|
||||
if (!tableHolder) {
|
||||
continue;
|
||||
}
|
||||
if (Definition::MethodType::kConstructor == child->fMethodType
|
||||
&& fConstructors != tableHolder) {
|
||||
continue;
|
||||
}
|
||||
if (Definition::MethodType::kOperator == child->fMethodType
|
||||
&& fOperators != tableHolder) {
|
||||
continue;
|
||||
}
|
||||
string temp = this->searchTable(tableHolder, child);
|
||||
if ("" != temp) {
|
||||
SkASSERT("" == oneLiner || temp == oneLiner);
|
||||
oneLiner = temp;
|
||||
}
|
||||
}
|
||||
if ("" == oneLiner) {
|
||||
#ifdef SK_DEBUG
|
||||
const Definition* rootParent = topic;
|
||||
while (rootParent->fParent && MarkType::kClass != rootParent->fMarkType
|
||||
&& MarkType::kStruct != rootParent->fMarkType) {
|
||||
rootParent = rootParent->fParent;
|
||||
}
|
||||
#endif
|
||||
SkASSERT(rootParent);
|
||||
SkASSERT(MarkType::kClass == rootParent->fMarkType
|
||||
|| MarkType::kStruct == rootParent->fMarkType);
|
||||
hasLine = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasIn && hasLine) {
|
||||
continue;
|
||||
}
|
||||
const char* start = fChar;
|
||||
const char* end = child->fContentStart;
|
||||
fprintf(fOut, "%.*s", (int) (end - start), start);
|
||||
fChar = end;
|
||||
// write to method markup header end
|
||||
if (!hasIn) {
|
||||
fprintf(fOut, "\n#In %s", topic->fName.c_str());
|
||||
}
|
||||
if (!hasLine) {
|
||||
fprintf(fOut, "\n#Line # %s ##", oneLiner.c_str());
|
||||
}
|
||||
}
|
||||
if (MarkType::kTopic == child->fMarkType || MarkType::kSubtopic == child->fMarkType ||
|
||||
MarkType::kStruct == child->fMarkType || MarkType::kClass == child->fMarkType) {
|
||||
this->topicIter(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool BmhParser::hasEndToken() const {
|
||||
const char* last = fLine + this->lineLength();
|
||||
while (last > fLine && ' ' >= *--last)
|
||||
@ -1206,6 +1338,18 @@ bool BmhParser::skipToDefinitionEnd(MarkType markType) {
|
||||
return this->reportError<bool>("unbalanced stack");
|
||||
}
|
||||
|
||||
bool BmhParser::skipToString() {
|
||||
this->skipSpace();
|
||||
if (fMC != this->peek()) {
|
||||
return this->reportError<bool>("expected end mark");
|
||||
}
|
||||
this->next();
|
||||
this->skipSpace();
|
||||
// body is text from here to double fMC
|
||||
// no single fMC allowed, no linefeed allowed
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<string> BmhParser::topicName() {
|
||||
vector<string> result;
|
||||
this->skipWhiteSpace();
|
||||
@ -1271,6 +1415,9 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) {
|
||||
case MarkType::kTrack:
|
||||
this->skipNoName();
|
||||
break;
|
||||
case MarkType::kLine:
|
||||
this->skipToString();
|
||||
break;
|
||||
case MarkType::kAlias:
|
||||
case MarkType::kAnchor:
|
||||
case MarkType::kBug: // fixme: expect number
|
||||
@ -1281,6 +1428,7 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) {
|
||||
case MarkType::kFile:
|
||||
case MarkType::kHeight:
|
||||
case MarkType::kImage:
|
||||
case MarkType::kIn:
|
||||
case MarkType::kLiteral:
|
||||
case MarkType::kOutdent:
|
||||
case MarkType::kPlatform:
|
||||
@ -1570,19 +1718,6 @@ int main(int argc, char** const argv) {
|
||||
SkCommandLineFlags::PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
if (FLAGS_hack) {
|
||||
if (FLAGS_bmh.isEmpty()) {
|
||||
SkDebugf("-k or --hack requires -b\n");
|
||||
SkCommandLineFlags::PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
HackParser hacker;
|
||||
if (!hacker.parseFile(FLAGS_bmh[0], ".bmh")) {
|
||||
SkDebugf("hack failed\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if ((FLAGS_include.isEmpty() || FLAGS_bmh.isEmpty()) && FLAGS_status.isEmpty() &&
|
||||
FLAGS_populate) {
|
||||
SkDebugf("-p requires -b -i or -a\n");
|
||||
@ -1623,6 +1758,19 @@ int main(int argc, char** const argv) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (FLAGS_hack) {
|
||||
if (FLAGS_bmh.isEmpty()) {
|
||||
SkDebugf("-k or --hack requires -b\n");
|
||||
SkCommandLineFlags::PrintUsage();
|
||||
return 1;
|
||||
}
|
||||
HackParser hacker(bmhParser);
|
||||
if (!hacker.parseFile(FLAGS_bmh[0], ".bmh")) {
|
||||
SkDebugf("hack failed\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (FLAGS_selfcheck && !SelfCheck(bmhParser)) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -108,7 +108,9 @@ enum class MarkType {
|
||||
kFunction,
|
||||
kHeight,
|
||||
kImage,
|
||||
kIn,
|
||||
kLegend,
|
||||
kLine,
|
||||
kLink,
|
||||
kList,
|
||||
kLiteral, // don't lookup hyperlinks, do substitution, etc
|
||||
@ -832,6 +834,7 @@ public:
|
||||
bool hasMatch(const string& name) const;
|
||||
const Definition* hasParam(const string& ref) const;
|
||||
bool isClone() const { return fClone; }
|
||||
bool isStructOrClass() const;
|
||||
|
||||
Definition* iRootParent() {
|
||||
Definition* test = fParent;
|
||||
@ -871,6 +874,7 @@ public:
|
||||
}
|
||||
|
||||
virtual RootDefinition* rootParent() { SkASSERT(0); return nullptr; }
|
||||
virtual const RootDefinition* rootParent() const { SkASSERT(0); return nullptr; }
|
||||
void setCanonicalFiddle();
|
||||
|
||||
void setParentIndex() {
|
||||
@ -942,6 +946,7 @@ public:
|
||||
const Definition* find(const string& ref, AllowParens ) const;
|
||||
bool isRoot() const override { return true; }
|
||||
RootDefinition* rootParent() override { return fRootParent; }
|
||||
const RootDefinition* rootParent() const override { return fRootParent; }
|
||||
void setRootParent(RootDefinition* rootParent) { fRootParent = rootParent; }
|
||||
|
||||
unordered_map<string, RootDefinition*> fBranches;
|
||||
@ -1229,7 +1234,11 @@ public:
|
||||
, { "Function", nullptr, MarkType::kFunction, R_O, E_N, M(Example) | M(NoExample) }
|
||||
, { "Height", nullptr, MarkType::kHeight, R_N, E_N, M(Example) | M(NoExample) }
|
||||
, { "Image", nullptr, MarkType::kImage, R_N, E_N, M(Example) | M(NoExample) }
|
||||
, { "In", nullptr, MarkType::kIn, R_N, E_N,
|
||||
M_CSST | M_E | M(Method) | M(Typedef) }
|
||||
, { "Legend", nullptr, MarkType::kLegend, R_Y, E_N, M(Table) }
|
||||
, { "Line", nullptr, MarkType::kLine, R_N, E_N,
|
||||
M_CSST | M_E | M(Method) | M(Typedef) }
|
||||
, { "", nullptr, MarkType::kLink, R_N, E_N, M(Anchor) }
|
||||
, { "List", nullptr, MarkType::kList, R_Y, E_N, M(Method) | M_CSST | M_E | M_D }
|
||||
, { "Literal", nullptr, MarkType::kLiteral, R_N, E_N, M(Code) }
|
||||
@ -1253,7 +1262,7 @@ public:
|
||||
, { "Subtopic", nullptr, MarkType::kSubtopic, R_Y, E_Y, M_CSST }
|
||||
, { "Table", nullptr, MarkType::kTable, R_Y, E_N, M(Method) | M_CSST | M_E }
|
||||
, { "Template", nullptr, MarkType::kTemplate, R_Y, E_N, 0 }
|
||||
, { "", nullptr, MarkType::kText, R_Y, E_N, 0 }
|
||||
, { "", nullptr, MarkType::kText, R_N, E_N, 0 }
|
||||
, { "Time", nullptr, MarkType::kTime, R_Y, E_N, M(Track) }
|
||||
, { "ToDo", nullptr, MarkType::kToDo, R_N, E_N, 0 }
|
||||
, { "Topic", nullptr, MarkType::kTopic, R_Y, E_Y, M_CS | M(Root) | M(Topic) }
|
||||
@ -1291,7 +1300,7 @@ public:
|
||||
int endHashCount() const;
|
||||
bool endTableColumn(const char* end, const char* terminator);
|
||||
|
||||
RootDefinition* findBmhObject(MarkType markType, const string& typeName) {
|
||||
RootDefinition* findBmhObject(MarkType markType, const string& typeName) const {
|
||||
auto map = fMaps[(int) markType].fBmh;
|
||||
if (!map) {
|
||||
return nullptr;
|
||||
@ -1334,6 +1343,7 @@ public:
|
||||
|
||||
bool skipNoName();
|
||||
bool skipToDefinitionEnd(MarkType markType);
|
||||
bool skipToString();
|
||||
void spellCheck(const char* match, SkCommandLineFlags::StringArray report) const;
|
||||
void spellStatus(const char* match, SkCommandLineFlags::StringArray report) const;
|
||||
vector<string> topicName();
|
||||
@ -1421,7 +1431,9 @@ public:
|
||||
, { nullptr, MarkType::kFunction }
|
||||
, { nullptr, MarkType::kHeight }
|
||||
, { nullptr, MarkType::kImage }
|
||||
, { nullptr, MarkType::kIn }
|
||||
, { nullptr, MarkType::kLegend }
|
||||
, { nullptr, MarkType::kLine }
|
||||
, { nullptr, MarkType::kLink }
|
||||
, { nullptr, MarkType::kList }
|
||||
, { nullptr, MarkType::kLiteral }
|
||||
@ -1962,7 +1974,9 @@ private:
|
||||
|
||||
class HackParser : public ParserCommon {
|
||||
public:
|
||||
HackParser() : ParserCommon() {
|
||||
HackParser(const BmhParser& bmhParser)
|
||||
: ParserCommon()
|
||||
, fBmhParser(bmhParser) {
|
||||
this->reset();
|
||||
}
|
||||
|
||||
@ -1977,7 +1991,15 @@ public:
|
||||
INHERITED::resetCommon();
|
||||
}
|
||||
|
||||
string searchTable(const Definition* tableHolder, const Definition* match);
|
||||
|
||||
void topicIter(const Definition* );
|
||||
|
||||
private:
|
||||
const BmhParser& fBmhParser;
|
||||
const Definition* fConstructors;
|
||||
const Definition* fOperators;
|
||||
const Definition* fMemberFunctions;
|
||||
bool hackFiles();
|
||||
|
||||
typedef ParserCommon INHERITED;
|
||||
@ -2011,6 +2033,7 @@ private:
|
||||
void markTypeOut(Definition* );
|
||||
void mdHeaderOut(int depth) { mdHeaderOutLF(depth, 2); }
|
||||
void mdHeaderOutLF(int depth, int lf);
|
||||
void overviewOut();
|
||||
bool parseFromFile(const char* path) override {
|
||||
return true;
|
||||
}
|
||||
@ -2045,6 +2068,7 @@ private:
|
||||
}
|
||||
|
||||
void resolveOut(const char* start, const char* end, BmhParser::Resolvable );
|
||||
void subtopicOut(const Definition* subtopic, vector<Definition*>& data);
|
||||
|
||||
const BmhParser& fBmhParser;
|
||||
const Definition* fEnumClass;
|
||||
|
@ -1052,6 +1052,16 @@ bool Definition::hasMatch(const string& name) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Definition::isStructOrClass() const {
|
||||
if (MarkType::kStruct != fMarkType && MarkType::kClass != fMarkType) {
|
||||
return false;
|
||||
}
|
||||
if (string::npos != fFileName.find("undocumented.bmh")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Definition::methodHasReturn(const string& name, TextParser* methodParser) const {
|
||||
if (methodParser->skipExact("static")) {
|
||||
methodParser->skipWhiteSpace();
|
||||
|
@ -114,6 +114,8 @@ void IncludeWriter::descriptionOut(const Definition* def) {
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case MarkType::kIn:
|
||||
case MarkType::kLine:
|
||||
case MarkType::kToDo:
|
||||
commentLen = (int) (prop->fStart - commentStart);
|
||||
if (commentLen > 0) {
|
||||
|
@ -694,7 +694,7 @@ string MdOut::linkRef(const string& leadingSpaces, const Definition* def,
|
||||
|
||||
}
|
||||
if (!found) {
|
||||
SkDebugf("");
|
||||
SkDebugf(""); // convenient place to set a breakpoint
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -851,8 +851,12 @@ void MdOut::markTypeOut(Definition* def) {
|
||||
break;
|
||||
case MarkType::kImage:
|
||||
break;
|
||||
case MarkType::kIn:
|
||||
break;
|
||||
case MarkType::kLegend:
|
||||
break;
|
||||
case MarkType::kLine:
|
||||
break;
|
||||
case MarkType::kLink:
|
||||
break;
|
||||
case MarkType::kList:
|
||||
@ -1143,6 +1147,34 @@ void MdOut::mdHeaderOutLF(int depth, int lf) {
|
||||
FPRINTF(" ");
|
||||
}
|
||||
|
||||
void MdOut::overviewOut() {
|
||||
#if 0 // under development
|
||||
// substitute $1 with def (e.g. Subtopics); substitute $2 with ref (e.g. SkRect)
|
||||
const char header[] =
|
||||
"## $1\n"
|
||||
"\n"
|
||||
"| name | description |\n"
|
||||
"| --- | --- |\n";
|
||||
const char* topics[] = {
|
||||
"Classes_and_Structs", "embedded struct and class members",
|
||||
"Constants", "enum and enum class, const values",
|
||||
"Constructors", "functions that construct $2",
|
||||
"Member_Function", "static functions and member methods",
|
||||
"Members", "member values",
|
||||
"Operator", "operator overloading methods",
|
||||
"Related_Functions", "similar methods grouped together",
|
||||
};
|
||||
int found = 0;
|
||||
vector<Definition*> classesAndStructs;
|
||||
vector<Definition*> constants;
|
||||
vector<Definition*> constructors;
|
||||
vector<Definition*> memberFunctions;
|
||||
vector<Definition*> members;
|
||||
vector<Definition*> operators;
|
||||
vector<Definition*> relatedFunctions;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable resolvable) {
|
||||
if ((BmhParser::Resolvable::kLiteral == resolvable || fRespectLeadingSpace) && end > start) {
|
||||
while ('\n' == *start) {
|
||||
|
@ -54,6 +54,9 @@ public:
|
||||
if (!this->checkCreators()) {
|
||||
return false;
|
||||
}
|
||||
if (!this->checkRelatedFunctions()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -131,14 +134,7 @@ protected:
|
||||
// Check that summary contains all methods
|
||||
bool checkMethodSummary() {
|
||||
// look for struct or class in fChildren
|
||||
Definition* cs = nullptr;
|
||||
for (auto& rootChild : fRoot->fChildren) {
|
||||
if (!this->isStructOrClass(rootChild)) {
|
||||
continue;
|
||||
}
|
||||
cs = rootChild;
|
||||
// expect Overview as Topic in every main class or struct or its parent
|
||||
}
|
||||
const Definition* cs = this->classOrStruct();
|
||||
if (!cs) {
|
||||
return true; // topics may not have included classes or structs
|
||||
}
|
||||
@ -179,11 +175,10 @@ protected:
|
||||
|
||||
// Check that all operators are in a table of contents
|
||||
bool checkOperatorsSummary() {
|
||||
for (auto& rootChild : fRoot->fChildren) {
|
||||
if (!this->isStructOrClass(rootChild)) {
|
||||
continue;
|
||||
const Definition* cs = this->classOrStruct();
|
||||
if (!cs) {
|
||||
return true; // topics may not have included classes or structs
|
||||
}
|
||||
auto& cs = rootChild;
|
||||
const Definition* operators = this->findTopic("Operators", Optional::kYes);
|
||||
if (operators && MarkType::kSubtopic != operators->fMarkType) {
|
||||
return operators->reportError<bool>("expected #Subtopic Operators");
|
||||
@ -213,6 +208,70 @@ protected:
|
||||
return csChild->reportError<bool>("missing operator in Operators");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool checkRelatedFunctions() {
|
||||
auto related = this->findTopic("Related_Functions", Optional::kYes);
|
||||
if (!related) {
|
||||
return true;
|
||||
}
|
||||
vector<string> relatedEntries;
|
||||
if (!this->collectEntries(related, &relatedEntries)) {
|
||||
return false;
|
||||
}
|
||||
const Definition* cs = this->classOrStruct();
|
||||
vector<string> methodNames;
|
||||
if (cs) {
|
||||
string prefix = cs->fName + "::";
|
||||
for (auto& csChild : cs->fChildren) {
|
||||
if (MarkType::kMethod != csChild->fMarkType) {
|
||||
// only check methods for now
|
||||
continue;
|
||||
}
|
||||
if (Definition::MethodType::kConstructor == csChild->fMethodType) {
|
||||
continue;
|
||||
}
|
||||
if (Definition::MethodType::kDestructor == csChild->fMethodType) {
|
||||
continue;
|
||||
}
|
||||
if (Definition::MethodType::kOperator == csChild->fMethodType) {
|
||||
continue;
|
||||
}
|
||||
if (csChild->fClone) {
|
||||
// FIXME: check to see if all cloned methods are in table
|
||||
// since format of clones is in flux, defer this check for now
|
||||
continue;
|
||||
}
|
||||
|
||||
SkASSERT(string::npos != csChild->fName.find(prefix));
|
||||
string name = csChild->fName.substr(csChild->fName.find(prefix));
|
||||
methodNames.push_back(name);
|
||||
}
|
||||
}
|
||||
vector<string> trim = methodNames;
|
||||
for (auto entryName : relatedEntries) {
|
||||
auto entryDef = this->findTopic(entryName, Optional::kNo);
|
||||
if (!entryDef) {
|
||||
|
||||
}
|
||||
vector<string> entries;
|
||||
this->collectEntries(entryDef, &entries);
|
||||
for (auto entry : entries) {
|
||||
auto it = std::find(methodNames.begin(), methodNames.end(), entry);
|
||||
if (it == methodNames.end()) {
|
||||
return cs->reportError<bool>("missing method");
|
||||
}
|
||||
it = std::find(trim.begin(), trim.end(), entry);
|
||||
if (it != trim.end()) {
|
||||
using std::swap;
|
||||
swap(*it, trim.back());
|
||||
trim.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trim.size() > 0) {
|
||||
return cs->reportError<bool>("extra method");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -222,11 +281,10 @@ protected:
|
||||
}
|
||||
|
||||
bool checkSubtopicSummary() {
|
||||
for (auto& rootChild : fRoot->fChildren) {
|
||||
if (!this->isStructOrClass(rootChild)) {
|
||||
continue;
|
||||
const auto& cs = this->classOrStruct();
|
||||
if (!cs) {
|
||||
return true;
|
||||
}
|
||||
auto& cs = rootChild;
|
||||
auto overview = this->findOverview(cs);
|
||||
if (!overview) {
|
||||
return false;
|
||||
@ -265,7 +323,6 @@ protected:
|
||||
return csChild->reportError<bool>("missing SubTopic in SubTopics");
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -298,6 +355,15 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
const Definition* classOrStruct() {
|
||||
for (auto& rootChild : fRoot->fChildren) {
|
||||
if (this->isStructOrClass(rootChild)) {
|
||||
return rootChild;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static const Definition* overview_def(const Definition* parent) {
|
||||
Definition* overview = nullptr;
|
||||
if (parent) {
|
||||
@ -316,7 +382,7 @@ protected:
|
||||
const Definition* findOverview(const Definition* parent) {
|
||||
// expect Overview as Topic in every main class or struct
|
||||
const Definition* overview = overview_def(parent);
|
||||
const Definition* parentOverview = overview_def(parent->fParent);
|
||||
const Definition* parentOverview = parent ? overview_def(parent->fParent) : nullptr;
|
||||
if (overview && parentOverview) {
|
||||
return overview->reportError<const Definition*>("expected only one Overview 2");
|
||||
}
|
||||
@ -333,11 +399,13 @@ protected:
|
||||
};
|
||||
|
||||
const Definition* findTopic(string name, Optional optional) {
|
||||
string topicKey = fRoot->fName + '_' + name;
|
||||
string undashed = name;
|
||||
std::replace(undashed.begin(), undashed.end(), '-', '_');
|
||||
string topicKey = fRoot->fName + '_' + undashed;
|
||||
auto topicKeyIter = fBmhParser.fTopicMap.find(topicKey);
|
||||
if (fBmhParser.fTopicMap.end() == topicKeyIter) {
|
||||
// TODO: remove this and require member functions outside of overview
|
||||
topicKey = fRoot->fName + "_Overview_" + name; // legacy form for now
|
||||
topicKey = fRoot->fName + "_Overview_" + undashed; // legacy form for now
|
||||
topicKeyIter = fBmhParser.fTopicMap.find(topicKey);
|
||||
if (fBmhParser.fTopicMap.end() == topicKeyIter) {
|
||||
if (Optional::kNo == optional) {
|
||||
@ -392,7 +460,7 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isStructOrClass(const Definition* definition) {
|
||||
bool isStructOrClass(const Definition* definition) const {
|
||||
if (MarkType::kStruct != definition->fMarkType &&
|
||||
MarkType::kClass != definition->fMarkType) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user