fix blank catalog images

Some catalog images are blank because
the image wasn't selected in the fiddle
example.

Also continue to add documentation and
examples for SkRRect

R=caryclark@google.com
NOTRY=true

Docs-Preview: https://skia.org/?cl=138382
Bug: skia:6898
Change-Id: I282a14ffcbaf2f8383294724900960f5ba40a2aa
Reviewed-on: https://skia-review.googlesource.com/138382
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-06-28 19:13:56 -04:00 committed by Skia Commit-Bot
parent 24d18ced1a
commit 53498e973e
9 changed files with 651 additions and 298 deletions

View File

@ -860,6 +860,7 @@ Da as destination Alpha, Dc as destination Color component
. SkBlendMode::kDarken does not make an image darker; it replaces the destination
component with source if source is darker.
#Example
#Image 3
canvas->drawImage(image, 0, 0);
SkColor colors[] = { SK_ColorWHITE, SK_ColorBLACK };
SkPoint horz[] = { { 0, 0 }, { 256, 0 } };
@ -885,6 +886,7 @@ Da as destination Alpha, Dc as destination Color component
. SkBlendMode::kDarken does not make an image lighter; it replaces the destination
component with source if source is lighter.
#Example
#Image 3
canvas->drawImage(image, 0, 0);
SkColor colors[] = { SK_ColorBLACK, SK_ColorWHITE };
SkPoint horz[] = { { 0, 0 }, { 256, 0 } };
@ -1065,6 +1067,7 @@ Da as destination Alpha, Dc as destination Color component
, the product of Unpremultiplied source and destination.
SkBlendMode::kMultiply makes the image darker.
#Example
#Image 5
canvas->drawImage(image, 0, 0);
canvas->drawImage(image, 128, 0);
canvas->drawImage(image, 0, 128);
@ -1094,6 +1097,7 @@ Da as destination Alpha, D as destination Color
##
, source hue, leaving destination luminosity and saturation unchanged.
#Example
#Image 3
canvas->drawImage(image, 0, 0);
canvas->drawColor(0xFF00FF00, SkBlendMode::kHue);
##
@ -1112,6 +1116,7 @@ Da as destination Alpha, D as destination Color
##
, source hue, leaving destination luminosity and saturation unchanged.
#Example
#Image 3
canvas->drawImage(image, 0, 0);
canvas->drawColor(0xFF00FF00, SkBlendMode::kSaturation);
##
@ -1130,6 +1135,7 @@ Da as destination Alpha, D as destination Color
##
, source hue and saturation, leaving destination luminosity unchanged.
#Example
#Image 3
canvas->drawImage(image, 0, 0);
canvas->drawColor(0xFF00FF00, SkBlendMode::kColor);
##
@ -1148,6 +1154,7 @@ Da as destination Alpha, D as destination Color
##
, source luminosity, leaving destination hue and saturation unchanged.
#Example
#Image 3
canvas->drawImage(image, 0, 0);
canvas->drawColor(0xFF00FF00, SkBlendMode::kLuminosity);
##

View File

