Typemembersbecomeprogressivelylessrestrictive;largervaluesof Typehavemoredegreesoffreedomthansmallervalues.
*/ enum Type {
kEmpty_Type, //!< zero width or height
kRect_Type, //!< non-zero width and height, and zeroed radii
kOval_Type, //!< non-zero width and height filled with radii
kSimple_Type, //!< non-zero width and height with equal radii
kNinePatch_Type, //!< non-zero width and height with axis-aligned radii
kComplex_Type, //!< non-zero width and height with arbitrary radii
kLastType = kComplex_Type, //!< largest Type value
};
Type getType() const {
SkASSERT(this->isValid()); returnstatic_cast<Type>(fType);
}
/** Sets bounds to zero width and height at (0, 0), the origin. Sets cornerradiitozeroandsetstypetokEmpty_Type.
*/ void setEmpty() { *this = SkRRect(); }
/** Sets bounds to sorted rect, and sets corner radii to zero. Ifsetboundshaswidthandheight,andsetstypetokRect_Type; otherwise,setstypetokEmpty_Type.
/** Initializes to oval, x-axis radii to half oval.width(), and all y-axis radii tohalfoval.height().Ifovalboundsisempty,setstokEmpty_Type. Otherwise,setstokOval_Type.
/** Initializes to rounded rectangle with the same radii for all four corners. Ifrectisempty,setstokEmpty_Type. Otherwise,ifxRadandyRadarezero,setstokRect_Type. Otherwise,ifxRadisatleasthalfrect.width()andyRadisatleasthalf rect.height(),setstokOval_Type. Otherwise,setstokSimple_Type.
/** Sets bounds to oval, x-axis radii to half oval.width(), and all y-axis radii tohalfoval.height().Ifovalboundsisempty,setstokEmpty_Type. Otherwise,setstokOval_Type.
/** Sets to rounded rectangle with the same radii for all four corners. Ifrectisempty,setstokEmpty_Type. Otherwise,ifxRadoryRadiszero,setstokRect_Type. Otherwise,ifxRadisatleasthalfrect.width()andyRadisatleasthalf rect.height(),setstokOval_Type. Otherwise,setstokSimple_Type.
/** \enum SkRRect::Corner Theradiiarestored:top-left,top-right,bottom-right,bottom-left.
*/ enum Corner {
kUpperLeft_Corner, //!< index of top-left corner radii
kUpperRight_Corner, //!< index of top-right corner radii
kLowerRight_Corner, //!< index of bottom-right corner radii
kLowerLeft_Corner, //!< index of bottom-left corner radii
};
/** Returns bounds. Bounds may have zero width or zero height. Bounds right is greaterthanorequaltoleft;boundsbottomisgreaterthanorequaltotop. ResultisidenticaltogetBounds().
/** Returns bounds. Bounds may have zero width or zero height. Bounds right is greaterthanorequaltoleft;boundsbottomisgreaterthanorequaltotop. Resultisidenticaltorect().
/** Returns true if bounds and radii values are finite and describe a SkRRect SkRRect::TypethatmatchesgetType().AllSkRRectmethodsconstructvalidtypes, eveniftheinputvaluesarenotvalid.InvalidSkRRectdatacanonly begeneratedbycorruptingmemory.
/** Transforms by SkRRect by matrix and return it if possible. *Ifthematrixdoesnotpreserveaxis-alignment(e.g.rotates,skews,etc.) *thenthisreturns{}.
*/
std::optional<SkRRect> transform(const SkMatrix&) const;
// Deprecated: use optional form bool transform(const SkMatrix& matrix, SkRRect* dst) const;
/** Writes text representation of SkRRect to standard output. SetasHextruetogenerateexactbinaryrepresentations offloatingpointnumbers.
/** Writes text representation of SkRRect to standard output. The representation maybedirectlycompiledasC++code.Floatingpointvaluesarewritten withlimitedprecision;itmaynotbepossibletoreconstructoriginal SkRRectfromoutput.
*/ void dump() const { this->dump(false); }
/** Writes text representation of SkRRect to standard output. The representation maybedirectlycompiledasC++code.Floatingpointvaluesarewritten inhexadecimaltopreservetheirexactbitpattern.Theoutputreconstructsthe originalSkRRect.
*/ void dumpHex() const { this->dump(true); }
void computeType(); bool checkCornerContainment(SkScalar x, SkScalar y) const; // Returns true if the radii had to be scaled to fit rect bool scaleRadii();
SkRect fRect = SkRect::MakeEmpty(); // Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[]
SkVector fRadii[4] = {{0, 0}, {0, 0}, {0,0}, {0,0}}; // use an explicitly sized type so we're sure the class is dense (no uninitialized bytes)
int32_t fType = kEmpty_Type;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.22Bemerkung:
(vorverarbeitet am 2026-09-30)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.