diff options
author | ethannicholas <ethannicholas@google.com> | 2015-06-10 12:11:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-10 12:11:17 -0700 |
commit | 1a1b3ac0d4feecb0fefa8a07c7abf3471c96f545 (patch) | |
tree | 4c03c8b596f18b5367e57624cfa0194d1e0107b0 /src/gpu/GrAAConvexTessellator.h | |
parent | 523beb7fd91e6a171a69f44cf6cc8e8d88a22dd0 (diff) |
Added GrAAFlatteningConvexPathRenderer.
This is an alternate version of GrAAConvexPathRenderer which handles
curves by first flattening them to straight lines.
BUG=skia:
Review URL: https://codereview.chromium.org/1158803002
Diffstat (limited to 'src/gpu/GrAAConvexTessellator.h')
-rw-r--r-- | src/gpu/GrAAConvexTessellator.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gpu/GrAAConvexTessellator.h b/src/gpu/GrAAConvexTessellator.h index 707995fadd..93e8d4ba61 100644 --- a/src/gpu/GrAAConvexTessellator.h +++ b/src/gpu/GrAAConvexTessellator.h @@ -165,7 +165,7 @@ private: // Movable points are those that can be slid along their bisector. // Basically, a point is immovable if it is part of the original // polygon or it results from the fusing of two bisectors. - int addPt(const SkPoint& pt, SkScalar depth, bool movable); + int addPt(const SkPoint& pt, SkScalar depth, bool movable, bool isCurve); void popLastPt(); void popFirstPtShuffle(); @@ -185,6 +185,14 @@ private: int edgeIdx, SkScalar desiredDepth, SkPoint* result) const; + void lineTo(const SkMatrix& m, SkPoint p, bool isCurve); + + void quadTo(const SkMatrix& m, SkPoint pts[3]); + + void cubicTo(const SkMatrix& m, SkPoint pts[4]); + + void conicTo(const SkMatrix& m, SkPoint pts[3], SkScalar w); + void terminate(const Ring& lastRing); // return false on failure/degenerate path @@ -217,6 +225,11 @@ private: // The inward facing bisector at each point in the original polygon. Only // needed for exterior ring creation and then handed off to the initial ring. SkTDArray<SkVector> fBisectors; + + // Tracks whether a given point is interior to a curve. Such points are + // assumed to have shallow curvature. + SkTDArray<bool> fIsCurve; + SkPoint::Side fSide; // winding of the original polygon // The triangulation of the points @@ -233,10 +246,16 @@ private: SkScalar fTargetDepth; + SkTDArray<SkPoint> fPointBuffer; + // If some goes wrong with the inset computation the tessellator will // truncate the creation of the inset polygon. In this case the depth // check will complain. SkDEBUGCODE(bool fShouldCheckDepths;) + + SkDEBUGCODE(SkScalar fMinCross;) + + SkDEBUGCODE(SkScalar fMaxCross;) }; |