@ -5044,7 +5044,7 @@ for (int y = 2; y < 256; y += 9) {
#Method void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const
#In Utility
#Line # sends text representation using floats to standard output ##
#Line # sends text representation to stream ##
Writes text representation of Path to stream. If stream is nullptr, writes to
standard output. Set forceClose to true to get edges used to fill Path.
Set dumpAsHex true to generate exact binary representations
@ -5086,7 +5086,7 @@ path.close();
##
##
#SeeAlso SkRect::dump() SkRRect::dump() SkPathMeasure::dump()
#SeeAlso dumpHex SkRect::dump() SkRRect::dump() SkPathMeasure::dump()
##

View File

@ -878,7 +878,23 @@ sets to kSimple_Type. Otherwise, sets to kNinePatch_Type.
#Param radii corner x-axis and y-axis radii ##
#Example
// incomplete
SkPaint paint;
paint.setStrokeWidth(15);
paint.setStrokeCap(SkPaint::kSquare_Cap);
paint.setAntiAlias(true);
float intervals[] = { 5, 21.75f };
paint.setStyle(SkPaint::kStroke_Style);
paint.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));
SkPath path;
SkRRect rrect;
SkVector corners[] = {{15, 17}, {17, 19}, {19, 15}, {15, 15}};
rrect.setRectRadii({20, 20, 100, 100}, corners);
path.addRRect(rrect, SkPath::kCW_Direction);
canvas->drawPath(path, paint);
path.rewind();
path.addRRect(rrect, SkPath::kCCW_Direction, 1);
canvas->translate(120, 0);
canvas->drawPath(path, paint);
##
#SeeAlso setNinePatch SkPath::addRoundRect
@ -888,7 +904,7 @@ sets to kSimple_Type. Otherwise, sets to kNinePatch_Type.
# ------------------------------------------------------------------------------
#Enum Corner
#Line # incomplete ##
#Line # corner radii order ##
#Code
enum Corner {
@ -901,74 +917,133 @@ sets to kSimple_Type. Otherwise, sets to kNinePatch_Type.
The radii are stored: top-left, top-right, bottom-right, bottom-left.
#Const kUpperLeft_Corner
#Line # incomplete ##
#Const kUpperLeft_Corner 0
#Line # index of top-left corner radii ##
##
#Const kUpperRight_Corner
#Line # incomplete ##
#Const kUpperRight_Corner 1
#Line # index of top-right corner radii ##
##
#Const kLowerRight_Corner
#Line # incomplete ##
#Const kLowerRight_Corner 2
#Line # index of bottom-right corner radii ##
##
#Const kLowerLeft_Corner
#Line # incomplete ##
#Const kLowerLeft_Corner 3
#Line # index of bottom-left corner radii ##
##
#Example
// incomplete
#Height 70
SkPaint paint;
paint.setAntiAlias(true);
SkRRect rrect;
SkVector corners[] = {{25, 17}, {17, 19}, {19, 15}, {15, 15}};
rrect.setRectRadii({30, 10, 100, 60}, corners);
canvas->drawRRect(rrect, paint);
paint.setColor(SK_ColorWHITE);
const SkRect r = rrect.getBounds();
canvas->drawLine(r.fLeft, r.fTop + rrect.radii(SkRRect::kUpperLeft_Corner).fY,
r.fRight, r.fTop + rrect.radii(SkRRect::kUpperRight_Corner).fY, paint);
canvas->drawLine(r.fLeft, r.fBottom - rrect.radii(SkRRect::kLowerLeft_Corner).fY,
r.fRight, r.fBottom - rrect.radii(SkRRect::kLowerRight_Corner).fY, paint);
canvas->drawLine(r.fLeft + rrect.radii(SkRRect::kUpperLeft_Corner).fX, r.fTop,
r.fLeft + rrect.radii(SkRRect::kLowerLeft_Corner).fX, r.fBottom, paint);
canvas->drawLine(r.fRight - rrect.radii(SkRRect::kUpperRight_Corner).fX, r.fTop,
r.fRight - rrect.radii(SkRRect::kLowerRight_Corner).fX, r.fBottom, paint);
##
#SeeAlso incomplete
#SeeAlso radii
#Enum ##
# ------------------------------------------------------------------------------
#Method const SkRect& rect() const
#In incomplete
#Line # incomplete ##
#In Property
#Line # returns bounds ##
Returns bounds. Bounds may have zero width or zero height. Bounds right is
greater than or equal to left; bounds bottom is greater than or equal to top.
Result is identical to getBounds.
#Return incomplete ##
#Return bounding box ##
#Example
// incomplete
for (SkScalar left : { SK_ScalarNaN, SK_ScalarInfinity, 100.f, 50.f, 25.f} ) {
SkRRect rrect1 = SkRRect::MakeRectXY({left, 20, 60, 220}, 50, 200);
SkDebugf("left bounds: (%g) %g\n", left, rrect1.rect().fLeft);
}
#StdOut
left bounds: (nan) 0
left bounds: (inf) 0
left bounds: (100) 60
left bounds: (50) 50
left bounds: (25) 25
##
##
#SeeAlso incomplete
#SeeAlso getBounds
#Method ##
# ------------------------------------------------------------------------------
#Method SkVector radii(Corner corner) const
#In incomplete
#Line # incomplete ##
#In Property
#Line # returns x-axis and y-axis radii for one corner ##
Returns Scalar pair for radius of curve on x-axis and y-axis for one corner.
Both radii may be zero. If not zero, both are positive and finite.
#Param corner incomplete ##
#Return incomplete ##
#Example
// incomplete
#Param corner one of: kUpperLeft_Corner, kUpperRight_Corner,
kLowerRight_Corner, kLowerLeft_Corner
##
#SeeAlso incomplete
#Return x-axis and y-axis radii for one corner ##
#Example
#Description
Finite values are scaled proportionately to fit; other values are set to zero.
Scaled values cannot be larger than 25, half the bounding rect width.
Small scaled values are halved to scale in proportion to the y-axis corner
radius, which is twice the bounds height.
##
for (SkScalar radiusX : { SK_ScalarNaN, SK_ScalarInfinity, 100.f, 50.f, 25.f} ) {
SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, radiusX, 200);
SkDebugf("left corner: (%g) %g\n", radiusX, rrect1.radii(SkRRect::kUpperLeft_Corner).fX);
}
#StdOut
left corner: (nan) 0
left corner: (inf) 0
left corner: (100) 25
left corner: (50) 25
left corner: (25) 12.5
##
##
#SeeAlso Corner
#Method ##
# ------------------------------------------------------------------------------
#Method const SkRect& getBounds() const
#In incomplete
#Line # incomplete ##
#In Property
#Line # returns bounds ##
Returns bounds. Bounds may have zero width or zero height. Bounds right is
greater than or equal to left; bounds bottom is greater than or equal to top.
Result is identical to rect().
#Return incomplete ##
#Return bounding box ##
#Example
// incomplete
#Height 120
SkPaint paint;
SkRRect rrect = SkRRect::MakeRectXY({20, 20, 220, 100}, 15, 15);
canvas->drawRRect(rrect, paint);
paint.setColor(SK_ColorWHITE);
rrect = SkRRect::MakeOval(rrect.getBounds());
canvas->drawRRect(rrect, paint);
##
#SeeAlso incomplete
#SeeAlso rect
#Method ##
@ -976,18 +1051,33 @@ The radii are stored: top-left, top-right, bottom-right, bottom-left.
#Method bool operator==(const SkRRect& a, const SkRRect& b)
#In Operator
#Line # incomplete ##
#Line # returns true if members are equal ##
Returns true if bounds and radii in a are equal to bounds and radii in b.
#Param a incomplete ##
#Param b incomplete ##
a and b are not equal if either contain NaN. a and b are equal if members
contain zeroes width different signs.
#Return incomplete ##
#Param a Rect bounds and radii to compare ##
#Param b Rect bounds and radii to compare ##
#Return true if members are equal ##
#Example
// incomplete
SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 200);
SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 25, 100);
SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());
canvas->drawRRect(rrect1, SkPaint());
std::string str = "rrect1 " + std::string(rrect1 == rrect2 ? "=" : "!") + "= rrect2";
canvas->drawString(str.c_str(), 10, 240, SkPaint());
canvas->translate(70, 0);
canvas->drawRRect(rrect2, SkPaint());
canvas->translate(70, 0);
canvas->drawRRect(rrect3, SkPaint());
str = "rrect2 " + std::string(rrect2 == rrect3 ? "=" : "!") + "= rrect3";
canvas->drawString(str.c_str(), -20, 240, SkPaint());
##
#SeeAlso incomplete
#SeeAlso operator!=(const SkRRect& a, const SkRRect& b)
#Method ##
@ -995,26 +1085,41 @@ The radii are stored: top-left, top-right, bottom-right, bottom-left.
#Method bool operator!=(const SkRRect& a, const SkRRect& b)
#In Operator
#Line # incomplete ##
#Line # returns true if members are unequal ##
Returns true if bounds and radii in a are not equal to bounds and radii in b.
#Param a incomplete ##
#Param b incomplete ##
a and b are not equal if either contain NaN. a and b are equal if members
contain zeroes width different signs.
#Return incomplete ##
#Param a Rect bounds and radii to compare ##
#Param b Rect bounds and radii to compare ##
#Return true if members are not equal ##
#Example
// incomplete
SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 100);
SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 50, 50);
SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());
canvas->drawRRect(rrect1, SkPaint());
std::string str = "rrect1 " + std::string(rrect1 == rrect2 ? "=" : "!") + "= rrect2";
canvas->drawString(str.c_str(), 10, 240, SkPaint());
canvas->translate(70, 0);
canvas->drawRRect(rrect2, SkPaint());
canvas->translate(70, 0);
canvas->drawRRect(rrect3, SkPaint());
str = "rrect2 " + std::string(rrect2 == rrect3 ? "=" : "!") + "= rrect3";
canvas->drawString(str.c_str(), -20, 240, SkPaint());
##
#SeeAlso incomplete
#SeeAlso operator==(const SkRRect& a, const SkRRect& b)
#Method ##
# ------------------------------------------------------------------------------
#Method void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # insets bounds and radii ##
Calls inset on the bounds, and adjust the radii to reflect what happens.
If the corner is sharp (no curvature), leave it alone,
@ -1026,40 +1131,55 @@ If the inset is sufficiently negative to cause the bounds to become infinite the
the result is a default initialized rrect.
It is valid for dst == this.
#Param dx incomplete ##
#Param dy incomplete ##
#Param dst incomplete ##
#Param dx added to rect().fLeft, and subtracted from rect().fRight ##
#Param dy added to rect().fTop, and subtracted from rect().fBottom ##
#Param dst insets bounds and radii ##
#Example
// incomplete
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
for (int index = 0; index < 25; ++index) {
canvas->drawRRect(rrect, paint);
rrect.inset(-3, 3, &rrect);
}
##
#SeeAlso incomplete
#SeeAlso outset offset makeOffset
#Method ##
# ------------------------------------------------------------------------------
#Method void inset(SkScalar dx, SkScalar dy)
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # insets bounds and radii ##
#Param dx incomplete ##
#Param dy incomplete ##
#Param dx added to rect().fLeft, and subtracted from rect().fRight ##
#Param dy added to rect().fTop, and subtracted from rect().fBottom ##
#Example
// incomplete
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkRRect rrect = SkRRect::MakeRectXY({10, 20, 180, 220}, 50, 100);
for (int index = 0; index < 25; ++index) {
canvas->drawRRect(rrect, paint);
rrect.inset(3, 3);
}
##
#SeeAlso incomplete
#SeeAlso outset offset makeOffset
#Method ##
# ------------------------------------------------------------------------------
#Method void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # outsets bounds and radii ##
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,
@ -1067,98 +1187,127 @@ 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.
#Param dx incomplete ##
#Param dy incomplete ##
#Param dst incomplete ##
#Param dx subtracted from rect().fLeft, and added to rect().fRight ##
#Param dy subtracted from rect().fTop, and added to rect().fBottom ##
#Param dst outset bounds and radii ##
#Example
// incomplete
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
for (int index = 0; index < 25; ++index) {
canvas->drawRRect(rrect, paint);
rrect.outset(-3, 3, &rrect);
}
##
#SeeAlso incomplete
#SeeAlso inset offset makeOffset
#Method ##
# ------------------------------------------------------------------------------
#Method void outset(SkScalar dx, SkScalar dy)
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # outsets bounds and radii ##
#Param dx incomplete ##
#Param dy incomplete ##
#Param dx subtracted from rect().fLeft, and added to rect().fRight ##
#Param dy subtracted from rect().fTop, and added to rect().fBottom ##
#Example
// incomplete
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
for (int index = 0; index < 25; ++index) {
canvas->drawRRect(rrect, paint);
rrect.outset(3, 3);
}
##
#SeeAlso incomplete
#SeeAlso inset offset makeOffset
#Method ##
# ------------------------------------------------------------------------------
#Method void offset(SkScalar dx, SkScalar dy)
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # offsets bounds and radii ##
Translate the rrect by (dx, dy).
Translates the rrect by (dx, dy).
#Param dx incomplete ##
#Param dy incomplete ##
#Param dx offset added to rect().fLeft and rect().fRight ##
#Param dy offset added to rect().fTop and rect().fBottom ##
#Example
// incomplete
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
for (int index = 0; index < 25; ++index) {
canvas->drawRRect(rrect, paint);
rrect.offset(3, 3);
}
##
#SeeAlso incomplete
#SeeAlso makeOffset inset outset
#Method ##
# ------------------------------------------------------------------------------
#Method SkRRect SK_WARN_UNUSED_RESULT makeOffset(SkScalar dx, SkScalar dy) const
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # offsets bounds and radii ##
#Param dx incomplete ##
#Param dy incomplete ##
#Param dx offset added to rect().fLeft and rect().fRight ##
#Param dy offset added to rect().fTop and rect().fBottom ##
#Return incomplete ##
#Return Round_Rect bounds offset by (dx, dy), with unchanged corner radii ##
#Example
// incomplete
SkPaint paint;
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style);
SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);
for (int index = 0; index < 25; ++index) {
canvas->drawRRect(rrect, paint);
rrect = rrect.makeOffset(-3, 3);
}
##
#SeeAlso incomplete
#SeeAlso offset inset outset
#Method ##
# ------------------------------------------------------------------------------
#Method bool contains(const SkRect& rect) const
#In incomplete
#Line # incomplete ##
#In Intersection
#Line # returns true if Rect is inside ##
Returns true if 'rect' is wholy inside the RR, and both
are not empty.
Returns true if rect is inside the bounds and corner radii, and if
Round_Rect and rect are not empty.
#Param rect incomplete ##
#Param rect area tested for containment ##
#Return incomplete ##
#Return true if Round_Rect contains rect ##
#Example
// incomplete
##
#SeeAlso incomplete
#SeeAlso SkRect::contains
#Method ##
# ------------------------------------------------------------------------------
#Method bool isValid() const
#In incomplete
#In Utility
#Line # incomplete ##
#Return incomplete ##
@ -1185,7 +1334,7 @@ are not empty.
# ------------------------------------------------------------------------------
#Method size_t writeToMemory(void* buffer) const
#In incomplete
#In Utility
#Line # incomplete ##
Write the rrect into the specified buffer. This is guaranteed to always
@ -1207,7 +1356,7 @@ a multiple of 4. Return kSizeInMemory.
# ------------------------------------------------------------------------------
#Method size_t readFromMemory(const void* buffer, size_t length)
#In incomplete
#In Utility
#Line # incomplete ##
Reads the rrect from the specified buffer.
@ -1234,19 +1383,19 @@ and that value is guaranteed to always be a multiple of 4.
# ------------------------------------------------------------------------------
#Method bool transform(const SkMatrix& matrix, SkRRect* dst) const
#In incomplete
#Line # incomplete ##
#In Inset_Outset_Offset
#Line # scales and offsets into copy ##
Transform by the specified matrix, and put the result in dst.
Transforms by Round_Rect by matrix, storing result in dst.
Returns true if Round_Rect transformed can be represented by another Round_Rect.
Returns false if matrix contains transformations other than scale and translate.
#Param matrix SkMatrix specifying the transform. Must only contain
scale and/or translate, or this call will fail.
##
#Param dst SkRRect to store the result. It is an error to use this,
which would make this function no longer const.
##
Asserts in debug builds if Round_Rect equals dst.
#Return true on success, false on failure.
#Param matrix SkMatrix specifying the transform ##
#Param dst SkRRect to store the result ##
#Return true if transformation succeeded.
##
#Example
@ -1260,44 +1409,125 @@ Transform by the specified matrix, and put the result in dst.
# ------------------------------------------------------------------------------
#Method void dump(bool asHex) const
#In incomplete
#Line # incomplete ##
#In Utility
#Line # sends text representation to standard output ##
Writes text representation of Round_Rect to standard output.
Set asHex true to generate exact binary representations
of floating point numbers.
#Param asHex incomplete ##
#Param asHex true if SkScalar values are written as hexadecimal ##
#Example
// incomplete
SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});
for (bool dumpAsHex : { false, true } ) {
rrect.dump(dumpAsHex);
}
#StdOut
SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
##
##
#SeeAlso incomplete
#SeeAlso dumpHex SkRect::dump SkPath::dump SkPathMeasure::dump
#Method ##
# ------------------------------------------------------------------------------
#Method void dump() const
#In incomplete
#Line # incomplete ##
#In Utility
#Line # sends text representation using floats to standard output ##
Writes text representation of Round_Rect to standard output. The representation
may be directly compiled as C++ code. Floating point values are written
with limited precision; it may not be possible to reconstruct original
Round_Rect from output.
#Example
// incomplete
SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});
rrect.dump();
SkRect bounds = SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
SkRRect copy;
copy.setRectRadii(bounds, corners);
SkDebugf("rrect is " "%s" "equal to copy\n", rrect == copy ? "" : "not ");
#StdOut
SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
rrect is not equal to copy
##
##
#SeeAlso incomplete
#SeeAlso dumpHex SkRect::dump SkPath::dump SkPathMeasure::dump
#Method ##
# ------------------------------------------------------------------------------
#Method void dumpHex() const
#In incomplete
#Line # incomplete ##
#In Utility
#Line # sends text representation using hexadecimal to standard output ##
Writes text representation of Round_Rect to standard output. The representation
may be directly compiled as C++ code. Floating point values are written
in hexadecimal to preserve their exact bit pattern. The output reconstructs the
original Round_Rect.
#Example
// incomplete
SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});
rrect.dumpHex();
SkRect bounds = SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
SkRRect copy;
copy.setRectRadii(bounds, corners);
SkDebugf("rrect is " "%s" "equal to copy\n", rrect == copy ? "" : "not ");
#StdOut
SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
rrect is equal to copy
##
##
#SeeAlso incomplete
#SeeAlso dump SkRect::dumpHex SkPath::dumpHex
#Method ##

