OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 9 |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 SkTextBlobBuilder builder; | 25 SkTextBlobBuilder builder; |
26 | 26 |
27 // make textblob. To stress distance fields, we choose sizes appropriat
ely | 27 // make textblob. To stress distance fields, we choose sizes appropriat
ely |
28 SkPaint paint; | 28 SkPaint paint; |
29 paint.setTextSize(162); | 29 paint.setTextSize(162); |
30 const char* text = "A"; | 30 const char* text = "A"; |
31 sk_tool_utils::set_portable_typeface(&paint); | 31 sk_tool_utils::set_portable_typeface(&paint); |
32 | 32 |
33 SkRect bounds; | 33 SkRect bounds; |
34 paint.measureText(text, strlen(text), &bounds); | 34 paint.measureText(text, strlen(text), &bounds); |
35 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, 0);; | 35 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, 0); |
36 | 36 |
37 // Medium | 37 // Medium |
38 SkScalar xOffset = bounds.width() + 5; | 38 SkScalar xOffset = bounds.width() + 5; |
39 paint.setTextSize(72); | 39 paint.setTextSize(72); |
40 text = "B"; | 40 text = "B"; |
41 sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset, 0); | 41 sk_tool_utils::add_to_text_blob(&builder, text, paint, xOffset, 0); |
42 | 42 |
43 paint.measureText(text, strlen(text), &bounds); | 43 paint.measureText(text, strlen(text), &bounds); |
44 SkScalar yOffset = bounds.height(); | 44 SkScalar yOffset = bounds.height(); |
45 | 45 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 static const int kWidth = 1000; | 163 static const int kWidth = 1000; |
164 static const int kHeight = 1200; | 164 static const int kHeight = 1200; |
165 | 165 |
166 typedef GM INHERITED; | 166 typedef GM INHERITED; |
167 }; | 167 }; |
168 | 168 |
169 ////////////////////////////////////////////////////////////////////////////// | 169 ////////////////////////////////////////////////////////////////////////////// |
170 | 170 |
171 DEF_GM( return SkNEW(TextBlobTransforms); ) | 171 DEF_GM( return SkNEW(TextBlobTransforms); ) |
172 } | 172 } |
OLD | NEW |