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 22 matching lines...) Expand all Loading... |
33 protected: | 33 protected: |
34 SkString onShortName() override { | 34 SkString onShortName() override { |
35 return SkString("fontcache"); | 35 return SkString("fontcache"); |
36 } | 36 } |
37 | 37 |
38 SkISize onISize() override { | 38 SkISize onISize() override { |
39 return SkISize::Make(1280, 640); | 39 return SkISize::Make(1280, 640); |
40 } | 40 } |
41 | 41 |
42 void onOnceBeforeDraw() override { | 42 void onOnceBeforeDraw() override { |
43 fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif", SkTypef
ace::kItalic); | 43 fTypefaces[0] = sk_tool_utils::create_portable_typeface_always("serif",
SkTypeface::kItalic); |
44 fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif", Sk
Typeface::kItalic); | 44 fTypefaces[1] = sk_tool_utils::create_portable_typeface_always("sans-ser
if", SkTypeface::kItalic); |
45 } | 45 } |
46 | 46 |
47 void onDraw(SkCanvas* canvas) override { | 47 void onDraw(SkCanvas* canvas) override { |
48 SkPaint paint; | 48 SkPaint paint; |
49 paint.setAntiAlias(true); | 49 paint.setAntiAlias(true); |
50 paint.setLCDRenderText(true); | 50 paint.setLCDRenderText(true); |
51 paint.setSubpixelText(true); | 51 paint.setSubpixelText(true); |
52 paint.setTypeface(fTypefaces[0]); | 52 paint.setTypeface(fTypefaces[0]); |
53 paint.setTextSize(192); | 53 paint.setTextSize(192); |
54 | 54 |
(...skipping 22 matching lines...) Expand all Loading... |
77 | 77 |
78 private: | 78 private: |
79 SkTypeface* fTypefaces[2]; | 79 SkTypeface* fTypefaces[2]; |
80 typedef GM INHERITED; | 80 typedef GM INHERITED; |
81 }; | 81 }; |
82 | 82 |
83 | 83 |
84 ////////////////////////////////////////////////////////////////////////////// | 84 ////////////////////////////////////////////////////////////////////////////// |
85 | 85 |
86 DEF_GM( return SkNEW(FontCacheGM); ) | 86 DEF_GM( return SkNEW(FontCacheGM); ) |
OLD | NEW |