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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 p.setAntiAlias(true); | 66 p.setAntiAlias(true); |
67 SkRect r; | 67 SkRect r; |
68 r.set(x - SkIntToScalar(3), SkIntToScalar(15), | 68 r.set(x - SkIntToScalar(3), SkIntToScalar(15), |
69 x - SkIntToScalar(1), SkIntToScalar(280)); | 69 x - SkIntToScalar(1), SkIntToScalar(280)); |
70 canvas->drawRect(r, p); | 70 canvas->drawRect(r, p); |
71 } | 71 } |
72 | 72 |
73 for (int ps = 6; ps <= 22; ps++) { | 73 for (int ps = 6; ps <= 22; ps++) { |
74 paint.setTextSize(SkIntToScalar(ps)); | 74 paint.setTextSize(SkIntToScalar(ps)); |
75 canvas->drawText(text, textLen, x, y, paint); | 75 canvas->drawText(text, textLen, x, y, paint); |
76 y += paint.getFontMetrics(NULL); | 76 y += paint.getFontMetrics(nullptr); |
77 } | 77 } |
78 } | 78 } |
79 canvas->translate(0, SkIntToScalar(360)); | 79 canvas->translate(0, SkIntToScalar(360)); |
80 paint.setSubpixelText(true); | 80 paint.setSubpixelText(true); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 private: | 84 private: |
85 typedef GM INHERITED; | 85 typedef GM INHERITED; |
86 }; | 86 }; |
87 | 87 |
88 ////////////////////////////////////////////////////////////////////////////// | 88 ////////////////////////////////////////////////////////////////////////////// |
89 | 89 |
90 static GM* MyFactory(void*) { return new FontScalerGM; } | 90 static GM* MyFactory(void*) { return new FontScalerGM; } |
91 static GMRegistry reg(MyFactory); | 91 static GMRegistry reg(MyFactory); |
92 | 92 |
93 } | 93 } |
OLD | NEW |