From 224c700a1fb0b7f6abd85a9729d29cbbdf5872dd Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 27 Jun 2018 11:00:21 -0400 Subject: sync docs up with tip of tree Also check in work in progress for blend modes, round rects, and a placeholder for pictures. One minor include change to add a parameter name for SkBlendMode function. TBR=reed@google.com R=caryclark@google.com Docs-Preview: https://skia.org/?cl=134200 Bug: skia:6898 Change-Id: I5d2a9221d61edb32d9c7edbb3193401605b2b513 Reviewed-on: https://skia-review.googlesource.com/134200 Reviewed-by: Cary Clark Reviewed-by: Cary Clark Commit-Queue: Cary Clark Auto-Submit: Cary Clark --- site/user/api/SkAutoCanvasRestore_Reference.md | 2 - site/user/api/SkBitmap_Reference.md | 18 +- site/user/api/SkBlendMode_Reference.md | 1050 +++++++++++++++ site/user/api/SkCanvas_Reference.md | 367 +++--- site/user/api/SkColor4f_Reference.md | 8 +- site/user/api/SkColor_Reference.md | 4 +- site/user/api/SkIPoint_Reference.md | 8 +- site/user/api/SkIRect_Reference.md | 15 +- site/user/api/SkImageInfo_Reference.md | 98 +- site/user/api/SkImage_Reference.md | 40 +- site/user/api/SkMatrix_Reference.md | 9 +- site/user/api/SkPaint_Reference.md | 73 +- site/user/api/SkPath_Reference.md | 178 ++- site/user/api/SkPicture_Reference.md | 516 ++++++++ site/user/api/SkPixmap_Reference.md | 4 - site/user/api/SkPoint_Reference.md | 9 +- site/user/api/SkRRect_Reference.md | 1674 ++++++++++++++++++++++++ site/user/api/SkRect_Reference.md | 22 +- site/user/api/SkSurface_Reference.md | 14 +- site/user/api/catalog.htm | 832 +++++++++++- site/user/api/undocumented.md | 95 +- 21 files changed, 4453 insertions(+), 583 deletions(-) create mode 100644 site/user/api/SkBlendMode_Reference.md create mode 100644 site/user/api/SkPicture_Reference.md create mode 100644 site/user/api/SkRRect_Reference.md (limited to 'site') diff --git a/site/user/api/SkAutoCanvasRestore_Reference.md b/site/user/api/SkAutoCanvasRestore_Reference.md index 1deec31d38..a31368d342 100644 --- a/site/user/api/SkAutoCanvasRestore_Reference.md +++ b/site/user/api/SkAutoCanvasRestore_Reference.md @@ -41,7 +41,6 @@ SkAutoCanvasRestore can be constructed or initialized by these functions, includ - ## Member Function @@ -55,7 +54,6 @@ SkAutoCanvasRestore member functions read and modify the structure properties. - ## SkAutoCanvasRestore diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 1385892ea3..61550cbed9 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -101,7 +101,6 @@ SkBitmap global, struct, and class related member func - ## Constant @@ -119,7 +118,6 @@ SkBitmap related constants are defined by enum, enum class - ## Class @@ -137,7 +135,6 @@ SkBitmap uses C++ classes to declare the public data structures and interfaces. - ## Constructor @@ -187,7 +184,6 @@ SkBitmap can be constructed or initialized by these functions, including C++ cla - ## Operator @@ -205,7 +201,6 @@ SkBitmap operators inline class member functions with arithmetic equivalents. - ## Member Function @@ -459,7 +454,6 @@ SkBitmap member functions read and modify the structure properties. - # Class SkBitmap::Allocator ## Member_Function @@ -471,7 +465,6 @@ SkBitmap member functions read and modify the structure properties. Description -
     class Allocator : public SkRefCnt {
     public:
@@ -520,7 +513,6 @@ SkBitmap member functions read and modify the structure properties.
 Description
 
 
-
 
     class HeapAllocator : public Allocator {
     public:
@@ -967,7 +959,6 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT
   
 
 
-
 
 ## pixmap
 
@@ -2200,7 +2191,6 @@ Instructs tryAllocPixelsFlags and 
 
 
-
 
 ## tryAllocPixelsFlags
 
@@ -2762,7 +2752,6 @@ soon
   
 
 
-
 
 ## setPixels
 
@@ -3014,7 +3003,6 @@ subset origin: 32, 64
   
 
 
-
 
 ## setPixelRef
 
@@ -3156,7 +3144,6 @@ Marks that pixels in Pixel Ref have changed
   
 
 
-
 
 ## eraseColor
 
@@ -4065,7 +4052,7 @@ true if src pixels are copied to hasHardwareMipMap() const
 
-Android framework only. +For use by Android framework only. ### Return Value @@ -4084,7 +4071,7 @@ true if setHasHardwareMipMap has be void setHasHardwareMipMap(bool hasHardwareMipMap)
-Android framework only. +For use by Android framework only. ### Parameters @@ -4302,7 +4289,6 @@ x---x- - ## validate diff --git a/site/user/api/SkBlendMode_Reference.md b/site/user/api/SkBlendMode_Reference.md new file mode 100644 index 0000000000..d1bb465851 --- /dev/null +++ b/site/user/api/SkBlendMode_Reference.md @@ -0,0 +1,1050 @@ +SkBlendMode Reference +=== + +# Blend Mode + +## Overview + + + + + + + + + + + + + + + + +
TopicDescription
Constantsenum and enum class, and their const values
Functionsglobal and class member functions
Related Functionssimilar member functions grouped together
+ + +## Member Function + + +SkBlendMode member functions read and modify the structure properties. + + + + + + + +
TopicDescription
SkBlendMode Namereturns mode as C string
+ +## Constant + + +SkBlendMode related constants are defined by enum, enum class, #define, const, and constexpr. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TopicDescription
SkBlendModealgorithm combining source and destination pixels
SkBlendMode::kClearreplaces destination with zero: fully transparent
SkBlendMode::kColorhue and saturation of source with luminosity of destination
SkBlendMode::kColorBurndarken destination to reflect source
SkBlendMode::kColorDodgebrighten destination to reflect source
SkBlendMode::kDarkendarker of source and destination
SkBlendMode::kDifferencesubtract darker from lighter with higher contrast
SkBlendMode::kDstpreserves destination
SkBlendMode::kDstATopdestination inside source blended with source
SkBlendMode::kDstIndestination trimmed by source
SkBlendMode::kDstOutdestination trimmed outside source
SkBlendMode::kDstOverdestination over source
SkBlendMode::kExclusionsubtract darker from lighter with lower contrast
SkBlendMode::kHardLightmultiply or screen, depending on source
SkBlendMode::kHuehue of source with saturation and luminosity of destination
SkBlendMode::kLastCoeffModelast Porter Duff blend mode
SkBlendMode::kLastModelast valid value
SkBlendMode::kLastSeparableModelast blend mode operating separately on components
SkBlendMode::kLightenlighter of source and destination
SkBlendMode::kLuminosityluminosity of source with hue and saturation of destination
SkBlendMode::kModulateproduct of Premultiplied colors; darkens destination
SkBlendMode::kMultiplymultiply source with destination, darkening image
SkBlendMode::kOverlaymultiply or screen, depending on destination
SkBlendMode::kPlussum of colors
SkBlendMode::kSaturationsaturation of source with hue and luminosity of destination
SkBlendMode::kScreenmultiply inverse of pixels, inverting result; brightens destination
SkBlendMode::kSoftLightlighten or darken, depending on source
SkBlendMode::kSrcreplaces destination
SkBlendMode::kSrcATopsource inside destination blended with destination
SkBlendMode::kSrcInsource trimmed inside destination
SkBlendMode::kSrcOutsource trimmed outside destination
SkBlendMode::kSrcOversource over destination
SkBlendMode::kXoreach of source and destination trimmed outside the other
+ +Describes how destination pixel is replaced with a combination of itself and +source pixel. Blend Mode may use source, destination, or both. Blend Mode may +operate on each Color component independently, or may allow all source pixel +components to contribute to one destination pixel component. + +Blend Mode does not use adjacent pixels to determine the outcome. + +Blend Mode uses source and read destination Alpha to determine written +destination Alpha; both source and destination Alpha may also affect written +destination Color components. + +Regardless of how Alpha is encoded in source and destination pixel, nearly all +Color Types treat it as ranging from zero to one. And, nearly all Blend Mode +algorithms limit the output so that all results are also zero to one. + +Two exceptions are SkBlendMode::kPlus and kRGBA_F16_SkColorType. + +SkBlendMode::kPlus permits computing Alpha and Color component values larger +than one. For Color Types other than kRGBA_F16_SkColorType, resulting Alpha +and component values are clamped to one. + +kRGBA_F16_SkColorType permits values outside the zero to one range. It is up +to the client to ensure that the result is within the range of zero to one, +and therefore well-defined. + +## Porter Duff + +Compositing Digital Images describes Porter Duff modes SkBlendMode::kClear through SkBlendMode::kXor. + +Drawing a bitmap with transparency using Porter Duff compositing is free to clear +the destination. + +![Porter_Duff](https://fiddle.skia.org/i/8c27fb2a58f63505cffa74c1c79e16ba_raster.png "") + +Draw geometry with transparency using Porter Duff compositing does not combine +transparent source pixels, leaving the destination outside the geometry untouched. + +![Porter_Duff](https://fiddle.skia.org/i/50ebbb0162bbf60524a196236d66c915_raster.png "") + +## Lighten Darken + +Modes SkBlendMode::kPlus and SkBlendMode::kScreen use +simple arithmetic to lighten or darken the destination. Modes +SkBlendMode::kOverlay through SkBlendMode::kMultiply use more complicated +algorithms to lighten or darken; sometimes one mode does both, as described by Blend Modes . + +![Lighten_Darken](https://fiddle.skia.org/i/8e04f89252632da0fffe713f07f2296f_raster.png "") + +## Modulate Blend + +SkBlendMode::kModulate is a mashup of SkBlendMode::kSrcATop and SkBlendMode::kMultiply. +It multiplies all components, including Alpha; unlike SkBlendMode::kMultiply, if either +source or destination is transparent, result is transparent. SkBlendMode::kModulate +uses Premultiplied values to compute the product; SkBlendMode::kMultiply uses Unpremultiplied +values to compute the product. + +![Modulate_Blend](https://fiddle.skia.org/i/d8abdd8fb56f9e69342d745d425c4a17_raster.png "") + +## Color Blends + +Modes SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor, and +SkBlendMode::kLuminosity convert source and destination pixels using all +components color information, using non-separable blend modes . + +![Color_Blends](https://fiddle.skia.org/i/03710c1770728da885fa4ac24a19d5d1_raster.png "") + +## Enum SkBlendMode + +
+    enum class SkBlendMode {
+        kClear,
+        kSrc,
+        kDst,
+        kSrcOver,
+        kDstOver,
+        kSrcIn,
+        kDstIn,
+        kSrcOut,
+        kDstOut,
+        kSrcATop,
+        kDstATop,
+        kXor,
+        kPlus,
+        kModulate,
+        kScreen,
+        kLastCoeffMode = kScreen,
+        kOverlay,
+        kDarken,
+        kLighten,
+        kColorDodge,
+        kColorBurn,
+        kHardLight,
+        kSoftLight,
+        kDifference,
+        kExclusion,
+        kMultiply,
+        kLastSeparableMode = kMultiply,
+        kHue,
+        kSaturation,
+        kColor,
+        kLuminosity,
+        kLastMode = kLuminosity,
+    };
+
+ +### Constants + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConstValueDetailsDescription
SkBlendMode::kClear0Blend Mode Clear  +Replaces destination with Alpha and Color components set to zero; +a fully transparent pixel. +
SkBlendMode::kSrc1Blend Mode Src  +Replaces destination with source. Destination alpha and color component values +are ignored. +
SkBlendMode::kDst2Blend Mode Dst  +Preserves destination, ignoring source. Drawing with Paint set to kDst has +no effect. +
SkBlendMode::kSrcOver3Blend Mode Src Over  +Replaces destination with source blended with destination. If source is opaque, +replaces destination with source. Used as the default Blend Mode for SkPaint. +
SkBlendMode::kDstOver4Blend Mode Dst Over  +Replaces destination with destination blended with source. If destination is opaque, +has no effect. +
SkBlendMode::kSrcIn5Blend Mode Src In  +Replaces destination with source using destination opacity. +
SkBlendMode::kDstIn6Blend Mode Dst In  +Scales destination opacity by source opacity. +
SkBlendMode::kSrcOut7Blend Mode Src Out  +Replaces destination with source using the inverse of destination opacity, +drawing source fully where destination opacity is zero. +
SkBlendMode::kDstOut8Blend Mode Dst Out  +Replaces destination opacity with inverse of source opacity. If source is +transparent, has no effect. +
SkBlendMode::kSrcATop9Blend Mode Src Atop  +Blends destination with source using read destination opacity. +
SkBlendMode::kDstATop10Blend Mode Dst Atop  +Blends destination with source using source opacity. +
SkBlendMode::kXor11Blend Mode Xor  +Blends destination by exchanging transparency of the source and destination. +
SkBlendMode::kPlus12Blend Mode Plus  +Replaces destination with source and destination added together. +
SkBlendMode::kModulate13Blend Mode Modulate  +Replaces destination with source and destination multiplied together. +
SkBlendMode::kScreen14Blend Mode Screen  +Replaces destination with inverted source and destination multiplied together. +
SkBlendMode::kLastCoeffMode14 +last Porter_Duff blend mode
SkBlendMode::kOverlay15Blend Mode Overlay  +Replaces destination with multiply or screen, depending on destination. +
SkBlendMode::kDarken16Blend Mode Darken  +Replaces destination with darker of source and destination. +
SkBlendMode::kLighten17Blend Mode Lighten  +Replaces destination with lighter of source and destination. +
SkBlendMode::kColorDodge18Blend Mode Color Dodge  +Makes destination brighter to reflect source. +
SkBlendMode::kColorBurn19Blend Mode Color Burn  +Makes destination darker to reflect source. +
SkBlendMode::kHardLight20Blend Mode Hard Light  +Makes destination lighter or darker, depending on source. +
SkBlendMode::kSoftLight21Blend Mode Soft Light  +Makes destination lighter or darker, depending on source. +
SkBlendMode::kDifference22Blend Mode Difference  +Subtracts darker from lighter with higher contrast. +
SkBlendMode::kExclusion23Blend Mode Exclusion  +Subtracts darker from lighter with lower contrast. +
SkBlendMode::kMultiply24Blend Mode Multiply  +Multiplies source with destination, darkening image. +
SkBlendMode::kLastSeparableMode24 +Last blend mode operating separately on components. +
SkBlendMode::kHue25Blend Mode Hue  +Replaces hue of destination with hue of source, leaving saturation and luminosity +unchanged. +
SkBlendMode::kSaturation26Blend Mode Saturation  +Replaces saturation of destination saturation hue of source, leaving hue and +luminosity unchanged. +
SkBlendMode::kColor27Blend Mode Color  +Replaces hue and saturation of destination with hue and saturation of source, +leaving luminosity unchanged. +
SkBlendMode::kLuminosity28Blend Mode Luminosity  +Replaces luminosity of destination with luminosity of source, leaving hue and +saturation unchanged. +
SkBlendMode::kLastMode28 +Used by tests to iterate through all valid values. +
+ +### See Also + +SkCanvas::drawColor SkCanvas::drawVertices[2] SkPaint SkShader::MakeCompose SkXfermodeImageFilter + +## Clear + +SkBlendMode::kClear sets destination to: +[0, 0] +. +Use SkBlendMode::kClear to initialize a buffer to fully transparent pixels when +creating a mask with irregular edges. + +### Example + +
SK ColorYELLOW is ignored because SkBlendMode::kClear ignores the source pixel +value and the destination pixel value, always setting the destination to zero. +
+ +### See Also + +SkCanvas::clear + +## Src + +Given: +Sa as source Alpha, Sc as source Color component; +SkBlendMode::kSrc sets destination to: +[Sa, Sc] +. +Use SkBlendMode::kSrc to copy one buffer to another. All pixels are copied, +regardless of source and destination Alpha values. As a parameter to +SkCanvas::drawAtlas, selects sprites and ignores colors. + +### Example + +
SkBlendMode::kSrc does not blend transparent pixels with existing background; +it punches a transparent hole in the existing image. +
+ +### See Also + +SkSurface::draw[2] SkSurface::readPixels[2][3] + +## Dst + +Given: +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDst preserves destination set to: +[Da, Dc] +. +Setting Paint Blend Mode to SkBlendMode::kDst causes drawing with +Paint to have no effect. As a parameter to SkCanvas::drawAtlas, +selects colors and ignores sprites. + +### Example + +
+ +## Src Over + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kSrcOver replaces destination with: +[Sa + Da * (1 - Sa), Sc + Dc * (1 - Sa)] +, +drawing source over destination. SkBlendMode::kSrcOver is the default for Paint. + +SkBlendMode::kSrcOver cannot make destination more transparent; the result will +be at least as opaque as the less transparent of source and original destination. + +### Example + +
+ +## Dst Over + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDstOver replaces destination with: +[Da + Sa * (1 - Da), Dc + Sc * (1 - Da)] +, +drawing destination over source. Has no effect destination if is opaque. + +### Example + +
+ +## Src In + +Given: +Sa as source Alpha, Sc as source Color component, Da as destination Alpha; +SkBlendMode::kSrcIn replaces destination with: +[Sa * Da, Sc * Da] +, +drawing source with destination opacity. + +### Example + +
+ +## Dst In + +Given: +Sa as source Alpha, Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDstIn replaces destination with: +[Da * Sa, Dc * Sa] +, +scaling destination Alpha by source Alpha. Resulting +destination is visible where source is visible. + +### Example + +
+ +## Src Out + +Given: +Sa as source Alpha, Sc as source Color component, Da as destination Alpha; +SkBlendMode::kSrcOut replaces destination with: +[Sa * (1 - Da), Sc * (1 - Da)] +, +drawing source fully where destination Alpha is zero. Is destination +is opaque, has no effect. + +### Example + +
+ +## Dst Out + +Given: +Sa as source Alpha, Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDstOut replaces destination with: +[Da * (1 - Sa), Dc * (1 - Sa)] +, +scaling destination Alpha by source transparency. Resulting +destination is visible where source is transparent. If source is transparent, +has no effect. + +### Example + +
+ +## Src Atop + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kSrcATop replaces destination with: +[Da, Sc * Da + Dc * (1 - Sa)] +, +replacing opaque destination with opaque source. If source or destination +is transparent, has no effect. + +### Example + +
+ +## Dst Atop + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDstATop replaces destination with: +[Sa, Dc * Sa + Sc * (1 - Da)] +, +making destination transparent where source is transparent. + +### Example + +
+ +## Xor + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kXor replaces destination with: +[Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa)] +, +exchanging the transparency of the source and destination. + +### Example + +
+ +## Plus + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kPlus replaces destination with: +[Sa + Da, Sc + Dc] +, +summing the Alpha and Color components. + +### Example + +
+ +## Modulate + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kModulate replaces destination with: +[Sa * Da, Sc * Dc] +, +scaling Alpha and Color components by the lesser of the values. +SkBlendMode::kModulate differs from SkBlendMode::kMultiply in two ways. +SkBlendMode::kModulate like SkBlendMode::kSrcATop alters the destination inside +the destination area, as if the destination Alpha defined the boudaries of a +soft clip. SkBlendMode::kMultiply like SkBlendMode::kSrcOver can alter the +destination where the destination is transparent. +SkBlendMode::kModulate computes the product of the source and destination using +Premultiplied component values. SkBlendMode::kMultiply the product of the source +and destination using Unpremultiplied component values. + +### Example + +
If source and destination are opaque, SkBlendMode::kModulate and +SkBlendMode::kMultiply produce the same results. +
+ +## Screen + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kScreen replaces destination with: +[Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] +. + +### Example + +
+ +## Overlay + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kOverlay replaces destination with: +[Sa + Da - Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa) + +(2 * Dc <= Da ? 2 * Sc * Dc : Sa * Da - 2 * (Da - Dc) * (Sa - Sc))] +. + +### Example + +
+ +## Darken + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDarken replaces destination with: +[Sa + Da - Sa * Da, Sc + Dc - max(Sc * Da, Dc * Sa)] +. +SkBlendMode::kDarken does not make an image darker; it replaces the destination +component with source if source is darker. + +### Example + +
+ +## Lighten + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kLighten replaces destination with: +[Sa + Da - Sa * Da, Sc + Dc - min(Sc * Da, Dc * Sa)] +. +SkBlendMode::kDarken does not make an image lighter; it replaces the destination +component with source if source is lighter. + +### Example + +
+ +## Color Dodge + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kColorDodge replaces destination with: +[Sa + Da - Sa * Da, Dc == 0 ? Sc * (1 - Da) : Sc == Sa ? Sc + Da * (1 - Sa) : +Sa * min(Da, Dc * Sa / (Sa - Sc)) + Sc * (1 - Da) + Da * (1 - Sa)] +, +making destination brighter to reflect source. + +### Example + +
+ +## Color Burn + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kColorBurn replaces destination with: +[Sa + Da - Sa * Da, Dc == Da ? Dc + Sc * (1 - Da) : Sc == 0 ? Da * (1 - Sa) : +Sa * (Da - min(Da, (Da - Dc) * Sa / Sc)) + Sc * (1 - Da) + Da * (1 - Sa)] +, +making destination darker to reflect source. + +### Example + +
+ +## Hard Light + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kHardLight replaces destination with: +[Sa + Da - Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa) + +2 * Sc <= Sa ? 2 * Sc * Dc : Sa * Da - 2 * (Da - Dc) * (Sa - Sc)] +, +making destination lighter or darker, depending on source. + +### Example + +
+ +## Soft Light + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component +where m = Da > 0 ? Dc / Da : 0; +SkBlendMode::kSoftLight replaces destination with: +[Sa + Da - Sa * Da, Sc / Da + Dc / Sa + +(2 * Sc <= Sa ? Dc * (Sa + (2 * Sc - Sa) * (1 - m)) : Dc * Sa + Da * (2 * Sc - Sa) * +(4 * Dc <= Da ? (16 * m * m + 4 * m) * (m - 1) + 7 * m : sqrt(m) - m))]\ +, +making destination lighter or darker, depending on source. + +### Example + +
+ +## Difference + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kDifference replaces destination with: +[Sa + Da - Sa * Da, Sc + Dc - 2 * min(Sc * Da, Dc * Sa)] +, +replacing destination with lighter less darker. + +### Example + +
+ +## Exclusion + +Given: +Sa as source Alpha, Sc as source Color, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kExclusion replaces destination with: +[Sa + Da - Sa * Da, Sc + Dc - 2 * Sc * Dc] +, +replacing destination with lighter less darker, ignoring Alpha. + +### Example + +
+ +## Multiply + +Given: +Sa as source Alpha, Sc as source Color component, +Da as destination Alpha, Dc as destination Color component; +SkBlendMode::kMultiply replaces destination with: +[Sa + Da - Sa * Da, Sc * (1 - Da) + Dc * (1 - Sa) + Sc * Dc] +, +the product of Unpremultiplied source and destination. +SkBlendMode::kMultiply makes the image darker. + +### Example + +
+ +## Hue + +Given: +Sa as source Alpha, S as source Color, +Da as destination Alpha, D as destination Color; +SkBlendMode::kHue replaces destination with: +[Sa + Da - Sa * Da, SetLuminosity(SetSaturation(S, Saturation(D)), Luminosity(D))] +, +source hue, leaving destination luminosity and saturation unchanged. + +### Example + +
+ +## Saturation + +Given: +Sa as source Alpha, S as source Color, +Da as destination Alpha, D as destination Color; +SkBlendMode::kHue replaces destination with: +[Sa + Da - Sa * Da, SetLuminosity(SetSaturation(D, Saturation(S)), Luminosity(D))] +, +source hue, leaving destination luminosity and saturation unchanged. + +### Example + +
+ +## Color + +Given: +Sa as source Alpha, S as source Color, +Da as destination Alpha, D as destination Color; +SkBlendMode::kColor replaces destination with: +[Sa + Da - Sa * Da, SetLuminosity(S, Luminosity(D))] +, +source hue and saturation, leaving destination luminosity unchanged. + +### Example + +
+ +## Luminosity + +Given: +Sa as source Alpha, S as source Color, +Da as destination Alpha, D as destination Color; +SkBlendMode::kLuminosity replaces destination with: +[Sa + Da - Sa * Da, SetLuminosity(D, Luminosity(S))] +, +source luminosity, leaving destination hue and saturation unchanged. + +### Example + +
+ + +## SkBlendMode_Name + +
+SK_API const char* SkBlendMode Name(SkBlendMode blendMode)
+
+ +Returns name of blendMode as null-terminated C string. + +### Parameters + + + + +
blendModeone of: SkBlendMode::kClear, SkBlendMode::kSrc, SkBlendMode::kDst, SkBlendMode::kSrcOver, +SkBlendMode::kDstOver, SkBlendMode::kSrcIn, SkBlendMode::kDstIn, +SkBlendMode::kSrcOut, SkBlendMode::kDstOut, SkBlendMode::kSrcATop, +SkBlendMode::kDstATop, SkBlendMode::kXor, SkBlendMode::kPlus, +SkBlendMode::kModulate, SkBlendMode::kScreen, SkBlendMode::kOverlay, +SkBlendMode::kDarken, SkBlendMode::kLighten, SkBlendMode::kColorDodge, +SkBlendMode::kColorBurn, SkBlendMode::kHardLight, SkBlendMode::kSoftLight, +SkBlendMode::kDifference, SkBlendMode::kExclusion, SkBlendMode::kMultiply, +SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor, +SkBlendMode::kLuminosity
+ +### Return Value + +C string + +### Example + +
+ +#### Example Output + +~~~~ +default blend: SkBlendMode::kSrcOver +~~~~ + +
+ +### See Also + +SkBlendMode + +--- + diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index 5c391e0245..3239e20199 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -18,7 +18,7 @@ Request Canvas from Canvas generated by Raster Surface draws to memory visible to the CPU. Canvas generated by GPU Surface uses Vulkan or OpenGL to draw to the GPU. -To draw to a document, obtain Canvas from SVG Canvas, Document PDF, or Picture Recorder. +To draw to a document, obtain Canvas from SVG Canvas, Document PDF, or Picture Recorder. Document based Canvas and other Canvas Subclasses reference Device describing the destination. @@ -114,7 +114,6 @@ SkCanvas global, struct, and class related member func - ## Constant @@ -123,33 +122,33 @@ SkCanvas related constants are defined by enum, enum classTopic Description + ColorBehavior::kLegacy + placeholder + + ColorBehavior exists for Android framework only - + PointMode sets drawPoints options - + SaveLayerFlagsSet sets SaveLayerRec options - + SrcRectConstraint sets drawImageRect options - + kFast SrcRectConstraint sample outside bounds; faster - + kInitWithPrevious SaveLayerFlag initializes with previous contents - - ColorBehavior::kLegacy - placeholder - kLines PointMode draw each pair of points as a line segment @@ -172,7 +171,6 @@ SkCanvas related constants are defined by enum, enum class - ## Struct @@ -190,7 +188,6 @@ SkCanvas uses C++ structs to declare the public data structures and interfaces. - ## Typedef @@ -204,7 +201,6 @@ SkCanvas typedef define a data type. - ## Constructor Create the desired type of Surface to obtain its Canvas when possible. Useful @@ -253,7 +249,6 @@ SkCanvas can be constructed or initialized by these functions, including C++ cla - ## Member Function @@ -291,7 +286,7 @@ SkCanvas member functions read and modify the structure properties. clipRRect - combines Clip with Round Rect + combines Clip with Round Rect clipRect @@ -343,11 +338,11 @@ SkCanvas member functions read and modify the structure properties. drawColor - fills Clip with Color and Blend Mode + fills Clip with Color and Blend Mode drawDRRect - draws double Round Rect stroked or filled + draws double Round Rect stroked or filled drawDrawable @@ -395,7 +390,7 @@ SkCanvas member functions read and modify the structure properties. drawPicture - draws Picture using Clip and Matrix + draws Picture using Clip and Matrix drawPoint @@ -415,7 +410,7 @@ SkCanvas member functions read and modify the structure properties. drawRRect - draws Round Rect using Clip, Matrix, and Paint + draws Round Rect using Clip, Matrix, and Paint drawRect @@ -427,7 +422,7 @@ SkCanvas member functions read and modify the structure properties. drawRoundRect - draws Round Rect using Clip, Matrix, and Paint + draws Round Rect using Clip, Matrix, and Paint drawString @@ -575,7 +570,6 @@ SkCanvas member functions read and modify the structure properties. - ## MakeRasterDirect @@ -873,8 +867,6 @@ storage of Raster Surface ## Enum SkCanvas::ColorBehavior -Android framework only. -
     enum class ColorBehavior {
         kLegacy,
@@ -1039,7 +1031,6 @@ transparent letters.
   
 
 
-
 
 ## getMetaData
 
@@ -1171,7 +1162,6 @@ isRGB:1
   
 
 
-
 
 ## flush
 
@@ -1421,7 +1411,6 @@ context = skia
   
 
 
-
 
 ## peekPixels
 
@@ -2058,7 +2047,7 @@ is restored, the Bitmap is drawn into th
 
 Layer may be initialized with the contents of the previous Layer. When Layer is
 restored, its Bitmap can be modified by Paint passed to Layer to apply
-Color Alpha, Color Filter, Image Filter, and Blend Mode.
+Color Alpha, Color Filter, Image Filter, and Blend Mode.
 
 
 ## saveLayer
@@ -2080,7 +2069,7 @@ and draws the Bitmap.
 a specific rectangle, use clipRect.
 
 Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and
-Blend Mode when restore is called.
+Blend Mode when restore is called.
 
 Call restoreToCount with returned value to restore this and subsequent saves.
 
@@ -2129,7 +2118,7 @@ and draws the Bitmap.
 a specific rectangle, use clipRect.
 
 Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and
-Blend Mode when restore is called.
+Blend Mode when restore is called.
 
 Call restoreToCount with returned value to restore this and subsequent saves.
 
@@ -2182,7 +2171,7 @@ and draws Layer.
 a specific rectangle, use clipRect.
 
 Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and
-Blend Mode when restore is called.
+Blend Mode when restore is called.
 
 Call restoreToCount with returned value to restore this and subsequent saves.
 
@@ -2334,8 +2323,8 @@ scalePaint blends Layer back with transparency.
 # Struct SkCanvas::SaveLayerRec
 
 
-    struct SaveLayerRec {
-        SaveLayerRec*(...
+    struct SaveLayerRec {
+        SaveLayerRec*(...
 
         const SkRect*           fBounds;
         const SkPaint*          fPaint;
@@ -2344,7 +2333,7 @@ scalePaint blends Layer back with transparency.
     };
 
-SaveLayerRec contains the state used to create the Layer. +SaveLayerRec contains the state used to create the Layer. ## Layer SaveLayerRec Overview @@ -2370,7 +2359,6 @@ scalePaint blends Layer back with transparency. Description - ### Members @@ -2391,7 +2379,7 @@ a specific rectangle, use clipRect. @@ -2447,19 +2435,18 @@ transferred to the main canvas.
fPaint fPaint modifies how Layer overlays the prior Layer; may be nullptr. -Color Alpha, Blend Mode, Color Filter, Draw Looper, Image Filter, and +Color Alpha, Blend Mode, Color Filter, Draw Looper, Image Filter, and Mask Filter affect Layer draw.
Description
- - + ## SaveLayerRec
-SaveLayerRec()
+SaveLayerRec()
 
Sets fBounds, fPaint, and fBackdrop to nullptr. Clears fSaveLayerFlags. ### Return Value -empty SaveLayerRec +empty SaveLayerRec ### Example @@ -2479,30 +2466,31 @@ rec1 == rec2 --- - + +## SaveLayerRec
-SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0)
+SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0)
 
Sets fBounds, fPaint, and fSaveLayerFlags; sets fBackdrop to nullptr. ### Parameters - +
bounds
- + - - + +
bounds Layer dimensions; may be nullptr
paint
paint applied to Layer when overlaying prior Layer; may be nullptr
saveLayerFlagsSaveLayerRec options to modify Layer
saveLayerFlagsSaveLayerRec options to modify Layer
### Return Value -SaveLayerRec with empty backdrop +SaveLayerRec with empty backdrop ### Example @@ -2522,10 +2510,11 @@ rec1 == rec2 --- - + +## SaveLayerRec
-SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop,
+SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop,
              SaveLayerFlags saveLayerFlags)
 
@@ -2533,24 +2522,24 @@ Sets fBounds, bounds + - + - + - - + +
bounds Layer dimensions; may be nullptr
paint
paint applied to Layer when overlaying prior Layer; may be nullptr
backdrop
backdrop prior Layer copied with Image Filter; may be nullptr
saveLayerFlagsSaveLayerRec options to modify Layer
saveLayerFlagsSaveLayerRec options to modify Layer
### Return Value -SaveLayerRec fully specified +SaveLayerRec fully specified ### Example @@ -2570,49 +2559,50 @@ rec1 == rec2 --- - + +## SaveLayerRec
-SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop,
+SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop,
              const SkImage* clipMask, const SkMatrix* clipMatrix, SaveLayerFlags saveLayerFlags)
 
Experimental. not readySets fBounds, fPaint, fBackdrop, fClipMask, fClipMatrix, and fSaveLayerFlags. -clipMatrix uses Color Alpha channel of image, transformed by clipMatrix, to clip +clipMatrix uses Color Alpha channel of image, transformed by clipMatrix, to clip Layer when drawn to Canvas. Implementation is not complete; has no effect if Device is GPU-backed. ### Parameters - +
bounds
- + - + - + - - + - - + +
bounds Layer dimensions; may be nullptr
paint
paint graphics state applied to Layer when overlaying prior Layer; may be nullptr
backdrop
backdrop prior Layer copied with Image Filter; may be nullptr
clipMask
clipMask clip applied to Layer; may be nullptr
clipMatrixmatrix applied to clipMask; may be nullptr to use +
clipMatrixmatrix applied to clipMask; may be nullptr to use identity matrix
saveLayerFlagsSaveLayerRec options to modify Layer
saveLayerFlagsSaveLayerRec options to modify Layer
### Return Value -SaveLayerRec fully specified +SaveLayerRec fully specified ### See Also @@ -2654,7 +2644,7 @@ depth of save state stack ### Example
The example draws an image, and saves it into a Layer with kInitWithPrevious SaveLayerFlag. -Next it punches a hole in Layer and restore with SkBlendMode::kPlus. +Next it punches a hole in Layer and restore with SkBlendMode::kPlus. Where Layer was cleared, the original image will draw unchanged. Outside of the circle the mandrill is brightened.
@@ -2989,7 +2979,7 @@ If clipping Path has Anti Aliased clip looks smoother but draws slower. -Clip can combine with Rect and Round Rect primitives; like +Clip can combine with Rect and Round Rect primitives; like Path, these are transformed by Matrix before they are combined with Clip. Clip can combine with Region. Region is assumed to be in Device coordinates @@ -3115,8 +3105,6 @@ The clip restriction is not recorded in pictures. Pass an empty rect to disable maximum clip. -This private API is for use by Android framework only. - ### Parameters @@ -3130,7 +3118,7 @@ This private API is for use by Android framework only. ## clipRRect
-void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias)
+void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias)
 
