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

Side by Side Diff: gm/dashing.cpp

Issue 1808203003: make sausages rounder and portable (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 527 }
528 canvas->drawPath(wavy, p); 528 canvas->drawPath(wavy, p);
529 } 529 }
530 530
531 DEF_SIMPLE_GM(dashtextcaps, canvas, 512, 512) { 531 DEF_SIMPLE_GM(dashtextcaps, canvas, 512, 512) {
532 SkPaint p; 532 SkPaint p;
533 p.setAntiAlias(true); 533 p.setAntiAlias(true);
534 p.setStyle(SkPaint::kStroke_Style); 534 p.setStyle(SkPaint::kStroke_Style);
535 p.setStrokeWidth(10); 535 p.setStrokeWidth(10);
536 p.setStrokeCap(SkPaint::kRound_Cap); 536 p.setStrokeCap(SkPaint::kRound_Cap);
537 p.setStrokeJoin(SkPaint::kRound_Join);
537 p.setTextSize(100); 538 p.setTextSize(100);
538 p.setARGB(0xff, 0xbb, 0x00, 0x00); 539 p.setARGB(0xff, 0xbb, 0x00, 0x00);
540 sk_tool_utils::set_portable_typeface(&p);
539 const SkScalar intervals[] = { 12, 12 }; 541 const SkScalar intervals[] = { 12, 12 };
540 p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals ), 0))->unref(); 542 p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals ), 0))->unref();
541 canvas->drawText("Sausages", 8, 10, 90, p); 543 canvas->drawText("Sausages", 8, 10, 90, p);
542 canvas->drawLine(8, 120, 456, 120, p); 544 canvas->drawLine(8, 120, 456, 120, p);
543 } 545 }
544 546
545 ////////////////////////////////////////////////////////////////////////////// 547 //////////////////////////////////////////////////////////////////////////////
546 548
547 DEF_GM(return new DashingGM;) 549 DEF_GM(return new DashingGM;)
548 DEF_GM(return new Dashing2GM;) 550 DEF_GM(return new Dashing2GM;)
549 DEF_GM(return new Dashing3GM;) 551 DEF_GM(return new Dashing3GM;)
550 DEF_GM(return new Dashing4GM;) 552 DEF_GM(return new Dashing4GM;)
551 DEF_GM(return new Dashing5GM(true);) 553 DEF_GM(return new Dashing5GM(true);)
552 DEF_GM(return new Dashing5GM(false);) 554 DEF_GM(return new Dashing5GM(false);)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698