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 #include "gm.h" | 7 #include "gm.h" |
8 #include "Resources.h" | 8 #include "Resources.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkStream.h" | 10 #include "SkStream.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SkCanvas* canvas = inputCanvas; | 63 SkCanvas* canvas = inputCanvas; |
64 #endif | 64 #endif |
65 // apply global scale to test glyph positioning | 65 // apply global scale to test glyph positioning |
66 canvas->scale(1.05f, 1.05f); | 66 canvas->scale(1.05f, 1.05f); |
67 canvas->clear(0xffffffff); | 67 canvas->clear(0xffffffff); |
68 | 68 |
69 SkPaint paint; | 69 SkPaint paint; |
70 paint.setAntiAlias(true); | 70 paint.setAntiAlias(true); |
71 paint.setSubpixelText(true); | 71 paint.setSubpixelText(true); |
72 | 72 |
73 sk_tool_utils::set_portable_typeface(&paint, "serif", SkTypeface::kNorma
l); | 73 sk_tool_utils::set_portable_typeface(&paint, "serif"); |
74 | 74 |
75 const char* text = "Hamburgefons"; | 75 const char* text = "Hamburgefons"; |
76 const size_t textLen = strlen(text); | 76 const size_t textLen = strlen(text); |
77 | 77 |
78 // check scaling up | 78 // check scaling up |
79 SkScalar x = SkIntToScalar(0); | 79 SkScalar x = SkIntToScalar(0); |
80 SkScalar y = SkIntToScalar(78); | 80 SkScalar y = SkIntToScalar(78); |
81 for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) { | 81 for (size_t i = 0; i < SK_ARRAY_COUNT(textSizes); ++i) { |
82 SkAutoCanvasRestore acr(canvas, true); | 82 SkAutoCanvasRestore acr(canvas, true); |
83 canvas->translate(x, y); | 83 canvas->translate(x, y); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 | 211 |
212 private: | 212 private: |
213 sk_sp<SkTypeface> fEmojiTypeface; | 213 sk_sp<SkTypeface> fEmojiTypeface; |
214 const char* fEmojiText; | 214 const char* fEmojiText; |
215 | 215 |
216 typedef skiagm::GM INHERITED; | 216 typedef skiagm::GM INHERITED; |
217 }; | 217 }; |
218 | 218 |
219 DEF_GM(return new DFTextGM;) | 219 DEF_GM(return new DFTextGM;) |
OLD | NEW |