| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual SkISize onISize() SK_OVERRIDE { | 54 virtual SkISize onISize() SK_OVERRIDE { |
| 55 return SkISize::Make(640, 320); | 55 return SkISize::Make(640, 320); |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual void onOnceBeforeDraw() SK_OVERRIDE { | 58 virtual void onOnceBeforeDraw() SK_OVERRIDE { |
| 59 int typefaceCount = 0; | 59 int typefaceCount = 0; |
| 60 for (size_t i = 0; i < SK_ARRAY_COUNT(gFamilyNames); ++i) { | 60 for (size_t i = 0; i < SK_ARRAY_COUNT(gFamilyNames); ++i) { |
| 61 for (size_t j = 0; j < SK_ARRAY_COUNT(gStyles); ++j) { | 61 for (size_t j = 0; j < SK_ARRAY_COUNT(gStyles); ++j) { |
| 62 fTypefaces[typefaceCount++] = SkTypeface::CreateFromName(gFamily
Names[i], | 62 fTypefaces[typefaceCount++] = sk_tool_utils::create_portable_typ
eface(gFamilyNames[i], |
| 63 gStyle
s[j]); | 63 g
Styles[j]); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 68 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 69 SkScalar y = 32; | 69 SkScalar y = 32; |
| 70 SkPaint paint; | 70 SkPaint paint; |
| 71 paint.setAntiAlias(true); | 71 paint.setAntiAlias(true); |
| 72 paint.setLCDRenderText(true); | 72 paint.setLCDRenderText(true); |
| 73 paint.setSubpixelText(true); | 73 paint.setSubpixelText(true); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 SkTypeface* fTypefaces[TYPEFACE_COUNT]; | 112 SkTypeface* fTypefaces[TYPEFACE_COUNT]; |
| 113 typedef GM INHERITED; | 113 typedef GM INHERITED; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 | 116 |
| 117 ////////////////////////////////////////////////////////////////////////////// | 117 ////////////////////////////////////////////////////////////////////////////// |
| 118 | 118 |
| 119 DEF_GM( return SkNEW(FontCacheGM); ) | 119 DEF_GM( return SkNEW(FontCacheGM); ) |
| OLD | NEW |