OLD | NEW |
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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 521 |
522 SkPath wavy; | 522 SkPath wavy; |
523 wavy.moveTo(-10000, 100); | 523 wavy.moveTo(-10000, 100); |
524 for (SkScalar i = -10000; i < 10000; i += 20) { | 524 for (SkScalar i = -10000; i < 10000; i += 20) { |
525 wavy.quadTo(i + 5, 95, i + 10, 100); | 525 wavy.quadTo(i + 5, 95, i + 10, 100); |
526 wavy.quadTo(i + 15, 105, i + 20, 100); | 526 wavy.quadTo(i + 15, 105, i + 20, 100); |
527 } | 527 } |
528 canvas->drawPath(wavy, p); | 528 canvas->drawPath(wavy, p); |
529 } | 529 } |
530 | 530 |
| 531 DEF_SIMPLE_GM(dashtextcaps, canvas, 512, 512) { |
| 532 SkPaint p; |
| 533 p.setAntiAlias(true); |
| 534 p.setStyle(SkPaint::kStroke_Style); |
| 535 p.setStrokeWidth(10); |
| 536 p.setStrokeCap(SkPaint::kRound_Cap); |
| 537 p.setTextSize(100); |
| 538 p.setARGB(0xff, 0xbb, 0x00, 0x00); |
| 539 const SkScalar intervals[] = { 12, 12 }; |
| 540 p.setPathEffect(SkDashPathEffect::Create(intervals, SK_ARRAY_COUNT(intervals
), 0))->unref(); |
| 541 canvas->drawText("Sausages", 8, 10, 90, p); |
| 542 canvas->drawLine(8, 120, 456, 120, p); |
| 543 } |
| 544 |
531 ////////////////////////////////////////////////////////////////////////////// | 545 ////////////////////////////////////////////////////////////////////////////// |
532 | 546 |
533 DEF_GM(return new DashingGM;) | 547 DEF_GM(return new DashingGM;) |
534 DEF_GM(return new Dashing2GM;) | 548 DEF_GM(return new Dashing2GM;) |
535 DEF_GM(return new Dashing3GM;) | 549 DEF_GM(return new Dashing3GM;) |
536 DEF_GM(return new Dashing4GM;) | 550 DEF_GM(return new Dashing4GM;) |
537 DEF_GM(return new Dashing5GM(true);) | 551 DEF_GM(return new Dashing5GM(true);) |
538 DEF_GM(return new Dashing5GM(false);) | 552 DEF_GM(return new Dashing5GM(false);) |
OLD | NEW |