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