View File

@ -1549,7 +1549,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59)
##
##
#SeeAlso SkIRect::contains
#SeeAlso SkIRect::contains SkRRect::contains
##

View File

@ -823,7 +823,7 @@ component with source if source is darker.
### Example
<div><fiddle-embed name="8c5065ba642f815602000f6b53cefc48"></fiddle-embed></div>
<div><fiddle-embed name="23c974d2759f523ca2f4a78ae86855c3"></fiddle-embed></div>
## <a name='Lighten'>Lighten</a>
@ -838,7 +838,7 @@ component with source if source is lighter.
### Example
<div><fiddle-embed name="bbbe1a7b2587e76f9b2c7996b188a054"></fiddle-embed></div>
<div><fiddle-embed name="95cb08b8c8db3af3b2c9ad56ae7d6bc1"></fiddle-embed></div>
## <a name='Color_Dodge'>Color Dodge</a>
@ -943,7 +943,7 @@ the product of <a href='undocumented#Unpremultiply'>Unpremultiplied</a> source a
### Example
<div><fiddle-embed name="145418271d58afc4070e7df42095c750"></fiddle-embed></div>
<div><fiddle-embed name="eb29c896f008dfbef09e16b85114fc3a"></fiddle-embed></div>
## <a name='Hue'>Hue</a>
@ -957,7 +957,7 @@ source hue, leaving destination luminosity and saturation unchanged.
### Example
<div><fiddle-embed name="ade7ea4d06775cb252a1d15c7a8112d3"></fiddle-embed></div>
<div><fiddle-embed name="41e45570d682397d3b8ff2f51bd9c574"></fiddle-embed></div>
## <a name='Saturation'>Saturation</a>
@ -971,7 +971,7 @@ source hue, leaving destination luminosity and saturation unchanged.
### Example
<div><fiddle-embed name="4a99f5f6738b18afd92a4cb2bd762bf0"></fiddle-embed></div>
<div><fiddle-embed name="a48698975d236573cef512f94a7e360b"></fiddle-embed></div>
## <a name='Color'>Color</a>
@ -985,7 +985,7 @@ source hue and saturation, leaving destination luminosity unchanged.
### Example
<div><fiddle-embed name="953eb53ac00e22d098c1a1290379282e"></fiddle-embed></div>
<div><fiddle-embed name="5d7c6e23a34ca9bf3ba8cda4cdc94cc4"></fiddle-embed></div>
## <a name='Luminosity'>Luminosity</a>
@ -999,7 +999,7 @@ source luminosity, leaving destination hue and saturation unchanged.
### Example
<div><fiddle-embed name="7161fa58aa064ee229ae346cb2e165c4"></fiddle-embed></div>
<div><fiddle-embed name="7d42fe34ae20dd9e12c39dc3950e9989"></fiddle-embed></div>
<a name='SkBlendMode_Name'></a>
## SkBlendMode_Name

