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

Side by Side Diff: gm/typeface.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 6 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/texteffects.cpp ('k') | gm/variedtext.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 2012 Google Inc. 2 * Copyright 2012 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 "SkString.h" 10 #include "SkString.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 public: 96 public:
97 TypefaceStylesGM(bool applyKerning) 97 TypefaceStylesGM(bool applyKerning)
98 : fApplyKerning(applyKerning) { 98 : fApplyKerning(applyKerning) {
99 memset(fFaces, 0, sizeof(fFaces)); 99 memset(fFaces, 0, sizeof(fFaces));
100 } 100 }
101 101
102 protected: 102 protected:
103 void onOnceBeforeDraw() override { 103 void onOnceBeforeDraw() override {
104 for (int i = 0; i < gFaceStylesCount; i++) { 104 for (int i = 0; i < gFaceStylesCount; i++) {
105 fFaces[i] = SkTypeface::MakeFromName( 105 fFaces[i] = SkTypeface::MakeFromName(
106 sk_tool_utils::platform_font_name(gFaceStyles[i].fName), gFa ceStyles[i].fStyle); 106 sk_tool_utils::platform_font_name(
107 gFaceStyles[i].fName), SkFontStyle::FromOldStyle(gFaceSt yles[i].fStyle));
107 } 108 }
108 } 109 }
109 110
110 SkString onShortName() override { 111 SkString onShortName() override {
111 SkString name("typefacestyles"); 112 SkString name("typefacestyles");
112 if (fApplyKerning) { 113 if (fApplyKerning) {
113 name.append("_kerning"); 114 name.append("_kerning");
114 } 115 }
115 name.append(sk_tool_utils::major_platform_os_name()); 116 name.append(sk_tool_utils::major_platform_os_name());
116 return name; 117 return name;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 149 }
149 150
150 private: 151 private:
151 typedef skiagm::GM INHERITED; 152 typedef skiagm::GM INHERITED;
152 }; 153 };
153 154
154 /////////////////////////////////////////////////////////////////////////////// 155 ///////////////////////////////////////////////////////////////////////////////
155 156
156 DEF_GM( return new TypefaceStylesGM(false); ) 157 DEF_GM( return new TypefaceStylesGM(false); )
157 DEF_GM( return new TypefaceStylesGM(true); ) 158 DEF_GM( return new TypefaceStylesGM(true); )
OLDNEW
« no previous file with comments | « gm/texteffects.cpp ('k') | gm/variedtext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698