Flutter Engine
The Flutter Engine
|
#include <SkPathRef.h>
Classes | |
class | Editor |
class | Iter |
Public Types | |
enum class | PathType : uint8_t { kGeneral , kOval , kRRect , kArc } |
using | PointsArray = skia_private::STArray< 4, SkPoint > |
using | VerbsArray = skia_private::STArray< 4, uint8_t > |
using | ConicWeightsArray = skia_private::STArray< 2, SkScalar > |
Public Member Functions | |
SkPathRef (PointsArray points, VerbsArray verbs, ConicWeightsArray weights, unsigned segmentMask) | |
bool | isFinite () const |
uint32_t | getSegmentMasks () const |
bool | isOval (SkRect *rect, bool *isCCW, unsigned *start) const |
bool | isRRect (SkRRect *rrect, bool *isCCW, unsigned *start) const |
bool | isArc (SkArc *arc) const |
bool | hasComputedBounds () const |
const SkRect & | getBounds () const |
SkRRect | getRRect () const |
~SkPathRef () | |
int | countPoints () const |
int | countVerbs () const |
int | countWeights () const |
size_t | approximateBytesUsed () const |
const uint8_t * | verbsBegin () const |
const uint8_t * | verbsEnd () const |
const SkPoint * | points () const |
const SkPoint * | pointsEnd () const |
const SkScalar * | conicWeights () const |
const SkScalar * | conicWeightsEnd () const |
uint8_t | atVerb (int index) const |
const SkPoint & | atPoint (int index) const |
bool | operator== (const SkPathRef &ref) const |
void | interpolate (const SkPathRef &ending, SkScalar weight, SkPathRef *out) const |
uint32_t | genID (uint8_t fillType) const |
void | addGenIDChangeListener (sk_sp< SkIDChangeListener >) |
int | genIDChangeListenerCount () |
bool | dataMatchesVerbs () const |
bool | isValid () const |
SkDEBUGCODE (void validate() const { SkASSERT(this->isValid());}) void reset() | |
bool | isInitialEmptyPathRef () const |
Public Member Functions inherited from SkNVRefCnt< SkPathRef > | |
SkNVRefCnt () | |
~SkNVRefCnt () | |
bool | unique () const |
void | ref () const |
void | unref () const |
void | deref () const |
bool | refCntGreaterThan (int32_t threadIsolatedTestCnt) const |
Static Public Member Functions | |
static SkPathRef * | CreateEmpty () |
static void | CreateTransformedCopy (sk_sp< SkPathRef > *dst, const SkPathRef &src, const SkMatrix &matrix) |
static void | Rewind (sk_sp< SkPathRef > *pathRef) |
Friends | |
class | PathRefTest_Private |
class | ForceIsRRect_Private |
class | SkPath |
class | SkPathBuilder |
class | SkPathPriv |
SkPathRef * | sk_create_empty_pathref () |
Holds the path verbs and points. It is versioned by a generation ID. None of its public methods modify the contents. To modify or append to the verbs/points wrap the SkPathRef in an SkPathRef::Editor object. Installing the editor resets the generation ID. It also performs copy-on-write if the SkPathRef is shared by multiple SkPaths. The caller passes the Editor's constructor a pointer to a sk_sp<SkPathRef>, which may be updated to point to a new SkPathRef after the editor's constructor returns.
The points and verbs are stored in a single allocation. The points are at the begining of the allocation while the verbs are stored at end of the allocation, in reverse order. Thus the points and verbs both grow into the middle of the allocation until the meet. To access verb i in the verb array use ref.verbs()[~i] (because verbs() returns a pointer just beyond the first logical verb or the last verb in memory).
Definition at line 55 of file SkPathRef.h.
Definition at line 61 of file SkPathRef.h.
using SkPathRef::PointsArray = skia_private::STArray<4, SkPoint> |
Definition at line 59 of file SkPathRef.h.
using SkPathRef::VerbsArray = skia_private::STArray<4, uint8_t> |
Definition at line 60 of file SkPathRef.h.
|
strong |
|
inline |
Definition at line 70 of file SkPathRef.h.
SkPathRef::~SkPathRef | ( | ) |
Definition at line 67 of file SkPathRef.cpp.
void SkPathRef::addGenIDChangeListener | ( | sk_sp< SkIDChangeListener > | listener | ) |
Definition at line 461 of file SkPathRef.cpp.
size_t SkPathRef::approximateBytesUsed | ( | ) | const |
Definition at line 60 of file SkPathRef.cpp.
Definition at line 342 of file SkPathRef.h.
|
inline |
Convenience methods for getting to a verb or point by index.
Definition at line 341 of file SkPathRef.h.
|
inline |
Definition at line 335 of file SkPathRef.h.
|
inline |
Definition at line 336 of file SkPathRef.h.
|
inline |
Definition at line 309 of file SkPathRef.h.
|
inline |
Definition at line 310 of file SkPathRef.h.
|
inline |
Definition at line 311 of file SkPathRef.h.
|
static |
Gets a path ref with no verbs or points.
Definition at line 76 of file SkPathRef.cpp.
|
static |
Transforms a path ref by a matrix, allocating a new one only if necessary.
Definition at line 140 of file SkPathRef.cpp.
bool SkPathRef::dataMatchesVerbs | ( | ) | const |
Definition at line 680 of file SkPathRef.cpp.
uint32_t SkPathRef::genID | ( | uint8_t | fillType | ) | const |
Gets an ID that uniquely identifies the contents of the path ref. If two path refs have the same ID then they have the same verbs and points. However, two path refs may have the same contents but different genIDs. skbug.com/1762 for background on why fillType is necessary (for now).
Definition at line 440 of file SkPathRef.cpp.
int SkPathRef::genIDChangeListenerCount | ( | ) |
Definition at line 468 of file SkPathRef.cpp.
|
inline |
Returns the bounds of the path's points. If the path contains 0 or 1 points, the bounds is set to (0,0,0,0), and isEmpty() will return true. Note: this bounds may be larger than the actual shape, since curves do not extend as far as their control points.
Definition at line 283 of file SkPathRef.h.
SkRRect SkPathRef::getRRect | ( | ) | const |
Definition at line 475 of file SkPathRef.cpp.
|
inline |
Returns a mask, where each bit corresponding to a SegmentMask is set if the path contains 1 or more segments of that type. Returns 0 for an empty path (no segments).
Definition at line 228 of file SkPathRef.h.
|
inline |
Definition at line 274 of file SkPathRef.h.
Definition at line 300 of file SkPathRef.cpp.
|
inline |
Definition at line 261 of file SkPathRef.h.
|
inline |
Returns true if all of the points in this path are finite, meaning there are no infinities and no NaNs.
Definition at line 216 of file SkPathRef.h.
|
inline |
Definition at line 368 of file SkPathRef.h.
|
inline |
Returns true if the path is an oval.
rect | returns the bounding rect of this oval. It's a circle if the height and width are the same. |
isCCW | is the oval CCW (or CW if false). |
start | indicates where the contour starts on the oval (see SkPath::addOval for intepretation of the index). |
Definition at line 243 of file SkPathRef.h.
bool SkPathRef::isRRect | ( | SkRRect * | rrect, |
bool * | isCCW, | ||
unsigned * | start | ||
) | const |
Definition at line 516 of file SkPathRef.cpp.
bool SkPathRef::isValid | ( | ) | const |
Definition at line 618 of file SkPathRef.cpp.
bool SkPathRef::operator== | ( | const SkPathRef & | ref | ) | const |
Definition at line 247 of file SkPathRef.cpp.
|
inline |
|
inline |
Rollsback a path ref to zero verbs and points with the assumption that the path ref will be repopulated with approximately the same number of verbs and points. A new path ref is created only if necessary.
Definition at line 227 of file SkPathRef.cpp.
Resets this SkPathRef to a clean state.
|
inline |
Returns a pointer one beyond the first logical verb (last verb in memory order).
Definition at line 318 of file SkPathRef.h.
|
inline |
Returns a const pointer to the first verb in memory (which is the last logical verb).
Definition at line 323 of file SkPathRef.h.
|
friend |
Definition at line 578 of file SkPathRef.h.
|
friend |
Definition at line 577 of file SkPathRef.h.
|
friend |
Called the first time someone calls CreateEmpty to actually create the singleton.
|
friend |
Definition at line 579 of file SkPathRef.h.
|
friend |
Definition at line 580 of file SkPathRef.h.
|
friend |
Definition at line 581 of file SkPathRef.h.