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 "SkTypeface.h" | 8 #include "SkTypeface.h" |
9 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 paint.setLCDRenderText(true); | 42 paint.setLCDRenderText(true); |
43 //With freetype the default (normal hinting) can be really ugly. | 43 //With freetype the default (normal hinting) can be really ugly. |
44 //Most distros now set slight (vertical hinting only) in any event. | 44 //Most distros now set slight (vertical hinting only) in any event. |
45 paint.setHinting(SkPaint::kSlight_Hinting); | 45 paint.setHinting(SkPaint::kSlight_Hinting); |
46 SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromName("Times Roman",
SkTypeface::kNormal))); | 46 SkSafeUnref(paint.setTypeface(SkTypeface::CreateFromName("Times Roman",
SkTypeface::kNormal))); |
47 | 47 |
48 const char* text = "Hamburgefons ooo mmm"; | 48 const char* text = "Hamburgefons ooo mmm"; |
49 const size_t textLen = strlen(text); | 49 const size_t textLen = strlen(text); |
50 | 50 |
51 for (int j = 0; j < 2; ++j) { | 51 for (int j = 0; j < 2; ++j) { |
52 for (int i = 0; i < 6; ++i) { | 52 // This used to do 6 iterations but it causes the N4 to crash in the
MSAA4 config. |
| 53 for (int i = 0; i < 5; ++i) { |
53 SkScalar x = SkIntToScalar(10); | 54 SkScalar x = SkIntToScalar(10); |
54 SkScalar y = SkIntToScalar(20); | 55 SkScalar y = SkIntToScalar(20); |
55 | 56 |
56 SkAutoCanvasRestore acr(canvas, true); | 57 SkAutoCanvasRestore acr(canvas, true); |
57 canvas->translate(SkIntToScalar(50 + i * 230), | 58 canvas->translate(SkIntToScalar(50 + i * 230), |
58 SkIntToScalar(20)); | 59 SkIntToScalar(20)); |
59 rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10); | 60 rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10); |
60 | 61 |
61 { | 62 { |
62 SkPaint p; | 63 SkPaint p; |
(...skipping 20 matching lines...) Expand all Loading... |
83 private: | 84 private: |
84 typedef GM INHERITED; | 85 typedef GM INHERITED; |
85 }; | 86 }; |
86 | 87 |
87 ////////////////////////////////////////////////////////////////////////////// | 88 ////////////////////////////////////////////////////////////////////////////// |
88 | 89 |
89 static GM* MyFactory(void*) { return new FontScalerGM; } | 90 static GM* MyFactory(void*) { return new FontScalerGM; } |
90 static GMRegistry reg(MyFactory); | 91 static GMRegistry reg(MyFactory); |
91 | 92 |
92 } | 93 } |
OLD | NEW |