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

Unified Diff: src/gpu/GrStrokeInfo.h

Issue 1108053004: Add dash lines batch unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@randbatch1
Patch Set: tweaks 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
Index: src/gpu/GrStrokeInfo.h
diff --git a/src/gpu/GrStrokeInfo.h b/src/gpu/GrStrokeInfo.h
index dd942c52e96be8ba39fd2f1f3e14c20cd80bdd87..f008dc6a5d27183cb7da349a0cc22daddd21b9ba 100644
--- a/src/gpu/GrStrokeInfo.h
+++ b/src/gpu/GrStrokeInfo.h
@@ -38,7 +38,6 @@ public:
this->init(paint);
}
-
explicit GrStrokeInfo(const SkPaint& paint) :
fStroke(paint), fDashType(SkPathEffect::kNone_DashType) {
this->init(paint);
@@ -78,6 +77,24 @@ public:
return false;
}
+ /*
+ * Like the above, but sets with an explicit SkPathEffect::DashInfo
+ */
+ bool setDashInfo(const SkPathEffect::DashInfo& info) {
+ if (!fStroke.isFillStyle()) {
+ SkASSERT(!fStroke.isFillStyle());
+ fDashInfo.fCount = info.fCount;
+ fDashInfo.fPhase = info.fPhase;
+ fIntervals.reset(info.fCount);
+ for (int i = 0; i < info.fCount; i++) {
+ fIntervals[i] = info.fIntervals[i];
+ }
+ fDashInfo.fIntervals = fIntervals.get();
+ return true;
+ }
+ return false;
+ }
+
bool isDashed() const {
return (!fStroke.isFillStyle() && SkPathEffect::kDash_DashType == fDashType);
}
« no previous file with comments | « include/gpu/GrTestUtils.h ('k') | src/gpu/GrTestUtils.cpp » ('j') | src/gpu/GrTestUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698