OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkPath.h" | 10 #include "SkPath.h" |
11 #include "SkTypeface.h" | 11 #include "SkTypeface.h" |
12 | 12 |
13 /* The hiragino_maru_goth_pro_e path was generated with Mac-specific code: | 13 /* The hiragino_maru_goth_pro_e path was generated with Mac-specific code: |
14 * | 14 * |
15 * paint.setTextSize(SkIntToScalar(100)); | 15 * paint.setTextSize(SkIntToScalar(100)); |
16 * paint.setTypeface(SkTypeface::CreateFromName("Hiragino Maru Gothic Pro")); | 16 * paint.setTypeface(SkTypeface::CreateFromName("Hiragino Maru Gothic Pro")); |
17 * paint.getTextPath("e", 1, 50, 50, &path); | 17 * paint.getTextPath("e", 1, 50, 50, &path); |
18 * | 18 * |
19 * The path data is duplicated here to allow the test to | 19 * The path data is duplicated here to allow the test to |
20 * run on all platforms and to remove the bug dependency | 20 * run on all platforms and to remove the bug dependency |
21 * should future Macs edit or delete the font. | 21 * should future Macs edit or delete the font. |
22 */ | 22 */ |
23 static SkPath hiragino_maru_goth_pro_e() { | 23 static SkPath hiragino_maru_goth_pro_e() { |
24 SkPath path; | 24 SkPath path; |
25 path.moveTo(98.6f, 24.7f); | 25 path.moveTo(98.6f, 24.7f); |
26 path.cubicTo(101.7f, 24.7f, 103.6f, 22.8f, 103.6f, 19.2f); | 26 path.cubicTo(101.7f, 24.7f, 103.6f, 22.8f, 103.6f, 19.2f); |
27 path.cubicTo(103.6f, 18.9f, 103.6f, 18.7f, 103.6f, 18.4f); | 27 path.cubicTo(103.6f, 18.9f, 103.6f, 18.7f, 103.6f, 18.4f); |
28 path.cubicTo(102.6f, 5.3f, 94.4f, -6.1f, 79.8f, -6.1f); | 28 path.cubicTo(102.6f, 5.3f, 94.4f, -6.1f, 79.8f, -6.1f); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 path.moveTo(10, 10); path.lineTo(30, 30); | 85 path.moveTo(10, 10); path.lineTo(30, 30); |
86 path.addOval(r); | 86 path.addOval(r); |
87 r.offset(50, 20); | 87 r.offset(50, 20); |
88 path.addOval(r); | 88 path.addOval(r); |
89 test_rev(canvas, path); | 89 test_rev(canvas, path); |
90 | 90 |
91 path = hiragino_maru_goth_pro_e(); | 91 path = hiragino_maru_goth_pro_e(); |
92 canvas->translate(0, 100); | 92 canvas->translate(0, 100); |
93 test_rev(canvas, path); | 93 test_rev(canvas, path); |
94 } | 94 } |
OLD | NEW |