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

Unified Diff: src/core/SkDraw.cpp

Issue 1491843006: add support for capped hairlines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning Created 5 years 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
« gm/hairlines.cpp ('K') | « gm/hairlines.cpp ('k') | src/core/SkScan.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index e1a49d39b4a582265dda15c430ffbf95578bc297..afa2c9dda95265f8f8fd5f0810681d2bfa3846b8 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1132,9 +1132,23 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint,
}
} else { // hairline
if (paint->isAntiAlias()) {
+ if (SkPaint::kButt_Cap == paint->getStrokeCap()) {
+ proc = SkScan::AntiHairPath;
+ } else {
+ proc = SkScan::AntiHairCapPath;
+ }
+#ifdef SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS
proc = SkScan::AntiHairPath;
+#endif
} else {
- proc = SkScan::HairPath;
+ if (SkPaint::kButt_Cap == paint->getStrokeCap()) {
+ proc = SkScan::HairPath;
+ } else {
+ proc = SkScan::HairCapPath;
+ }
+#ifdef SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS
+ proc = SkScan::AntiHairPath;
+#endif
}
}
proc(*devPathPtr, *fRC, blitter);
« gm/hairlines.cpp ('K') | « gm/hairlines.cpp ('k') | src/core/SkScan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698