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

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

Issue 2301353004: Make AALinearizingConvexPathRenderer able to handle stroke and fill (Closed)
Patch Set: Fix bug Created 4 years, 3 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 268314791256bcca24c9fbf3bc09cc3e1f4b637a..4ba3a9c78b17c7348fbf46d6d83903fb3e5597d4 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;
« 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