diff options
Diffstat (limited to 'src/gpu/batches/GrAAConvexTessellator.h')
-rw-r--r-- | src/gpu/batches/GrAAConvexTessellator.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gpu/batches/GrAAConvexTessellator.h b/src/gpu/batches/GrAAConvexTessellator.h index 2683147912..4ba3a9c78b 100644 --- a/src/gpu/batches/GrAAConvexTessellator.h +++ b/src/gpu/batches/GrAAConvexTessellator.h @@ -12,6 +12,7 @@ #include "SkPaint.h" #include "SkPoint.h" #include "SkScalar.h" +#include "SkStrokeRec.h" #include "SkTDArray.h" class SkCanvas; @@ -31,11 +32,13 @@ class GrAAConvexTessellator; // computeDepthFromEdge requests. class GrAAConvexTessellator { public: - GrAAConvexTessellator(SkScalar strokeWidth = -1.0f, + GrAAConvexTessellator(SkStrokeRec::Style style = SkStrokeRec::kFill_Style, + SkScalar strokeWidth = -1.0f, SkPaint::Join join = SkPaint::Join::kBevel_Join, SkScalar miterLimit = 0.0f) : fSide(SkPoint::kOn_Side) , fStrokeWidth(strokeWidth) + , fStyle(style) , fJoin(join) , fMiterLimit(miterLimit) { } @@ -136,6 +139,13 @@ private: pt->fOrigEdgeId = origEdgeId; } + // Upgrade this ring so that it can behave like an originating ring + void makeOriginalRing() { + for (int i = 0; i < fPts.count(); ++i) { + fPts[i].fOrigEdgeId = fPts[i].fIndex; + } + } + // init should be called after all the indices have been added (via addIdx) void init(const GrAAConvexTessellator& tess); void init(const SkTDArray<SkVector>& norms, const SkTDArray<SkVector>& bisectors); @@ -267,8 +277,9 @@ private: #endif CandidateVerts fCandidateVerts; - // < 0 means filling rather than stroking + // the stroke width is only used for stroke or stroke-and-fill styles SkScalar fStrokeWidth; + SkStrokeRec::Style fStyle; SkPaint::Join fJoin; |