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

Unified Diff: src/gpu/GrStrokeInfo.h

Issue 1100073003: Extract gpu line dashing to GrDashLinePathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 8 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 | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/GrStrokeInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStrokeInfo.h
diff --git a/src/gpu/GrStrokeInfo.h b/src/gpu/GrStrokeInfo.h
index 2bd056ea3cadba0e77d35bb50f42a9f9d0dea3af..dd942c52e96be8ba39fd2f1f3e14c20cd80bdd87 100644
--- a/src/gpu/GrStrokeInfo.h
+++ b/src/gpu/GrStrokeInfo.h
@@ -44,6 +44,15 @@ public:
this->init(paint);
}
+ GrStrokeInfo& operator=(const GrStrokeInfo& other) {
+ fStroke = other.fStroke;
+ fDashInfo = other.fDashInfo;
+ fDashType = other.fDashType;
+ fIntervals.reset(other.dashCount());
+ memcpy(fIntervals.get(), other.fIntervals.get(), other.dashCount() * sizeof(SkScalar));
+ return *this;
+ }
+
const SkStrokeRec& getStrokeRec() const { return fStroke; }
SkStrokeRec* getStrokeRecPtr() { return &fStroke; }
@@ -73,6 +82,8 @@ public:
return (!fStroke.isFillStyle() && SkPathEffect::kDash_DashType == fDashType);
}
+ bool isFillStyle() const { return fStroke.isFillStyle(); }
+
int32_t dashCount() const {
return fDashInfo.fCount;
}
@@ -83,6 +94,14 @@ public:
const SkPathEffect::DashInfo& getDashInfo() const { return fDashInfo; }
+ /** Applies the dash to a path, if the stroke info has dashing.
+ * @return true if the dash ingwas applied (dst and dstStrokeInfo will be modified).
+ * false if the stroke info did not have dashing. The dst and dstStrokeInfo
+ * will be unmodified. The stroking in the SkStrokeRec might still
+ * be applicable.
+ */
+ bool applyDash(SkPath* dst, GrStrokeInfo* dstStrokeInfo, const SkPath& src) const;
+
private:
void init(const SkPaint& paint) {
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/GrStrokeInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698