Replace Clip with the intersection or difference of Clip and rrect, @@ -3141,7 +3129,7 @@ before it is combined with Clip. ### Parameters
rect
- + @@ -3164,7 +3152,7 @@ before it is combined with Clip.
-void clipRRect(const SkRRect& rrect, SkClipOp op)
+void clipRRect(const SkRRect& rrect, SkClipOp op)
 
Replace Clip with the intersection or difference of Clip and rrect. @@ -3174,7 +3162,7 @@ Resulting Clip is Aliased; ### Parameters
rrectRound Rect to combine with ClipRound Rect to combine with Clip
op Clip Op to apply to Clip
- + @@ -3194,7 +3182,7 @@ Resulting Clip is Aliased;
-void clipRRect(const SkRRect& rrect, bool doAntiAlias = false)
+void clipRRect(const SkRRect& rrect, bool doAntiAlias = false)
 
Replace Clip with the intersection of Clip and rrect, @@ -3204,7 +3192,7 @@ with an Aliased or rrect - + @@ -3689,11 +3677,11 @@ device bounds empty = true - + - + @@ -3749,7 +3737,7 @@ device bounds empty = true - + @@ -3785,7 +3773,7 @@ device bounds empty = true - + @@ -3797,7 +3785,7 @@ device bounds empty = true - + @@ -3813,12 +3801,11 @@ device bounds empty = true
rrectRound Rect to combine with ClipRound Rect to combine with Clip
op Clip Op to apply to Clip Round Rect to combine with ClipRound Rect to combine with Clip
doAntiAlias true if Clip is to be Anti Aliased
drawColorfills Clip with Color and Blend Modefills Clip with Color and Blend Mode
drawDRRectdraws double Round Rect stroked or filleddraws double Round Rect stroked or filled
drawDrawable
drawPicturedraws Picture using Clip and Matrixdraws Picture using Clip and Matrix
drawRRectdraws Round Rect using Clip, Matrix, and Paintdraws Round Rect using Clip, Matrix, and Paint
drawRect
drawRoundRectdraws Round Rect using Clip, Matrix, and Paintdraws Round Rect using Clip, Matrix, and Paint
drawVertices
- ## drawColor
-void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver)
+void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver)
 
Fill Clip with Color color. @@ -3830,7 +3817,7 @@ Fill Clip with Color < Unpremultiplied ARGB mode - SkBlendMode used to combine source color and destination + SkBlendMode used to combine source color and destination @@ -3851,7 +3838,7 @@ Fill Clip with Color < void clear(SkColor color)
-Fill Clip with Color color using SkBlendMode::kSrc. +Fill Clip with Color color using SkBlendMode::kSrc. This has the effect of replacing all pixels contained by Clip with color. ### Parameters @@ -3879,7 +3866,7 @@ void discard() Make Canvas contents undefined. Subsequent calls that read Canvas pixels, -such as drawing with SkBlendMode, return undefined results. discard does +such as drawing with SkBlendMode, return undefined results. discard does not change Clip or Matrix. discard may do nothing, depending on the implementation of Surface or Device @@ -3904,7 +3891,7 @@ void drawPaint(const Clip with Paint paint. Paint components Mask Filter, Shader, -Color Filter, Image Filter, and Blend Mode affect drawing; +Color Filter, Image Filter, and Blend Mode affect drawing; Path Effect in paint is ignored. ### Parameters @@ -4331,10 +4318,10 @@ if stroked, Paint Stroke Width desc ## drawRRect
-void drawRRect(const SkRRect& rrect, const SkPaint& paint)
+void drawRRect(const SkRRect& rrect, const SkPaint& paint)
 
-Draw Round Rect rrect using Clip, Matrix, and Paint 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. @@ -4344,7 +4331,7 @@ may have any combination of positive non-square radii for the four corners. ### Parameters - + @@ -4365,15 +4352,15 @@ may have any combination of positive non-square radii for the four corners. ## drawDRRect
-void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint)
+void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint)
 
