Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: gm/fontcache.cpp

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/filterbitmap.cpp ('k') | gm/fontscaler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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); )
OLDNEW
« no previous file with comments | « gm/filterbitmap.cpp ('k') | gm/fontscaler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698