Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: src/gpu/batches/GrAAConvexTessellator.h

Issue 2280943003: fixed 'corners' of paths in GrAAConvexTessellator (Closed)
Patch Set: oops Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/batches/GrAAConvexTessellator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAAConvexTessellator.h
diff --git a/src/gpu/batches/GrAAConvexTessellator.h b/src/gpu/batches/GrAAConvexTessellator.h
index faa251e2a824eccef842a21782c3458fa7133f57..268314791256bcca24c9fbf3bc09cc3e1f4b637a 100644
--- a/src/gpu/batches/GrAAConvexTessellator.h
+++ b/src/gpu/batches/GrAAConvexTessellator.h
@@ -166,12 +166,24 @@ private:
SkTDArray<PointData> fPts;
};
+ // Represents whether a given point is within a curve. A point is inside a curve only if it is
+ // an interior point within a quad, cubic, or conic, or if it is the endpoint of a quad, cubic,
+ // or conic with another curve meeting it at (more or less) the same angle.
+ enum CurveState {
+ // point is a sharp vertex
+ kSharp_CurveState,
+ // endpoint of a curve with the other side's curvature not yet determined
+ kIndeterminate_CurveState,
+ // point is in the interior of a curve
+ kCurve_CurveState
+ };
+
bool movable(int index) const { return fMovable[index]; }
// 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, SkScalar coverage, bool movable, bool isCurve);
+ int addPt(const SkPoint& pt, SkScalar depth, SkScalar coverage, bool movable, CurveState curve);
void popLastPt();
void popFirstPtShuffle();
@@ -191,9 +203,9 @@ private:
int edgeIdx, SkScalar desiredDepth,
SkPoint* result) const;
- void lineTo(SkPoint p, bool isCurve);
+ void lineTo(SkPoint p, CurveState curve);
- void lineTo(const SkMatrix& m, SkPoint p, bool isCurve);
+ void lineTo(const SkMatrix& m, SkPoint p, CurveState curve);
void quadTo(SkPoint pts[3]);
@@ -226,43 +238,43 @@ private:
void validate() const;
// fPts, fCoverages & fMovable should always have the same # of elements
- SkTDArray<SkPoint> fPts;
- SkTDArray<SkScalar> fCoverages;
+ SkTDArray<SkPoint> fPts;
+ SkTDArray<SkScalar> fCoverages;
// movable points are those that can be slid further along their bisector
- SkTDArray<bool> fMovable;
+ SkTDArray<bool> fMovable;
// The outward facing normals for the original polygon
- SkTDArray<SkVector> fNorms;
+ SkTDArray<SkVector> fNorms;
// 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;
+ SkTDArray<SkVector> fBisectors;
// Tracks whether a given point is interior to a curve. Such points are
// assumed to have shallow curvature.
- SkTDArray<bool> fIsCurve;
+ SkTDArray<CurveState> fCurveState;
- SkPoint::Side fSide; // winding of the original polygon
+ SkPoint::Side fSide; // winding of the original polygon
// The triangulation of the points
- SkTDArray<int> fIndices;
+ SkTDArray<int> fIndices;
- Ring fInitialRing;
+ Ring fInitialRing;
#if GR_AA_CONVEX_TESSELLATOR_VIZ
// When visualizing save all the rings
- SkTDArray<Ring*> fRings;
+ SkTDArray<Ring*> fRings;
#else
- Ring fRings[2];
+ Ring fRings[2];
#endif
- CandidateVerts fCandidateVerts;
+ CandidateVerts fCandidateVerts;
// < 0 means filling rather than stroking
- SkScalar fStrokeWidth;
+ SkScalar fStrokeWidth;
- SkPaint::Join fJoin;
+ SkPaint::Join fJoin;
- SkScalar fMiterLimit;
+ SkScalar fMiterLimit;
- SkTDArray<SkPoint> fPointBuffer;
+ SkTDArray<SkPoint> fPointBuffer;
};
« no previous file with comments | « no previous file | src/gpu/batches/GrAAConvexTessellator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698