View File

@ -524,7 +524,7 @@ SkPath member functions read and modify the structure properties.
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to stream</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dumpHex'>dumpHex</a></td>
@ -2525,7 +2525,7 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to stream</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
@ -5433,7 +5433,7 @@ path.close();
### See Also
<a href='SkRect_Reference#SkRect_dump'>SkRect::dump()</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='SkRRect_Reference#SkRRect_dump'>SkRRect::dump()</a><sup><a href='SkRRect_Reference#SkRRect_dump_2'>[2]</a></sup> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump()</a>
<a href='#SkPath_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect_dump'>SkRect::dump()</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='SkRRect_Reference#SkRRect_dump'>SkRRect::dump()</a><sup><a href='SkRRect_Reference#SkRRect_dump_2'>[2]</a></sup> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump()</a>
---

View File

@ -14,7 +14,7 @@ SkRRect related constants are defined by <code>enum</code>, <code>enum class</co
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_Corner'>Corner</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>corner radii order</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_Type'>Type</a></td>
@ -34,11 +34,11 @@ SkRRect related constants are defined by <code>enum</code>, <code>enum class</co
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft Corner</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of bottom-left corner radii</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kLowerRight_Corner'>kLowerRight Corner</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of bottom-right corner radii</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a></td>
@ -62,11 +62,11 @@ SkRRect related constants are defined by <code>enum</code>, <code>enum class</co
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kUpperLeft_Corner'>kUpperLeft Corner</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of top-left corner radii</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kUpperRight_Corner'>kUpperRight Corner</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of top-right corner radii</td>
</tr>
</table>
@ -157,7 +157,7 @@ SkRRect can be constructed or initialized by these functions, including C++ clas
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_makeOffset'>makeOffset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td>
</tr>
</table>
@ -170,7 +170,7 @@ SkRRect operators inline class member functions with arithmetic equivalents.
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_copy_operator'>operator=(const SkRRect& rrect)</a></td>
@ -178,7 +178,7 @@ SkRRect operators inline class member functions with arithmetic equivalents.
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td>
</tr>
</table>
@ -207,19 +207,19 @@ SkRRect member functions read and modify the structure properties.
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_contains'>contains</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkRect_Reference#Rect'>Rect</a> is inside</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_dump_2'>dump</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_dumpHex'>dumpHex</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using hexadecimal to standard output</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getBounds'>getBounds</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getSimpleRadii'>getSimpleRadii</a></td>
@ -235,7 +235,7 @@ SkRRect member functions read and modify the structure properties.
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_inset'>inset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>insets bounds and radii</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isComplex'>isComplex</a></td>
@ -267,19 +267,19 @@ SkRRect member functions read and modify the structure properties.
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_makeOffset'>makeOffset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_offset'>offset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_outset'>outset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>outsets bounds and radii</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_radii'>radii</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns x-axis and y-axis radii for one corner</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_readFromMemory'>readFromMemory</a></td>
@ -287,7 +287,7 @@ SkRRect member functions read and modify the structure properties.
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_rect'>rect</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setEmpty'>setEmpty</a></td>
@ -315,7 +315,7 @@ SkRRect member functions read and modify the structure properties.
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_transform'>transform</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and offsets into copy</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_type'>type</a></td>
@ -1129,7 +1129,7 @@ sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>. Otherwise, sets to <a
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="4589dd49da291f8cd414db96c12851c7"></fiddle-embed></div>
### See Also
@ -1158,37 +1158,37 @@ The radii are stored: top-left, top-right, bottom-right, bottom-left.
<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRRect_kUpperLeft_Corner'><code>SkRRect::kUpperLeft_Corner</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
incomplete</td>
index of top-left corner radii</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRRect_kUpperRight_Corner'><code>SkRRect::kUpperRight_Corner</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
incomplete</td>
index of top-right corner radii</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRRect_kLowerRight_Corner'><code>SkRRect::kLowerRight_Corner</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
incomplete</td>
index of bottom-right corner radii</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkRRect_kLowerLeft_Corner'><code>SkRRect::kLowerLeft_Corner</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
incomplete</td>
index of bottom-left corner radii</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="9205393f30b156e1507e88aa27f1dd91"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_radii'>radii</a>
<a name='SkRRect_rect'></a>
## rect
@ -1197,17 +1197,33 @@ incomplete
const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_rect'>rect</a>() const
</pre>
Returns bounds. Bounds may have zero width or zero height. Bounds right is
greater than or equal to left; bounds bottom is greater than or equal to top.
Result is identical to <a href='#SkRRect_getBounds'>getBounds</a>.
### Return Value
incomplete
bounding box
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="6831adf4c536047f4709c686feb10c48">
#### Example Output
~~~~
left bounds: (nan) 0
left bounds: (inf) 0
left bounds: (100) 60
left bounds: (50) 50
left bounds: (25) 25
~~~~
</fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_getBounds'>getBounds</a>
---
@ -1218,24 +1234,44 @@ incomplete
<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkRRect_radii'>radii</a>(<a href='#SkRRect_Corner'>Corner</a> corner) const
</pre>
Returns <a href='undocumented#Scalar'>Scalar</a> pair for radius of curve on x-axis and y-axis for one <a href='#SkRRect_radii_corner'>corner</a>.
Both radii may be zero. If not zero, both are positive and finite.
### Parameters
<table> <tr> <td><a name='SkRRect_radii_corner'><code><strong>corner</strong></code></a></td>
<td>incomplete</td>
<td>one of: <a href='#SkRRect_kUpperLeft_Corner'>kUpperLeft Corner</a>, <a href='#SkRRect_kUpperRight_Corner'>kUpperRight Corner</a>,
<a href='#SkRRect_kLowerRight_Corner'>kLowerRight Corner</a>, <a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft Corner</a></td>
</tr>
</table>
### Return Value
incomplete
x-axis and y-axis radii for one <a href='#SkRRect_radii_corner'>corner</a>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="8d5c88478528584913867ada423e0d59"><div>Finite values are scaled proportionately to fit; other values are set to zero.
Scaled values cannot be larger than 25, half the bounding rect width.
Small scaled values are halved to scale in proportion to the y-axis <a href='#SkRRect_radii_corner'>corner</a>
radius, which is twice the bounds height.
</div>
#### Example Output
~~~~
left corner: (nan) 0
left corner: (inf) 0
left corner: (100) 25
left corner: (50) 25
left corner: (25) 12.5
~~~~
</fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_Corner'>Corner</a>
---
@ -1246,17 +1282,21 @@ incomplete
const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_getBounds'>getBounds</a>() const
</pre>
Returns bounds. Bounds may have zero width or zero height. Bounds right is
greater than or equal to left; bounds bottom is greater than or equal to top.
Result is identical to <a href='#SkRRect_rect'>rect</a>.
### Return Value
incomplete
bounding box
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="4577e2dcb086b241bb43d8b89ee0b0dd"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_rect'>rect</a>
---
@ -1267,27 +1307,32 @@ incomplete
bool <a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a>
</pre>
Returns true if bounds and radii in <a href='#SkRRect_equal_operator_a'>a</a> are equal to bounds and radii in <a href='#SkRRect_equal_operator_b'>b</a>.
<a href='#SkRRect_equal_operator_a'>a</a> and <a href='#SkRRect_equal_operator_b'>b</a> are not equal if either contain NaN. <a href='#SkRRect_equal_operator_a'>a</a> and <a href='#SkRRect_equal_operator_b'>b</a> are equal if members
contain zeroes width different signs.
### Parameters
<table> <tr> <td><a name='SkRRect_equal_operator_a'><code><strong>a</strong></code></a></td>
<td>incomplete</td>
<td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td>
</tr>
<tr> <td><a name='SkRRect_equal_operator_b'><code><strong>b</strong></code></a></td>
<td>incomplete</td>
<td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td>
</tr>
</table>
### Return Value
incomplete
true if members are equal
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="df181af37f1d2b06f0f45af73df7b47d"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a>
---
@ -1298,27 +1343,32 @@ incomplete
bool <a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a>
</pre>
Returns true if bounds and radii in <a href='#SkRRect_notequal_operator_a'>a</a> are not equal to bounds and radii in <a href='#SkRRect_notequal_operator_b'>b</a>.
<a href='#SkRRect_notequal_operator_a'>a</a> and <a href='#SkRRect_notequal_operator_b'>b</a> are not equal if either contain NaN. <a href='#SkRRect_notequal_operator_a'>a</a> and <a href='#SkRRect_notequal_operator_b'>b</a> are equal if members
contain zeroes width different signs.
### Parameters
<table> <tr> <td><a name='SkRRect_notequal_operator_a'><code><strong>a</strong></code></a></td>
<td>incomplete</td>
<td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td>
</tr>
<tr> <td><a name='SkRRect_notequal_operator_b'><code><strong>b</strong></code></a></td>
<td>incomplete</td>
<td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td>
</tr>
</table>
### Return Value
incomplete
true if members are not equal
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="505e47b3e6474ebdecdc04c3c2af2c34"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a>
---
@ -1342,23 +1392,23 @@ It is valid for <a href='#SkRRect_inset_dst'>dst</a> == this.
### Parameters
<table> <tr> <td><a name='SkRRect_inset_dx'><code><strong>dx</strong></code></a></td>
<td>incomplete</td>
<td>added to <a href='#SkRRect_rect'>rect</a>.fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>.fRight</td>
</tr>
<tr> <td><a name='SkRRect_inset_dy'><code><strong>dy</strong></code></a></td>
<td>incomplete</td>
<td>added to <a href='#SkRRect_rect'>rect</a>.fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>.fBottom</td>
</tr>
<tr> <td><a name='SkRRect_inset_dst'><code><strong>dst</strong></code></a></td>
<td>incomplete</td>
<td>insets bounds and radii</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="f02f0110d5605dac6d14dcb8d1d8cb6e"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_outset'>outset</a><sup><a href='#SkRRect_outset_2'>[2]</a></sup> <a href='#SkRRect_offset'>offset</a> <a href='#SkRRect_makeOffset'>makeOffset</a>
---
@ -1371,20 +1421,20 @@ void <a href='#SkRRect_inset'>inset</a>(<a href='undocumented#SkScalar'>SkScalar
### Parameters
<table> <tr> <td><a name='SkRRect_inset_2_dx'><code><strong>dx</strong></code></a></td>
<td>incomplete</td>
<td>added to <a href='#SkRRect_rect'>rect</a>.fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>.fRight</td>
</tr>
<tr> <td><a name='SkRRect_inset_2_dy'><code><strong>dy</strong></code></a></td>
<td>incomplete</td>
<td>added to <a href='#SkRRect_rect'>rect</a>.fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>.fBottom</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="da61054322550a2d5ac15114da23bd23"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_outset'>outset</a><sup><a href='#SkRRect_outset_2'>[2]</a></sup> <a href='#SkRRect_offset'>offset</a> <a href='#SkRRect_makeOffset'>makeOffset</a>
---
@ -1404,23 +1454,23 @@ It is valid for <a href='#SkRRect_outset_dst'>dst</a> == this.
### Parameters
<table> <tr> <td><a name='SkRRect_outset_dx'><code><strong>dx</strong></code></a></td>
<td>incomplete</td>
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fLeft, and added to <a href='#SkRRect_rect'>rect</a>.fRight</td>
</tr>
<tr> <td><a name='SkRRect_outset_dy'><code><strong>dy</strong></code></a></td>
<td>incomplete</td>
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fTop, and added to <a href='#SkRRect_rect'>rect</a>.fBottom</td>
</tr>
<tr> <td><a name='SkRRect_outset_dst'><code><strong>dst</strong></code></a></td>
<td>incomplete</td>
<td>outset bounds and radii</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="4d69b6d9c7726c47c42827d79fc7899c"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_inset'>inset</a><sup><a href='#SkRRect_inset_2'>[2]</a></sup> <a href='#SkRRect_offset'>offset</a> <a href='#SkRRect_makeOffset'>makeOffset</a>
---
@ -1433,20 +1483,20 @@ void <a href='#SkRRect_outset'>outset</a>(<a href='undocumented#SkScalar'>SkScal
### Parameters
<table> <tr> <td><a name='SkRRect_outset_2_dx'><code><strong>dx</strong></code></a></td>
<td>incomplete</td>
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fLeft, and added to <a href='#SkRRect_rect'>rect</a>.fRight</td>
</tr>
<tr> <td><a name='SkRRect_outset_2_dy'><code><strong>dy</strong></code></a></td>
<td>incomplete</td>
<td>subtracted from <a href='#SkRRect_rect'>rect</a>.fTop, and added to <a href='#SkRRect_rect'>rect</a>.fBottom</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="4391cced86653dcd0f84439a5c0bb3f2"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_inset'>inset</a><sup><a href='#SkRRect_inset_2'>[2]</a></sup> <a href='#SkRRect_offset'>offset</a> <a href='#SkRRect_makeOffset'>makeOffset</a>
---
@ -1457,25 +1507,25 @@ incomplete
void <a href='#SkRRect_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy)
</pre>
Translate the rrect by (<a href='#SkRRect_offset_dx'>dx</a>, <a href='#SkRRect_offset_dy'>dy</a>).
Translates the rrect by (<a href='#SkRRect_offset_dx'>dx</a>, <a href='#SkRRect_offset_dy'>dy</a>).
### Parameters
<table> <tr> <td><a name='SkRRect_offset_dx'><code><strong>dx</strong></code></a></td>
<td>incomplete</td>
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fLeft and <a href='#SkRRect_rect'>rect</a>.fRight</td>
</tr>
<tr> <td><a name='SkRRect_offset_dy'><code><strong>dy</strong></code></a></td>
<td>incomplete</td>
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fTop and <a href='#SkRRect_rect'>rect</a>.fBottom</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="a45cdd46ef2fe0df62d84d41713e82e2"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_makeOffset'>makeOffset</a> <a href='#SkRRect_inset'>inset</a><sup><a href='#SkRRect_inset_2'>[2]</a></sup> <a href='#SkRRect_outset'>outset</a><sup><a href='#SkRRect_outset_2'>[2]</a></sup>
---
@ -1489,24 +1539,24 @@ incomplete
### Parameters
<table> <tr> <td><a name='SkRRect_makeOffset_dx'><code><strong>dx</strong></code></a></td>
<td>incomplete</td>
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fLeft and <a href='#SkRRect_rect'>rect</a>.fRight</td>
</tr>
<tr> <td><a name='SkRRect_makeOffset_dy'><code><strong>dy</strong></code></a></td>
<td>incomplete</td>
<td>offset added to <a href='#SkRRect_rect'>rect</a>.fTop and <a href='#SkRRect_rect'>rect</a>.fBottom</td>
</tr>
</table>
### Return Value
incomplete
<a href='#RRect'>Round Rect</a> bounds offset by (<a href='#SkRRect_makeOffset_dx'>dx</a>, <a href='#SkRRect_makeOffset_dy'>dy</a>), with unchanged corner radii
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="c433aa41eaf5e419e3349fb970a08151"></fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_offset'>offset</a> <a href='#SkRRect_inset'>inset</a><sup><a href='#SkRRect_inset_2'>[2]</a></sup> <a href='#SkRRect_outset'>outset</a><sup><a href='#SkRRect_outset_2'>[2]</a></sup>
---
@ -1517,19 +1567,19 @@ incomplete
bool <a href='#SkRRect_contains'>contains</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect) const
</pre>
Returns true if 'rect' is wholy inside the RR, and both
are not empty.
Returns true if rect is inside the bounds and corner radii, and if
<a href='#RRect'>Round Rect</a> and rect are not empty.
### Parameters
<table> <tr> <td><a name='SkRRect_contains_rect'><code><strong>rect</strong></code></a></td>
<td>incomplete</td>
<td>area tested for containment</td>
</tr>
</table>
### Return Value
incomplete
true if <a href='#RRect'>Round Rect</a> contains rect
### Example
@ -1537,7 +1587,7 @@ incomplete
### See Also
incomplete
<a href='SkRect_Reference#SkRect_contains'>SkRect::contains</a><sup><a href='SkRect_Reference#SkRect_contains_2'>[2]</a></sup><sup><a href='SkRect_Reference#SkRect_contains_3'>[3]</a></sup>
---
@ -1657,25 +1707,25 @@ incomplete
bool <a href='#SkRRect_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix, <a href='#SkRRect'>SkRRect</a>* dst) const
</pre>
Transform by the specified <a href='#SkRRect_transform_matrix'>matrix</a>, and put the result in <a href='#SkRRect_transform_dst'>dst</a>.
Transforms by <a href='#RRect'>Round Rect</a> by <a href='#SkRRect_transform_matrix'>matrix</a>, storing result in <a href='#SkRRect_transform_dst'>dst</a>.
Returns true if <a href='#RRect'>Round Rect</a> transformed can be represented by another <a href='#RRect'>Round Rect</a>.
Returns false if <a href='#SkRRect_transform_matrix'>matrix</a> contains transformations other than scale and translate.
Asserts in debug builds if <a href='#RRect'>Round Rect</a> equals <a href='#SkRRect_transform_dst'>dst</a>.
### Parameters
<table> <tr> <td><a name='SkRRect_transform_matrix'><code><strong>matrix</strong></code></a></td>
<td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> specifying the transform. Must only contain
scale and/or translate, or this call will fail.
</td>
<td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> specifying the transform</td>
</tr>
<tr> <td><a name='SkRRect_transform_dst'><code><strong>dst</strong></code></a></td>
<td><a href='#SkRRect'>SkRRect</a> to store the result. It is an error to use this,
which would make this function no longer const.
</td>
<td><a href='#SkRRect'>SkRRect</a> to store the result</td>
</tr>
</table>
### Return Value
true on success, false on failure.
true if transformation succeeded.
### Example
@ -1694,20 +1744,48 @@ incomplete
void <a href='#SkRRect_dump'>dump</a>(bool asHex) const
</pre>
Writes text representation of <a href='#RRect'>Round Rect</a> to standard output.
Set <a href='#SkRRect_dump_asHex'>asHex</a> true to generate exact binary representations
of floating point numbers.
### Parameters
<table> <tr> <td><a name='SkRRect_dump_asHex'><code><strong>asHex</strong></code></a></td>
<td>incomplete</td>
<td>true if <a href='undocumented#SkScalar'>SkScalar</a> values are written as hexadecimal</td>
</tr>
</table>
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="265b8d23288dc8026ff788e809360af7">
#### Example Output
~~~~
SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
~~~~
</fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect_dump'>SkRect::dump</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='SkPath_Reference#SkPath_dump'>SkPath::dump</a><sup><a href='SkPath_Reference#SkPath_dump_2'>[2]</a></sup> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump</a>
---
@ -1717,13 +1795,33 @@ incomplete
void <a href='#SkRRect_dump'>dump</a>() const
</pre>
Writes text representation of <a href='#RRect'>Round Rect</a> to standard output. The representation
may be directly compiled as C++ code. Floating point values are written
with limited precision; it may not be possible to reconstruct original
<a href='#RRect'>Round Rect</a> from output.
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="f850423c7c0c4f803d479ecd92221059">
#### Example Output
~~~~
SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
rrect is not equal to copy
~~~~
</fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect_dump'>SkRect::dump</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='SkPath_Reference#SkPath_dump'>SkPath::dump</a><sup><a href='SkPath_Reference#SkPath_dump_2'>[2]</a></sup> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump</a>
---
@ -1734,13 +1832,36 @@ incomplete
void <a href='#SkRRect_dumpHex'>dumpHex</a>() const
</pre>
Writes text representation of <a href='#RRect'>Round Rect</a> to standard output. The representation
may be directly compiled as C++ code. Floating point values are written
in hexadecimal to preserve their exact bit pattern. The output reconstructs the
original <a href='#RRect'>Round Rect</a>.
### Example
<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div>
<div><fiddle-embed name="c73f5e2644d949b859f05bd367883454">
#### Example Output
~~~~
SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
rrect is equal to copy
~~~~
</fiddle-embed></div>
### See Also
incomplete
<a href='#SkRRect_dump'>dump</a><sup><a href='#SkRRect_dump_2'>[2]</a></sup> <a href='SkRect_Reference#SkRect_dumpHex'>SkRect::dumpHex</a> <a href='SkPath_Reference#SkPath_dumpHex'>SkPath::dumpHex</a>
---

View File

@ -2531,7 +2531,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59)
### See Also
<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup>
<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup> <a href='SkRRect_Reference#SkRRect_contains'>SkRRect::contains</a>
---

