aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-05-17 12:17:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-17 16:45:13 +0000
commitffb3d688b0e76ad7d1517657b00e4525cc603f40 (patch)
tree3b48887597f78b47214b2ac3c12b4e4cc2cf6bc6 /docs
parent0b82a71c4ca4cd3d5a477ea0293b877132f0a411 (diff)
Color Documentation
- treat Color, ARGB, etc as things not requiring definitions - fix links to Anti-alias, RGB-565 - finish everything marked incomplete, color and elsewhere - add #Code blocks for #Typedef R=caryclark@google.com Docs-Preview: https://skia.org/?cl=128547 Bug: skia:6898 Change-Id: Icf12fe70bc2bf1a8b1a5b31380b2454610949f23 Reviewed-on: https://skia-review.googlesource.com/128547 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkBitmap_Reference.bmh18
-rw-r--r--docs/SkCanvas_Reference.bmh65
-rw-r--r--docs/SkColor4f_Reference.bmh210
-rw-r--r--docs/SkColor_Reference.bmh330
-rw-r--r--docs/SkImageInfo_Reference.bmh71
-rw-r--r--docs/SkImage_Reference.bmh35
-rw-r--r--docs/SkMatrix_Reference.bmh18
-rw-r--r--docs/SkPaint_Reference.bmh87
-rw-r--r--docs/SkRect_Reference.bmh17
-rw-r--r--docs/SkSurface_Reference.bmh24
-rw-r--r--docs/undocumented.bmh2
11 files changed, 559 insertions, 318 deletions
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index 4d949a5887..967b9d1ca9 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -1707,7 +1707,7 @@ for (int y : { 0, 64, 128, 192 } ) {
#Method bool SK_WARN_UNUSED_RESULT tryAllocN32Pixels(int width, int height, bool isOpaque = false)
#In Allocate
-#Line # allocates compatible Color_ARGB pixels if possible ##
+#Line # allocates compatible 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.
@@ -1749,7 +1749,7 @@ the platform. Bitmap drawn to output device skips converting its pixel format.
#Method void allocN32Pixels(int width, int height, bool isOpaque = false)
#In Allocate
-#Line # allocates compatible Color_ARGB pixels, or aborts ##
+#Line # allocates compatible 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.
@@ -2364,8 +2364,8 @@ getGenerationID() return a different value.
#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,
-then Color_RGB is ignored.
+is ignored; RGB is treated as opaque. If colorType is kAlpha_8_SkColorType,
+then RGB is ignored.
#Param c Unpremultiplied Color ##
@@ -2394,9 +2394,9 @@ is ignored; r, g, and b are treated as opaque. If colorType is kAlpha_8_SkColorT
then r, g, and b are ignored.
#Param a amount of Color_Alpha, from fully transparent (0) to fully opaque (255) ##
-#Param r amount of Color_RGB_Red, from no red (0) to full red (255) ##
-#Param g amount of Color_RGB_Green, from no green (0) to full green (255) ##
-#Param b amount of Color_RGB_Blue, from no blue (0) to full blue (255) ##
+#Param r amount of red, from no red (0) to full red (255) ##
+#Param g amount of green, from no green (0) to full green (255) ##
+#Param b amount of blue, from no blue (0) to full blue (255) ##
#Example
#Height 80
@@ -2427,8 +2427,8 @@ Replaces pixel values inside area with c. If area does not intersect bounds(),
call has no effect.
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,
-then Color_RGB is ignored.
+is ignored; RGB is treated as opaque. If colorType is kAlpha_8_SkColorType,
+then RGB is ignored.
#Param c Unpremultiplied Color ##
#Param area rectangle to fill ##
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index 063e53ee5d..6c12339ce3 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -980,7 +980,7 @@ Does not copy, and returns false if:
#Description
Canvas returned by Raster_Surface has Premultiplied pixel values.
clear() takes Unpremultiplied input with Color_Alpha equal 0x80
- and Color_RGB equal 0x55, 0xAA, 0xFF. Color_RGB is multiplied by Color_Alpha
+ and RGB equal 0x55, 0xAA, 0xFF. RGB is multiplied by Color_Alpha
to generate Premultiplied value 0x802B5580. readPixels converts pixel back
to Unpremultiplied value 0x8056A9FF, introducing error.
##
@@ -1047,7 +1047,7 @@ Does not copy, and returns false if:
#Example
#Description
clear() takes Unpremultiplied input with Color_Alpha equal 0x80
- and Color_RGB equal 0x55, 0xAA, 0xFF. Color_RGB is multiplied by Color_Alpha
+ and RGB equal 0x55, 0xAA, 0xFF. RGB is multiplied by Color_Alpha
to generate Premultiplied value 0x802B5580.
##
void draw(SkCanvas* canvas) {
@@ -1110,7 +1110,7 @@ Does not copy, and returns false if:
#Example
#Description
clear() takes Unpremultiplied input with Color_Alpha equal 0x80
- and Color_RGB equal 0x55, 0xAA, 0xFF. Color_RGB is multiplied by Color_Alpha
+ and RGB equal 0x55, 0xAA, 0xFF. RGB is multiplied by Color_Alpha
to generate Premultiplied value 0x802B5580.
##
void draw(SkCanvas* canvas) {
@@ -1816,7 +1816,7 @@ SaveLayerRec contains the state used to create the Layer.
#Example
#Height 160
#Description
-Canvas Layer captures a red Anti-aliased circle and a blue Aliased circle scaled
+Canvas Layer captures a red Anti_Aliased circle and a blue Aliased circle scaled
up by four. After drawing another red circle without scaling on top, the Layer is
transferred to the main canvas.
##
@@ -2342,14 +2342,14 @@ prior Clip to form the replacement Clip. Use SkClipOp::kDifference
to subtract Path from Clip; use SkClipOp::kIntersect to intersect Path
with Clip.
-A clipping Path may be Anti-aliased; if Path, after transformation, is
-composed of horizontal and vertical lines, clearing Anti-alias allows whole pixels
+A clipping Path may be Anti_Aliased; if Path, after transformation, is
+composed of horizontal and vertical lines, clearing Anti_Alias allows whole pixels
to either be inside or outside the clip. The fastest drawing has a Aliased,
rectangular clip.
-If clipping Path has Anti-alias set, clip may partially clip a pixel, requiring
+If clipping Path has Anti_Alias set, clip may partially clip a pixel, requiring
that drawing blend partially with the destination along the edge. A rotated
-rectangular Anti-aliased clip looks smoother but draws slower.
+rectangular Anti_Aliased clip looks smoother but draws slower.
Clip can combine with Rect and Round_Rect primitives; like
Path, these are transformed by Matrix before they are combined with Clip.
@@ -2360,10 +2360,10 @@ and is unaffected by Matrix.
#Example
#Height 90
#Description
- Draw a red circle with an Aliased clip and an Anti-aliased clip.
+ Draw a red circle with an Aliased clip and an Anti_Aliased clip.
Use an image filter to zoom into the pixels drawn.
The edge of the Aliased clip fully draws pixels in the red circle.
- The edge of the Anti-aliased clip partially draws pixels in the red circle.
+ The edge of the Anti_Aliased clip partially draws pixels in the red circle.
##
SkPaint redPaint, scalePaint;
redPaint.setAntiAlias(true);
@@ -2392,12 +2392,12 @@ and is unaffected by Matrix.
#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
+with an Aliased or Anti_Aliased clip edge. rect is transformed by Matrix
before it is combined with Clip.
#Param rect Rect to combine with Clip ##
#Param op Clip_Op to apply to Clip ##
-#Param doAntiAlias true if Clip is to be Anti-aliased ##
+#Param doAntiAlias true if Clip is to be Anti_Aliased ##
#Example
#Height 128
@@ -2457,13 +2457,13 @@ rect is transformed by Matrix
before it is combined with Clip.
#Param rect Rect to combine with Clip ##
-#Param doAntiAlias true if Clip is to be Anti-aliased ##
+#Param doAntiAlias true if Clip is to be Anti_Aliased ##
#Example
#Height 133
#Description
A circle drawn in pieces looks uniform when drawn Aliased.
- The same circle pieces blend with pixels more than once when Anti-aliased,
+ The same circle pieces blend with pixels more than once when Anti_Aliased,
visible as a thin pair of lines through the right circle.
##
void draw(SkCanvas* canvas) {
@@ -2515,13 +2515,13 @@ This is private API to be used only by Android framework.
#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.
+with an Aliased or Anti_Aliased clip edge.
rrect is transformed by Matrix
before it is combined with Clip.
#Param rrect Round_Rect to combine with Clip ##
#Param op Clip_Op to apply to Clip ##
-#Param doAntiAlias true if Clip is to be Anti-aliased ##
+#Param doAntiAlias true if Clip is to be Anti_Aliased ##
#Example
#Height 128
@@ -2570,11 +2570,11 @@ void draw(SkCanvas* canvas) {
#In Clip
Replace Clip with the intersection of Clip and rrect,
-with an Aliased or Anti-aliased clip edge.
+with an Aliased or Anti_Aliased clip edge.
rrect is transformed by Matrix before it is combined with Clip.
#Param rrect Round_Rect to combine with Clip ##
-#Param doAntiAlias true if Clip is to be Anti-aliased ##
+#Param doAntiAlias true if Clip is to be Anti_Aliased ##
#Example
#Height 128
@@ -2596,14 +2596,14 @@ void draw(SkCanvas* canvas) {
#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
+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
itself or another Path_Contour, whether the overlaps form part of the area.
path is transformed by Matrix before it is combined with Clip.
#Param path Path to combine with Clip ##
#Param op Clip_Op to apply to Clip ##
-#Param doAntiAlias true if Clip is to be Anti-aliased ##
+#Param doAntiAlias true if Clip is to be Anti_Aliased ##
#Example
#Description
@@ -2687,7 +2687,7 @@ itself or another Path_Contour, whether the overlaps form part of the area.
path is transformed by Matrix before it is combined with Clip.
#Param path Path to combine with Clip ##
-#Param doAntiAlias true if Clip is to be Anti-aliased ##
+#Param doAntiAlias true if Clip is to be Anti_Aliased ##
#Example
#Height 212
@@ -2849,7 +2849,7 @@ Return bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
return SkRect::MakeEmpty, where all Rect sides equal zero.
Rect returned is outset by one to account for partial pixel coverage if Clip
-is Anti-aliased.
+is Anti_Aliased.
#Return bounds of Clip in local coordinates ##
@@ -2895,7 +2895,7 @@ 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.
bounds is outset by one to account for partial pixel coverage if Clip
-is Anti-aliased.
+is Anti_Aliased.
#Param bounds Rect of Clip in local coordinates ##
@@ -3022,9 +3022,9 @@ Unlike getLocalClipBounds, bounds is not outset.
#In Draw
#Line # fills Clip with Color and Blend_Mode ##
Fill Clip with Color color.
-mode determines how Color_ARGB is combined with destination.
+mode determines how ARGB is combined with destination.
-#Param color Unpremultiplied Color_ARGB ##
+#Param color Unpremultiplied ARGB ##
#Param mode SkBlendMode used to combine source color and destination ##
#Example
@@ -3047,7 +3047,7 @@ mode determines how Color_ARGB is combined with destination.
Fill Clip with Color color using SkBlendMode::kSrc.
This has the effect of replacing all pixels contained by Clip with color.
-#Param color Unpremultiplied Color_ARGB ##
+#Param color Unpremultiplied ARGB ##
#Example
void draw(SkCanvas* canvas) {
@@ -5135,6 +5135,7 @@ filled 12 point black Glyphs.
#Param paint text size, blend, color, and so on, used to draw ##
#Example
+#Height 48
SkPaint paint;
canvas->drawString("a small hello", 20, 20, paint);
##
@@ -5441,7 +5442,7 @@ Draw Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
blob contains Glyphs, their positions, and paint attributes specific to text:
Typeface, Paint_Text_Size, Paint_Text_Scale_X, Paint_Text_Skew_X,
-Paint_Text_Align, Paint_Hinting, Anti-alias, Paint_Fake_Bold,
+Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
Subpixel_Text, and Paint_Vertical_Text.
@@ -5494,7 +5495,7 @@ Draw Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
blob contains Glyphs, their positions, and paint attributes specific to text:
Typeface, Paint_Text_Size, Paint_Text_Scale_X, Paint_Text_Skew_X,
-Paint_Text_Align, Paint_Hinting, Anti-alias, Paint_Fake_Bold,
+Paint_Text_Align, Paint_Hinting, Anti_Alias, Paint_Fake_Bold,
Font_Embedded_Bitmaps, Full_Hinting_Spacing, LCD_Text, Linear_Text,
Subpixel_Text, and Paint_Vertical_Text.
@@ -5898,7 +5899,7 @@ void draw(SkCanvas* canvas) {
#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
+paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -5939,7 +5940,7 @@ void draw(SkCanvas* canvas) {
const SkPaint* 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
+paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -5982,7 +5983,7 @@ void draw(SkCanvas* canvas) {
const SkRect* cullRect, const SkPaint* 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
+paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -6018,7 +6019,7 @@ void draw(SkCanvas* canvas) {
int count, const SkRect* cullRect, const SkPaint* 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
+paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
diff --git a/docs/SkColor4f_Reference.bmh b/docs/SkColor4f_Reference.bmh
index eaf762d2e3..a2c3b0ea2d 100644
--- a/docs/SkColor4f_Reference.bmh
+++ b/docs/SkColor4f_Reference.bmh
@@ -3,7 +3,14 @@
#Struct SkColor4f
-The float values are 0...1 Unpremultiplied
+Each component is stored as a 32-bit single precision floating point float value.
+All values are allowed, but only the range from zero to one is meaningful.
+
+Each component is independent of the others; fA Alpha is not Premultiplied
+with fG green, fB blue, or fR red.
+
+Values smaller than zero or larger than one are allowed. Values out of range
+may be used with Blend_Mode so that the final component is in range.
#Subtopic Overview
#Populate
@@ -18,36 +25,47 @@ The float values are 0...1 Unpremultiplied
##
#Member float fR
-#Line # incomplete ##
+#Line # red component ##
+Single precision float for red ranges from no red (0.0) to full red (1.0).
##
#Member float fG
-#Line # incomplete ##
+#Line # green component ##
+Single precision float for green ranges from no green (0.0) to full green (1.0).
##
#Member float fB
-#Line # incomplete ##
+#Line # blue component ##
+Single precision float for blue ranges from no blue (0.0) to full blue (1.0).
##
#Member float fA
-#Line # incomplete ##
+#Line # alpha component ##
+Single precision float for Alpha ranges from no Alpha (0.0) to full Alpha (1.0).
##
# ------------------------------------------------------------------------------
#Method bool operator==(const SkColor4f& other)_const
#In Operator
-#Line # incomplete ##
+#Line # compares Color4f for equality ##
-#Param other incomplete ##
+Compares Color4f with other, and returns true if all components are equivalent.
-#Return incomplete ##
+#Param other Color4f to compare ##
+
+#Return true if Color4f equals other ##
#Example
-// incomplete
+ SkColor4f colorRed = { 1, 0, 0, 1 };
+ SkColor4f colorNamedRed = SkColor4f::FromColor(SK_ColorRED);
+ SkDebugf("colorRed %c= colorNamedRed", colorRed == colorNamedRed ? '=' : '!');
+#StdOut
+colorRed == colorNamedRed
+##
##
-#SeeAlso incomplete
+#SeeAlso operator!=(const SkColor4f& other)_const
#Method ##
@@ -55,122 +73,212 @@ The float values are 0...1 Unpremultiplied
#Method bool operator!=(const SkColor4f& other)_const
#In Operator
-#Line # incomplete ##
+#Line # compares colors for inequality ##
-#Param other incomplete ##
+Compares Color4f with other, and returns true if all components are not
+equivalent.
-#Return incomplete ##
+#Param other Color4f to compare ##
+
+#Return true if Color4f is not equal to other ##
#Example
-// incomplete
+ SkColor4f colorGray = { .5, .5, .5, 1 };
+ SkColor4f colorNamedGray = SkColor4f::FromColor(SK_ColorGRAY);
+ SkDebugf("colorGray %c= colorNamedGray ", colorGray != colorNamedGray ? '!' : '=');
+#StdOut
+colorGray != colorNamedGray
+##
##
-#SeeAlso incomplete
+#SeeAlso operator==(const SkColor4f& other)_const
#Method ##
# ------------------------------------------------------------------------------
#Method const float* vec() const
-#In incomplete
-#Line # incomplete ##
+#In Property
+#Line # returns array of components ##
+
+Returns Color4f components as a read-only array.
-#Return incomplete ##
+#Return components as read-only array ##
#Example
-// incomplete
+ SkColor4f color = SkColor4f::FromColor(0x884488CC);
+ SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color.fR, color.fG, color.fB, color.fA);
+ const float* array = color.vec();
+ SkDebugf("[0]=%g [1]=%g [2]=%g [3]=%g\n", array[0], array[1], array[2], array[3]);
+#StdOut
+red=0.0578054 green=0.246201 blue=0.603827 alpha=0.533333
+[0]=0.0578054 [1]=0.246201 [2]=0.603827 [3]=0.533333
+##
##
-#SeeAlso incomplete
+#SeeAlso SkColor4f
#Method ##
# ------------------------------------------------------------------------------
#Method float* vec()
-#In incomplete
-#Line # incomplete ##
+#In Property
+#Line # returns array of components ##
+
+Returns Color4f components as a writable array.
-#Return incomplete ##
+#Return components as writable array ##
#Example
-// incomplete
+ SkColor4f color = SkColor4f::FromColor(0x884488CC);
+ SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color.fR, color.fG, color.fB, color.fA);
+ float* array = color.vec();
+ array[3] = 1;
+ SkDebugf("[0]=%g [1]=%g [2]=%g [3]=%g\n", array[0], array[1], array[2], array[3]);
+#StdOut
+red=0.0578054 green=0.246201 blue=0.603827 alpha=0.533333
+[0]=0.0578054 [1]=0.246201 [2]=0.603827 [3]=1
+##
##
-#SeeAlso incomplete
+#SeeAlso SkColor4f
#Method ##
# ------------------------------------------------------------------------------
#Method static SkColor4f Pin(float r, float g, float b, float a)
-#In incomplete
-#Line # incomplete ##
+#In Utility
+#Line # sets components to valid range ##
+
+Constructs and returns Color4f with each component pinned from zero to one.
-#Param r incomplete ##
-#Param g incomplete ##
-#Param b incomplete ##
-#Param a incomplete ##
+#Param r red component ##
+#Param g green component ##
+#Param b blue component ##
+#Param a Alpha component ##
-#Return incomplete ##
+#Return Color4f with valid components ##
#Example
-// incomplete
+#Height 40
+ uint32_t storage[8];
+ SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);
+ SkPixmap pixmap(info, storage, info.minRowBytes());
+ pixmap.erase(SK_ColorWHITE);
+ SkIRect bounds = {0, 0, 1, 1};
+ SkColor4f colors[] = { SkColor4f::Pin(1.5, 0.45f, 0.0, 1),
+ SkColor4f::Pin(1, 0.45f, -0.25, 1),
+ {1.5, 0.45f, 0.0, 1},
+ {1, 0.45f, -0.25, 1},
+ };
+ for (auto color4f : colors) {
+ pixmap.erase(color4f, &bounds);
+ bounds.offset(2, 0);
+ }
+ SkBitmap bitmap;
+ canvas->scale(20, 20);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
##
-#SeeAlso incomplete
+#SeeAlso pin() FromColor
#Method ##
# ------------------------------------------------------------------------------
#Method static SkColor4f FromColor(SkColor)
-#In incomplete
-#Line # incomplete ##
+#In Utility
+#Line # sets components from Color ##
-Convert to SkColor4f, assuming SkColor is sRGB
+Converts to closest Color4f.
-#Param SkColor incomplete ##
+#Param SkColor Color with Alpha, red, blue, and green components ##
-#Return incomplete ##
+#Return Color4f equivalent ##
#Example
-// incomplete
+ uint8_t red = 77, green = 101, blue = 153, alpha = 43;
+ SkColor argb = SkColorSetARGB(alpha, red, green, blue);
+ SkColor4f color4f = SkColor4f::FromColor(argb);
+ SkDebugf("red=%g green=%g blue=%g alpha=%g\n", color4f.fR, color4f.fG, color4f.fB, color4f.fA);
+ SkColor fromColor4f = color4f.toSkColor();
+ SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(fromColor4f),
+ SkColorGetG(fromColor4f), SkColorGetB(fromColor4f), SkColorGetA(fromColor4f));
+#StdOut
+red=0.0742136 green=0.130136 blue=0.318547 alpha=0.168627
+red=77 green=101 blue=153 alpha=43
+##
##
-#SeeAlso incomplete
+#SeeAlso toSkColor
#Method ##
# ------------------------------------------------------------------------------
#Method SkColor toSkColor() const
-#In incomplete
-#Line # incomplete ##
+#In Utility
+#Line # returns closest Color ##
+
+Converts to closest SkColor.
-#Return incomplete ##
+#Return closest Color ##
#Example
-// incomplete
+ float red = 0.07, green = 0.13, blue = 0.32, alpha = 0.17;
+ SkColor4f color4f = { red, green, blue, alpha };
+ SkColor argb = color4f.toSkColor();
+ SkDebugf("red=%d green=%d blue=%d alpha=%d\n", SkColorGetR(argb),
+ SkColorGetG(argb), SkColorGetB(argb), SkColorGetA(argb));
+ SkColor4f fromSkColor = SkColor4f::FromColor(argb);
+ SkDebugf("red=%g green=%g blue=%g alpha=%g\n", fromSkColor.fR, fromSkColor.fG,
+ fromSkColor.fB, fromSkColor.fA);
+#StdOut
+red=75 green=101 blue=153 alpha=43
+red=0.0703601 green=0.130136 blue=0.318547 alpha=0.168627
+##
##
-#SeeAlso incomplete
+#SeeAlso FromColor
#Method ##
# ------------------------------------------------------------------------------
#Method SkColor4f pin() const
-#In incomplete
-#Line # incomplete ##
+#In Utility
+#Line # sets components to valid range ##
+
+Returns Color4f with all components in the range from zero to one.
-#Return incomplete ##
+#Return Color4f with valid components ##
#Example
-// incomplete
+#Height 40
+ uint32_t storage[8];
+ SkImageInfo info = SkImageInfo::MakeN32Premul(8, 1);
+ SkPixmap pixmap(info, storage, info.minRowBytes());
+ pixmap.erase(SK_ColorWHITE);
+ SkIRect bounds = {0, 0, 1, 1};
+ SkColor4f colors[] = { {1.5, 0.45f, 0.0, 1},
+ {1, 0.45f, -0.25, 1},
+ };
+ for (auto color4f : colors) {
+ pixmap.erase(color4f, &bounds);
+ bounds.offset(2, 0);
+ pixmap.erase(color4f.pin(), &bounds);
+ bounds.offset(2, 0);
+ }
+ SkBitmap bitmap;
+ canvas->scale(20, 20);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
##
-#SeeAlso incomplete
+#SeeAlso Pin
#Method ##
diff --git a/docs/SkColor_Reference.bmh b/docs/SkColor_Reference.bmh
index 349de3803d..67a47a297e 100644
--- a/docs/SkColor_Reference.bmh
+++ b/docs/SkColor_Reference.bmh
@@ -25,36 +25,6 @@ required.
#Populate
##
-
- #Subtopic RGB
- #Substitute RGB
- #Subtopic Red
- #Alias Red
- #Subtopic ##
- #Subtopic Blue
- #Alias Blue
- #Subtopic ##
- #Subtopic Green
- #Alias Green
- #Subtopic ##
- #Subtopic ##
-
- #Subtopic ARGB
- #Substitute ARGB
- #Subtopic ##
-
- #Subtopic RBG
- #Substitute RBG
- #Subtopic ##
-
- #Subtopic RGB-565
- #Substitute RGB-565
- #Alias Color_RGB-565 # quit changing - to _ !
- #Subtopic ##
-
- #Subtopic Gray
- ##
-
# ------------------------------------------------------------------------------
#Subtopic Alpha
@@ -71,6 +41,10 @@ zero, fully transparent, to one, fully opaque.
#Typedef uint8_t SkAlpha
#Line # defines Alpha as eight bits ##
+#Code
+typedef uint8_t SkAlpha;
+##
+
8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent.
#Typedef ##
@@ -82,6 +56,10 @@ zero, fully transparent, to one, fully opaque.
#Typedef uint32_t SkColor
#Line # defines Color as 32 bits ##
+#Code
+typedef uint32_t SkColor;
+##
+
32-bit ARGB Color value, Unpremultiplied. Color components are always in
a known order. This is different from SkPMColor, which has its bytes in a configuration
dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. SkColor
@@ -99,16 +77,16 @@ component values in a different order.
#Method static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#In Function
-#Line # returns Color_Alpha and Color_RGB combined ##
+#Line # returns Color_Alpha and RGB combined ##
Returns Color value from 8-bit component values. Asserts if SK_DEBUG is defined
if a, r, g, or b exceed 255. Since Color is Unpremultiplied, a may be smaller
than the largest of r, g, and b.
#Param a amount of Alpha, from fully transparent (0) to fully opaque (255) ##
-#Param r amount of RGB_Red, from no red (0) to full red (255) ##
-#Param g amount of RGB_Green, from no green (0) to full green (255) ##
-#Param b amount of RGB_Blue, from no blue (0) to full blue (255) ##
+#Param r amount of red, from no red (0) to full red (255) ##
+#Param g amount of green, from no green (0) to full green (255) ##
+#Param b amount of blue, from no blue (0) to full blue (255) ##
#Return color and alpha, Unpremultiplied ##
@@ -120,40 +98,12 @@ than the largest of r, g, and b.
canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0x00, 0xFF));
##
-#SeeAlso SkColorSetRGB SkPaint::setARGB SkPaint::setColor
+#SeeAlso SkColorSetRGB SkPaint::setARGB SkPaint::setColor SkColorSetA
#Method ##
# ------------------------------------------------------------------------------
-#Define SkColorSetARGBInline
-
-#Code
-###$
- #define SkColorSetARGBInline SkColorSetARGB
-$$$#
-##
-
-#Deprecated soon
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SkColorSetARGBMacro
-
-#Code
-###$
- #define SkColorSetARGBMacro SkColorSetARGB
-$$$#
-##
-
-#Deprecated soon
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
#Define SkColorSetRGB
#Line # returns opaque Color ##
@@ -166,9 +116,9 @@ $$$#
Returns Color value from 8-bit component values, with Alpha set
fully opaque to 255.
-#Param r amount of RGB_Red, from no red (0) to full red (255) ##
-#Param g amount of RGB_Green, from no green (0) to full green (255) ##
-#Param b amount of RGB_Blue, from no blue (0) to full blue (255) ##
+#Param r amount of red, from no red (0) to full red (255) ##
+#Param g amount of green, from no green (0) to full green (255) ##
+#Param b amount of blue, from no blue (0) to full blue (255) ##
#Return color with opaque alpha ##
@@ -180,7 +130,7 @@ fully opaque to 255.
canvas->drawColor(SkColorSetRGB(0x00, 0x00, 0xFF));
##
-#SeeAlso incomplete
+#SeeAlso SkColorSetARGB
#Define ##
@@ -200,17 +150,26 @@ Returns Alpha byte from Color value.
#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
#Example
-// incomplete
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setColor(SK_ColorRED);
+ for (int alpha = 255; alpha >= 0; alpha -= 17) {
+ paint.setAlpha(alpha);
+ canvas->drawRect({5, 5, 100, 20}, paint);
+ SkAlpha alphaInPaint = SkColorGetA(paint.getColor());
+ canvas->drawString(std::to_string(alphaInPaint).c_str(), 110, 18, paint);
+ canvas->translate(0, 15);
+ }
##
-#SeeAlso incomplete
+#SeeAlso SkPaint::getAlpha
#Define ##
# ------------------------------------------------------------------------------
#Define SkColorGetR
-#Line # incomplete ##
+#Line # returns red component ##
#Code
###$
@@ -224,17 +183,24 @@ Returns red component of Color, from zero to 255.
#Return red byte ##
#Example
-// incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ SkPaint bgPaint;
+ bgPaint.setColor(0xafffffff);
+ canvas->drawRect({20, 50, 80, 70}, bgPaint);
+ uint8_t red = SkColorGetR(source.getColor(226, 128));
+ canvas->drawString(std::to_string(red).c_str(), 40, 65, SkPaint());
+ canvas->drawLine(80, 70, 226, 128, SkPaint());
##
-#SeeAlso incomplete
+#SeeAlso SkColorGetG SkColorGetB
#Define ##
# ------------------------------------------------------------------------------
#Define SkColorGetG
-#Line # incomplete ##
+#Line # returns green component ##
#Code
###$
@@ -248,17 +214,24 @@ Returns green component of Color, from zero to 255.
#Return green byte ##
#Example
-// incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ SkPaint bgPaint;
+ bgPaint.setColor(0xafffffff);
+ canvas->drawRect({20, 50, 80, 70}, bgPaint);
+ uint8_t green = SkColorGetG(source.getColor(57, 192));
+ canvas->drawString(std::to_string(green).c_str(), 40, 65, SkPaint());
+ canvas->drawLine(80, 70, 57, 192, SkPaint());
##
-#SeeAlso incomplete
+#SeeAlso SkColorGetR SkColorGetB
#Define ##
# ------------------------------------------------------------------------------
#Define SkColorGetB
-#Line # incomplete ##
+#Line # returns blue component ##
#Code
###$
@@ -272,10 +245,17 @@ Returns blue component of Color, from zero to 255.
#Return blue byte ##
#Example
-// incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ SkPaint bgPaint;
+ bgPaint.setColor(0xafffffff);
+ canvas->drawRect({20, 50, 80, 70}, bgPaint);
+ uint8_t blue = SkColorGetB(source.getColor(168, 170));
+ canvas->drawString(std::to_string(blue).c_str(), 40, 65, SkPaint());
+ canvas->drawLine(80, 70, 168, 170, SkPaint());
##
-#SeeAlso incomplete
+#SeeAlso SkColorGetR SkColorGetG
#Define ##
@@ -283,20 +263,30 @@ Returns blue component of Color, from zero to 255.
#Method static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a)
#In Function
-#Line # incomplete ##
+#Line # returns Color with transparency ##
-Returns Color with red, blue, and green set from c; and alpha set from a.
+Returns Unpremultiplied Color with red, blue, and green set from c; and alpha set
+from a. Alpha component of c is ignored and is replaced by a in result.
-#Param c Unpremultiplied Color_ARGB ##
-#Param a incomplete ##
+#Param c packed RGB, eight bits per component ##
+#Param a Alpha: transparent at zero, fully opaque at 255 ##
-#Return incomplete ##
+#Return Color with transparency ##
#Example
-// incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ for (int y = 0; y < 256; y += 16) {
+ for (int x = 0; x < 256; x += 16) {
+ SkColor color = source.getColor(x + 8, y + 8);
+ SkPaint paint;
+ paint.setColor(SkColorSetA(color, x + y));
+ canvas->drawRect(SkRect::MakeXYWH(x, y, 16, 16), paint);
+ }
+ }
##
-#SeeAlso incomplete
+#SeeAlso SkColorSetARGB
#Method ##
@@ -535,6 +525,7 @@ $$$#
#Subtopic Transparent
#Example
+#Image 3
std::vector<uint32_t> srcPixels;
constexpr int width = 256;
constexpr int height = 256;
@@ -619,11 +610,11 @@ modulo 360, where zero degrees is red.
#Subtopic Value
##
-#Method SK_API void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
+#Method void SkRGBToHSV(U8CPU red, U8CPU green, U8CPU blue, SkScalar hsv[3])
#In Function
-#Line # incomplete ##
+#Line # converts RGB to HSV ##
-Converts RGB components to HSV.
+Converts RGB to its HSV components.
hsv[0] contains Hue, a value from zero to less than 360.
hsv[1] contains Saturation, a value from zero to one.
hsv[2] contains Value, a value from zero to one.
@@ -634,19 +625,28 @@ hsv[2] contains Value, a value from zero to one.
#Param hsv three element array which holds the resulting HSV components
##
-#Return incomplete ##
-
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ SkPaint bgPaint;
+ bgPaint.setColor(0xafffffff);
+ canvas->drawRect({20, 30, 110, 90}, bgPaint);
+ SkScalar hsv[3];
+ SkColor c = source.getColor(226, 128);
+ SkRGBToHSV(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c), hsv);
+ canvas->drawString(("h: " + std::to_string(hsv[0]).substr(0, 6)).c_str(), 27, 45, SkPaint());
+ canvas->drawString(("s: " + std::to_string(hsv[1]).substr(0, 6)).c_str(), 27, 65, SkPaint());
+ canvas->drawString(("v: " + std::to_string(hsv[2]).substr(0, 6)).c_str(), 27, 85, SkPaint());
+ canvas->drawLine(110, 90, 226, 128, SkPaint());
+##
+
+#SeeAlso SkColorToHSV SkHSVToColor
#Method ##
# ------------------------------------------------------------------------------
-#Method static inline void SkColorToHSV(SkColor color, SkScalar hsv[3])
+#Method void SkColorToHSV(SkColor color, SkScalar hsv[3])
#In Function
#Line # converts RGB to HSV ##
@@ -660,28 +660,37 @@ hsv[2] contains Value, a value from zero to one.
#Param hsv three element array which holds the resulting HSV components
##
-#Return incomplete ##
-
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ for (int y = 0; y < 256; ++y) {
+ for (int x = 0; x < 256; ++x) {
+ SkScalar hsv[3];
+ SkColorToHSV(source.getColor(x, y), hsv);
+ SkTSwap(hsv[1], hsv[2]);
+ SkPaint paint;
+ paint.setColor(SkHSVToColor(hsv));
+ canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
+ }
+ }
+##
+
+#SeeAlso SkRGBToHSV SkHSVToColor
#Method ##
# ------------------------------------------------------------------------------
-#Method SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
+#Method SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
#In Function
#Line # converts HSV with Alpha to RGB ##
-Converts HSV components to an ARGB color. The alpha component is passed through unchanged.
+Converts HSV components to an ARGB color. Alpha is passed through unchanged.
hsv[0] represents Hue, an angle from zero to less than 360.
hsv[1] represents Saturation, and varies from zero to one.
hsv[2] represents Value, and varies from zero to one.
-If hsv values are out of range, they are pinned.
+Out of range hsv values are pinned.
#Param alpha Alpha component of the returned ARGB color
##
@@ -692,37 +701,61 @@ If hsv values are out of range, they are pinned.
##
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ for (int y = 0; y < 256; ++y) {
+ for (int x = 0; x < 256; ++x) {
+ SkColor color = source.getColor(x, y);
+ SkScalar hsv[3];
+ SkColorToHSV(color, hsv);
+ hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
+ SkPaint paint;
+ paint.setColor(SkHSVToColor(x + y, hsv));
+ canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
+ }
+ }
+##
+
+#SeeAlso SkColorToHSV SkRGBToHSV
#Method ##
# ------------------------------------------------------------------------------
-#Method static inline SkColor SkHSVToColor(const SkScalar hsv[3])
+#Method SkColor SkHSVToColor(const SkScalar hsv[3])
#In Function
-#Line # incomplete ##
+#Line # converts HSV to RGB ##
-Convert HSV components to an ARGB color. The alpha component set to 0xFF.
+Convert HSV components to an ARGB color. Alpha is set to 0xFF.
hsv[0] represents Hue, an angle from zero to less than 360.
hsv[1] represents Saturation, and varies from zero to one.
hsv[2] represents Value, and varies from zero to one.
-If hsv values are out of range, they are pinned.
+Out of range hsv values are pinned.
-#Param hsv 3 element array which holds the input HSV components.
+#Param hsv three element array which holds the input HSV components
##
-#Return the resulting ARGB color
+#Return RGB equivalent to HSV
##
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
+#Image 3
+ canvas->drawBitmap(source, 0, 0);
+ for (int y = 0; y < 256; ++y) {
+ for (int x = 0; x < 256; ++x) {
+ SkColor color = source.getColor(x, y);
+ SkScalar hsv[3];
+ SkColorToHSV(color, hsv);
+ hsv[0] = hsv[0] + 90 >= 360 ? hsv[0] - 270 : hsv[0] + 90;
+ SkPaint paint;
+ paint.setColor(SkHSVToColor(hsv));
+ canvas->drawRect(SkRect::MakeXYWH(x, y, 1, 1), paint);
+ }
+ }
+##
+
+#SeeAlso SkColorToHSV SkRGBToHSV
#Method ##
@@ -735,6 +768,10 @@ If hsv values are out of range, they are pinned.
#Typedef uint32_t SkPMColor
#Line # defines Premultiplied Color as 32 bits ##
+#Code
+typedef uint32_t SkPMColor;
+##
+
32-bit ARGB color value, Premultiplied. The byte order for this value is
configuration dependent, matching the format of kBGRA_8888_SkColorType bitmaps.
This is different from SkColor, which is Unpremultiplied, and is always in the
@@ -744,45 +781,70 @@ same byte order.
# ------------------------------------------------------------------------------
-#Method SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
+#Method SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#In Function
#Line # converts Unpremultiplied ARGB to Premultiplied PMColor ##
-Return a SkPMColor value from Unpremultiplied 8-bit component values
+Returns a SkPMColor value from Unpremultiplied 8-bit component values.
-#Param a incomplete ##
-#Param r incomplete ##
-#Param g incomplete ##
-#Param b incomplete ##
+#Param a amount of Alpha, from fully transparent (0) to fully opaque (255) ##
+#Param r amount of red, from no red (0) to full red (255) ##
+#Param g amount of green, from no green (0) to full green (255) ##
+#Param b amount of blue, from no blue (0) to full blue (255) ##
-#Return incomplete ##
+#Return Premultiplied Color ##
#Example
-// incomplete
+#Height 128
+#Width 300
+ SkPMColor premultiplied = SkPreMultiplyARGB(160, 128, 160, 192);
+ canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
+ canvas->drawString("alpha=160 red=128 green=160 blue=192", 20, 40, SkPaint());
+ canvas->drawString("Premultiplied:", 20, 80, SkPaint());
+ std::string str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
+ str += " red=" + std::to_string(SkColorGetR(premultiplied));
+ str += " green=" + std::to_string(SkColorGetG(premultiplied));
+ str += " blue=" + std::to_string(SkColorGetB(premultiplied));
+ canvas->drawString(str.c_str(), 20, 100, SkPaint());
##
-#SeeAlso incomplete
+#SeeAlso SkPreMultiplyColor
#Method ##
# ------------------------------------------------------------------------------
-#Method SK_API SkPMColor SkPreMultiplyColor(SkColor c)
+#Method SkPMColor SkPreMultiplyColor(SkColor c)
#In Function
#Line # converts Unpremultiplied Color to Premultiplied PMColor ##
Returns PMColor closest to Color c. Multiplies c RGB components by the c Alpha,
and arranges the bytes to match the format of kN32_SkColorType.
-#Param c incomplete ##
+#Param c Unpremultiplied ARGB Color ##
-#Return incomplete ##
+#Return Premultiplied Color ##
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
+#Height 128
+#Width 300
+ SkColor unpremultiplied = SkColorSetARGB(160, 128, 160, 192);
+ SkPMColor premultiplied = SkPreMultiplyColor(unpremultiplied);
+ canvas->drawString("Unpremultiplied:", 20, 20, SkPaint());
+ std::string str = "alpha=" + std::to_string(SkColorGetA(unpremultiplied));
+ str += " red=" + std::to_string(SkColorGetR(unpremultiplied));
+ str += " green=" + std::to_string(SkColorGetG(unpremultiplied));
+ str += " blue=" + std::to_string(SkColorGetB(unpremultiplied));
+ canvas->drawString(str.c_str(), 20, 40, SkPaint());
+ canvas->drawString("Premultiplied:", 20, 80, SkPaint());
+ str = "alpha=" + std::to_string(SkColorGetA(premultiplied));
+ str += " red=" + std::to_string(SkColorGetR(premultiplied));
+ str += " green=" + std::to_string(SkColorGetG(premultiplied));
+ str += " blue=" + std::to_string(SkColorGetB(premultiplied));
+ canvas->drawString(str.c_str(), 20, 100, SkPaint());
+##
+
+#SeeAlso SkPreMultiplyARGB
#Method ##
diff --git a/docs/SkImageInfo_Reference.bmh b/docs/SkImageInfo_Reference.bmh
index 861dabbdee..c477d4f752 100644
--- a/docs/SkImageInfo_Reference.bmh
+++ b/docs/SkImageInfo_Reference.bmh
@@ -55,8 +55,8 @@ color to create a new color. If alpha describes a weight from zero to one:
In practice alpha is encoded in two or more bits, where 1.0 equals all bits set.
-Color_RGB may have Color_Alpha included in each component value; the stored
-value is the original Color_RGB multiplied by Color_Alpha. Premultiplied color
+RGB may have Color_Alpha included in each component value; the stored
+value is the original RGB multiplied by Color_Alpha. Premultiplied color
components improve performance.
#Const kUnknown_SkAlphaType 0
@@ -265,10 +265,10 @@ $$$#
#Code ##
Describes how pixel bits encode color. A pixel may be an alpha mask, a
-gray level, Color_RGB, or Color_ARGB.
+grayscale, RGB, or ARGB.
-kN32_SkColorType selects the native 32-bit Color_ARGB format. On Little_Endian
-processors, pixels containing 8-bit Color_ARGB components pack into 32-bit
+kN32_SkColorType selects the native 32-bit ARGB format. On Little_Endian
+processors, pixels containing 8-bit ARGB components pack into 32-bit
kBGRA_8888_SkColorType. On Big_Endian processors, pixels pack into 32-bit
kRGBA_8888_SkColorType.
@@ -335,7 +335,7 @@ kRGBA_8888_SkColorType.
##
#Const kGray_8_SkColorType 9
-#Line # pixel with Color_Gray level in 8-bit byte ##
+#Line # pixel with grayscale level in 8-bit byte ##
#Details Gray_8
Stores 8-bit byte pixel encoding that equivalent to equal values for red,
blue, and green, representing colors from black to white.
@@ -357,8 +357,8 @@ kRGBA_8888_SkColorType.
#Const kN32_SkColorType 4 or 6
#Alias Native_Color_Type
#NoJustify
-#Line # native Color_ARGB 32-bit encoding ##
- Encodes Color_ARGB as either kRGBA_8888_SkColorType or
+#Line # native ARGB 32-bit encoding ##
+ Encodes ARGB as either kRGBA_8888_SkColorType or
kBGRA_8888_SkColorType, whichever is native to the platform.
##
@@ -398,12 +398,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 2, 2, &orangePaint);
}
##
- #SeeAlso incomplete
+ #SeeAlso Alpha Gray_8
##
#Subtopic RGB_565
-#Line # encodes Color_RGB in 16 bits ##
- kRGB_565_SkColorType encodes Color_RGB to fit in a 16-bit word. Red and Blue
+#Line # encodes RGB in 16 bits ##
+ kRGB_565_SkColorType encodes RGB to fit in a 16-bit word. Red and blue
components use five bits describing 32 levels. Green components, more sensitive
to the eye, use six bits describing 64 levels. kRGB_565_SkColorType has no
bits for Alpha.
@@ -438,12 +438,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 4, 4);
}
##
- #SeeAlso incomplete
+ #SeeAlso ARGB_4444 RGBA_8888
##
#Subtopic ARGB_4444
-#Line # encodes Color_ARGB in 16 bits ##
- kARGB_4444_SkColorType encodes Color_ARGB to fit in 16-bit word. Each
+#Line # encodes ARGB in 16 bits ##
+ kARGB_4444_SkColorType encodes ARGB to fit in 16-bit word. Each
component: alpha, blue, green, and red; use four bits, describing 16 levels.
Note that kARGB_4444_SkColorType is misnamed; the acronym does not
describe the actual component order.
@@ -489,12 +489,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 4, 4);
}
##
- #SeeAlso incomplete
+ #SeeAlso RGBA_8888
##
#Subtopic RGBA_8888
-#Line # encodes Color_ARGB Big_Endian in 32 bits ##
- kRGBA_8888_SkColorType encodes Color_ARGB into a 32-bit word. Each component:
+#Line # encodes ARGB Big_Endian in 32 bits ##
+ kRGBA_8888_SkColorType encodes ARGB into a 32-bit word. Each component:
red, green, blue, alpha; use eight bits, describing 256 levels.
#Illustration
@@ -540,12 +540,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 4, 4);
}
##
- #SeeAlso incomplete
+ #SeeAlso RGB_888 BGRA_8888
##
#Subtopic RGB_888
-#Line # encodes Color_RGB in 32 bits ##
- kRGB_888x_SkColorType encodes Color_RGB into a 32-bit word. Each component:
+#Line # encodes RGB in 32 bits ##
+ kRGB_888x_SkColorType encodes RGB into a 32-bit word. Each component:
red, green, blue; use eight bits, describing 256 levels. Eight bits are
unused. Pixels described by kRGB_888x_SkColorType are fully opaque as if
their Color_Alpha was set to one, and should always be paired with
@@ -578,11 +578,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 4, 4);
}
##
+ #SeeAlso RGBA_8888 BGRA_8888
##
#Subtopic BGRA_8888
-#Line # encodes Color_ARGB Little_Endian in 32 bits ##
- kBGRA_8888_SkColorType encodes Color_ARGB into a 32-bit word. Each component:
+#Line # encodes ARGB Little_Endian in 32 bits ##
+ kBGRA_8888_SkColorType encodes ARGB into a 32-bit word. Each component:
blue, green, red, and alpha; use eight bits, describing 256 levels.
#Illustration
@@ -632,8 +633,8 @@ kRGBA_8888_SkColorType.
##
#Subtopic RGBA_1010102
-#Line # encodes Color_ARGB ten bits per color component ##
- kRGBA_1010102_SkColorType encodes Color_ARGB into a 32-bit word. Each
+#Line # encodes ARGB ten bits per color component ##
+ kRGBA_1010102_SkColorType encodes ARGB into a 32-bit word. Each
Color component: red, green, and blue; use ten bits, describing 1024 levels.
Two bits contain alpha, describing four levels. Possible alpha
values are zero: fully transparent; one: 33% opaque; two: 67% opaque;
@@ -686,12 +687,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 4, 4);
}
##
- #SeeAlso incomplete
+ #SeeAlso RGB_101010 RGBA_8888
##
#Subtopic RGB_101010
-#Line # encodes Color_RGB ten bits per color component ##
- kRGB_101010x_SkColorType encodes Color_RGB into a 32-bit word. Each
+#Line # encodes RGB ten bits per color component ##
+ kRGB_101010x_SkColorType encodes RGB into a 32-bit word. Each
Color component: red, green, and blue; use ten bits, describing 1024 levels.
Two bits are unused. Pixels described by kRGB_101010x_SkColorType are fully
opaque as if its Color_Alpha was set to one, and should always be paired
@@ -728,12 +729,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 4, 4);
}
##
- #SeeAlso incomplete
+ #SeeAlso RGBA_1010102
##
#Subtopic Gray_8
-#Line # encodes level of Color_Gray in 8 bits ##
- kGray_8_SkColorType encodes Color_Gray level in eight bits that is equivalent
+#Line # encodes level of grayscale in 8 bits ##
+ kGray_8_SkColorType encodes grayscale level in eight bits that is equivalent
to equal values for red, blue, and green, representing colors from black to
white. Pixels described by kGray_8_SkColorType are fully
opaque as if its Color_Alpha was set to one, and should always be paired with
@@ -754,12 +755,12 @@ kRGBA_8888_SkColorType.
canvas->drawBitmap(bitmap, 2, 2);
}
##
- #SeeAlso incomplete
+ #SeeAlso Alpha_8
##
#Subtopic RGBA_F16
-#Line # encodes Color_ARGB as half floats ##
- kRGBA_F16_SkColorType encodes Color_ARGB into a 64-bit word. Each component:
+#Line # encodes ARGB as half floats ##
+ kRGBA_F16_SkColorType encodes ARGB into a 64-bit word. Each component:
blue, green, red, and alpha; use 16 bits, describing a floating point value.
from -65500 to 65000 with 3.31 decimal digits of precision.
@@ -841,7 +842,7 @@ kRGBA_8888_SkColorType.
}
}
##
- #SeeAlso incomplete
+ #SeeAlso SkColor4f
##
#Subtopic Color_Type ##
@@ -2155,7 +2156,7 @@ info1 == info2
#Line # compares Image_Info for inequality ##
Compares Image_Info with other, and returns true if width, height, Color_Type,
-Alpha_Type, and Color_Space are equivalent.
+Alpha_Type, and Color_Space are not equivalent.
#Param other Image_Info to compare ##
diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh
index 571dc49996..4f2549b03a 100644
--- a/docs/SkImage_Reference.bmh
+++ b/docs/SkImage_Reference.bmh
@@ -144,6 +144,11 @@ pixels is not nullptr, and contains enough data for Image.
#Typedef void* ReleaseContext
#Line # parameter type for MakeFromRaster ##
+
+#Code
+typedef void* ReleaseContext;
+##
+
Caller data passed to RasterReleaseProc; may be nullptr.
#SeeAlso MakeFromRaster RasterReleaseProc
@@ -152,6 +157,11 @@ Caller data passed to RasterReleaseProc; may be nullptr.
#Typedef void (*RasterReleaseProc)(const void* pixels, ReleaseContext)
#Line # parameter type for MakeFromRaster ##
+
+#Code
+typedef void (*RasterReleaseProc)(const void* pixels, ReleaseContext);
+##
+
Function called when Image no longer shares pixels. ReleaseContext is
provided by caller when Image is created, and may be nullptr.
@@ -340,6 +350,11 @@ for (int quality : { 100, 50, 10, 1} ) {
#Typedef void (*TextureReleaseProc)(ReleaseContext releaseContext)
#Line # parameter type for MakeFromTexture ##
+
+#Code
+typedef void (*TextureReleaseProc)(ReleaseContext releaseContext);
+##
+
User function called when supplied texture may be deleted.
#SeeAlso MakeFromTexture
##
@@ -696,11 +711,11 @@ should this be moved to chrome only?
#Const kU8 0
#Line # uses 8-bit unsigned int per Color component ##
-Use 8 bits per Color_ARGB component using unsigned integer format.
+Use 8 bits per ARGB component using unsigned integer format.
##
#Const kF16 1
#Line # uses 16-bit float per Color component ##
-Use 16 bits per Color_ARGB component using half-precision floating point format.
+Use 16 bits per ARGB component using half-precision floating point format.
##
#NoExample
@@ -940,8 +955,7 @@ or was parsed from encoded data.
const char* alphaTypeStr[] = { "Unknown", "Opaque", "Premul", "Unpremul" };
SkAlphaType alphaType = image->alphaType();
canvas->drawImage(image, 16, 0);
- SkPaint paint;
- canvas->drawString(alphaTypeStr[(int) alphaType], 20, image->height() + 20, paint);
+ canvas->drawString(alphaTypeStr[(int) alphaType], 20, image->height() + 20, SkPaint());
##
#SeeAlso SkImageInfo::alphaType
@@ -959,7 +973,13 @@ Returns Color_Type if known; otherwise, returns kUnknown_SkColorType.
#Return Color_Type of Image ##
#Example
-// incomplete
+#Image 4
+#Height 96
+ const char* colors[] = { "Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
+ "BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16" };
+ SkColorType colorType = image->colorType();
+ canvas->drawImage(image, 16, 0);
+ canvas->drawString(colors[(int) colorType], 20, image->height() + 20, SkPaint());
##
#SeeAlso SkImageInfo::colorType
@@ -1994,6 +2014,11 @@ By translating canvas by returned offset, Image appears stationary.
#Typedef std::function<void(GrBackendTexture)> BackendTextureReleaseProc
#Line # parameter type for MakeBackendTextureFromSkImage ##
+
+#Code
+typedef std::function<void(GrBackendTexture)> BackendTextureReleaseProc;
+##
+
Defines a function take one parameter of type
GrBackendTexture with no return value.
##
diff --git a/docs/SkMatrix_Reference.bmh b/docs/SkMatrix_Reference.bmh
index 8cd86bcd3d..e76accdb40 100644
--- a/docs/SkMatrix_Reference.bmh
+++ b/docs/SkMatrix_Reference.bmh
@@ -3720,10 +3720,20 @@ Returns bounds of src corners mapped by Matrix.
#Return mapped bounds ##
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
+ SkRect rect{110, 50, 180, 100};
+ SkMatrix matrix;
+ matrix.setRotate(50, 28, 28);
+ SkRect mapped = matrix.mapRect(rect);
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRect(rect, paint);
+ canvas->drawRect(mapped, paint);
+ canvas->concat(matrix);
+ canvas->drawRect(rect, paint);
+##
+
+#SeeAlso mapRectToQuad mapRectScaleTranslate
#Method ##
# ------------------------------------------------------------------------------
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index 6fdf2a0e89..057135414e 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -22,7 +22,7 @@ Paint does not directly implement dashing or blur, but contains the objects that
The objects contained by Paint are opaque, and cannot be edited outside of the Paint
to affect it. The implementation is free to defer computations associated with the
Paint, or ignore them altogether. For instance, some GPU implementations draw all
-Path geometries with Anti-aliasing, regardless of how SkPaint::kAntiAlias_Flag
+Path geometries with Anti_Aliasing, regardless of how SkPaint::kAntiAlias_Flag
is set in Paint.
Paint describes a single color, a single font, a single image quality, and so on.
@@ -71,7 +71,7 @@ Constructs Paint with default values.
#Legend
# attribute # default value ##
#Legend ##
-# Anti-alias # false ##
+# Anti_Alias # false ##
# Blend_Mode # SkBlendMode::kSrcOver ##
# Color # SK_ColorBLACK ##
# Color_Alpha # 255 ##
@@ -546,7 +546,7 @@ All flags can be read and written explicitly; Flags allows manipulating
multiple settings at once.
#Const kAntiAlias_Flag 0x0001
- #Line # mask for setting Anti-alias ##
+ #Line # mask for setting Anti_Alias ##
##
#Const kDither_Flag 0x0004
#Line # mask for setting Dither ##
@@ -648,14 +648,17 @@ All Flags members may be cleared, or one or more may be set.
#Subtopic Flags ##
# ------------------------------------------------------------------------------
-#Subtopic Anti-alias
-#Alias Anti-alias # permit hyphen in topic name, should probably not substitute hyphen with _
-#Alias Anti-aliased
-#Alias Anti-aliasing
+#Subtopic Anti_Alias
+#Alias Anti_Alias
+#Substitute Anti-alias
+#Alias Anti_Aliased
+#Substitute Anti-aliased
+#Alias Anti_Aliasing
+#Substitute Anti-aliasing
#In Related_Function
#Line # approximating coverage with transparency ##
-Anti-alias drawing approximates partial pixel 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.
If kAntiAlias_Flag is set, pixels are drawn with Color_Alpha equal to their coverage.
@@ -667,14 +670,14 @@ active Path edge, and whose center is to the left of the end of the active Path
#ToDo add illustration of raster pixels ##
-A platform may only support Anti-aliased drawing. Some GPU-backed platforms use
-Supersampling to Anti-alias all drawing, and have no mechanism to selectively
+A platform may only support Anti_Aliased drawing. Some GPU-backed platforms use
+Supersampling to Anti_Alias all drawing, and have no mechanism to selectively
Alias.
-The amount of coverage computed for Anti-aliased pixels also varies across platforms.
+The amount of coverage computed for Anti_Aliased pixels also varies across platforms.
-Anti-alias is disabled by default.
-Anti-alias can be enabled by default by setting SkPaintDefaults_Flags to kAntiAlias_Flag
+Anti_Alias is disabled by default.
+Anti_Alias can be enabled by default by setting SkPaintDefaults_Flags to kAntiAlias_Flag
at compile time.
#Example
@@ -710,7 +713,7 @@ at compile time.
#Method bool isAntiAlias() const
#In Anti_alias
-#Line # returns true if Anti-alias is set ##
+#Line # returns true if Anti_Alias is set ##
If true, pixels on the active edges of Path may be drawn with partial transparency.
@@ -736,7 +739,7 @@ at compile time.
#Method void setAntiAlias(bool aa)
#In Anti_alias
-#Line # sets or clears Anti-alias ##
+#Line # sets or clears Anti_Alias ##
Requests, but does not require, that Path edge pixels draw opaque or with
partial transparency.
@@ -758,7 +761,7 @@ at compile time.
##
-#Subtopic Anti-alias ##
+#Subtopic Anti_Alias ##
# ------------------------------------------------------------------------------
#Subtopic Dither
#Line # distributing color error ##
@@ -892,7 +895,7 @@ void draw(SkCanvas* canvas) {
##
-#SeeAlso Gradient Color_RGB-565
+#SeeAlso Gradient kRGB_565_SkColorType
#Subtopic Dither ##
# ------------------------------------------------------------------------------
@@ -901,11 +904,11 @@ void draw(SkCanvas* canvas) {
LCD_Text and Subpixel_Text increase the precision of glyph position.
-When set, Flags kLCDRenderText_Flag takes advantage of the organization of Color_RGB stripes that
+When set, Flags kLCDRenderText_Flag takes advantage of the organization of RGB stripes that
create a color, and relies
on the small size of the stripe and visual perception to make the color fringing imperceptible.
LCD_Text can be enabled on devices that orient stripes horizontally or vertically, and that order
-the color components as Color_RGB or Color_RBG.
+the color components as RGB or BGR.
Flags kSubpixelText_Flag uses the pixel transparency to represent a fractional offset.
As the opaqueness
@@ -1083,14 +1086,14 @@ SkDebugf("paint.isSubpixelText() %c= !!(paint.getFlags() & SkPaint::kSubpixelTex
#Subtopic LCD_Text
#Substitute LCD text
-#Line # text relying on the order of Color_RGB stripes ##
+#Line # text relying on the order of RGB stripes ##
#Alias LCD_Text # makes this a top level name, since it is under subtopic Device_Text
-When set, Flags kLCDRenderText_Flag takes advantage of the organization of Color_RGB stripes that
+When set, Flags kLCDRenderText_Flag takes advantage of the organization of RGB stripes that
create a color, and relies
on the small size of the stripe and visual perception to make the color fringing imperceptible.
LCD_Text can be enabled on devices that orient stripes horizontally or vertically, and that order
-the color components as Color_RGB or Color_RBG.
+the color components as RGB or BGR.
#Method bool isLCDRenderText() const
@@ -1628,25 +1631,25 @@ Does not check to see if quality is valid.
#Legend
# name # description ##
#Legend ##
-# getColor # returns Color_Alpha and Color_RGB, one drawing color ##
-# setColor # sets Color_Alpha and Color_RGB, one drawing color ##
+# getColor # returns Color_Alpha and RGB, one drawing color ##
+# setColor # sets Color_Alpha and RGB, one drawing color ##
#Table ##
-Color specifies the Color_RGB_Red, Color_RGB_Blue, Color_RGB_Green, and Color_Alpha
+Color specifies the red, blue, 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.
Color is not Premultiplied; Color_Alpha sets the transparency independent of
-Color_RGB: Color_RGB_Red, Color_RGB_Blue, and Color_RGB_Green.
+RGB: red, blue, and green.
-The bit positions of Color_Alpha and Color_RGB are independent of the bit
+The bit positions of Color_Alpha and 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
-# bit positions # Color_Alpha # Color_RGB_Red # Color_RGB_Blue # Color_RGB_Green ##
+# bit positions # Color_Alpha # red # blue # green ##
#Legend ##
# # 31 - 24 # 23 - 16 # 15 - 8 # 7 - 0 ##
#Table ##
@@ -1668,12 +1671,12 @@ a different arrangement.
#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.
+#Line # returns Color_Alpha and RGB, one drawing color ##
+ Retrieves Alpha and RGB, Unpremultiplied, packed into 32 bits.
Use helpers SkColorGetA, SkColorGetR, SkColorGetG, and SkColorGetB to extract
a color component.
- #Return Unpremultiplied Color_ARGB ##
+ #Return Unpremultiplied ARGB ##
#Example
SkPaint paint;
@@ -1694,11 +1697,11 @@ a different arrangement.
#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.
+#Line # sets Color_Alpha and RGB, one drawing color ##
+ Sets Alpha and RGB used when stroking and filling. The color is a 32-bit value,
+ Unpremultiplied, packing 8-bit components for Alpha, red, blue, and green.
- #Param color Unpremultiplied Color_ARGB ##
+ #Param color Unpremultiplied ARGB ##
#Example
SkPaint green1, green2;
@@ -1723,7 +1726,7 @@ a different arrangement.
#Subtopic Alpha_Methods
#Line # get and set Alpha ##
-Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color_RGB_Blue, and Color_RGB_Green.
+Color_Alpha sets the transparency independent of RGB: red, blue, and green.
#Method uint8_t getAlpha() const
@@ -1748,7 +1751,7 @@ Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color
#In Alpha_Methods
#Line # sets Color_Alpha, color opacity ##
- Replaces Alpha, leaving Color_RGB
+ Replaces Alpha, leaving RGB
unchanged. An out of range value triggers an assert in the debug
build. a is a value from zero to 255.
a set to zero makes Color fully transparent; a set to 255 makes Color
@@ -1776,12 +1779,12 @@ Color_Alpha sets the transparency independent of Color_RGB: Color_RGB_Red, Color
#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.
+ The color is Unpremultiplied; Alpha sets the transparency independent of RGB.
#Param a amount of Color_Alpha, from fully transparent (0) to fully opaque (255) ##
- #Param r amount of Color_RGB_Red, from no red (0) to full red (255) ##
- #Param g amount of Color_RGB_Green, from no green (0) to full green (255) ##
- #Param b amount of Color_RGB_Blue, from no blue (0) to full blue (255) ##
+ #Param r amount of red, from no red (0) to full red (255) ##
+ #Param g amount of green, from no green (0) to full green (255) ##
+ #Param b amount of blue, from no blue (0) to full blue (255) ##
#Example
SkPaint transRed1, transRed2;
@@ -1837,7 +1840,7 @@ Stroke_Width of zero has a special meaning and switches drawing to use Hairline.
Hairline draws the thinnest continuous frame. If kAntiAlias_Flag is clear, adjacent pixels
flow horizontally, vertically,or diagonally.
-#ToDo what is the description of Anti-aliased hairlines? ##
+#ToDo what is the description of Anti_Aliased hairlines? ##
Path drawing with Hairline may hit the same pixel more than once. For instance, Path containing
two lines in one Path_Contour will draw the corner point once, but may both lines may draw the adjacent
diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh
index 2adfecf5bc..12f5a6208d 100644
--- a/docs/SkRect_Reference.bmh
+++ b/docs/SkRect_Reference.bmh
@@ -904,14 +904,25 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false
#Method void setBoundsNoCheck(const SkPoint pts[], int count)
#In Set
#Line # sets to upper and lower limits of Point array ##
-Sets to bounds of Point array with count entries. If any point contains a non-finite value
-then the rect will also be non-finite.
+Sets to bounds of Point pts array with count entries. If any Point in pts
+contains Infinity or NaN, all Rect dimensions are set to NaN.
#Param pts Point array ##
#Param count entries in array ##
#Example
-// incomplete
+ SkPoint points[] = {{3, 4}, {1, 2}, {SkScalar_Inf, 6}, {SK_ScalarNaN, 8}};
+ for (int count = 0; count <= (int) SK_ARRAY_COUNT(points); ++count) {
+ SkRect rect;
+ rect.setBoundsNoCheck(points, count);
+ if (count > 0) {
+ SkDebugf("added: %3g, %g ", points[count - 1].fX, points[count - 1].fY);
+ } else {
+ SkDebugf("%14s", " ");
+ }
+ SkDebugf("count: %d rect: %g, %g, %g, %g\n", count,
+ rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
+ }
##
#SeeAlso setBoundsCheck
diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh
index 01df8b80d6..30a3d8fd60 100644
--- a/docs/SkSurface_Reference.bmh
+++ b/docs/SkSurface_Reference.bmh
@@ -1438,7 +1438,20 @@ converting to Surface colorType() and Surface alphaType() if required.
#Param dstY x position relative to Surface to begin copy; may be negative ##
#Example
- // incomplete
+#Image 4
+#Height 96
+ sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));
+ auto surfCanvas = surf->getCanvas();
+ surfCanvas->clear(SK_ColorRED);
+ SkPaint paint;
+ paint.setTextSize(40);
+ surfCanvas->drawString("&", 16, 40, paint);
+ SkPixmap pixmap;
+ if (surf->peekPixels(&pixmap)) {
+ surf->writePixels(pixmap, 25, 25);
+ sk_sp<SkImage> image(surf->makeImageSnapshot());
+ canvas->drawImage(image, 0, 0);
+ }
##
#SeeAlso readPixels peekPixels
@@ -1465,7 +1478,14 @@ converting to Surface colorType() and Surface alphaType() if required.
#Param dstY x position relative to Surface to begin copy; may be negative ##
#Example
- // incomplete
+#Image 4
+#Height 96
+ sk_sp<SkSurface> surf(SkSurface::MakeRasterN32Premul(64, 64));
+ auto surfCanvas = surf->getCanvas();
+ surfCanvas->clear(SK_ColorGREEN);
+ surf->writePixels(source, 25, 25);
+ sk_sp<SkImage> image(surf->makeImageSnapshot());
+ canvas->drawImage(image, 0, 0);
##
#SeeAlso readPixels peekPixels
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index d0efc87680..be0c1b5c2c 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -3,7 +3,7 @@
DirectWrite TrueType Windows Linux Android iOS __ANDROID_API__ AHardwareBuffer
FreeType FreeType-based Harfbuzz
Descenders Kerning Unhinted
- LCD RGB sRGB YUV SDTV HDTV
+ LCD RGB sRGB ARGB BGR YUV SDTV HDTV
YUV_Component_Y YUV_Component_U YUV_Component_V
Unicode Unicode5 UTF-8 UTF-16 UTF-32 ASCII Unichar
API