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

Unified Diff: gm/dashing.cpp

Issue 1776983002: pass cap to dash text (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/core/SkPaint.cpp » ('j') | src/core/SkScalerContext.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/dashing.cpp
diff --git a/gm/dashing.cpp b/gm/dashing.cpp
index e44e356b8765cd214e0503fd2333e37e603b203a..0e249c7d61cae7248206b857e2d31d63e12d41df 100644
--- a/gm/dashing.cpp
+++ b/gm/dashing.cpp
@@ -528,6 +528,20 @@ DEF_SIMPLE_GM(longwavyline, canvas, 512, 512) {
canvas->drawPath(wavy, p);
}
+DEF_SIMPLE_GM(dashtextcaps, canvas, 512, 512) {
+ SkPaint p;
+ p.setAntiAlias(true);
+ p.setStyle(SkPaint::kStroke_Style);
+ p.setStrokeWidth(10);
+ p.setStrokeCap(SkPaint::kRound_Cap);
+ p.setTextSize(100);
+ p.setARGB(0xff, 0xbb, 0x00, 0x00);
+ const SkScalar intervals[] = { 12, 12 };
+ p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals), 0))->unref();
+ canvas->drawText("Sausages", 8, 10, 90, p);
+ canvas->drawLine(8, 120, 456, 120, p);
+}
+
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new DashingGM;)
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | src/core/SkScalerContext.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698