View File

@ -2701,6 +2701,27 @@
"file": "SkPoint_Reference",
"name": "SkPoint::y()",
"stdout": "pt1.fY == pt1.y()\\n"
},
"SkRRect_dump": {
"code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n for (bool dumpAsHex : { false, true } ) {\n rrect.dump(dumpAsHex);\n }\n}",
"hash": "265b8d23288dc8026ff788e809360af7",
"file": "SkRRect_Reference",
"name": "SkRRect::dump()",
"stdout": "SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);\\nconst SkPoint corners[] = {\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n};\\nSkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab), /* 0.666667 */\\n SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab) /* 0.666667 */);\\nconst SkPoint corners[] = {\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n};\\n"
},
"SkRRect_dumpHex": {
"code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n rrect.dumpHex();\n SkRect bounds = SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */\n SkBits2Float(0x3f2aaaab), /* 0.666667 */\n SkBits2Float(0x3f5b6db7), /* 0.857143 */\n SkBits2Float(0x3f2aaaab) /* 0.666667 */);\n const SkPoint corners[] = {\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n };\n SkRRect copy;\n copy.setRectRadii(bounds, corners);\n SkDebugf(\"rrect is \" \"%s\" \"equal to copy\\n\", rrect == copy ? \"\" : \"not \");\n}",
"hash": "c73f5e2644d949b859f05bd367883454",
"file": "SkRRect_Reference",
"name": "SkRRect::dumpHex",
"stdout": "SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab), /* 0.666667 */\\n SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab) /* 0.666667 */);\\nconst SkPoint corners[] = {\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n};\\nrrect is equal to copy\\n"
},
"SkRRect_dump_2": {
"code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n rrect.dump();\n SkRect bounds = SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);\n const SkPoint corners[] = {\n { 0, 0 },\n { 0, 0 },\n { 0, 0 },\n { 0, 0 },\n };\n SkRRect copy;\n copy.setRectRadii(bounds, corners);\n SkDebugf(\"rrect is \" \"%s\" \"equal to copy\\n\", rrect == copy ? \"\" : \"not \");\n}",
"hash": "f850423c7c0c4f803d479ecd92221059",
"file": "SkRRect_Reference",
"name": "SkRRect::dump_2",
"stdout": "SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);\\nconst SkPoint corners[] = {\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n};\\nrrect is not equal to copy\\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}",
@ -2708,6 +2729,20 @@
"file": "SkRRect_Reference",
"name": "SkRRect::height()",
"stdout": "unsorted height: 5\\nlarge height: inf\\n"
},
"SkRRect_radii": {
"code": "void draw(SkCanvas* canvas) {\n for (SkScalar radiusX : { SK_ScalarNaN, SK_ScalarInfinity, 100.f, 50.f, 25.f} ) {\n SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, radiusX, 200);\n SkDebugf(\"left corner: (%g) %g\\n\", radiusX, rrect1.radii(SkRRect::kUpperLeft_Corner).fX);\n }\n}",
"hash": "8d5c88478528584913867ada423e0d59",
"file": "SkRRect_Reference",
"name": "SkRRect::radii()",
"stdout": "left corner: (nan) 0\\nleft corner: (inf) 0\\nleft corner: (100) 25\\nleft corner: (50) 25\\nleft corner: (25) 12.5\\n"
},
"SkRRect_rect": {
"code": "void draw(SkCanvas* canvas) {\n for (SkScalar left : { SK_ScalarNaN, SK_ScalarInfinity, 100.f, 50.f, 25.f} ) {\n SkRRect rrect1 = SkRRect::MakeRectXY({left, 20, 60, 220}, 50, 200);\n SkDebugf(\"left bounds: (%g) %g\\n\", left, rrect1.rect().fLeft);\n }\n}",
"hash": "6831adf4c536047f4709c686feb10c48",
"file": "SkRRect_Reference",
"name": "SkRRect::rect()",
"stdout": "left bounds: (nan) 0\\nleft bounds: (inf) 0\\nleft bounds: (100) 60\\nleft bounds: (50) 50\\nleft bounds: (25) 25\\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}",
@ -3297,7 +3332,7 @@
"code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kColor);\n}",
"width": 256,
"height": 256,
"hash": "953eb53ac00e22d098c1a1290379282e",
"hash": "5d7c6e23a34ca9bf3ba8cda4cdc94cc4",
"file": "SkBlendMode_Reference",
"name": "Color"
},
@ -3321,7 +3356,7 @@
"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",
"hash": "23c974d2759f523ca2f4a78ae86855c3",
"file": "SkBlendMode_Reference",
"name": "Darken"
},
@ -3393,7 +3428,7 @@
"code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kHue);\n}",
"width": 256,
"height": 256,
"hash": "ade7ea4d06775cb252a1d15c7a8112d3",
"hash": "41e45570d682397d3b8ff2f51bd9c574",
"file": "SkBlendMode_Reference",
"name": "Hue"
},
@ -3401,7 +3436,7 @@
"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",
"hash": "95cb08b8c8db3af3b2c9ad56ae7d6bc1",
"file": "SkBlendMode_Reference",
"name": "Lighten"
},
@ -3409,7 +3444,7 @@
"code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kLuminosity);\n}",
"width": 256,
"height": 256,
"hash": "7161fa58aa064ee229ae346cb2e165c4",
"hash": "7d42fe34ae20dd9e12c39dc3950e9989",
"file": "SkBlendMode_Reference",
"name": "Luminosity"
},
@ -3425,7 +3460,7 @@
"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",
"hash": "eb29c896f008dfbef09e16b85114fc3a",
"file": "SkBlendMode_Reference",
"name": "Multiply"
},
@ -3449,7 +3484,7 @@
"code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kSaturation);\n}",
"width": 256,
"height": 256,
"hash": "4a99f5f6738b18afd92a4cb2bd762bf0",
"hash": "a48698975d236573cef512f94a7e360b",
"file": "SkBlendMode_Reference",
"name": "Saturation"
},
@ -7566,10 +7601,10 @@
"name": "SkRGBToHSV"
},
"SkRRect_Corner": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkRRect rrect;\n SkVector corners[] = {{25, 17}, {17, 19}, {19, 15}, {15, 15}};\n rrect.setRectRadii({30, 10, 100, 60}, corners);\n canvas->drawRRect(rrect, paint);\n paint.setColor(SK_ColorWHITE);\n const SkRect r = rrect.getBounds();\n canvas->drawLine(r.fLeft, r.fTop + rrect.radii(SkRRect::kUpperLeft_Corner).fY,\n r.fRight, r.fTop + rrect.radii(SkRRect::kUpperRight_Corner).fY, paint);\n canvas->drawLine(r.fLeft, r.fBottom - rrect.radii(SkRRect::kLowerLeft_Corner).fY,\n r.fRight, r.fBottom - rrect.radii(SkRRect::kLowerRight_Corner).fY, paint);\n canvas->drawLine(r.fLeft + rrect.radii(SkRRect::kUpperLeft_Corner).fX, r.fTop,\n r.fLeft + rrect.radii(SkRRect::kLowerLeft_Corner).fX, r.fBottom, paint);\n canvas->drawLine(r.fRight - rrect.radii(SkRRect::kUpperRight_Corner).fX, r.fTop,\n r.fRight - rrect.radii(SkRRect::kLowerRight_Corner).fX, r.fBottom, paint);\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"height": 70,
"hash": "9205393f30b156e1507e88aa27f1dd91",
"file": "SkRRect_Reference",
"name": "SkRRect::Corner"
},
@ -7636,30 +7671,6 @@
"hash": "94c298c404fff922ec53a3d7567852a2",
"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 SkRRect rrect;\n SkPaint p;\n p.setStyle(SkPaint::kStroke_Style);\n p.setStrokeWidth(10);\n canvas->drawRRect(rrect, p);\n rrect.setRect({10, 10, 100, 50});\n canvas->drawRRect(rrect, p);\n}",
@ -7670,18 +7681,18 @@
"name": "SkRRect::SkRRect()"
},
"SkRRect_equal_operator": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 200);\n SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 25, 100);\n SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());\n canvas->drawRRect(rrect1, SkPaint());\n std::string str = \"rrect1 \" + std::string(rrect1 == rrect2 ? \"=\" : \"!\") + \"= rrect2\";\n canvas->drawString(str.c_str(), 10, 240, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect2, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect3, SkPaint());\n str = \"rrect2 \" + std::string(rrect2 == rrect3 ? \"=\" : \"!\") + \"= rrect3\";\n canvas->drawString(str.c_str(), -20, 240, SkPaint());\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "df181af37f1d2b06f0f45af73df7b47d",
"file": "SkRRect_Reference",
"name": "SkRRect::operator==(const SkRRect& a, const SkRRect& b)"
},
"SkRRect_getBounds": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkRRect rrect = SkRRect::MakeRectXY({20, 20, 220, 100}, 15, 15);\n canvas->drawRRect(rrect, paint);\n paint.setColor(SK_ColorWHITE);\n rrect = SkRRect::MakeOval(rrect.getBounds());\n canvas->drawRRect(rrect, paint);\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"height": 120,
"hash": "4577e2dcb086b241bb43d8b89ee0b0dd",
"file": "SkRRect_Reference",
"name": "SkRRect::getBounds"
},
@ -7702,18 +7713,18 @@
"name": "SkRRect::getType"
},
"SkRRect_inset": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.inset(-3, 3, &rrect);\n }\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "f02f0110d5605dac6d14dcb8d1d8cb6e",
"file": "SkRRect_Reference",
"name": "SkRRect::inset()"
},
"SkRRect_inset_2": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({10, 20, 180, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.inset(3, 3);\n }\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "da61054322550a2d5ac15114da23bd23",
"file": "SkRRect_Reference",
"name": "SkRRect::inset_2"
},
@ -7782,52 +7793,44 @@
"name": "SkRRect::kSizeInMemory"
},
"SkRRect_makeOffset": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect = rrect.makeOffset(-3, 3);\n }\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "c433aa41eaf5e419e3349fb970a08151",
"file": "SkRRect_Reference",
"name": "SkRRect::makeOffset"
},
"SkRRect_notequal_operator": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 100);\n SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 50, 50);\n SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());\n canvas->drawRRect(rrect1, SkPaint());\n std::string str = \"rrect1 \" + std::string(rrect1 == rrect2 ? \"=\" : \"!\") + \"= rrect2\";\n canvas->drawString(str.c_str(), 10, 240, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect2, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect3, SkPaint());\n str = \"rrect2 \" + std::string(rrect2 == rrect3 ? \"=\" : \"!\") + \"= rrect3\";\n canvas->drawString(str.c_str(), -20, 240, SkPaint());\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "505e47b3e6474ebdecdc04c3c2af2c34",
"file": "SkRRect_Reference",
"name": "SkRRect::operator!=(const SkRRect& a, const SkRRect& b)"
},
"SkRRect_offset": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.offset(3, 3);\n }\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "a45cdd46ef2fe0df62d84d41713e82e2",
"file": "SkRRect_Reference",
"name": "SkRRect::offset()"
},
"SkRRect_outset": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.outset(-3, 3, &rrect);\n }\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "4d69b6d9c7726c47c42827d79fc7899c",
"file": "SkRRect_Reference",
"name": "SkRRect::outset()"
},
"SkRRect_outset_2": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.outset(3, 3);\n }\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "4391cced86653dcd0f84439a5c0bb3f2",
"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}",
@ -7836,14 +7839,6 @@
"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}",
@ -7878,10 +7873,10 @@
"name": "SkRRect::setRect"
},
"SkRRect_setRectRadii": {
"code": "void draw(SkCanvas* canvas) {\n // incomplete\n}",
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setStrokeWidth(15);\n paint.setStrokeCap(SkPaint::kSquare_Cap);\n paint.setAntiAlias(true);\n float intervals[] = { 5, 21.75f };\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));\n SkPath path;\n SkRRect rrect;\n SkVector corners[] = {{15, 17}, {17, 19}, {19, 15}, {15, 15}};\n rrect.setRectRadii({20, 20, 100, 100}, corners);\n path.addRRect(rrect, SkPath::kCW_Direction);\n canvas->drawPath(path, paint);\n path.rewind();\n path.addRRect(rrect, SkPath::kCCW_Direction, 1);\n canvas->translate(120, 0);\n canvas->drawPath(path, paint);\n}",
"width": 256,
"height": 256,
"hash": "882e8e0103048009a25cfc20400492f7",
"hash": "4589dd49da291f8cd414db96c12851c7",
"file": "SkRRect_Reference",
"name": "SkRRect::setRectRadii"
},