-DrawRound Rectouter and inner +DrawRound Rectouter and inner using Clip, Matrix, and Paintpaint. outer must contain inner or the drawing is undefined. -In paint: Paint Style determines if Round Rect is stroked or filled; +In paint: Paint Style determines if Round Rect is stroked or filled; if stroked, Paint Stroke Width describes the line thickness. -If stroked and Round Rect corner has zero length radii, Paint Stroke Join can +If stroked and Round Rect corner has zero length radii, Paint Stroke Join can draw corners rounded or square. GPU-backed platforms optimize drawing when both outer and inner are @@ -4383,10 +4370,10 @@ concave and outer contains outer - + - + @@ -4400,8 +4387,8 @@ concave and outer contains Rect has no corner radii, but stroke join is rounded. -Inner Round Rect has corner radii; outset stroke increases radii of corners. -Stroke join does not affect innerRound Rect since it has no sharp corners. +Inner Round Rect has corner radii; outset stroke increases radii of corners. +Stroke join does not affect innerRound Rect since it has no sharp corners. ### See Also @@ -4544,20 +4531,20 @@ If Rectova void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, const SkPaint& paint) -DrawRound Rect bounded by Rectrect, with corner radii (rx, ry) using Clip, +DrawRound Rect bounded by Rectrect, with corner radii (rx, ry) using Clip, Matrix, and Paintpaint. -In paint: Paint Style determines if Round Rect is stroked or filled; +In paint: Paint Style determines if Round Rect is stroked or filled; if stroked, Paint Stroke Width describes the line thickness. If rx or ry are less than zero, they are treated as if they are zero. If rx plus ry exceeds rect width or rect height, radii are scaled down to fit. -If rx and ry are zero, Round Rect is drawn as Rect and if stroked is affected by +If rx and ry are zero, Round Rect is drawn as Rect and if stroked is affected by Paint Stroke Join. ### Parameters
rrectRound Rect with up to eight corner radii to drawRound Rect with up to eight corner radii to draw
paint Paint stroke or fill, blend, color, and so on, used to draw Round Rect outer bounds to drawRound Rect outer bounds to draw
innerRound Rect inner bounds to drawRound Rect inner bounds to draw
paint Paint stroke or fill, blend, color, and so on, used to draw
- + @@ -4594,7 +4581,7 @@ void drawPath(const DrawPathpath using Clip, Matrix, and Paintpaint. Path contains an array of Path Contour, each of which may be open or closed. -In paint: Paint Style determines if Round Rect is stroked or filled: +In paint: Paint Style determines if Round Rect is stroked or filled: if filled, Path Fill Type determines whether Path Contour describes inside or outside of fill; if stroked, Paint Stroke Width describes the line thickness, Paint Stroke Cap describes line ends, and Paint Stroke Join describes how @@ -4641,7 +4628,7 @@ void drawImage(const DrawImageimage, with its top-left corner at (left, top), using Clip, Matrix, and optional Paintpaint. -If paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, +If paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just as Shader @@ -4660,7 +4647,7 @@ made from SkImage::makeShader -
rectRect bounds of Round Rect to drawRect bounds of Round Rect to draw
rx axis length on x-axis of oval describing rounded corners top side of image
paintPaint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr
@@ -4686,7 +4673,7 @@ void drawImage(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just as Shader made from SkImage::makeShader with SkShader::kClamp TileMode set replicates the @@ -4704,7 +4691,7 @@ made from SkImage::makeShader pop side of image paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -4787,7 +4774,7 @@ void drawImageRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just @@ -4810,7 +4797,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -4846,7 +4833,7 @@ boundaries. Additionally transform draw using Clip, paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just @@ -4869,7 +4856,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -4898,7 +4885,7 @@ void drawImageRect(const Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just @@ -4918,7 +4905,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -4947,7 +4934,7 @@ void drawImageRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just @@ -4970,7 +4957,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -5002,7 +4989,7 @@ void drawImageRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just @@ -5025,7 +5012,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -5054,7 +5041,7 @@ void drawImageRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If generated mask extends beyond image bounds, replicate image edge colors, just @@ -5074,7 +5061,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -5107,7 +5094,7 @@ are larger than dst; Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If paint Filter Quality set to kNone_SkFilterQuality, disable pixel filtering. For all other values of paint Filter Quality, use kLow_SkFilterQuality to filter pixels. @@ -5128,7 +5115,7 @@ replicates the image edge color when destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -5161,7 +5148,7 @@ are larger than dst; Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If paint Filter Quality set to kNone_SkFilterQuality, disable pixel filtering. For all other values of paint Filter Quality, use kLow_SkFilterQuality to filter pixels. @@ -5182,7 +5169,7 @@ replicates the image edge color wh destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -5214,7 +5201,7 @@ void drawBitmap(const Clip, Matrix, and optional Paint paint. If Paint paint is not nullptr, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. If generated mask extends beyond bitmap bounds, replicate bitmap edge colors, @@ -5234,7 +5221,7 @@ outside of its bounds. top side of bitmap paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -5261,7 +5248,7 @@ void drawBitmapRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. If generated mask extends beyond bitmap bounds, replicate bitmap edge colors, @@ -5285,7 +5272,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -5315,7 +5302,7 @@ void drawBitmapRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. If generated mask extends beyond bitmap bounds, replicate bitmap edge colors, @@ -5339,7 +5326,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -5369,7 +5356,7 @@ void drawBitmapRect(const Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. If generated mask extends beyond bitmap bounds, replicate bitmap edge colors, @@ -5390,7 +5377,7 @@ improve performance. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint @@ -5424,7 +5411,7 @@ space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from bitmap bounds. If paint Filter Quality set to kNone_SkFilterQuality, disable pixel filtering. For all other values of paint Filter Quality, use kLow_SkFilterQuality to filter pixels. @@ -5446,7 +5433,7 @@ outside of its bounds. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -5517,7 +5504,6 @@ remaining space, if any. Description - ## Enum SkCanvas::Lattice::RectType
@@ -5565,7 +5551,6 @@ draws one of fColors into lattice rectangle
 Description
 
 
-
 ### Members
 
 
@@ -5664,7 +5649,7 @@ dimension. All other grid elements scale to fill the available space, if any.
 
 Additionally transform draw using Clip, Matrix, and optional Paintpaint.
 If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter,
-Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader.
+Blend Mode, and Draw Looper. If bitmap is kAlpha_8_SkColorType, apply Shader.
 If paint contains Mask Filter, generate mask from bitmap bounds. If paintFilter Quality set to kNone_SkFilterQuality, disable pixel filtering. For all
 other values of paintFilter Quality, use kLow_SkFilterQuality to filter pixels.
@@ -5686,7 +5671,7 @@ outside of its bounds.
     
-    
destination Rect of image to draw to
paintPaint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr
@@ -5725,7 +5710,7 @@ dimension. All other grid elements scale to fill the available space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, -Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. +Blend Mode, and Draw Looper. If image is kAlpha_8_SkColorType, apply Shader. If paint contains Mask Filter, generate mask from image bounds. If paint Filter Quality set to kNone_SkFilterQuality, disable pixel filtering. For all other values of paint Filter Quality, use kLow_SkFilterQuality to filter pixels. @@ -5747,7 +5732,7 @@ outside of its bounds. destination Rect of image to draw to paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -5822,7 +5807,6 @@ are scaled if needed to take up the remaining space; the center is transparent. - ## drawText @@ -6337,14 +6321,14 @@ Elements of paint: drawPicture(const SkPicture* picture) +void drawPicture(const SkPicture* picture)
-Draw Picture 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. -Picture records a series of draw commands for later playback. +Picture records a series of draw commands for later playback. ### Parameters @@ -6359,21 +6343,21 @@ void drawPicture(const drawDrawable[2] SkPicture SkPicture::playback +drawDrawable[2] SkPicture SkPicture::playback ---
-void drawPicture(const sk sp<SkPicture>& picture)
+void drawPicture(const sk sp<SkPicture>& picture)
 
-Draw Picture 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. -Picture records a series of draw commands for later playback. +Picture records a series of draw commands for later playback. ### Parameters @@ -6388,19 +6372,19 @@ void drawPicture(const drawDrawable[2] SkPicture SkPicture::playback +drawDrawable[2] SkPicture SkPicture::playback ---
-void drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)
+void drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)
 
-Draw Picture picture, using Clip and Matrix; transforming picture with +Draw Picture picture, using Clip and Matrix; transforming picture with Matrix matrix, if provided; and use Paint paint Color Alpha, Color Filter, -Image Filter, and Blend Mode, if provided. +Image Filter, and Blend Mode, if provided. matrix transformation is equivalent to: save, concat, drawPicture, restore. paint use is equivalent to: saveLayer, drawPicture, restore. @@ -6424,19 +6408,19 @@ void drawPicture(const drawDrawable[2] SkPicture SkPicture::playback +drawDrawable[2] SkPicture SkPicture::playback ---
-void drawPicture(const sk sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint)
+void drawPicture(const sk sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint)
 
-Draw Picture picture, using Clip and Matrix; transforming picture with +Draw Picture picture, using Clip and Matrix; transforming picture with Matrix matrix, if provided; and use Paint paint Color Alpha, Color Filter, -Image Filter, and Blend Mode, if provided. +Image Filter, and Blend Mode, if provided. matrix transformation is equivalent to: save, concat, drawPicture, restore. paint use is equivalent to: saveLayer, drawPicture, restore. @@ -6460,7 +6444,7 @@ void drawPicture(const drawDrawable[2] SkPicture SkPicture::playback +drawDrawable[2] SkPicture SkPicture::playback --- @@ -6468,12 +6452,12 @@ void drawPicture(const drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) +void drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) 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. +contains Shader, Blend Mode mode combines Vertices Colors with Shader. ### Parameters @@ -6501,12 +6485,12 @@ contains Shader,
-void drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint)
+void drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint)
 
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. +contains Shader, Blend Mode mode combines Vertices Colors with Shader. ### Parameters @@ -6536,15 +6520,15 @@ contains Shader, drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], - SkBlendMode mode, const SkPaint& paint) + SkBlendMode mode, const SkPaint& paint) Draws a Coons Patch: the interpolation of four cubics with shared corners, associating a color, and optionally a texture Point, with each corner. Coons Patch uses Clip and Matrix, paint Shader, Color Filter, -Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated -as Coons Patch texture; Blend Mode mode combines Color colors and Shader if +Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated +as Coons Patch texture; Blend Mode mode combines Color colors and Shader if both are provided. Point array cubics specifies four Cubics starting at the top-left corner, @@ -6570,10 +6554,10 @@ corners in top-left, top-right, bottom-right, bottom-left order. may be nullptr # mode - Blend Mode for colors, and for Shader if paint has one + Blend Mode for colors, and for Shader if paint has one paint - Shader, Color Filter, Blend Mode, used to draw + Shader, Color Filter, Blend Mode, used to draw @@ -6598,8 +6582,8 @@ Draws Cubic Point, with each corner. Coons Patch uses Clip and Matrix, paint Shader, Color Filter, -Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated -as Coons Patch texture; Blend Mode mode combines Color colors and Shader if +Color Alpha, Image Filter, and Blend Mode. If Shader is provided it is treated +as Coons Patch texture; Blend Mode mode combines Color colors and Shader if both are provided. Point array cubics specifies four Cubics starting at the top-left corner, @@ -6625,7 +6609,7 @@ corners in top-left, top-right, bottom-right, bottom-left order. may be nullptr # paint - Shader, Color Filter, Blend Mode, used to draw + Shader, Color Filter, Blend Mode, used to draw @@ -6648,17 +6632,18 @@ SeeAlso drawVerticesdrawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], - const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, + const SkColor colors[], int count, SkBlendMode mode, 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. xform, text, and colors if present, must contain count entries. -Optional colors are applied for each sprite using Blend Mode. +Optional colors are applied for each sprite using Blend Mode mode, treating +sprite as source and colors as destination. Optional cullRect is a conservative bounds of all transformed sprites. If cullRect is outside of Clip, canvas can skip drawing. @@ -6674,19 +6659,19 @@ If cullRect is outside of Rect locations of sprites in atlas colors - one per sprite, blended with sprite using Blend Mode; may be nullptr + one per sprite, blended with sprite using Blend Mode; may be nullptr count number of sprites to draw mode - Blend Mode combining colors and sprites + Blend Mode combining colors and sprites cullRect bounds of transformed sprites for efficient clipping; may be nullptr paint - Color Filter, Image Filter, Blend Mode, and so on; may be nullptr + Color Filter, Image Filter, Blend Mode, and so on; may be nullptr @@ -6704,17 +6689,17 @@ If cullRect is outside of drawAtlas(const sk sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[], - const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect, + const SkColor colors[], int count, SkBlendMode mode, 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. xform, text, and colors if present, must contain count entries. -Optional colors is applied for each sprite using Blend Mode. +Optional colors is applied for each sprite using Blend Mode. Optional cullRect is a conservative bounds of all transformed sprites. If cullRect is outside of Clip, canvas can skip drawing. @@ -6730,19 +6715,19 @@ If cullRect is outside of Rect locations of sprites in atlas colors - one per sprite, blended with sprite using Blend Mode; may be nullptr + one per sprite, blended with sprite using Blend Mode; may be nullptr count number of sprites to draw mode - Blend Mode combining colors and sprites + Blend Mode combining colors and sprites cullRect bounds of transformed sprites for efficient clipping; may be nullptr paint - Color Filter, Image Filter, Blend Mode, and so on; may be nullptr + Color Filter, Image Filter, Blend Mode, and so on; may be nullptr @@ -6764,7 +6749,7 @@ void drawAtlas(const 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. @@ -6790,7 +6775,7 @@ If cullRect is outside of paint - Color Filter, Image Filter, Blend Mode, and so on; may be nullptr + Color Filter, Image Filter, Blend Mode, and so on; may be nullptr @@ -6812,7 +6797,7 @@ void drawAtlas(const 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. @@ -6838,7 +6823,7 @@ If cullRect is outside of paint - Color Filter, Image Filter, Blend Mode, and so on; may be nullptr + Color Filter, Image Filter, Blend Mode, and so on; may be nullptr @@ -6863,7 +6848,7 @@ void drawDrawable(matrix. If Canvas has an asynchronous implementation, as is the case -when it is recording into Picture, then drawable will be referenced, +when it is recording into Picture, then drawable will be referenced, so that SkDrawable::draw() can be called when the operation is finalized. To force immediate drawing, call SkDrawable::draw() instead. @@ -6896,7 +6881,7 @@ void drawDrawable(Draw Drawable drawable using Clip and Matrix, offset by (x, y). If Canvas has an asynchronous implementation, as is the case -when it is recording into Picture, then drawable will be referenced, +when it is recording into Picture, then drawable will be referenced, so that SkDrawable::draw() can be called when the operation is finalized. To force immediate drawing, call SkDrawable::draw() instead. @@ -6933,7 +6918,7 @@ void drawAnnotation(const Rect on Canvas with an annotation; a key-value pair, where the key is a null-terminated utf8 string, and optional value is stored as Data. -Only some canvas implementations, such as recording to Picture, or drawing to +Only some canvas implementations, such as recording to Picture, or drawing to Document PDF, use annotations. ### Parameters @@ -6955,7 +6940,7 @@ Only some canvas implementations, such as recording to SkPicture SkDocument +SkPicture SkDocument --- @@ -6968,7 +6953,7 @@ void drawAnnotation(const 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. -Only some canvas implementations, such as recording to Picture, or drawing to +Only some canvas implementations, such as recording to Picture, or drawing to Document PDF, use annotations. ### Parameters @@ -6990,7 +6975,7 @@ Only some canvas implementations, such as recording to SkPicture SkDocument +SkPicture SkDocument --- diff --git a/site/user/api/SkColor4f_Reference.md b/site/user/api/SkColor4f_Reference.md index 574681d50a..569236ad27 100644 --- a/site/user/api/SkColor4f_Reference.md +++ b/site/user/api/SkColor4f_Reference.md @@ -29,6 +29,7 @@ SkColor4f members may be read and written directly without using a member functi red component + 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. @@ -36,7 +37,7 @@ Each component is independent of the others; fA 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. +may be used with Blend Mode so that the final component is in range. ## Overview @@ -75,7 +76,6 @@ SkColor4f operators inline class member functions with arithmetic equivalents. - ## Member Function @@ -109,7 +109,6 @@ SkColor4f member functions read and modify the structure properties. - ### Members @@ -426,8 +425,6 @@ Returns Color4f with all components in the range from zer SkPM4fpremul() const -Internal use only. - ### Return Value Premultiplied color @@ -435,4 +432,3 @@ Internal use only. --- # Struct SkPM4f -Internal use only. diff --git a/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md index 3dbbea58a3..11920e670c 100644 --- a/site/user/api/SkColor_Reference.md +++ b/site/user/api/SkColor_Reference.md @@ -56,6 +56,7 @@ SkColor uses preprocessor definitions to inline code and constants, and to abstr
returns opaque Color
+ Color constants can be helpful to write code, documenting the meaning of values the represent transparency and color values. The use of Color constants is not required. @@ -125,7 +126,6 @@ SkColor related constants are defined by enum, enum class - ## Function @@ -166,7 +166,6 @@ SkColor related constants are defined by enum, enum class - ## Typedef @@ -188,7 +187,6 @@ SkColor typedef define a data type. - ## Alpha Alpha represents the transparency of Color. Color with Alpha of zero is fully diff --git a/site/user/api/SkIPoint_Reference.md b/site/user/api/SkIPoint_Reference.md index a5f149b6d6..f3e43231f4 100644 --- a/site/user/api/SkIPoint_Reference.md +++ b/site/user/api/SkIPoint_Reference.md @@ -13,6 +13,7 @@ SkIPoint typedef define a data type. Topic Description + SkIPoint holds two 32-bit integer coordinates. ## Overview @@ -64,7 +65,6 @@ SkIPoint global, struct, and class related member func - ## Member Function @@ -98,7 +98,6 @@ SkIPoint member functions read and modify the structure properties. - ## Member @@ -136,7 +135,6 @@ SkIPoint members may be read and written directly without using a member functio - ### Members @@ -172,7 +170,6 @@ SkIPoint can be constructed or initialized by these functions, including C++ cla
- ## Make @@ -234,7 +231,6 @@ pt1 == pt2 - ## x @@ -340,7 +336,6 @@ pt.isZero() == true - ## set @@ -419,7 +414,6 @@ SkIPoint operators inline class member functions with arithmetic equivalents. - ## operator- diff --git a/site/user/api/SkIRect_Reference.md b/site/user/api/SkIRect_Reference.md index 8f8014767f..06e581f015 100644 --- a/site/user/api/SkIRect_Reference.md +++ b/site/user/api/SkIRect_Reference.md @@ -71,7 +71,6 @@ SkIRect global, struct, and class related member funct - ## Member Function @@ -241,7 +240,6 @@ SkIRect member functions read and modify the structure properties. - ## Member @@ -297,7 +295,6 @@ SkIRect members may be read and written directly without using a member function - ### Members @@ -387,7 +384,6 @@ SkIRect can be constructed or initialized by these functions, including C++ clas
- ## MakeEmpty @@ -668,7 +664,6 @@ rect: -10, 35, 5, 60 isEmpty: false - ## left @@ -1120,7 +1115,6 @@ SkIRect operators inline class member functions with arithmetic equivalents. - ## operator== @@ -1229,7 +1223,6 @@ test != sorted - ## setEmpty @@ -1434,7 +1427,6 @@ rect: -10, 35, 5, 60 isEmpty: false - ## makeOffset @@ -1785,8 +1777,8 @@ rect: 5, 1, 55, 86 must describe area; fLeft is less than fRight, and fTop is less than fBottom; empty() returns false. The intersection of IRect pair can be described by: -(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), -min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)) +(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), +min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)) . The intersection is only meaningful if the resulting IRect is not empty and @@ -1834,7 +1826,6 @@ describes an area: fLeft is less than ## adjust @@ -2461,7 +2452,6 @@ intersection - ## join @@ -2558,7 +2548,6 @@ join: 10, 20, 55, 65 - ## sort diff --git a/site/user/api/SkImageInfo_Reference.md b/site/user/api/SkImageInfo_Reference.md index 611ae68d5d..743907ff54 100644 --- a/site/user/api/SkImageInfo_Reference.md +++ b/site/user/api/SkImageInfo_Reference.md @@ -112,40 +112,43 @@ SkImageInfo related constants are defined by enum, enum class pixel with half floats for red, green, blue, alpha; in 64-bit word + kRGBA_F32_SkColorType + pixel using C float for red, green, blue, alpha; in 128-bit word + + kRGB_101010x_SkColorType pixel with 10 bits each for red, green, blue; in 32-bit word - + kRGB_565_SkColorType pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word - + kRGB_888x_SkColorType pixel with 8 bits each for red, green, blue; in 32-bit word - + kRec601_SkYUVColorSpace describes SDTV range - + kRec709_SkYUVColorSpace describes HDTV range - + kUnknown_SkAlphaType uninitialized - + kUnknown_SkColorType uninitialized - + kUnpremul_SkAlphaType pixel components are independent of Alpha - ## Alpha Type ## Enum SkAlphaType @@ -333,8 +336,8 @@ true if at equals kRGB_101010x_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType, - - kLastEnum_SkColorType = kRGBA_F16_SkColorType, + kRGBA_F32_SkColorType, + kLastEnum_SkColorType = kRGBA_F32_SkColorType, #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A) kN32_SkColorType = kBGRA_8888_SkColorType, #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A) @@ -456,18 +459,29 @@ blue, and green, representing colors from black to white. Color Type RGBA F16  Stores 64-bit word pixel encoding that contains 16 bits of blue, -16 bits of green, 16 bits of red, and 16 bits of alpha. +16 bits of green, 16 bits of red, and 16 bits of alpha. Each component +is encoded as a half float. + kRGBA_F32_SkColorType + 11 + Color Type RGBA F32  + +Stores 128-bit word pixel encoding that contains 32 bits of blue, +32 bits of green, 32 bits of red, and 32 bits of alpha. Each component +is encoded as a single precision float. + + + kLastEnum_SkColorType - 10 + 11 Used by tests to iterate through all valid values. - + kN32_SkColorType 4 or 6 @@ -701,7 +715,7 @@ opaque as if its Color Alpha was set to on ## Color Type RGBA F16 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. +blue, green, red, and alpha; use 16 bits, describing a floating point value, from -65500 to 65000 with 3.31 decimal digits of precision. At present, Color in Paint does not provide enough precision or range to @@ -723,11 +737,42 @@ pixels. If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum; blue, green, and red components are fully opaque. If any alpha component is -less than 255, the drawn result is undefined. +less than one, the drawn result is undefined. ### Example -
+
+ +### See Also + +SkColor4f + +## Color Type RGBA F32 + +kRGBA_F32_SkColorType encodes ARGB into a 128-bit word. Each component: +blue, green, red, and alpha; use 32 bits, describing a floating point value, +from -3.402823e+38 to 3.402823e+38 with 7.225 decimal digits of precision. + +At present, Color in Paint does not provide enough precision or range to +draw all colors possible to a kRGBA_F32_SkColorType Surface. + +Each component encodes a floating point value using single-precision floats . +Meaningful colors are represented by the range 0.0 to 1.0, although smaller +and larger values may be useful when used in combination with Transfer Mode. + +![Color_Type_RGBA_F32](https://fiddle.skia.org/i/b26119f9312d5f5d4011bf2dac94fafe_raster.png "") + +If paired with kPremul_SkAlphaType: blue, green, and red components are +Premultiplied by the alpha value. If blue, green, or red is greater than alpha, +the drawn result is undefined. + +If paired with kUnpremul_SkAlphaType: blue, green, red, and alpha components +may have any value. There may be a performance penalty with Unpremultiplied +pixels. + +If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum; +blue, green, and red components are fully opaque. If any alpha component is +less than one, the drawn result is undefined. ### See Also @@ -942,6 +987,7 @@ SkImageInfo related constants are defined by enum, enum class Topic Description + Describes pixel dimensions and encoding. Bitmap, Image, PixMap, and Surface can be created from Image Info. Image Info can be retrieved from Bitmap and Pixmap, but not from Image and Surface. For example, Image and Surface @@ -1104,7 +1150,6 @@ SkImageInfo member functions read and modify the structure properties. - ## Related Function @@ -1161,32 +1206,35 @@ SkImageInfo global, struct, and class related member f encodes ARGB as half floats + Color Type RGBA F32 + encodes ARGB as single precision floats + + Color Type RGB 101010 encodes RGB ten bits per color component - + Color Type RGB 565 encodes RGB in 16 bits - + Color Type RGB 888 encodes RGB in 32 bits - + Property metrics and attributes - + Utility rarely called management functions - + YUV ColorSpace color range of YUV pixels - ## Constructor @@ -1260,7 +1308,6 @@ SkImageInfo can be constructed or initialized by these functions, including C++ - ## SkImageInfo @@ -1695,7 +1742,6 @@ created Image Info - ## width @@ -2382,7 +2428,6 @@ SkImageInfo operators inline class member functions with arithmetic equivalents. - ## operator== @@ -2673,7 +2718,6 @@ SkImageInfo() == reset copy - ## validate diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index e53eef618c..eec6966d98 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -12,6 +12,14 @@ SkImage related constants are defined by enum, enum class Topic Description + + BitDepth::kF16 + uses 16-bit float per Color component + + + BitDepth::kU8 + uses 8-bit unsigned int per Color component + BitDepth options for MakeFromPicture @@ -29,20 +37,11 @@ SkImage related constants are defined by enum, enum classdisallows internally caching decoded and copied pixels - BitDepth::kF16 - uses 16-bit float per Color component - - kRO LegacyBitmapMode returned bitmap is read-only and immutable - - BitDepth::kU8 - uses 8-bit unsigned int per Color component - - ## Typedef @@ -67,8 +66,9 @@ SkImage typedef define a data type. parameter type for MakeFromTexture + Image describes a two dimensional array of pixels to draw. The pixels may be -decoded in a Raster Bitmap, encoded in a Picture or compressed data stream, +decoded in a Raster Bitmap, encoded in a Picture or compressed data stream, or located in GPU memory as a GPU Texture. Image cannot be modified after it is created. Image may allocate additional @@ -77,7 +77,7 @@ storage as needed; for instance, an encoded Image may decod Image width and height are greater than zero. Creating an Image with zero width or height returns Image equal to nullptr. -Image may be created from Bitmap, Pixmap, Surface, Picture, encoded streams, +Image may be created from Bitmap, Pixmap, Surface, Picture, encoded streams, GPU Texture, YUV ColorSpace data, or hardware buffer. Encoded streams supported include BMP, GIF, HEIF, ICO, JPEG, PNG, WBMP, WebP. Supported encoding details vary with platform. @@ -162,7 +162,6 @@ SkImage global, struct, and class related member funct - ## Constructor @@ -208,7 +207,7 @@ SkImage can be constructed or initialized by these functions, including C++ clas MakeFromPicture - creates Image from Picture + creates Image from Picture MakeFromRaster @@ -280,7 +279,6 @@ SkImage can be constructed or initialized by these functions, including C++ clas - ## Member Function @@ -326,7 +324,7 @@ SkImage member functions read and modify the structure properties. MakeFromPicture - creates Image from Picture + creates Image from Picture MakeFromRaster @@ -462,7 +460,6 @@ SkImage member functions read and modify the structure properties. - ## MakeRasterCopy @@ -691,7 +688,7 @@ otherwise, subset must be contai Image is returned if generator data is valid. Valid data parameters vary by type of data and platform. -imageGenerator may wrap Picture data, codec data, or custom data. +imageGenerator may wrap Picture data, codec data, or custom data. ### Parameters @@ -709,7 +706,7 @@ created Image, or nullptr ### Example -
The generator returning Picture cannot be shared; std::move transfers ownership to generated Image. +
The generator returning Picture cannot be shared; std::move transfers ownership to generated Image.
### See Also @@ -1194,7 +1191,7 @@ Use 16 bits per ARGB component using half-precision floating point format. ## MakeFromPicture
-static sk sp<SkImage> MakeFromPicture(sk sp<SkPicture> picture, const SkISize& dimensions,
+static sk sp<SkImage> MakeFromPicture(sk sp<SkPicture> picture, const SkISize& dimensions,
                                       const SkMatrix* matrix, const SkPaint* paint,
                                       BitDepth bitDepth, sk sp<SkColorSpace> colorSpace)
 
@@ -1347,7 +1344,6 @@ created Image, or nullptr - ## width @@ -1747,7 +1743,6 @@ transforming Image before ## peekPixels @@ -2279,7 +2274,6 @@ encoded Image, or nullptr - ## makeSubset @@ -2306,7 +2300,7 @@ partial or full Image, or nullptr ### Example -
+
### See Also diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md index d2ffdd14ad..4c891add50 100644 --- a/site/user/api/SkMatrix_Reference.md +++ b/site/user/api/SkMatrix_Reference.md @@ -117,6 +117,7 @@ SkMatrix related constants are defined by enum, enum classtranslation Matrix + Matrix holds a 3x3 matrix for transforming coordinates. This allows mapping Points and Vectors with translation, scaling, skewing, rotation, and perspective. @@ -498,7 +499,6 @@ SkMatrix member functions read and modify the structure properties. - ## Related Function @@ -532,7 +532,6 @@ SkMatrix global, struct, and class related member func - ## Constructor @@ -666,7 +665,6 @@ SkMatrix can be constructed or initialized by these functions, including C++ cla - ## MakeScale @@ -1027,7 +1025,6 @@ after setPolyToPoly: kTranslate_Mask kScale_Mask kAffine_Mask kPerspective_Mask - ## getType @@ -1688,7 +1685,6 @@ SkMatrix operators inline class member functions with arithmetic equivalents. - ## operator[] @@ -2209,7 +2205,6 @@ after dirty cache: x = 66 - ## set @@ -4443,7 +4438,6 @@ ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7 - ## mapPoints @@ -5339,7 +5333,6 @@ true if Matrix a - ## dump diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index 3821dc3d87..1bff17da88 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -83,7 +83,7 @@ SkPaint global, struct, and class related member funct Blend Mode Methods - get and set Blend Mode + get and set Blend Mode Color Filter Methods @@ -255,7 +255,6 @@ SkPaint global, struct, and class related member funct - ## Constant @@ -445,7 +444,6 @@ SkPaint related constants are defined by enum, enum class - ## Struct @@ -459,7 +457,6 @@ SkPaint uses C++ structs to declare the public data structures and interfaces. - ## Constructor @@ -485,7 +482,6 @@ SkPaint can be constructed or initialized by these functions, including C++ clas - ## Operator @@ -511,7 +507,6 @@ SkPaint operators inline class member functions with arithmetic equivalents. - ## Member Function @@ -553,7 +548,7 @@ SkPaint member functions read and modify the structure properties. getBlendMode - returns Blend Mode, how colors combine with Device + returns Blend Mode, how colors combine with Device getColor @@ -721,7 +716,7 @@ SkPaint member functions read and modify the structure properties. isSrcOver - returns true if Blend Mode is SkBlendMode::kSrcOver + returns true if Blend Mode is SkBlendMode::kSrcOver isSubpixelText @@ -789,7 +784,7 @@ SkPaint member functions read and modify the structure properties. setBlendMode - sets Blend Mode, how colors combine with destination + sets Blend Mode, how colors combine with destination setColor @@ -909,7 +904,6 @@ SkPaint member functions read and modify the structure properties. - ## Initializers @@ -924,7 +918,7 @@ Constructs Paint with default values. | attribute | default value | | --- | --- | | Anti Alias | false | -| Blend Mode | SkBlendMode::kSrcOver | +| Blend Mode | SkBlendMode::kSrcOver | | Color | SK ColorBLACK | | Color Alpha | 255 | | Color Filter | nullptr | @@ -1752,7 +1746,7 @@ alternating nearby colors from pixel to pixel. ### Example
Dithering introduces subtle adjustments to color to smooth gradients. -Drawing the gradient repeatedly with SkBlendMode::kPlus exaggerates the +Drawing the gradient repeatedly with SkBlendMode::kPlus exaggerates the dither, making it easier to see.
@@ -2807,7 +2801,7 @@ a fill draw. SkPaint::kFill_Style 0 -Applies to Rect, Region, Round Rect, Circles, Ovals, Path, and Text. +Applies to Rect, Region, Round Rect, Circles, Ovals, Path, and Text. Bitmap, Image, Patches, Region, Sprites, and Vertices are painted as if kFill Style is set, and ignore the set Style. The Path Fill Type specifies additional rules to fill the area outside the path edge, @@ -2819,7 +2813,7 @@ and to create an unfilled hole inside the shape. SkPaint::kStroke_Style 1 -Applies to Rect, Region, Round Rect, Arcs, Circles, Ovals, Path, and Text. +Applies to Rect, Region, Round Rect, Arcs, Circles, Ovals, Path, and Text. Arcs, Lines, and points, are always drawn as if kStroke Style is set, and ignore the set Style. The stroke construction is unaffected by the Path Fill Type. @@ -2829,7 +2823,7 @@ The stroke construction is unaffected by the SkPaint::kStrokeAndFill_Style 2 -Applies to Rect, Region, Round Rect, Circles, Ovals, Path, and Text. +Applies to Rect, Region, Round Rect, Circles, Ovals, Path, and Text. Path is treated as if it is set to SkPath::kWinding FillType, and the set Path Fill Type is ignored. @@ -3625,7 +3619,7 @@ Increments shader Color Filter Methods Color Filter alters the color used when drawing a shape. -Color Filter may apply Blend Mode, transform the color through a matrix, or composite multiple filters. +Color Filter may apply Blend Mode, transform the color through a matrix, or composite multiple filters. If Paint has no Color Filter, the color is unaltered. The drawn transparency can be modified without altering Color Filter, by changing Color Alpha. @@ -3719,8 +3713,8 @@ Increments filter Reference Count by ## Blend Mode Methods -Blend Mode describes how Color combines with the destination color. -The default setting, SkBlendMode::kSrcOver, draws the source color +Blend Mode describes how Color combines with the destination color. +The default setting, SkBlendMode::kSrcOver, draws the source color over the destination color. ### Example @@ -3729,17 +3723,17 @@ over the destination color. ### See Also -Blend Mode +Blend Mode ## getBlendMode
-SkBlendMode getBlendMode() const
+SkBlendMode getBlendMode() const
 
-Returns Blend Mode. -By default, returns SkBlendMode::kSrcOver. +Returns Blend Mode. +By default, returns SkBlendMode::kSrcOver. ### Return Value @@ -3767,11 +3761,11 @@ kSrcOver != getBlendMode bool isSrcOver() const -Returns true if Blend Mode is SkBlendMode::kSrcOver, the default. +Returns true if Blend Mode is SkBlendMode::kSrcOver, the default. ### Return Value -true if Blend Mode is SkBlendMode::kSrcOver +true if Blend Mode is SkBlendMode::kSrcOver ### Example @@ -3792,16 +3786,16 @@ isSrcOver != true ## setBlendMode
-void setBlendMode(SkBlendMode mode)
+void setBlendMode(SkBlendMode mode)
 
-Sets Blend Mode to mode. +Sets Blend Mode to mode. Does not check for valid input. ### Parameters - +
modeSkBlendMode used to combine source color and destinationSkBlendMode used to combine source color and destination
@@ -4110,8 +4104,8 @@ Pass nullptr to clear Typeface and use the d ## Image Filter Methods Image Filter operates on the pixel representation of the shape, as modified by Paint -with Blend Mode set to SkBlendMode::kSrcOver. Image Filter creates a new bitmap, -which is drawn to the device using the set Blend Mode. +with Blend Mode set to SkBlendMode::kSrcOver. Image Filter creates a new bitmap, +which is drawn to the device using the set Blend Mode. Image Filter is higher level than Mask Filter; for instance, an Image Filter can operate on all channels of Color, while Mask Filter generates Alpha only. @@ -4802,7 +4796,6 @@ SkPaint related constants are defined by enum, enum class - ## Member_Function @@ -4828,7 +4821,6 @@ SkPaint member functions read and modify the structure properties. - ## Member @@ -4902,7 +4894,6 @@ SkPaint members may be read and written directly without using a member function -
     struct FontMetrics {
         enum FontMetricsFlags {
@@ -5997,7 +5988,7 @@ bool nothingToDraw() const
 Returns true if Paint prevents all drawing;
 otherwise, the Paint may or may not allow drawing.
 
-Returns true if, for example, Blend Mode combined with Color Alpha computes a
+Returns true if, for example, Blend Mode combined with Color Alpha computes a
 new Alpha of zero.
 
 ### Return Value
@@ -6023,7 +6014,6 @@ alpha 0 nothing to draw: true
 
 ## Fast Bounds
 
-To be made private.
 Fast Bounds functions conservatively outset a drawing bounds by additional area
 Paint may draw to.
 
@@ -6034,7 +6024,6 @@ To be made private.
 bool canComputeFastBounds() const
 
-( to be made private) Returns true if Paint does not include elements requiring extensive computation to compute Device bounds of drawn geometry. For instance, Paint with Path Effect always returns false. @@ -6052,7 +6041,6 @@ true if Paint allows for fast computation of bounds const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const -( to be made private) Only call this if canComputeFastBounds returned true. This takes a raw rectangle (the raw bounds of a shape), and adjusts it for stylistic effects in the paint (e.g. stroking). If needed, it uses the storage @@ -6064,15 +6052,6 @@ should not rely on storage bein use the returned value. It is legal for orig and storage to be the same Rect. -For example: -if (!path.isInverseFillType() && paint.canComputeFastBounds) { -SkRect storage; -if (canvas->quickReject(paint.computeFastBounds(path.getBounds(), &storage))) { -return; // do not draw the path -} -} -// draw the path - ### Parameters @@ -6096,8 +6075,6 @@ fast computed bounds const SkRect& computeFastStrokeBounds(const SkRect& orig, SkRect* storage) const -( to be made private) - ### Parameters
orig
@@ -6121,7 +6098,6 @@ fast computed bounds const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style style) const -( to be made private) Computes the bounds, overriding the PaintStyle. This can be used to account for additional width required by stroking orig, without altering Style set to fill. @@ -6172,3 +6148,4 @@ fast computed bounds
orig converts text into glyph indices
+ diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md index 8134c5f805..f213448922 100644 --- a/site/user/api/SkPath_Reference.md +++ b/site/user/api/SkPath_Reference.md @@ -13,11 +13,11 @@ containing two connected Lines are described the with three entries, sharing the middle entry as the end of the first Line and the start of the second Line. -Path components Arc, Rect, Round Rect, Circle, and Oval are composed of +Path components Arc, Rect, Round Rect, Circle, and Oval are composed of Lines and Curves with as many Verbs and Points required for an exact description. Once added to Path, these components may lose their identity; although Path can be inspected to determine if it describes a single -Rect, Oval, Round Rect, and so on. +Rect, Oval, Round Rect, and so on. ### Example @@ -219,7 +219,6 @@ SkPath global, struct, and class related member functi - ## Constant @@ -353,7 +352,6 @@ SkPath related constants are defined by enum, enum class - ## Class @@ -371,7 +369,6 @@ SkPath uses C++ classes to declare the public data structures and interfaces. - ## Constructor @@ -401,7 +398,6 @@ SkPath can be constructed or initialized by these functions, including C++ class - ## Operator @@ -427,7 +423,6 @@ SkPath operators inline class member functions with arithmetic equivalents. - ## Member Function @@ -481,7 +476,7 @@ SkPath member functions read and modify the structure properties. addRRect - adds one Contour containing Round Rect + adds one Contour containing Round Rect addRect @@ -489,7 +484,7 @@ SkPath member functions read and modify the structure properties. addRoundRect - adds one Contour containing Round Rect with common corner radii + adds one Contour containing Round Rect with common corner radii arcTo @@ -621,7 +616,7 @@ SkPath member functions read and modify the structure properties. isRRect - returns if describes Round Rect + returns if describes Round Rect isRect @@ -733,7 +728,6 @@ SkPath member functions read and modify the structure properties. - ## Verb ## Enum SkPath::Verb @@ -873,7 +867,7 @@ When Path contains multiple overlapping C measures along Path to determine where to start and stop stroke; Direction will change dashed results as it steps clockwise or counterclockwise. -Closed Contours like Rect, Round Rect, Circle, and Oval added with +Closed Contours like Rect, Round Rect, Circle, and Oval added with kCW Direction travel clockwise; the same added with kCCW Direction travel counterclockwise. @@ -1209,7 +1203,7 @@ convexity != isRRect - returns if describes Round Rect + returns if describes Round Rect isRect @@ -1225,7 +1219,6 @@ convexity != - ## isInterpolatable @@ -1281,7 +1274,6 @@ paths are interpolatable - ## interpolate @@ -1743,25 +1735,25 @@ true if Path is recognized as an oval or circle ## isRRect
-bool isRRect(SkRRect* rrect) const
+bool isRRect(SkRRect* rrect) const
 
-Returns true if this path is recognized as a SkRRect (but not an oval/circle or rect). +Returns true if this path is recognized as a SkRRect (but not an oval/circle or rect). -rrect receives bounds of Round Rect. +rrect receives bounds of Round Rect. -rrect is unmodified if Round Rect is not found. +rrect is unmodified if Round Rect is not found. ### Parameters - +
rrectstorage for bounding Rect of Round Rect; may be nullptrstorage for bounding Rect of Round Rect; may be nullptr
### Return Value -true if Path contains only Round Rect +true if Path contains only Round Rect ### Example @@ -1770,7 +1762,7 @@ true if Path contains only Round Rect addRoundRect[2] addRRect[2] +Round Rect addRoundRect[2] addRRect[2] --- @@ -1975,7 +1967,6 @@ volatile by default is false - ## setIsVolatile @@ -2233,9 +2224,9 @@ one Point for move, one getPoints(SkPoint points[], int max) const -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. +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. ### Parameters @@ -2399,7 +2390,7 @@ round rect verb count: 10 int getVerbs(uint8_t verbs[], int max) const -Returns the number of verbs in the path. Up to max verbs are copied. The +Returns the number of verbs in the path. Up to max verbs are copied. The verbs are copied as one byte per verb. ### Parameters @@ -2582,7 +2573,6 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553 - ## updateBoundsCache @@ -2775,7 +2765,7 @@ reducing the number and size of allocations when creating Path addRRect - adds one Contour containing Round Rect + adds one Contour containing Round Rect @@ -2803,7 +2793,7 @@ reducing the number and size of allocations when creating Path addRoundRect - adds one Contour containing Round Rect with common corner radii + adds one Contour containing Round Rect with common corner radii @@ -2887,7 +2877,6 @@ reducing the number and size of allocations when creating Path - ## moveTo @@ -4595,10 +4584,10 @@ and startAngle modulo 90 is not zero. void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW Direction) -Append Round Rect to Path, creating a new closed Contour. Round Rect has bounds +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 -dir is kCW Direction, Round Rect starts at top-left of the lower-left corner and -winds clockwise. If dir is kCCW Direction, Round Rect starts at the bottom-left +dir is kCW Direction, Round Rect starts at top-left of the lower-left corner and +winds clockwise. If dir is kCCW Direction, Round Rect starts at the bottom-left of the upper-left corner and winds counterclockwise. If either rx or ry is too large, rx and ry are scaled uniformly until the @@ -4610,16 +4599,16 @@ After appending, Path may be empty, or may contain: rect - bounds of Round Rect + bounds of Round Rect rx - x-axis radius of rounded corners on the Round Rect + x-axis radius of rounded corners on the Round Rect ry - y-axis radius of rounded corners on the Round Rect + y-axis radius of rounded corners on the Round Rect dir - Direction to wind Round Rect + Direction to wind Round Rect @@ -4644,7 +4633,7 @@ drawn in green. void addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW Direction) -Append Round Rect to Path, creating a new closed Contour. Round Rect has bounds +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 from the array. @@ -4659,8 +4648,8 @@ array. | 6 | x-axis radius of bottom-left corner | | 7 | y-axis radius of bottom-left corner | -If dir is kCW Direction, Round Rect starts at top-left of the lower-left corner -and winds clockwise. If dir is kCCW Direction, Round Rect starts at the +If dir is kCW Direction, Round Rect starts at top-left of the lower-left corner +and winds clockwise. If dir is kCCW Direction, Round Rect starts at the bottom-left of the upper-left corner and winds counterclockwise. If both radii on any side of rect exceed its length, all radii are scaled @@ -4672,13 +4661,13 @@ After appending, Path may be empty, or may contain: rect - bounds of Round Rect + bounds of Round Rect radii array of 8 SkScalar values, a radius pair for each corner dir - Direction to wind Round Rect + Direction to wind Round Rect @@ -4696,7 +4685,7 @@ After appending, Path may be empty, or may contain: -void addRRect(const SkRRect& rrect, Direction dir = kCW Direction) +void addRRect(const SkRRect& rrect, Direction dir = kCW Direction) Add rrect to Path, creating a new closed Contour. If @@ -4704,7 +4693,7 @@ Add rrect to Path, crea winds clockwise. If dir is kCCW Direction, rrect starts at the bottom-left of the upper-left corner and winds counterclockwise. -After appending, Path may be empty, or may contain: Rect, Oval, or Round Rect. +After appending, Path may be empty, or may contain: Rect, Oval, or Round Rect. ### Parameters @@ -4712,7 +4701,7 @@ After appending, Path may be empty, or may contain: bounds and radii of rounded rectangle dir - Direction to wind Round Rect + Direction to wind Round Rect @@ -4729,7 +4718,7 @@ After appending, Path may be empty, or may contain:
-void addRRect(const SkRRect& rrect, Direction dir, unsigned start)
+void addRRect(const SkRRect& rrect, Direction dir, unsigned start)
 
Add rrect to Path, creating a new closed Contour. If dir is kCW Direction, rrect @@ -4747,7 +4736,7 @@ winds clockwise; if dir is Path may be empty, or may contain: Rect, Oval, or Round Rect. +After appending, Path may be empty, or may contain: Rect, Oval, or Round Rect. ### Parameters @@ -4755,10 +4744,10 @@ After appending, Path may be empty, or may contain: bounds and radii of rounded rectangle dir - Direction to wind Round Rect + Direction to wind Round Rect start - index of initial point of Round Rect + index of initial point of Round Rect @@ -5058,7 +5047,6 @@ If dst is nullptr, Path is -
@@ -5406,7 +5394,7 @@ of floating point numbers used in Point Array and       stream
-    writable Stream receiving Path text representation; may be nullptr
+    writable WStream receiving Path text representation; may be nullptr
   
       forceClose
     true if missing kClose Verb is output
@@ -5445,7 +5433,7 @@ path.close();
 
 ### See Also
 
-SkRect::dump()[2] SkRRect::dump() SkPathMeasure::dump()
+SkRect::dump()[2] SkRRect::dump()[2] SkPathMeasure::dump()
 
 ---
 
@@ -5477,7 +5465,7 @@ path is not equal to copy
 
 ### See Also
 
-dumpHex SkRect::dump()[2] SkRRect::dump() SkPathMeasure::dump() writeToMemory
+dumpHex SkRect::dump()[2] SkRRect::dump()[2] SkPathMeasure::dump() writeToMemory
 
 ---
 
@@ -5512,7 +5500,7 @@ path is equal to copy
 
 ### See Also
 
-dump[2] SkRect::dumpHex SkRRect::dumpHex writeToMemory
+dump[2] SkRect::dumpHex SkRRect::dumpHex writeToMemory
 
 ---
 
@@ -5737,7 +5725,6 @@ SkPath can be constructed or initialized by these functions, including C++ class
 Description
 
 
-
 ## Member_Function
 
 
@@ -5747,12 +5734,11 @@ SkPath member functions read and modify the structure properties.
 Description
 
 
-
 
-class Iter {
+class Iter {
 public:
-    Iter();
-    Iter(const SkPath& path, bool forceClose);
+    Iter();
+    Iter(const SkPath& path, bool forceClose);
     void setPath(const SkPath& path, bool forceClose);
     Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false);
     SkScalar conicWeight const;
@@ -5775,19 +5761,19 @@ path of the glyph.
 
 RawIter
 
-
+
 ## Iter
 
 
-Iter()
+Iter()
 
-Initializes Iter with an empty Path. next on Iter returns kDone Verb. -Call setPath to initialize Iter at a later time. +Initializes Iter with an empty Path. next on Iter returns kDone Verb. +Call setPath to initialize Iter at a later time. ### Return Value -Iter of empty Path +Iter of empty Path ### Example @@ -5808,29 +5794,30 @@ iter is done --- - + +## Iter
-Iter(const SkPath& path, bool forceClose)
+Iter(const SkPath& path, bool forceClose)
 
-Sets Iter to return elements of Verb Array, Point Array, and Conic Weight in path. -If forceClose is true, Iter will add kLine Verb and kClose Verb after each -open Contour. path is not altered. +Sets Iter to return elements of Verb Array, Point Array, and Conic Weight in path. +If forceClose is true, Iter will add kLine Verb and kClose Verb after each +open Contour. path is not altered. ### Parameters - +
path
- +
path Path to iterate
forceClose
forceClose true if open Contours generate kClose Verb
### Return Value -Iter of path +Iter of path ### Example @@ -5866,8 +5853,8 @@ kDone_Verb void setPath(const SkPath& path, bool forceClose)
-Sets Iter to return elements of Verb Array, Point Array, and Conic Weight in path. -If forceClose is true, Iter will add kLine Verb and kClose Verb after each +Sets Iter to return elements of Verb Array, Point Array, and Conic Weight in path. +If forceClose is true, Iter will add kLine Verb and kClose Verb after each open Contour. path is not altered. ### Parameters @@ -5903,7 +5890,7 @@ kDone_Verb ### See Also -Iter(const SkPath& path, bool forceClose) +Iter(const SkPath& path, bool forceClose) --- @@ -5914,7 +5901,7 @@ kDone_Verb Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)
-Returns next Verb in Verb Array, and advances Iter. +Returns next Verb in Verb Array, and advances Iter. When Verb Array is exhausted, returns kDone Verb. Zero to four Points are stored in pts, depending on the returned Verb. @@ -6074,8 +6061,8 @@ bool isClosedContour() const Returns true if subsequent calls to next return kClose Verb before returning -kMove Verb. if true, Contour Iter is processing may end with kClose Verb, or -Iter may have been initialized with force close set to true. +kMove Verb. if true, Contour Iter is processing may end with kClose Verb, or +Iter may have been initialized with force close set to true. ### Return Value @@ -6098,7 +6085,7 @@ with close(), forceClose is true : isClosedContour returns true ### See Also -Iter(const SkPath& path, bool forceClose) +Iter(const SkPath& path, bool forceClose) --- @@ -6113,7 +6100,6 @@ SkPath can be constructed or initialized by these functions, including C++ class Description - ## Member_Function @@ -6123,12 +6109,11 @@ SkPath member functions read and modify the structure properties. Description -
-    class RawIter {
+    class RawIter {
     public:
-        RawIter();
-        RawIter(const SkPath& path);
+        RawIter();
+        RawIter(const SkPath& path);
         void setPath(const SkPath& path);
         Verb next(SkPoint pts[4]);
         Verb peek const;
@@ -6139,40 +6124,41 @@ SkPath member functions read and modify the structure properties.
 Iterates through Verb Array, and associated Point Array and Conic Weight.
 Verb Array, Point Array, and Conic Weight are returned unaltered.
 
-
+
 ## RawIter
 
 
-RawIter()
+RawIter()
 
-Initializes RawIter with an empty Path. next on RawIter returns kDone Verb. +Initializes RawIter with an empty Path. next on RawIter returns kDone Verb. Call setPath to initialize SkPath::Iter at a later time. ### Return Value -RawIter of empty Path +RawIter of empty Path --- - + +## RawIter
-RawIter(const SkPath& path)
+RawIter(const SkPath& path)
 
-Sets RawIter to return elements of Verb Array, Point Array, and Conic Weight in path. +Sets RawIter to return elements of Verb Array, Point Array, and Conic Weight in path. ### Parameters - +
path
path Path to iterate
### Return Value -RawIter of path +RawIter of path --- @@ -6201,7 +6187,7 @@ Sets SkPath::Iter to return elements of Verb next(SkPoint pts[4])
-Returns next Verb in Verb Array, and advances RawIter. +Returns next Verb in Verb Array, and advances RawIter. When Verb Array is exhausted, returns kDone Verb. Zero to four Points are stored in pts, depending on the returned Verb. @@ -6248,7 +6234,7 @@ kDone_Verb Verb peek() const -Returns next Verb, but does not advance RawIter. +Returns next Verb, but does not advance RawIter. ### Return Value diff --git a/site/user/api/SkPicture_Reference.md b/site/user/api/SkPicture_Reference.md new file mode 100644 index 0000000000..c904aedb18 --- /dev/null +++ b/site/user/api/SkPicture_Reference.md @@ -0,0 +1,516 @@ +SkPicture Reference +=== + +# Picture + +# Class SkPicture + +## Constructor + + +SkPicture can be constructed or initialized by these functions, including C++ class constructors. + + + + + + + + + + + + + + + +
TopicDescription
MakeFromDataincomplete
MakeFromStreamincomplete
MakePlaceholderincomplete
+ +An SkPicture records drawing commands made to a canvas to be played back at a later time. +This base class handles serialization and a few other miscellany. + +## Overview + + + + + + + + + + + + + + + + +
TopicDescription
Class Declarationsembedded class members
Constructorsfunctions that construct SkPicture
Functionsglobal and class member functions
+ + +## Class + + +SkPicture uses C++ classes to declare the public data structures and interfaces. + + + + + + + +
TopicDescription
AbortCallbackincomplete
+ +## Member Function + + +SkPicture member functions read and modify the structure properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TopicDescription
MakeFromDataincomplete
MakeFromStreamincomplete
MakePlaceholderincomplete
approximateBytesUsedincomplete
approximateOpCountincomplete
cullRectincomplete
playbackincomplete
serializeincomplete
uniqueIDincomplete
+ +# Class SkPicture::AbortCallback + +## Constructor + + +SkPicture can be constructed or initialized by these functions, including C++ class constructors. + + + +
TopicDescription
+ +## Member_Function + + +SkPicture member functions read and modify the structure properties. + + + +
TopicDescription
+ +
+
+ +Subclasses of this can be passed to playback. During the playback +of the picture, this callback will periodically be invoked. If its +abort returns true, then picture playback will be interrupted. +The resulting drawing is undefined, as there is no guarantee how often the +callback will be invoked. If the abort happens inside some level of nested +calls to save(), restore will automatically be called to return the state +to the same level it was before the playback call was made. + + +## AbortCallback + +
+AbortCallback()
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## ~AbortCallback + +
+virtual
+
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## abort + +
+virtual bool abort() = 0
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## MakeFromStream + +
+static sk sp<SkPicture> MakeFromStream(SkStream* stream, const SkDeserialProcs* procs = nullptr)
+
+ +Recreate a picture that was serialized into a stream or data. + +### Parameters + + + + + + + +
streamincomplete
procsincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## MakeFromData + +
+static sk sp<SkPicture> MakeFromData(const SkData* data, const SkDeserialProcs* procs = nullptr)
+
+ +### Parameters + + + + + + + +
dataincomplete
procsincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+static sk sp<SkPicture> MakeFromData(const void* data, size_t size,
+                                     const SkDeserialProcs* procs = nullptr)
+
+ +### Parameters + + + + + + + + + + +
dataincomplete
sizeincomplete
procsincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## playback + +
+virtual void playback(SkCanvas* canvas, AbortCallback* callback = nullptr) const = 0
+
+ +Replays the drawing commands on the specified canvas. Note that +this has the effect of unfurling this picture into the destination +canvas. Using the SkCanvas::drawPicture entry point gives the destination +canvas the option of just taking a ref. + +### Parameters + + + + + + + +
canvasthe canvas receiving the drawing commands. +
callbacka callback that allows interruption of playback
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## cullRect + +
+virtual SkRect cullRect() const = 0
+
+ +Return a cull rect for this picture. +Ops recorded into this picture that attempt to draw outside the cull might not be drawn. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## uniqueID + +
+uint32_t uniqueID() const
+
+ +Returns a non-zero value unique among all pictures. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## serialize + +
+sk sp<SkData> serialize(const SkSerialProcs* procs = nullptr) const
+
+ +### Parameters + + + + +
procsincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+void serialize(SkWStream* stream, const SkSerialProcs* procs = nullptr) const
+
+ +### Parameters + + + + + + + +
streamincomplete
procsincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## MakePlaceholder + +
+static sk sp<SkPicture> MakePlaceholder(SkRect cull)
+
+ +Return a placeholder SkPicture. +This placeholder does not draw anything itself. It has a distinct uniqueID +(just like all Pictures) and will always be visible to SkSerialProcs. + +### Parameters + + + + +
cullthe placeholder's dimensions
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## approximateOpCount + +
+virtual int approximateOpCount() const = 0
+
+ +Return the approximate number of operations in this picture. This +number may be greater or less than the number of SkCanvas calls +recorded: some calls may be recorded as more than one operation, or some +calls may be optimized away. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## approximateBytesUsed + +
+virtual size_t approximateBytesUsed() const = 0
+
+ +Returns the approximate byte size of this picture, not including large ref'd objects. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md index 9fb64e9e0a..4a5ba1f941 100644 --- a/site/user/api/SkPixmap_Reference.md +++ b/site/user/api/SkPixmap_Reference.md @@ -68,7 +68,6 @@ SkPixmap global, struct, and class related member func - ## Constructor @@ -86,7 +85,6 @@ SkPixmap can be constructed or initialized by these functions, including C++ cla - ## Member Function @@ -224,7 +222,6 @@ SkPixmap member functions read and modify the structure properties. - ## Initialization @@ -1828,7 +1825,6 @@ is drawn after overwriting bottom half float color with top half float color. - ## readPixels diff --git a/site/user/api/SkPoint_Reference.md b/site/user/api/SkPoint_Reference.md index 9e701b8a5f..e35801822d 100644 --- a/site/user/api/SkPoint_Reference.md +++ b/site/user/api/SkPoint_Reference.md @@ -13,6 +13,7 @@ SkPoint typedef define a data type. Topic Description + SkPoint holds two 32-bit floating point coordinates. ## Overview @@ -68,7 +69,6 @@ SkPoint global, struct, and class related member funct - ## Member Function @@ -178,7 +178,6 @@ SkPoint member functions read and modify the structure properties. - ## Member @@ -216,7 +215,6 @@ SkPoint members may be read and written directly without using a member function - ### Members @@ -254,7 +252,6 @@ SkPoint can be constructed or initialized by these functions, including C++ clas
- ## Make @@ -336,7 +333,6 @@ all equal - ## x @@ -479,7 +475,6 @@ pt.isZero() == true - ## set @@ -665,7 +660,6 @@ pt: nan, -nan abs: nan, nan - ## Offset @@ -1017,7 +1011,6 @@ SkPoint operators inline class member functions with arithmetic equivalents. - ## scale diff --git a/site/user/api/SkRRect_Reference.md b/site/user/api/SkRRect_Reference.md new file mode 100644 index 0000000000..077838975e --- /dev/null +++ b/site/user/api/SkRRect_Reference.md @@ -0,0 +1,1674 @@ +SkRRect Reference +=== + +# RRect + +# Class SkRRect + +## Constant + + +SkRRect related constants are defined by enum, enum class, #define, const, and constexpr. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TopicDescription
Cornerincomplete
Typeincomplete
kComplex Typeincomplete
kEmpty Typeincomplete
kLastTypeincomplete
kLowerLeft Cornerincomplete
kLowerRight Cornerincomplete
kNinePatch Typeincomplete
kOval Typeincomplete
kRect Typeincomplete
kSimple Typeincomplete
kSizeInMemoryincomplete
kUpperLeft Cornerincomplete
kUpperRight Cornerincomplete
+ +The SkRRect class represents a rounded rect with a potentially different +radii for each corner. It does not have a constructor so must be +initialized with one of the initialization functions (e.g., setEmpty, +setRectRadii, etc.) + +This class allows implementing CSS properties that describe rounded corners. +A rectangle may have up to eight radii, one for each axis on each of its four +corners. + +If either corner's radii are zero, the corner is square. +Negative radii are treated as zero. +If corner curves overlap, they are proportionally reduced to fit. + +## Overview + + + + + + + + + + + + + + + + + + + + +
TopicDescription
Constantsenum and enum class, and their const values
Constructorsfunctions that construct SkRRect
Functionsglobal and class member functions
Operatorsoperator overloading methods
+ + +## Constructor + + +SkRRect can be constructed or initialized by these functions, including C++ class constructors. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TopicDescription
MakeEmptyincomplete
MakeOvalincomplete
MakeRectincomplete
MakeRectXYincomplete
SkRRect()incomplete
SkRRect(const SkRRect& rrect)incomplete
makeOffsetincomplete
+ +## Operator + + +SkRRect operators inline class member functions with arithmetic equivalents. + + + + + + + + + + + + + + + +
TopicDescription
operator!=(const SkRRect& a, const SkRRect& b)incomplete
operator=(const SkRRect& rrect)incomplete
operator==(const SkRRect& a, const SkRRect& b)incomplete
+ +## Member Function + + +SkRRect member functions read and modify the structure properties. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TopicDescription
MakeEmptyincomplete
MakeOvalincomplete
MakeRectincomplete
MakeRectXYincomplete
containsincomplete
dumpincomplete
dumpHexincomplete
getBoundsincomplete
getSimpleRadiireturns corner radii for simple types
getTypeincomplete
heightreturns span in y
insetincomplete
isComplexreturns true if not empty, rect, oval, simple, or nine-patch
isEmptyreturns true if width or height are zero
isNinePatchreturns true if not empty, rect, oval or simple; and radii are axis-aligned
isOvalreturns true if not empty, axes radii are equal, radii fill bounds
isRectreturns true if not empty, and one radius at each corner is zero
isSimplereturns true if not empty, rect or oval; and axes radii are equal
isValidincomplete
makeOffsetincomplete
offsetincomplete
outsetincomplete
radiiincomplete
readFromMemoryincomplete
rectincomplete
setEmptyzeroes width, height, and corner radii
setNinePatchincomplete
setOvalincomplete
setRectsets rect bounds with zeroed corners
setRectRadiiincomplete
setRectXYincomplete
transformincomplete
typeincomplete
widthreturns span in x
writeToMemoryincomplete
+ + +## SkRRect + +
+SkRRect() = default
+
+ +Default initialized to a rrect at the origin with zero width and height. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## SkRRect + +
+SkRRect(const SkRRect& rrect) = default
+
+ +### Parameters + + + + +
rrectincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## operator= + +
+SkRRect& operator=(const SkRRect& rrect) = default
+
+ +### Parameters + + + + +
rrectincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + +## Enum SkRRect::Type + +
+    enum Type {
+        kEmpty Type,
+        kRect Type,
+        kOval Type,
+        kSimple Type,
+        kNinePatch Type,
+        kComplex Type,
+        kLastType = kComplex Type,
+    };
+
+ +Enum to capture the various possible subtypes of Round Rect. Accessed +by type. The subtypes become progressively less restrictive. + +### Constants + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConstValueDescription
SkRRect::kEmpty_Type#Line # incomplete ## +Round Rect has zero width or height. All radii are zero. +
SkRRect::kRect_Type#Line # incomplete ## +Round Rect has width and height. All radii are zero. +
SkRRect::kOval_Type#Line # incomplete ## +Round Rect has width and height. All four x-radii are equal, +and at least half the width. All four y-radii are equal, +and at least half the height. +
SkRRect::kSimple_Type#Line # incomplete ## +Round Rect has width and height. All four x-radii are equal and +greater than zero, and all four y-radii are equal and greater than +zero. Either x-radii are less than half the width, or y-radii is +less than half the height, or both. +
SkRRect::kNinePatch_Type#Line # incomplete ## +Round Rect has width and height. Left x-radii are equal, top +y-radii are equal, right x-radii are equal, and bottom y-radii +are equal. The radii do not descript a rect, oval, or simple type. + +The centers of the corner ellipses form an axis-aligned rectangle +that divides the Round Rect into nine rectangular patches; an +interior rectangle, four edges, and four corners. +
SkRRect::kComplex_Type#Line # incomplete ## +both radii are non-zero. +
SkRRect::kLastType= kComplex_Type +incomplete
+ +### Example + +
+ +### See Also + +incomplete + + +## getType + +
+Type getType() const
+
+ +Returns the RR's sub type. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## type + +
+Type type() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## isEmpty + +
+inline bool isEmpty() const
+
+ +Returns true if rect.fLeft is equal to rect.fRight, or if rect.fTop is equal +to rect.fBottom. + +### Return Value + +true if width or height are zero + +### Example + +
+ +### See Also + +SkRect::isEmpty height width + +--- + + +## isRect + +
+inline bool isRect() const
+
+ +Returns true if not empty, and if either x or y radius at each corner is zero. + +### Return Value + +true if not empty, and one radius at each corner is zero + +### Example + +
+ +### See Also + +isEmpty radii + +--- + + +## isOval + +
+inline bool isOval() const
+
+ +Returns true if not empty, if all x-axis radii are equal, if all y-axis radii +are equal, x-axis radii are at least half the width, and y-axis radii are at +least half the height. + +### Return Value + +true if has identical geometry to Oval + +### Example + +
The first radii are scaled down proportionately until both x-axis and y-axis fit +within the bounds. After scaling, x-axis radius is smaller than half the width; +left round rect is not an oval. The second radii are equal to half the +dimensions; right round rect is an oval. +
+ +### See Also + +isEmpty isSimple SkCanvas::drawOval + +--- + + +## isSimple + +
+inline bool isSimple() const
+
+ +Returns true if not empty, if all x-axis radii are equal but not zero, +if all y-axis radii are equal but not zero; and x-axis radius is less than half +width, or y-axis radius is less than half height. + +### Return Value + +true if not empty, rect or oval; and axes radii are equal + +### Example + +
+ +### See Also + +isEmpty isRect isOval isNinePatch + +--- + + +## isNinePatch + +
+inline bool isNinePatch() const
+
+ +Returns true if isEmpty, isRect, isOval, and isSimple return false; and if +left x-axis radii are equal, right x-axis radii are equal, top y-axis radii are +equal, and bottom y-axis radii are equal. + +### Return Value + +true if not empty, rect, oval or simple; and radii are axis-aligned + +### Example + +
+ +### See Also + +isEmpty isRect isOval isSimple isComplex + +--- + + +## isComplex + +
+inline bool isComplex() const
+
+ +Returns true if isEmpty, isRect, isOval, isSimple, and isNinePatch return false. +If true: width and height are greater than zero, at least one corner radii are +both greater than zero; left x-axis radii are not equal, or right x-axis radii +are not equal, or top y-axis radii are not equal, or bottom y-axis radii are not +equal. + +### Return Value + +true if not empty, rect, oval, simple, or nine-patch + +### Example + +
+ +### See Also + +isEmpty isRect isOval isSimple isNinePatch + +--- + + +## width + +
+SkScalar width() const
+
+ +Returns span on the x-axis. This does not check if result fits in 32-bit float; +result may be infinity. + +### Return Value + +bounds().fRight minus bounds().fLeft + +### Example + +
SkRRect::MakeRect sorts its input, so width is always zero or larger. +
+ +#### Example Output + +~~~~ +unsorted width: 5 +large width: inf +~~~~ + +
+ +### See Also + +SkRect::width height getBounds + +--- + + +## height + +
+SkScalar height() const
+
+ +Returns span on the y-axis. This does not check if result fits in 32-bit float; +result may be infinity. + +### Return Value + +bounds().fBottom minus bounds().fTop + +### Example + +
SkRRect::MakeRect sorts its input, so height is always zero or larger. +
+ +#### Example Output + +~~~~ +unsorted height: 5 +large height: inf +~~~~ + +
+ +### See Also + +SkRect.height width getBounds + +--- + + +## getSimpleRadii + +
+SkVector getSimpleRadii() const
+
+ +Returns top-left corner x-radii. If type returns kEmpty Type, kRect Type, +kOval Type, or kSimple Type, returns a value representative of all corner radii. +If type returns kNinePatch Type or kComplex Type, at least one of the +remaining three corners has a different value. + +### Return Value + +corner radii for simple types + +### Example + +
+ +### See Also + +radii getBounds getType isSimple + +--- + + +## setEmpty + +
+void setEmpty()
+
+ +Sets bounds to zero width and height at (0, 0), the origin. Sets +corner radii to zero and sets type to kEmpty Type. + +### Example + +
Nothing blue is drawn because rrect is set to empty. +
+ +### See Also + +MakeEmpty setRect + +--- + + +## setRect + +
+void setRect(const SkRect& rect)
+
+ +Sets bounds to sorted rect, and sets corner radii to zero. +If set bounds has width and height, and sets type to kRect Type; +otherwise, sets type to kEmpty Type. + +### Parameters + + + + +
rectbounds to set
+ +### Example + +
+ +### See Also + +MakeRect setRectXY + +--- + + +## MakeEmpty + +
+static SkRRect MakeEmpty()
+
+ +Makes an empty rrect at the origin with zero width and height. + +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## MakeRect + +
+static SkRRect MakeRect(const SkRect& r)
+
+ +### Parameters + + + + +
rincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## MakeOval + +
+static SkRRect MakeOval(const SkRect& oval)
+
+ +### Parameters + + + + +
ovalincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## MakeRectXY + +
+static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
+
+ +### Parameters + + + + + + + + + + +
rectincomplete
xRadincomplete
yRadincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## setOval + +
+void setOval(const SkRect& oval)
+
+ +Sets Round Rect to match the supplied oval. All x-radii will equal half the +width and all y-radii will equal half the height. + +### Parameters + + + + +
ovalincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## setRectXY + +
+void setRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
+
+ +Initializes Round Rect with the same radii for all four corners. + +### Parameters + + + + + + + + + + +
rectincomplete
xRadincomplete
yRadincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## setNinePatch + +
+void setNinePatch(const SkRect& rect, SkScalar leftRad, SkScalar topRad, SkScalar rightRad,
+                  SkScalar bottomRad)
+
+ +Initializes Round Rect with one radius per-side. + +### Parameters + + + + + + + + + + + + + + + + +
rectincomplete
leftRadincomplete
topRadincomplete
rightRadincomplete
bottomRadincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## setRectRadii + +
+void setRectRadii(const SkRect& rect, const SkVector radii[4])
+
+ +Initializes Round Rect with potentially different radii for all four corners. + +### Parameters + + + + + + + +
rectincomplete
radiiincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + +## Enum SkRRect::Corner + +
+    enum Corner {
+        kUpperLeft Corner,
+        kUpperRight Corner,
+        kLowerRight Corner,
+        kLowerLeft Corner,
+    };
+
+ +The radii are stored: top-left, top-right, bottom-right, bottom-left. + +### Constants + + + + + + + + + + + + + + + + + + + + + + + + + +
ConstValueDescription
SkRRect::kUpperLeft_Corner#Line # incomplete ## +incomplete
SkRRect::kUpperRight_Corner#Line # incomplete ## +incomplete
SkRRect::kLowerRight_Corner#Line # incomplete ## +incomplete
SkRRect::kLowerLeft_Corner#Line # incomplete ## +incomplete
+ +### Example + +
+ +### See Also + +incomplete + + +## rect + +
+const SkRect& rect() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## radii + +
+SkVector radii(Corner corner) const
+
+ +### Parameters + + + + +
cornerincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## getBounds + +
+const SkRect& getBounds() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## operator== + +
+bool operator==(const SkRRect& a, const SkRRect& b)
+
+ +### Parameters + + + + + + + +
aincomplete
bincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## operator!= + +
+bool operator!=(const SkRRect& a, const SkRRect& b)
+
+ +### Parameters + + + + + + + +
aincomplete
bincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## inset + +
+void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const
+
+ +Calls inset on the bounds, and adjust the radii to reflect what happens. +If the corner is sharp (no curvature), leave it alone, +otherwise we grow/shrink the radii by the amount of the inset. If a +given radius becomes negative, it is pinned to 0. +If the inset amount is larger than the width/height then the rrect collapses to +a degenerate line or point. +If the inset is sufficiently negative to cause the bounds to become infinite then +the result is a default initialized rrect. +It is valid for dst == this. + +### Parameters + + + + + + + + + + +
dxincomplete
dyincomplete
dstincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+void inset(SkScalar dx, SkScalar dy)
+
+ +### Parameters + + + + + + + +
dxincomplete
dyincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## outset + +
+void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const
+
+ +Call outset on the bounds, and adjust the radii to reflect what happens +in stroking. If the corner is sharp (no curvature), leave it alone, +otherwise we grow/shrink the radii by the amount of the inset. If a +given radius becomes negative, it is pinned to 0. +It is valid for dst == this. + +### Parameters + + + + + + + + + + +
dxincomplete
dyincomplete
dstincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+void outset(SkScalar dx, SkScalar dy)
+
+ +### Parameters + + + + + + + +
dxincomplete
dyincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## offset + +
+void offset(SkScalar dx, SkScalar dy)
+
+ +Translate the rrect by (dx, dy). + +### Parameters + + + + + + + +
dxincomplete
dyincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## makeOffset + +
+SkRRect SK_WARN_UNUSED_RESULT makeOffset(SkScalar dx, SkScalar dy) const
+
+ +### Parameters + + + + + + + +
dxincomplete
dyincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## contains + +
+bool contains(const SkRect& rect) const
+
+ +Returns true if 'rect' is wholy inside the RR, and both +are not empty. + +### Parameters + + + + +
rectincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## isValid + +
+bool isValid() const
+
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + +### Constants + + + + + + + + + + +
ConstValueDescription
SkRRect::kSizeInMemory48 + + +### Example + +
incomplete + +
+ + +## writeToMemory + +
+size_t writeToMemory(void* buffer) const
+
+ +Write the rrect into the specified buffer. This is guaranteed to always +write kSizeInMemory bytes, and that value is guaranteed to always be +a multiple of 4. Return kSizeInMemory. + +### Parameters + + + + +
bufferincomplete
+ +### Return Value + +incomplete + +### Example + +
+ +### See Also + +incomplete + +--- + + +## readFromMemory + +
+size_t readFromMemory(const void* buffer, size_t length)
+
+ +Reads the rrect from the specified buffer. +If the specified buffer is large enough, this will read kSizeInMemory bytes, +and that value is guaranteed to always be a multiple of 4. + +### Parameters + + + + + + + +
buffermemory to read from
lengthamount of memory available in the buffer
+ +### Return Value + +number of bytes read (must be a multiple of 4) or +0 if there was not enough memory available + +### Example + +
+ +### See Also + +incomplete + +--- + + +## transform + +
+bool transform(const SkMatrix& matrix, SkRRect* dst) const
+
+ +Transform by the specified matrix, and put the result in dst. + +### Parameters + + + + + + + +
matrixSkMatrix specifying the transform. Must only contain +scale and/or translate, or this call will fail. +
dstSkRRect to store the result. It is an error to use this, +which would make this function no longer const. +
+ +### Return Value + +true on success, false on failure. + +### Example + +
+ +### See Also + +incomplete + +--- + + +## dump + +
+void dump(bool asHex) const
+
+ +### Parameters + + + + +
asHexincomplete
+ +### Example + +
+ +### See Also + +incomplete + +--- + + + +
+void dump() const
+
+ +### Example + +
+ +### See Also + +incomplete + +--- + + +## dumpHex + +
+void dumpHex() const
+
+ +### Example + +
+ +### See Also + +incomplete + +--- + diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md index fcd018d0df..02438608ca 100644 --- a/site/user/api/SkRect_Reference.md +++ b/site/user/api/SkRect_Reference.md @@ -86,7 +86,6 @@ SkRect global, struct, and class related member functi - ## Member Function @@ -308,7 +307,6 @@ SkRect member functions read and modify the structure properties. - ## Member @@ -364,7 +362,6 @@ SkRect members may be read and written directly without using a member function. - ### Members @@ -458,7 +455,6 @@ SkRect can be constructed or initialized by these functions, including C++ class
- ## MakeEmpty @@ -888,7 +884,6 @@ than fBottom. - ## isEmpty @@ -1234,7 +1229,7 @@ large width: 4294967296 SkScalar height() const -Returns span on the y-axis. This does not check if IRect is sorted, or if +Returns span on the y-axis. This does not check if Rect is sorted, or if result fits in 32-bit float; result may be negative or infinity. ### Return Value @@ -1345,7 +1340,6 @@ SkRect operators inline class member functions with arithmetic equivalents. - ## operator== @@ -1459,7 +1453,6 @@ test with NaN is not equal to itself - ## toQuad @@ -1470,8 +1463,6 @@ void toQuad(SkP Returns four points in quad that enclose Rect ordered as: top-left, top-right, bottom-right, bottom-left. -Consider adding param to control whether quad is clockwise or counterclockwise. - ### Parameters @@ -1629,7 +1620,6 @@ added: nan, 8 count: 4 rect: 0, 0, 0, 0 success: false
quad
- ## setBoundsNoCheck @@ -1995,7 +1985,6 @@ rect: -15, 0, 0, 25 isEmpty: false - ## iset @@ -2111,7 +2100,6 @@ rect2: {0, 0, 1, 2} - ## makeOffset @@ -2462,8 +2450,8 @@ rect: 5, 1, 55, 86 must describe area; fLeft is less than fRight, and fTop is less than fBottom; empty() returns false. The intersection of Rect pair can be described by: -(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), -min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)) +(max(a.fLeft, b.fLeft), max(a.fTop, b.fTop), +min(a.fRight, b.fRight), min(a.fBottom, b.fBottom)) . The intersection is only meaningful if the resulting Rect is not empty and @@ -2503,7 +2491,6 @@ describes an area: fLeft is less than ## contains @@ -2929,7 +2916,6 @@ intersection - ## join @@ -3122,7 +3108,6 @@ sorted: 10, 0, 55, 100 - ## round @@ -3348,7 +3333,6 @@ round: 30, 50, 41, 61 - ## sort diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md index 76f2de6716..387c6cbae6 100644 --- a/site/user/api/SkSurface_Reference.md +++ b/site/user/api/SkSurface_Reference.md @@ -72,7 +72,6 @@ SkSurface related constants are defined by enum, enum class - ## Related Function @@ -98,7 +97,6 @@ SkSurface global, struct, and class related member fun - ## Member Function @@ -216,7 +214,6 @@ SkSurface member functions read and modify the structure properties. - ## Constructor @@ -270,7 +267,6 @@ SkSurface can be constructed or initialized by these functions, including C++ cl - ## MakeRasterDirect @@ -1071,7 +1067,6 @@ surf->makeImageSnapshot() == nullptr - ## width @@ -1220,7 +1215,6 @@ If a snapshot has been generated, this copies the Surface - ## notifyContentWillChange @@ -1233,8 +1227,6 @@ Subsequent calls to generationID return a mode is normally passed as kRetain ContentChangeMode. -Can we deprecate this? - ### Parameters @@ -1527,7 +1519,6 @@ are not captured. Image allocation is acco
mode
- ## draw @@ -1538,7 +1529,7 @@ void draw(Sk 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, -Blend Mode, and Draw Looper. +Blend Mode, and Draw Looper. ### Parameters @@ -1552,7 +1543,7 @@ If Paint p vertical offset in Canvas paint - Paint containing Blend Mode, Color Filter, Image Filter, + Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr @@ -1941,7 +1932,6 @@ soon - ## flush diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index e8b4e7e70a..e1f9d3ef77 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -349,6 +349,13 @@ "file": "SkBitmap_Reference", "name": "SkBitmap::width()", "stdout": "bitmap width: 16 info width: 16\\n" + }, + "SkBlendMode_Name": { + "code": "void draw(SkCanvas* canvas) {\n SkDebugf(\"default blend: SkBlendMode::k%s\\n\", SkBlendMode_Name(SkPaint().getBlendMode()));\n}", + "hash": "3996f4994bf4e90b4cd86524c1f9f1a6", + "file": "SkBlendMode_Reference", + "name": "SkBlendMode_Name", + "stdout": "default blend: SkBlendMode::kSrcOver\\n" }, "SkCanvas_MakeRasterDirect": { "code": "void draw(SkCanvas* ) {\n SkImageInfo info = SkImageInfo::MakeN32Premul(3, 3); // device aligned, 32 bpp, Premultiplied\n const size_t minRowBytes = info.minRowBytes(); // bytes used by one bitmap row\n const size_t size = info.computeMinByteSize(); // bytes used by all rows\n SkAutoTMalloc storage(size); // allocate storage for pixels\n SkPMColor* pixels = storage.get(); // get pointer to allocated storage\n // create a SkCanvas backed by a raster device, and delete it when the\n // function goes out of scope.\n std::unique_ptr canvas = SkCanvas::MakeRasterDirect(info, pixels, minRowBytes);\n canvas->clear(SK_ColorWHITE); // white is Unpremultiplied, in ARGB order\n canvas->flush(); // ensure that pixels are cleared\n SkPMColor pmWhite = pixels[0]; // the Premultiplied format may vary\n SkPaint paint; // by default, draws black\n canvas->drawPoint(1, 1, paint); // draw in the center\n canvas->flush(); // ensure that point was drawn\n for (int y = 0; y < info.height(); ++y) {\n for (int x = 0; x < info.width(); ++x) {\n SkDebugf(\"%c\", *pixels++ == pmWhite ? '-' : 'x');\n }\n SkDebugf(\"\\n\");\n }\n}\n", @@ -364,25 +371,11 @@ "name": "SkCanvas::MakeRasterDirectN32", "stdout": "---\\n-x-\\n---\\n" }, - "SkCanvas_SaveLayerRec_SaveLayerRec": { + "SkCanvas_SaveLayerRec_empty_constructor": { "code": "void draw(SkCanvas* canvas) {\n SkCanvas::SaveLayerRec rec1;\n rec1.fSaveLayerFlags = SkCanvas::kPreserveLCDText_SaveLayerFlag;\n SkCanvas::SaveLayerRec rec2(nullptr, nullptr, SkCanvas::kPreserveLCDText_SaveLayerFlag);\n SkDebugf(\"rec1 %c= rec2\\n\", rec1.fBounds == rec2.fBounds\n && rec1.fPaint == rec2.fPaint\n && rec1.fBackdrop == rec2.fBackdrop\n && rec1.fSaveLayerFlags == rec2.fSaveLayerFlags ? '=' : '!');\n}", "hash": "b5cea1eed80a0eb04ddbab3f36dff73f", "file": "SkCanvas_Reference", - "name": "SkCanvas::SaveLayerRec::SaveLayerRec", - "stdout": "rec1 == rec2\\n" - }, - "SkCanvas_SaveLayerRec_SaveLayerRec_2": { - "code": "void draw(SkCanvas* canvas) {\n SkCanvas::SaveLayerRec rec1;\n SkCanvas::SaveLayerRec rec2(nullptr, nullptr);\n SkDebugf(\"rec1 %c= rec2\\n\", rec1.fBounds == rec2.fBounds\n && rec1.fPaint == rec2.fPaint\n && rec1.fBackdrop == rec2.fBackdrop\n && rec1.fSaveLayerFlags == rec2.fSaveLayerFlags ? '=' : '!');\n}", - "hash": "027f920259888fc19591ea9a90d92873", - "file": "SkCanvas_Reference", - "name": "SkCanvas::SaveLayerRec::SaveLayerRec_2", - "stdout": "rec1 == rec2\\n" - }, - "SkCanvas_SaveLayerRec_SaveLayerRec_3": { - "code": "void draw(SkCanvas* canvas) {\n SkCanvas::SaveLayerRec rec1;\n SkCanvas::SaveLayerRec rec2(nullptr, nullptr, nullptr, 0);\n SkDebugf(\"rec1 %c= rec2\\n\", rec1.fBounds == rec2.fBounds\n && rec1.fPaint == rec2.fPaint\n && rec1.fBackdrop == rec2.fBackdrop\n && rec1.fSaveLayerFlags == rec2.fSaveLayerFlags ? '=' : '!');\n}", - "hash": "9b7fa2fe855642ffff6538829db15328", - "file": "SkCanvas_Reference", - "name": "SkCanvas::SaveLayerRec::SaveLayerRec_3", + "name": "SkCanvas::SaveLayerRec::SaveLayerRec()", "stdout": "rec1 == rec2\\n" }, "SkCanvas_accessTopRasterHandle": { @@ -398,6 +391,21 @@ "file": "SkCanvas_Reference", "name": "SkCanvas::SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)", "stdout": "-----\\n---x-\\n---x-\\n---x-\\n---x-\\n---x-\\n---x-\\n-----\\n---x-\\n---x-\\n-----\\n" + }, + "SkCanvas_const_SkRect_star_const_SkPaint_star": { + "code": "void draw(SkCanvas* canvas) {\n SkCanvas::SaveLayerRec rec1;\n SkCanvas::SaveLayerRec rec2(nullptr, nullptr);\n SkDebugf(\"rec1 %c= rec2\\n\", rec1.fBounds == rec2.fBounds\n && rec1.fPaint == rec2.fPaint\n && rec1.fBackdrop == rec2.fBackdrop\n && rec1.fSaveLayerFlags == rec2.fSaveLayerFlags ? '=' : '!');\n}", + "hash": "027f920259888fc19591ea9a90d92873", + "file": "SkCanvas_Reference", + "name": "SkCanvas::SaveLayerRec::SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0)", + "stdout": "rec1 == rec2\\n" + }, + "SkCanvas_const_SkRect_star_const_SkPaint_star_const_SkImageFilter_star": { + "code": "void draw(SkCanvas* canvas) {\n SkCanvas::SaveLayerRec rec1;\n SkCanvas::SaveLayerRec rec2(nullptr, nullptr, nullptr, 0);\n SkDebugf(\"rec1 %c= rec2\\n\", rec1.fBounds == rec2.fBounds\n && rec1.fPaint == rec2.fPaint\n && rec1.fBackdrop == rec2.fBackdrop\n && rec1.fSaveLayerFlags == rec2.fSaveLayerFlags ? '=' : '!');\n}", + "hash": "9b7fa2fe855642ffff6538829db15328", + "file": "SkCanvas_Reference", + "name": "SkCanvas::SaveLayerRec::SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop, + SaveLayerFlags saveLayerFlags)", + "stdout": "rec1 == rec2\\n" }, "SkCanvas_copy_const_SkBitmap": { "code": "void draw(SkCanvas* ) {\n SkBitmap bitmap;\n // create a bitmap 5 wide and 11 high\n bitmap.allocPixels(SkImageInfo::MakeN32Premul(5, 11));\n SkCanvas canvas(bitmap);\n canvas.clear(SK_ColorWHITE); // white is Unpremultiplied, in ARGB order\n SkPixmap pixmap; // provides guaranteed access to the drawn pixels\n if (!canvas.peekPixels(&pixmap)) {\n SkDebugf(\"peekPixels should never fail.\\n\");\n }\n const SkPMColor* pixels = pixmap.addr32(); // points to top-left of bitmap\n SkPMColor pmWhite = pixels[0]; // the Premultiplied format may vary\n SkPaint paint; // by default, draws black, 12 point text\n canvas.drawString(\"!\", 1, 10, paint); // 1 char at baseline (1, 10)\n for (int y = 0; y < bitmap.height(); ++y) {\n for (int x = 0; x < bitmap.width(); ++x) {\n SkDebugf(\"%c\", *pixels++ == pmWhite ? '-' : 'x');\n }\n SkDebugf(\"\\n\");\n }\n}", @@ -2001,20 +2009,6 @@ "file": "SkPath_Reference", "name": "SkPath::IsQuadDegenerate", "stdout": "quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is degenerate, nearly\\nquad (1100,1100), (1100,1100), (1100,1100) is degenerate, nearly\\nquad (100,100), (100.00001,100.00001), (100.00002,100.00002) is not degenerate, exactly\\nquad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly\\n" - }, - "SkPath_Iter_Iter": { - "code": "void draw(SkCanvas* canvas) {\n SkPath::Iter iter;\n SkPoint points[4];\n SkDebugf(\"iter is \" \"%s\" \"done\\n\", SkPath::kDone_Verb == iter.next(points) ? \"\" : \"not \");\n SkPath path;\n iter.setPath(path, false);\n SkDebugf(\"iter is \" \"%s\" \"done\\n\", SkPath::kDone_Verb == iter.next(points) ? \"\" : \"not \");\n}\n", - "hash": "01648775cb9b354b2f1836dad82a25ab", - "file": "SkPath_Reference", - "name": "SkPath::Iter::Iter", - "stdout": "iter is done\\niter is done\\n" - }, - "SkPath_Iter_Iter_2": { - "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, SkPath::Iter& iter) -> void {\n SkDebugf(\"%s:\\n\", prefix);\n const char* verbStr[] = { \"Move\", \"Line\", \"Quad\", \"Conic\", \"Cubic\", \"Close\", \"Done\" };\n const int pointCount[] = { 1 , 2 , 3 , 3 , 4 , 1 , 0 };\n SkPath::Verb verb;\n do {\n SkPoint points[4];\n verb = iter.next(points);\n SkDebugf(\"k%s_Verb \", verbStr[(int) verb]);\n for (int i = 0; i < pointCount[(int) verb]; ++i) {\n SkDebugf(\"{%g, %g}, \", points[i].fX, points[i].fY);\n }\n if (SkPath::kConic_Verb == verb) {\n SkDebugf(\"weight = %g\", iter.conicWeight());\n }\n SkDebugf(\"\\n\");\n } while (SkPath::kDone_Verb != verb);\n SkDebugf(\"\\n\");\n };\n SkPath path;\n path.quadTo(10, 20, 30, 40);\n SkPath::Iter openIter(path, false);\n debugster(\"open\", openIter);\n SkPath::Iter closedIter(path, true);\n debugster(\"closed\", closedIter);\n}\n", - "hash": "13044dbf68885c0f15322c0633b633a3", - "file": "SkPath_Reference", - "name": "SkPath::Iter::Iter_2", - "stdout": "open:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkDone_Verb \\n\\nclosed:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkLine_Verb {30, 40}, {0, 0}, \\nkClose_Verb {0, 0}, \\nkDone_Verb \\n\\n" }, "SkPath_Iter_conicWeight": { "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.conicTo(1, 2, 3, 4, .5f);\n SkPath::Iter iter(path, false);\n SkPoint p[4];\n SkDebugf(\"first verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"next verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"conic points: {%g,%g}, {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY,\n p[2].fX, p[2].fY);\n SkDebugf(\"conic weight: %g\\n\", iter.conicWeight());\n}\n", @@ -2022,6 +2016,13 @@ "file": "SkPath_Reference", "name": "SkPath::Iter::conicWeight", "stdout": "first verb is move\\nnext verb is conic\\nconic points: {0,0}, {1,2}, {3,4}\\nconic weight: 0.5\\n" + }, + "SkPath_Iter_empty_constructor": { + "code": "void draw(SkCanvas* canvas) {\n SkPath::Iter iter;\n SkPoint points[4];\n SkDebugf(\"iter is \" \"%s\" \"done\\n\", SkPath::kDone_Verb == iter.next(points) ? \"\" : \"not \");\n SkPath path;\n iter.setPath(path, false);\n SkDebugf(\"iter is \" \"%s\" \"done\\n\", SkPath::kDone_Verb == iter.next(points) ? \"\" : \"not \");\n}\n", + "hash": "01648775cb9b354b2f1836dad82a25ab", + "file": "SkPath_Reference", + "name": "SkPath::Iter::Iter()", + "stdout": "iter is done\\niter is done\\n" }, "SkPath_Iter_isCloseLine": { "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.moveTo(6, 7);\n path.conicTo(1, 2, 3, 4, .5f);\n path.close();\n SkPath::Iter iter(path, false);\n SkPoint p[4];\n SkDebugf(\"1st verb is \" \"%s\" \"move\\n\", SkPath::kMove_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"moveTo point: {%g,%g}\\n\", p[0].fX, p[0].fY);\n SkDebugf(\"2nd verb is \" \"%s\" \"conic\\n\", SkPath::kConic_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"3rd verb is \" \"%s\" \"line\\n\", SkPath::kLine_Verb == iter.next(p) ? \"\" : \"not \");\n SkDebugf(\"line points: {%g,%g}, {%g,%g}\\n\", p[0].fX, p[0].fY, p[1].fX, p[1].fY);\n SkDebugf(\"line \" \"%s\" \"generated by close\\n\", iter.isCloseLine() ? \"\" : \"not \");\n SkDebugf(\"4th verb is \" \"%s\" \"close\\n\", SkPath::kClose_Verb == iter.next(p) ? \"\" : \"not \");\n}\n", @@ -2106,6 +2107,13 @@ "file": "SkPath_Reference", "name": "SkPath::computeTightBounds", "stdout": "empty bounds = 0, 0, 0, 0\\ncircle bounds = 25, 20, 75, 70\\nrotated circle bounds = 25, 20, 75, 70\\n" + }, + "SkPath_const_SkPath": { + "code": "void draw(SkCanvas* canvas) {\n auto debugster = [](const char* prefix, SkPath::Iter& iter) -> void {\n SkDebugf(\"%s:\\n\", prefix);\n const char* verbStr[] = { \"Move\", \"Line\", \"Quad\", \"Conic\", \"Cubic\", \"Close\", \"Done\" };\n const int pointCount[] = { 1 , 2 , 3 , 3 , 4 , 1 , 0 };\n SkPath::Verb verb;\n do {\n SkPoint points[4];\n verb = iter.next(points);\n SkDebugf(\"k%s_Verb \", verbStr[(int) verb]);\n for (int i = 0; i < pointCount[(int) verb]; ++i) {\n SkDebugf(\"{%g, %g}, \", points[i].fX, points[i].fY);\n }\n if (SkPath::kConic_Verb == verb) {\n SkDebugf(\"weight = %g\", iter.conicWeight());\n }\n SkDebugf(\"\\n\");\n } while (SkPath::kDone_Verb != verb);\n SkDebugf(\"\\n\");\n };\n SkPath path;\n path.quadTo(10, 20, 30, 40);\n SkPath::Iter openIter(path, false);\n debugster(\"open\", openIter);\n SkPath::Iter closedIter(path, true);\n debugster(\"closed\", closedIter);\n}\n", + "hash": "13044dbf68885c0f15322c0633b633a3", + "file": "SkPath_Reference", + "name": "SkPath::Iter::Iter(const SkPath& path, bool forceClose)", + "stdout": "open:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkDone_Verb \\n\\nclosed:\\nkMove_Verb {0, 0}, \\nkQuad_Verb {0, 0}, {10, 20}, {30, 40}, \\nkLine_Verb {30, 40}, {0, 0}, \\nkClose_Verb {0, 0}, \\nkDone_Verb \\n\\n" }, "SkPath_copy_const_SkPath": { "code": "void draw(SkCanvas* canvas) {\n SkPath path;\n path.lineTo(20, 20);\n SkPath path2(path);\n path2.close();\n SkDebugf(\"path verbs: %d\\n\", path.countVerbs());\n SkDebugf(\"path2 verbs: %d\\n\", path2.countVerbs());\n path.reset();\n SkDebugf(\"after reset\\n\" \"path verbs: %d\\n\", path.countVerbs());\n SkDebugf(\"path2 verbs: %d\\n\", path2.countVerbs());\n}", @@ -2694,6 +2702,20 @@ "file": "SkPoint_Reference", "name": "SkPoint::y()", "stdout": "pt1.fY == pt1.y()\\n" + }, + "SkRRect_height": { + "code": "void draw(SkCanvas* canvas) {\n SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 20 });\n SkDebugf(\"unsorted height: %g\\n\", unsorted.height());\n SkRRect large = SkRRect::MakeRect({ 1, -FLT_MAX, 2, FLT_MAX });\n SkDebugf(\"large height: %.0f\\n\", large.height());\n}", + "hash": "5a3eb1755164a7becec33cec6e6eca31", + "file": "SkRRect_Reference", + "name": "SkRRect::height()", + "stdout": "unsorted height: 5\\nlarge height: inf\\n" + }, + "SkRRect_width": { + "code": "void draw(SkCanvas* canvas) {\n SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 5 });\n SkDebugf(\"unsorted width: %g\\n\", unsorted.width());\n SkRRect large = SkRRect::MakeRect({ -FLT_MAX, 1, FLT_MAX, 2 });\n SkDebugf(\"large width: %.0f\\n\", large.width());\n}", + "hash": "c675a480b41dee157f84fa2550a2a53c", + "file": "SkRRect_Reference", + "name": "SkRRect::width()", + "stdout": "unsorted width: 5\\nlarge width: inf\\n" }, "SkRect_Intersects": { "code": "void draw(SkCanvas* canvas) {\n SkDebugf(\"%s intersection\", SkRect::Intersects({10, 40, 50, 80}, {30, 60, 70, 90}) ? \"\" : \"no \");\n}", @@ -3264,7 +3286,239 @@ } } - var pngs = {"Canvas_Clip": { + var pngs = {"Blend_Mode_Clear": { + "code": "void draw(SkCanvas* canvas) {\n canvas->saveLayer(nullptr, nullptr);\n canvas->drawColor(SK_ColorYELLOW, SkBlendMode::kClear);\n SkPaint paint;\n for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN } ) {\n SkColor colors[] = { color, SkColorSetA(color, 0) }; \n paint.setShader(SkGradientShader::MakeRadial({ 64, 64}, 100,\n colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));\n canvas->drawCircle(64, 64, 100, paint);\n canvas->translate(64, 64);\n }\n canvas->restore();\n}", + "width": 256, + "height": 256, + "hash": "a9b56a26ca469bab9ab10e16f62fb2e2", + "file": "SkBlendMode_Reference", + "name": "Clear" +}, + "Blend_Mode_Color": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kColor);\n}", + "width": 256, + "height": 256, + "hash": "953eb53ac00e22d098c1a1290379282e", + "file": "SkBlendMode_Reference", + "name": "Color" +}, + "Blend_Mode_Color_Burn": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->clipRect({128, 0, 256, 256});\n canvas->drawColor(SkColorSetARGB(0x80, 0x90, 0x90, 0x90), SkBlendMode::kColorBurn);\n}", + "width": 256, + "height": 256, + "hash": "3eeef529375d8083ae0d615789d55e89", + "file": "SkBlendMode_Reference", + "name": "Color_Burn" +}, + "Blend_Mode_Color_Dodge": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->clipRect({128, 0, 256, 256});\n canvas->drawColor(SkColorSetARGB(0x80, 0x90, 0x90, 0x90), SkBlendMode::kColorDodge);\n}", + "width": 256, + "height": 256, + "hash": "280ad6267a7d2d77b6d2c4531c6fc0bf", + "file": "SkBlendMode_Reference", + "name": "Color_Dodge" +}, + "Blend_Mode_Darken": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n SkColor colors[] = { SK_ColorWHITE, SK_ColorBLACK };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n paint.setBlendMode(SkBlendMode::kDarken);\n canvas->drawPaint(paint);\n}", + "width": 256, + "height": 256, + "hash": "8c5065ba642f815602000f6b53cefc48", + "file": "SkBlendMode_Reference", + "name": "Darken" +}, + "Blend_Mode_Difference": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawImage(image, 128, 0);\n canvas->drawImage(image, 0, 128);\n canvas->drawImage(image, 128, 128);\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(0x80bb9977, SkBlendMode::kDifference);\n}", + "width": 256, + "height": 256, + "hash": "52d2c8d1b9b428de4477b4caa1543a3d", + "file": "SkBlendMode_Reference", + "name": "Difference" +}, + "Blend_Mode_Dst": { + "code": "void draw(SkCanvas* canvas) {\n SkRSXform xforms[] = { { .5f, 0, 0, 0 }, {0, .5f, 125, 128 } };\n SkRect tex[] = { { 0, 0, 250, 250 }, { 0, 0, 250, 250 } };\n SkColor colors[] = { 0x7f55aa00, 0x7f3333bf };\n canvas->drawAtlas(image.get(), xforms, tex, colors, 2, SkBlendMode::kSrc, nullptr, nullptr);\n canvas->translate(128, 0);\n canvas->drawAtlas(image.get(), xforms, tex, colors, 2, SkBlendMode::kDst, nullptr, nullptr);\n}", + "width": 256, + "height": 256, + "hash": "35915a2273be1076f00f2e47998ce808", + "file": "SkBlendMode_Reference", + "name": "Dst" +}, + "Blend_Mode_Dst_Atop": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kSrcATop);\n}", + "width": 256, + "height": 256, + "hash": "1955856d45773a4fd914fcc1f813222f", + "file": "SkBlendMode_Reference", + "name": "Dst_Atop" +}, + "Blend_Mode_Dst_In": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kDstIn);\n}", + "width": 256, + "height": 256, + "hash": "a5eeba05ccf6097a5d110a9d64f97c25", + "file": "SkBlendMode_Reference", + "name": "Dst_In" +}, + "Blend_Mode_Dst_Out": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kDstOut);\n}", + "width": 256, + "height": 256, + "hash": "b9a894c9accfc5d94081bbd77d5d790a", + "file": "SkBlendMode_Reference", + "name": "Dst_Out" +}, + "Blend_Mode_Dst_Over": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kDstOver);\n}", + "width": 256, + "height": 256, + "hash": "10dbb4d97902956ef5f5f8562f65119e", + "file": "SkBlendMode_Reference", + "name": "Dst_Over" +}, + "Blend_Mode_Exclusion": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawImage(image, 128, 0);\n canvas->drawImage(image, 0, 128);\n canvas->drawImage(image, 128, 128);\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(0x80bb9977, SkBlendMode::kExclusion);\n}", + "width": 256, + "height": 256, + "hash": "a544ee1c67c7c557a9e54d5e99f94bb6", + "file": "SkBlendMode_Reference", + "name": "Exclusion" +}, + "Blend_Mode_Hard_Light": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n const SkColor colors[] = { 0xFFFFFFFF, 0x00000000 };\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kHardLight);\n paint.setShader(SkGradientShader::MakeRadial({ 128, 128}, 100, colors,\n nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));\n canvas->clipRect({0, 128, 256, 256});\n canvas->drawPaint(paint);\n}", + "width": 256, + "height": 256, + "hash": "ac2fe555e2196e15863ea4ce74db3d54", + "file": "SkBlendMode_Reference", + "name": "Hard_Light" +}, + "Blend_Mode_Hue": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kHue);\n}", + "width": 256, + "height": 256, + "hash": "ade7ea4d06775cb252a1d15c7a8112d3", + "file": "SkBlendMode_Reference", + "name": "Hue" +}, + "Blend_Mode_Lighten": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n SkColor colors[] = { SK_ColorBLACK, SK_ColorWHITE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n paint.setBlendMode(SkBlendMode::kLighten);\n canvas->drawPaint(paint);\n}", + "width": 256, + "height": 256, + "hash": "bbbe1a7b2587e76f9b2c7996b188a054", + "file": "SkBlendMode_Reference", + "name": "Lighten" +}, + "Blend_Mode_Luminosity": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kLuminosity);\n}", + "width": 256, + "height": 256, + "hash": "7161fa58aa064ee229ae346cb2e165c4", + "file": "SkBlendMode_Reference", + "name": "Luminosity" +}, + "Blend_Mode_Modulate": { + "code": "void draw(SkCanvas* canvas) {\n auto drawSquare = [=](int dx, int dy, SkBlendMode mode, const char* label) -> void {\n const SkColor colors[] = { SK_ColorBLACK, SK_ColorWHITE };\n const SkPoint horz[] = { { 0, 0 }, { 128, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n paint.setBlendMode(mode);\n canvas->translate(dx, dy);\n canvas->drawRect({0, 0, 128, 128}, paint);\n paint.setBlendMode(SkBlendMode::kXor);\n canvas->drawString(label, 40, 100, paint);\n };\n drawSquare(0, 0, SkBlendMode::kSrc, \"destination\");\n drawSquare(128, 0, SkBlendMode::kSrc, \"\");\n drawSquare(0, 128, SkBlendMode::kSrc, \"\");\n canvas->translate(-128, -128);\n canvas->rotate(90, 0, 128);\n drawSquare(0, 0, SkBlendMode::kSrc, \"source\");\n drawSquare(0, -128, SkBlendMode::kModulate, \"modulate\");\n drawSquare(-128, 0, SkBlendMode::kMultiply, \"multiply\");\n}", + "width": 256, + "height": 256, + "hash": "3fdac2b2f48bd227d2e74234c260bc8e", + "file": "SkBlendMode_Reference", + "name": "Modulate" +}, + "Blend_Mode_Multiply": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawImage(image, 128, 0);\n canvas->drawImage(image, 0, 128);\n canvas->drawImage(image, 128, 128);\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(0x80bb9977, SkBlendMode::kMultiply);\n}", + "width": 256, + "height": 256, + "hash": "145418271d58afc4070e7df42095c750", + "file": "SkBlendMode_Reference", + "name": "Multiply" +}, + "Blend_Mode_Overlay": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kOverlay);\n}", + "width": 256, + "height": 256, + "hash": "03bf042201de02d6d131938ccd3172eb", + "file": "SkBlendMode_Reference", + "name": "Overlay" +}, + "Blend_Mode_Plus": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawColor(SK_ColorBLACK);\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kPlus);\n for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN } ) {\n SkColor colors[] = { color, SkColorSetA(color, 192), SkColorSetA(color, 128),\n SkColorSetA(color, 0) }; \n paint.setShader(SkGradientShader::MakeRadial({ 64, 64}, 100,\n colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));\n canvas->drawCircle(64, 64, 100, paint);\n canvas->translate(64, 64);\n }\n}", + "width": 256, + "height": 256, + "hash": "05383441e510d54008402e128fc8ad2b", + "file": "SkBlendMode_Reference", + "name": "Plus" +}, + "Blend_Mode_Saturation": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kSaturation);\n}", + "width": 256, + "height": 256, + "hash": "4a99f5f6738b18afd92a4cb2bd762bf0", + "file": "SkBlendMode_Reference", + "name": "Saturation" +}, + "Blend_Mode_Screen": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kScreen);\n}", + "width": 256, + "height": 256, + "hash": "b7b42965927788d853f449f08ddf46de", + "file": "SkBlendMode_Reference", + "name": "Screen" +}, + "Blend_Mode_Soft_Light": { + "code": "void draw(SkCanvas* canvas) {\n const SkColor colors[] = { 0xFFFFFFFF, 0x3FFFFFFF };\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kSoftLight);\n paint.setShader(SkGradientShader::MakeRadial({ 128, 128}, 100, colors,\n nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));\n canvas->drawImage(image, 0, 0);\n canvas->drawCircle(128, 128, 100, paint);\n}", + "width": 256, + "height": 256, + "hash": "ac93f30dff13f8a8bb31398de370863b", + "file": "SkBlendMode_Reference", + "name": "Soft_Light" +}, + "Blend_Mode_Src": { + "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->clipRect({50, 50, 200, 200});\n SkPaint srcBlend;\n srcBlend.setBlendMode(SkBlendMode::kSrc);\n canvas->saveLayer(nullptr, &srcBlend);\n canvas->drawColor(0);\n SkPaint transRed;\n transRed.setColor(SkColorSetA(SK_ColorRED, 127));\n canvas->drawCircle(125, 125, 75, transRed);\n canvas->restore();\n}", + "width": 256, + "height": 256, + "hash": "0fc85dd916cc1a5896d36c80b9847391", + "file": "SkBlendMode_Reference", + "name": "Src" +}, + "Blend_Mode_Src_Atop": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kSrcATop);\n}", + "width": 256, + "height": 256, + "hash": "a13148977bfc985934a92752c83a2041", + "file": "SkBlendMode_Reference", + "name": "Src_Atop" +}, + "Blend_Mode_Src_In": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kSrcIn);\n}", + "width": 256, + "height": 256, + "hash": "b0833c18fe8b0eeaab9bd6d2160d272f", + "file": "SkBlendMode_Reference", + "name": "Src_In" +}, + "Blend_Mode_Src_Out": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kSrcOut);\n}", + "width": 256, + "height": 256, + "hash": "ccc1e74226e0c9eacbc21f1eed017b84", + "file": "SkBlendMode_Reference", + "name": "Src_Out" +}, + "Blend_Mode_Src_Over": { + "code": "void draw(SkCanvas* canvas) {\n SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n paint.setBlendMode(SkBlendMode::kDstIn);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(SkColorSetA(SK_ColorGREEN, 128), SkBlendMode::kSrcOver);\n}", + "width": 256, + "height": 256, + "hash": "2ea9c149964a06cdb4929158cb4f15f8", + "file": "SkBlendMode_Reference", + "name": "Src_Over" +}, + "Blend_Mode_Xor": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kXor);\n for (auto color : { SK_ColorRED, SK_ColorBLUE, SK_ColorGREEN } ) {\n SkColor colors[] = { color, SkColorSetA(color, 192), SkColorSetA(color, 128),\n SkColorSetA(color, 0) }; \n paint.setShader(SkGradientShader::MakeRadial({ 64, 64}, 100,\n colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode));\n canvas->drawCircle(64, 64, 100, paint);\n canvas->translate(64, 64);\n }\n}", + "width": 256, + "height": 256, + "hash": "29db2c7493d9098b8a086ddbe30dd6d6", + "file": "SkBlendMode_Reference", + "name": "Xor" +}, + "Canvas_Clip": { "code": "void draw(SkCanvas* canvas) {\n SkPaint redPaint, scalePaint;\n redPaint.setAntiAlias(true);\n redPaint.setColor(SK_ColorRED);\n canvas->save();\n for (bool antialias : { false, true } ) {\n canvas->save();\n canvas->clipRect(SkRect::MakeWH(19.5f, 11.5f), antialias);\n canvas->drawCircle(17, 11, 8, redPaint);\n canvas->restore();\n canvas->translate(16, 0);\n }\n canvas->restore();\n SkMatrix matrix;\n matrix.setScale(6, 6);\n scalePaint.setImageFilter(\n SkImageFilter::MakeMatrixFilter(matrix, kNone_SkFilterQuality, nullptr));\n SkCanvas::SaveLayerRec saveLayerRec(\n nullptr, &scalePaint, SkCanvas::kInitWithPrevious_SaveLayerFlag);\n canvas->saveLayer(saveLayerRec);\n canvas->restore();\n}", "width": 256, "height": 90, @@ -3335,6 +3589,46 @@ "hash": "fce650f997e802d4e55edf62b8437a2d", "file": "SkColor_Reference", "name": "Color_Constants_White" +}, + "Illustrations_Blend_Mode_Color_Blends": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n canvas->drawColor(0, SkBlendMode::kClear);\n for (auto blend : { SkBlendMode::kHue, SkBlendMode::kSaturation, SkBlendMode::kColor,\n SkBlendMode::kLuminosity } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(90, 0);\n }\n}", + "width": 480, + "height": 110, + "hash": "03710c1770728da885fa4ac24a19d5d1", + "file": "illustrations", + "name": "Blend_Mode_Color_Blends" +}, + "Illustrations_Blend_Mode_Lighten_Darken": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n canvas->drawColor(0, SkBlendMode::kClear);\n for (auto blend : { SkBlendMode::kPlus, SkBlendMode::kScreen, SkBlendMode::kOverlay,\n SkBlendMode::kDarken, SkBlendMode::kLighten, SkBlendMode::kColorDodge,\n SkBlendMode::kColorBurn, SkBlendMode::kHardLight, SkBlendMode::kSoftLight,\n SkBlendMode::kDifference, SkBlendMode::kExclusion, SkBlendMode::kMultiply } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(90, 0);\n if (SkBlendMode::kLighten == blend || SkBlendMode::kDifference == blend) {\n canvas->translate(-90 * 5, 100);\n }\n }\n}", + "width": 480, + "height": 330, + "hash": "8e04f89252632da0fffe713f07f2296f", + "file": "illustrations", + "name": "Blend_Mode_Lighten_Darken" +}, + "Illustrations_Blend_Mode_Modulate_Blend": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n SkBitmap srcBits;\n srcBits.allocN32Pixels(80, 84);\n SkCanvas srcCanvas(srcBits);\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n srcBits.eraseColor(0);\n srcCanvas.drawPath(srcPath, srcPaint);\n canvas->drawColor(0, SkBlendMode::kClear);\n srcPaint.setBlendMode(SkBlendMode::kModulate);\n for (auto step: { 1, 2 } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n if (1 == step) {\n canvas->drawBitmap(srcBits, 0, 0, &srcPaint);\n canvas->drawString(\"Bitmap\", 50, 18, labelPaint);\n } else {\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(\"Geometry\", 50, 18, labelPaint);\n }\n canvas->drawString(SkBlendMode_Name(SkBlendMode::kModulate), 50, 100, labelPaint);\n canvas->translate(120, 0);\n }\n}", + "width": 480, + "height": 110, + "hash": "d8abdd8fb56f9e69342d745d425c4a17", + "file": "illustrations", + "name": "Blend_Mode_Modulate_Blend" +}, + "Illustrations_Blend_Mode_Porter_Duff": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n SkBitmap srcBits;\n srcBits.allocN32Pixels(80, 84);\n SkCanvas srcCanvas(srcBits);\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n srcBits.eraseColor(0);\n srcCanvas.drawPath(srcPath, srcPaint);\n canvas->drawColor(0, SkBlendMode::kClear);\n for (auto blend : { SkBlendMode::kSrc, SkBlendMode::kSrcATop, SkBlendMode::kSrcOver,\n SkBlendMode::kSrcIn, SkBlendMode::kSrcOut,\n SkBlendMode::kDst, SkBlendMode::kDstATop, SkBlendMode::kDstOver,\n SkBlendMode::kDstIn, SkBlendMode::kDstOut,\n SkBlendMode::kClear, SkBlendMode::kXor } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawBitmap(srcBits, 0, 0, &srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(80, 0);\n if (SkBlendMode::kSrcOut == blend || SkBlendMode::kDstOut == blend) {\n canvas->translate(-80 * 5, 100);\n }\n }\n}", + "width": 480, + "height": 330, + "hash": "8c27fb2a58f63505cffa74c1c79e16ba", + "file": "illustrations", + "name": "Blend_Mode_Porter_Duff" +}, + "Illustrations_Blend_Mode_Porter_Duff_2": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint srcPaint;\n srcPaint.setAntiAlias(true);\n SkPaint labelPaint = srcPaint;\n labelPaint.setTextAlign(SkPaint::kCenter_Align);\n labelPaint.setTextSize(16);\n SkPaint dstPaint = labelPaint;\n dstPaint.setTextSize(80);\n dstPaint.setColor(0xFF606080);\n dstPaint.setTypeface(SkTypeface::MakeFromName(\"Roboto\", SkFontStyle::Bold()));\n srcPaint.setColor(0xFFcc6633);\n SkPath srcPath;\n const SkPoint points[] = {{20, 20}, {80, 45}, {45, 80}};\n srcPath.addPoly(points, SK_ARRAY_COUNT(points), true);\n canvas->drawColor(0, SkBlendMode::kClear);\n SkBitmap dstBits;\n dstBits.allocN32Pixels(80, 80);\n SkCanvas dstCanvas(dstBits);\n for (auto blend : { SkBlendMode::kSrc, SkBlendMode::kSrcATop, SkBlendMode::kSrcOver,\n SkBlendMode::kSrcIn, SkBlendMode::kSrcOut,\n SkBlendMode::kDst, SkBlendMode::kDstATop, SkBlendMode::kDstOver,\n SkBlendMode::kDstIn, SkBlendMode::kDstOut,\n SkBlendMode::kClear, SkBlendMode::kXor } ) {\n canvas->drawString(\"&\", 50, 80, dstPaint);\n srcPaint.setBlendMode(blend);\n canvas->drawPath(srcPath, srcPaint);\n canvas->drawString(SkBlendMode_Name(blend), 50, 100, labelPaint);\n canvas->translate(80, 0);\n if (SkBlendMode::kSrcOut == blend || SkBlendMode::kDstOut == blend) {\n canvas->translate(-80 * 5, 100);\n }\n }\n}", + "width": 480, + "height": 330, + "hash": "50ebbb0162bbf60524a196236d66c915", + "file": "illustrations", + "name": "Blend_Mode_Porter_Duff_2" }, "Illustrations_Image_Info_Color_Type_ARGB_4444": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"16-bit word\", 5 + 20 * 8, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 4, 8, 12, 16 };\n const char* labels[] = { \"red\", \"green\", \"blue\", \"alpha\" };\n drawBoxText(&edges[0], &labels[0], 4, 15, 45);\n drawBoxText(&edges[0], &labels[2], 2, 7, 110);\n drawBoxText(&edges[0], &labels[0], 2, 7, 160);\n}\n", @@ -3375,6 +3669,14 @@ "hash": "9344796c059ff5e4f057595e781905b3", "file": "illustrations", "name": "Image_Info_Color_Type_RGBA_F16" +}, + "Illustrations_Image_Info_Color_Type_RGBA_F32": { + "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"128-bit word\", 5 + 20 * 16, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 135, paint);\n for (int i = 0; i < 4; ++i) {\n canvas->drawString(\"(low bits)\", 5 + 10 * 4, 187 + i * 100, paint);\n canvas->drawString(\"(high bits)\", 105 + 10 * 4, 237 + i * 100, paint);\n }\n auto drawBoxText = [=](SkScalar e[], const char* s[], const char* nums[] , \n int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int stringIndex = 0;\n for (int i = n; i >= 0; --i) {\n if (0 == i || n == i || 32 == i || 31 == i) {\n int x = xPos;\n if (2 == count) {\n x += stringIndex * 12 + (stringIndex ? 8 : 0);\n }\n canvas->drawString(nums[stringIndex], x, yPos - 5, p);\n if (1 == count) {\n canvas->drawString(nums[stringIndex], xPos + 100, yPos - 5, p);\n }\n ++stringIndex;\n }\n xPos += 9;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 5, yPos + 10, p);\n if (1 == count) {\n canvas->drawString(s[i], 105 + (e[i] + e[i + 1]) * 5, yPos + 10, p);\n }\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 10, yPos, 5 + e[i] * 10, yPos + 15, p);\n if (1 == count) {\n canvas->drawLine(105 + e[i] * 10, yPos, 105 + e[i] * 10, yPos + 15, p);\n }\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 10, yPos + i * 15,\n 5 + e[count] * 10, yPos + i * 15, p);\n if (1 == count) {\n canvas->drawLine(105 + e[0] * 10, yPos + i * 15,\n 105 + e[count] * 10, yPos + i * 15, p);\n }\n }\n };\n SkScalar edges[] = { 0, 32, 64,\n 0, 8\n };\n const char* labels[] = { \"alpha\", \"blue\", \"green\", \"red\" };\n const char* nums128[] = { \"127\", \"96\", \"95\", \"64\"};\n const char* nums64[] = { \"63\", \"32\", \"31\", \"0\"};\n const char* nums8[] = { \"7\", \"0\"};\n drawBoxText(&edges[0], &labels[0], nums128, 2, 63, 45);\n drawBoxText(&edges[0], &labels[2], nums64, 2, 63, 95);\n drawBoxText(&edges[3], &labels[3], nums8, 1, 7, 160);\n drawBoxText(&edges[3], &labels[3], nums8, 1, 7, 210);\n drawBoxText(&edges[3], &labels[2], nums8, 1, 7, 260);\n drawBoxText(&edges[3], &labels[2], nums8, 1, 7, 310);\n drawBoxText(&edges[3], &labels[1], nums8, 1, 7, 360);\n drawBoxText(&edges[3], &labels[1], nums8, 1, 7, 410);\n drawBoxText(&edges[3], &labels[0], nums8, 1, 7, 460);\n drawBoxText(&edges[3], &labels[0], nums8, 1, 7, 510);\n}\n", + "width": 812, + "height": 685, + "hash": "b26119f9312d5f5d4011bf2dac94fafe", + "file": "illustrations", + "name": "Image_Info_Color_Type_RGBA_F32" }, "Illustrations_Image_Info_Color_Type_RGB_101010": { "code": "void draw(SkCanvas* canvas) {\n canvas->scale(1.25f, 1.25f);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(10);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"32-bit word\", 5 + 20 * 16, 20, paint);\n canvas->drawString(\"little endian byte order\", 5 + 20 * 4, 85, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 4, 137, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 3, 187, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 7, 187, paint);\n canvas->drawString(\"(low bits)\", 5 + 20 * 2, 237, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 6, 237, paint);\n canvas->drawString(\"(high bits)\", 5 + 20 * 5, 287, paint);\n auto drawBoxText = [=](SkScalar e[], const char* s[], int count, int n, SkScalar yPos) -> void {\n SkPaint p(paint);\n p.setColor(SK_ColorRED);\n SkScalar xPos = 15;\n int width = n % 32 + 1;\n int lastN = n > 32 ? 32 : 0;\n for (; n >= lastN; --n) {\n for (int i = 0; i <= count; ++i) {\n int a = width - e[i];\n if (a == n || a == n + 1 || a == n - 32 || a == n - 31) {\n char num[3] = {(char) ('0' + n / 10), (char) ('0' + n % 10), '\\0'};\n canvas->drawString(n >= 10 ? num : &num[1], xPos, yPos - 5, p);\n break;\n }\n }\n xPos += 20;\n }\n p.setColor(SK_ColorBLACK);\n for (int i = 0; i < count; ++i) {\n canvas->drawString(s[i], 5 + (e[i] + e[i + 1]) * 10, yPos + 10, p);\n }\n p.setStyle(SkPaint::kStroke_Style);\n for (int i = 0; i <= count; ++i) {\n canvas->drawLine(5 + e[i] * 20, yPos, 5 + e[i] * 20, yPos + 15, p);\n }\n for (int i = 0; i < 2; ++i) {\n canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);\n }\n };\n SkScalar edges[] = { 0, 2, 12, 22, 32,\n 0, 8,\n 0, 6, 8,\n 0, 4, 8,\n 0, 2, 8\n };\n const char* labels[] = { \"unused\", \"blue\", \"green\", \"red\" };\n drawBoxText(&edges[0], &labels[0], 4, 31, 45);\n drawBoxText(&edges[5], &labels[3], 1, 7, 110);\n drawBoxText(&edges[7], &labels[2], 2, 7, 160);\n drawBoxText(&edges[10], &labels[1], 2, 7, 210);\n drawBoxText(&edges[13], &labels[0], 2, 7, 260);\n}\n", @@ -3473,10 +3775,10 @@ "name": "Color_Type_RGBA_8888" }, "Image_Info_Color_Type_RGBA_F16": { - "code": "union FloatUIntUnion {\n uint32_t fUInt;\n float fFloat;\n};\nuint16_t FloatToHalf(float f) {\n static const FloatUIntUnion magic = { 15 << 23 };\n static const uint32_t round_mask = ~0xfffu;\n FloatUIntUnion floatUnion;\n floatUnion.fFloat = f;\n uint32_t sign = floatUnion.fUInt & 0x80000000u;\n floatUnion.fUInt ^= sign;\n floatUnion.fUInt &= round_mask;\n floatUnion.fFloat *= magic.fFloat;\n floatUnion.fUInt -= round_mask;\n return (floatUnion.fUInt >> 13) | (sign >> 16);\n}\n\nvoid draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto H = [](float c) -> uint16_t {\n return FloatToHalf(c);\n };\n // R G B A\n uint16_t red_f16[][4] = { { H(1.0f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.75f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.50f), H(0.0f), H(0.0f), H(1.0f) },\n { H(.25f), H(0.0f), H(0.0f), H(1.0f) } };\n uint16_t blue_f16[][4] = { { H(0.0f), H(0.0f), H(1.0f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.75f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.50f), H(1.0f) },\n { H(0.0f), H(0.0f), H(.25f), H(1.0f) } };\n SkPixmap redPixmap(imageInfo, red_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, blue_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}\n", + "code": "union FloatUIntUnion {\n uint32_t fUInt;\n float fFloat;\n};\nuint16_t FloatToHalf(float f) {\n static const FloatUIntUnion magic = { 15 << 23 };\n static const uint32_t round_mask = ~0xfffu;\n FloatUIntUnion floatUnion;\n floatUnion.fFloat = f;\n uint32_t sign = floatUnion.fUInt & 0x80000000u;\n floatUnion.fUInt ^= sign;\n floatUnion.fUInt &= round_mask;\n floatUnion.fFloat *= magic.fFloat;\n floatUnion.fUInt -= round_mask;\n return (floatUnion.fUInt >> 13) | (sign >> 16);\n}\n\nvoid draw(SkCanvas* canvas) {\n canvas->scale(16, 16);\n SkBitmap bitmap;\n SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);\n bitmap.allocPixels(imageInfo);\n SkCanvas offscreen(bitmap);\n offscreen.clear(SK_ColorGREEN);\n canvas->drawBitmap(bitmap, 0, 0);\n auto H = [](float c) -> uint16_t {\n return FloatToHalf(c);\n };\n // R G B A\n uint16_t red_f16[][4] = { { H(1.0), H(0.0), H(0.0), H(1.0) },\n { H(.75), H(0.0), H(0.0), H(1.0) },\n { H(.50), H(0.0), H(0.0), H(1.0) },\n { H(.25), H(0.0), H(0.0), H(1.0) } };\n uint16_t blue_f16[][4] = { { H(0.0), H(0.0), H(1.0), H(1.0) },\n { H(0.0), H(0.0), H(.75), H(1.0) },\n { H(0.0), H(0.0), H(.50), H(1.0) },\n { H(0.0), H(0.0), H(.25), H(1.0) } };\n SkPixmap redPixmap(imageInfo, red_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(redPixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 2, 2);\n }\n SkPixmap bluePixmap(imageInfo, blue_f16, imageInfo.minRowBytes());\n if (bitmap.writePixels(bluePixmap, 0, 0)) {\n canvas->drawBitmap(bitmap, 4, 4);\n }\n}\n", "width": 256, "height": 96, - "hash": "788ac33198103a14a5076dc3e03f2f4b", + "hash": "dd81527bbdf5eaae7dd21ac04ab84f9e", "file": "SkImageInfo_Reference", "name": "Color_Type_RGBA_F16" }, @@ -6807,6 +7109,118 @@ "hash": "c40979a3b92a30cfb7bae36abcc1d805", "file": "SkPath_Reference", "name": "SkPath::transform_2" +}, + "SkPicture_AbortCallback_abort": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::AbortCallback::abort()" +}, + "SkPicture_AbortCallback_empty_constructor": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::AbortCallback::AbortCallback()" +}, + "SkPicture_MakeFromData": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::MakeFromData" +}, + "SkPicture_MakeFromData_2": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::MakeFromData_2" +}, + "SkPicture_MakeFromStream": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::MakeFromStream" +}, + "SkPicture_MakePlaceholder": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::MakePlaceholder" +}, + "SkPicture_approximateBytesUsed": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::approximateBytesUsed" +}, + "SkPicture_approximateOpCount": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::approximateOpCount" +}, + "SkPicture_cullRect": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::cullRect" +}, + "SkPicture_destructor": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::AbortCallback::~AbortCallback()" +}, + "SkPicture_playback": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::playback()" +}, + "SkPicture_serialize": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::serialize()" +}, + "SkPicture_serialize_2": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::serialize_2" +}, + "SkPicture_uniqueID": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkPicture_Reference", + "name": "SkPicture::uniqueID" }, "SkPixmap_erase": { "code": "void draw(SkCanvas* canvas) {\n uint32_t storage[2];\n SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorBLUE, {0, 0, 1, 1});\n pixmap.erase(SK_ColorRED, {0, 1, 1, 2});\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", @@ -7151,6 +7565,358 @@ "hash": "4fb2da4a3d9b14ca4ac24eefb0f5126a", "file": "SkColor_Reference", "name": "SkRGBToHSV" +}, + "SkRRect_Corner": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::Corner" +}, + "SkRRect_MakeEmpty": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::MakeEmpty" +}, + "SkRRect_MakeOval": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::MakeOval" +}, + "SkRRect_MakeRect": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::MakeRect" +}, + "SkRRect_MakeRectXY": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::MakeRectXY" +}, + "SkRRect_Type": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::Type" +}, + "SkRRect_contains": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::contains()" +}, + "SkRRect_copy_const_SkRRect": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::SkRRect(const SkRRect& rrect)" +}, + "SkRRect_copy_operator": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::operator=(const SkRRect& rrect)" +}, + "SkRRect_dump": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::dump()" +}, + "SkRRect_dumpHex": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::dumpHex" +}, + "SkRRect_dump_2": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::dump_2" +}, + "SkRRect_empty_constructor": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::SkRRect()" +}, + "SkRRect_equal_operator": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::operator==(const SkRRect& a, const SkRRect& b)" +}, + "SkRRect_getBounds": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::getBounds" +}, + "SkRRect_getSimpleRadii": { + "code": "void draw(SkCanvas* canvas) {\n auto drawDetails = [=](const SkRRect& rrect) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(12);\n canvas->drawRRect(rrect, paint);\n SkVector corner = rrect.getSimpleRadii();\n std::string label = \"corner: \" + std::to_string(corner.fX).substr(0, 3) + \", \" +\n std::to_string(corner.fY).substr(0, 3);\n canvas->drawString(label.c_str(), 64, 90, paint);\n canvas->translate(128, 0);\n };\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n drawDetails(rrect);\n rrect.setRectXY(rrect.getBounds(), 5, 8);\n drawDetails(rrect);\n}", + "width": 256, + "height": 256, + "hash": "f0e02101ecbdb5a2963ec82e7832afb1", + "file": "SkRRect_Reference", + "name": "SkRRect::getSimpleRadii" +}, + "SkRRect_getType": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::getType" +}, + "SkRRect_inset": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::inset()" +}, + "SkRRect_inset_2": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::inset_2" +}, + "SkRRect_isComplex": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkVector radii[] = {{25, 30}, {40, 30}, {40, 30}, {20, 30}};\n SkRRect rrect;\n rrect.setRectRadii({30, 10, 100, 60}, radii);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isComplex() ? \"complex\" : \"not complex\", 64, 90, paint);\n radii[0].fX = 20;\n rrect.setRectRadii(rrect.getBounds(), radii);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isComplex() ? \"complex\" : \"not complex\", 64, 90, paint);\n}", + "width": 256, + "height": 256, + "hash": "75db3f4e4757478bca641bccf89b9398", + "file": "SkRRect_Reference", + "name": "SkRRect::isComplex" +}, + "SkRRect_isEmpty": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 10, 5);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isEmpty() ? \"empty\" : \"not empty\", 64, 90, paint);\n rrect.inset(40, 0);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isEmpty() ? \"empty\" : \"not empty\", 64, 90, paint);\n}", + "width": 256, + "height": 100, + "hash": "3afe4ea247923e06326aeb2b165c7485", + "file": "SkRRect_Reference", + "name": "SkRRect::isEmpty" +}, + "SkRRect_isNinePatch": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkVector radii[] = {{20, 30}, {40, 30}, {40, 30}, {20, 30}};\n SkRRect rrect;\n rrect.setRectRadii({30, 10, 100, 60}, radii);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isNinePatch() ? \"9 patch\" : \"not 9 patch\", 64, 90, paint);\n radii[0].fX = 35;\n rrect.setRectRadii(rrect.getBounds(), radii);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isNinePatch() ? \"9 patch\" : \"not 9 patch\", 64, 90, paint);\n}", + "width": 256, + "height": 100, + "hash": "568cb730e66d0df09a7d9bd9d6142c9e", + "file": "SkRRect_Reference", + "name": "SkRRect::isNinePatch" +}, + "SkRRect_isOval": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkRRect rrect = SkRRect::MakeRectXY({30, 10, 100, 60}, 40, 30);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isOval() ? \"oval\" : \"not oval\", 64, 90, paint);\n rrect.setRectXY(rrect.getBounds(), 35, 25);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isOval() ? \"oval\" : \"not oval\", 64, 90, paint);\n}", + "width": 256, + "height": 100, + "hash": "ab9b3aef7896aee80b780789848fbba4", + "file": "SkRRect_Reference", + "name": "SkRRect::isOval" +}, + "SkRRect_isRect": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isRect() ? \"rect\" : \"not rect\", 64, 90, paint);\n SkVector radii[] = {{10, 10}, {0, 0}, {0, 0}, {0, 0}};\n rrect.setRectRadii(rrect.getBounds(), radii);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isRect() ? \"rect\" : \"not rect\", 64, 90, paint);\n}", + "width": 256, + "height": 100, + "hash": "e2dcdad0e9cb7ba3e78a9871e9229753", + "file": "SkRRect_Reference", + "name": "SkRRect::isRect" +}, + "SkRRect_isSimple": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkVector radii[] = {{40, 30}, {40, 30}, {40, 30}, {40, 30}};\n SkRRect rrect;\n rrect.setRectRadii({30, 10, 100, 60}, radii);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isSimple() ? \"simple\" : \"not simple\", 64, 90, paint);\n radii[0].fX = 35;\n rrect.setRectRadii(rrect.getBounds(), radii);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isSimple() ? \"simple\" : \"not simple\", 64, 90, paint);\n}", + "width": 256, + "height": 100, + "hash": "65bbb109483ed79edb32027cf71851eb", + "file": "SkRRect_Reference", + "name": "SkRRect::isSimple" +}, + "SkRRect_isValid": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::isValid" +}, + "SkRRect_kSizeInMemory": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::kSizeInMemory" +}, + "SkRRect_makeOffset": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::makeOffset" +}, + "SkRRect_notequal_operator": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::operator!=(const SkRRect& a, const SkRRect& b)" +}, + "SkRRect_offset": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::offset()" +}, + "SkRRect_outset": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::outset()" +}, + "SkRRect_outset_2": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::outset_2" +}, + "SkRRect_radii": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::radii()" +}, + "SkRRect_readFromMemory": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::readFromMemory" +}, + "SkRRect_rect": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::rect()" +}, + "SkRRect_setEmpty": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n canvas->drawRRect(rrect, paint);\n rrect.setEmpty();\n paint.setColor(SK_ColorBLUE);\n canvas->drawRRect(rrect, paint);\n}", + "width": 256, + "height": 256, + "hash": "59c1025b8116ec1d3b55f4f6306d1e37", + "file": "SkRRect_Reference", + "name": "SkRRect::setEmpty" +}, + "SkRRect_setNinePatch": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::setNinePatch" +}, + "SkRRect_setOval": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::setOval" +}, + "SkRRect_setRect": { + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n canvas->drawRRect(rrect, paint);\n rrect.setRect({60, 30, 120, 80});\n paint.setColor(SK_ColorBLUE);\n canvas->drawRRect(rrect, paint);\n}", + "width": 256, + "height": 256, + "hash": "fc97ef7310473b9ba6dc7202efbebb3b", + "file": "SkRRect_Reference", + "name": "SkRRect::setRect" +}, + "SkRRect_setRectRadii": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::setRectRadii" +}, + "SkRRect_setRectXY": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::setRectXY" +}, + "SkRRect_transform": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::transform()" +}, + "SkRRect_type": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::type()" +}, + "SkRRect_writeToMemory": { + "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "width": 256, + "height": 256, + "hash": "882e8e0103048009a25cfc20400492f7", + "file": "SkRRect_Reference", + "name": "SkRRect::writeToMemory" }, "SkSurface_MakeFromBackendTexture": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(32);\n GrContext* context = canvas->getGrContext();\n if (!context) {\n canvas->drawString(\"GPU only!\", 20, 40, paint);\n return;\n }\n sk_sp gpuSurface = SkSurface::MakeFromBackendTexture(context,\n backEndTexture, kTopLeft_GrSurfaceOrigin, 0,\n kRGBA_8888_SkColorType, nullptr, nullptr);\n auto surfaceCanvas = gpuSurface->getCanvas();\n surfaceCanvas->drawString(\"GPU rocks!\", 20, 40, paint);\n sk_sp image(gpuSurface->makeImageSnapshot());\n canvas->drawImage(image, 0, 0);\n}", diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index bb8977a294..26e9795b37 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -17,36 +17,6 @@ undocumented # Big Endian -# Blend Mode - -## Enum SkBlendMode - -### Constants - - - - - - - - - - - - - - - - - - - - -
ConstValueDescription
SkBlendMode::kSrc1 -
SkBlendMode::kSrcOver3 -
SkBlendMode::kPlus12 -
- # Cartesian Coordinate # Circle @@ -181,6 +151,10 @@ SK_API void SkDebugf(const char format[], ...) # Descenders +# Deserial Procs + +# Struct SkDeserialProcs + # Destructor # Device @@ -417,20 +391,7 @@ bool SK_API Op(const SkPath< # Class SkPathEffect -# Picture - -# Class SkPicture - - -## playback - -
-virtual void playback(SkCanvas*, AbortCallback* = nullptr) const = 0
-
- ---- - -## Recorder +# Picture Recorder # Class SkPictureRecorder @@ -555,28 +516,6 @@ bool isValid() const # Right Side Bearing -# Round Rect - -# Class SkRRect - - -## dump - -
-void dump() const
-
- ---- - - -## dumpHex - -
-void dumpHex() const
-
- ---- - # SVG ## Canvas @@ -591,6 +530,10 @@ void dumpHex() const ## Typedef SkScalar +# Serial Procs + +# Struct SkSerialProcs + # Shader # Class SkShader @@ -633,6 +576,16 @@ static sk sp<SkShader> +## MakeCompose + +
+static sk sp<SkShader> MakeCompose(sk sp<SkShader> dst, sk sp<SkShader> src, SkBlendMode mode,
+                                   float lerp = 1)
+
+ +--- + # Size # Struct SkSize @@ -641,7 +594,7 @@ static sk sp<SkShader> Stream -# Class SkWStream +# Class SkStream # String @@ -719,6 +672,14 @@ bool isValid() const ## Texs +# WStream + +# Class SkWStream + +# Xfermode Image Filter + +# Class SkXfermodeImageFilter + # YUV Component U # YUV Component V -- cgit v1.2.3