// Can be used to join edges together
SkEdge* fNext;
SkEdge* fPrev;
// The current line segment starts at (fX, fFirstY + 0.5). It has slope // fDxDy (yes, run over rise, because this is geared toward horizontal scanlines) // and stops once Y gets to fLastY + 0.5.
SkFixed fX;
SkFixed fDxDy;
// These are integers because they represent a discrete pixel. Mathematically, these are // treated as half way inside the pixel, so 6 -> 6.5.
int32_t fFirstY;
int32_t fLastY;
Type fEdgeType; // Remembers the *initial* edge type
Winding fWinding;
// Represent a straight line with an optional clip. This will always be a single segment. // Returns false if the line has height 0. bool setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip); // call this version if you know you don't have a clip inlinebool setLine(const SkPoint& p0, const SkPoint& p1);
bool hasNextSegment() const { return fSegmentCount != 0;
} // Update fX, fDxDY, fFirstY, and fLastY to represent the segment. It will skip over // any lines that have a height of 0 pixels and return false if there were only 0-height // segments remaining. For quadratic and cubic curves this will involve forward-differencing // (see the subclasses for those values). virtualbool nextSegment();
uint8_t fSegmentCount; // only non-zero for Quad and Cubics // How much to shift the derivatives to multiply by deltaT when doing forward-differencing. // For cubics, this is log_2(N) and for quadratics this is log_2(N) - 1.
uint8_t fCurveShift;
class SkQuadraticEdge final : public SkEdge { public: // Sets up the line segments. Returns false if the line would be of height 0. bool setQuadratic(const SkPoint pts[3]); bool nextSegment() override;
private: // These are the non-rounded points that the current line segment ends at.
SkFixed fQx, fQy; // These represent the first derivatives of the quadratic curve evaluated // at the midpoint of the next line segment. To avoid overflows, we store them as half // their normal value. During the forward-difference step, instead of multiplying by // a deltaT of 1/N, we'll multiply by 2/N instead.
SkFixed fQDxDt, fQDyDt; // These are the second derivatives of the quadratic curve pre-multiplied by 1/N.
SkFixed fQD2xDt2, fQD2yDt2;
// The non-rounded end points for the entire curve. On the last segment, these // will be used instead of the results from our forward-differnce technique // to make sure cumulative error doesn't result in a dramatically different line.
SkFixed fQLastX, fQLastY;
class SkCubicEdge final : public SkEdge { public: // Sets up the line segments. Returns false if the line would be of height 0. bool setCubic(const SkPoint pts[4]); bool nextSegment() override;
private: // These are the non-rounded points that the current line segment ends at.
SkFixed fCx, fCy;
SkFixed fCDxDt, fCDyDt;
SkFixed fCD2xDt2, fCD2yDt2;
SkFixed fCD3xDt3, fCD3yDt3;
// The non-rounded end points for the entire curve. On the last segment, these // will be used instead of the results from our forward-difference technique // to make sure cumulative error doesn't result in a dramatically different line.
SkFixed fCLastX, fCLastY;
uint8_t fCubicDShift; // applied to fCDxDt and fCDyDt only in cubic
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.