| 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 14 matching lines...) Expand all Loading... |
| 25 protected: | 25 protected: |
| 26 SkString onShortName() override { | 26 SkString onShortName() override { |
| 27 return SkString("fontcache"); | 27 return SkString("fontcache"); |
| 28 } | 28 } |
| 29 | 29 |
| 30 SkISize onISize() override { | 30 SkISize onISize() override { |
| 31 return SkISize::Make(1280, 640); | 31 return SkISize::Make(1280, 640); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void onOnceBeforeDraw() override { | 34 void onOnceBeforeDraw() override { |
| 35 fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif", SkTypef
ace::kItalic); | 35 fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif", |
| 36 fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif", Sk
Typeface::kItalic); | 36 SkFontStyle::FromOldStyle(SkTypeface::kItalic)); |
| 37 fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif", |
| 38 SkFontStyle::FromOldStyle(SkTypeface::kItalic)); |
| 37 } | 39 } |
| 38 | 40 |
| 39 void onDraw(SkCanvas* canvas) override { | 41 void onDraw(SkCanvas* canvas) override { |
| 40 SkPaint paint; | 42 SkPaint paint; |
| 41 paint.setAntiAlias(true); | 43 paint.setAntiAlias(true); |
| 42 paint.setLCDRenderText(true); | 44 paint.setLCDRenderText(true); |
| 43 paint.setSubpixelText(true); | 45 paint.setSubpixelText(true); |
| 44 paint.setTypeface(fTypefaces[0]); | 46 paint.setTypeface(fTypefaces[0]); |
| 45 paint.setTextSize(192); | 47 paint.setTextSize(192); |
| 46 | 48 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 69 | 71 |
| 70 private: | 72 private: |
| 71 sk_sp<SkTypeface> fTypefaces[2]; | 73 sk_sp<SkTypeface> fTypefaces[2]; |
| 72 typedef GM INHERITED; | 74 typedef GM INHERITED; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 | 77 |
| 76 ////////////////////////////////////////////////////////////////////////////// | 78 ////////////////////////////////////////////////////////////////////////////// |
| 77 | 79 |
| 78 DEF_GM(return new FontCacheGM;) | 80 DEF_GM(return new FontCacheGM;) |
| OLD | NEW |