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

Side by Side Diff: tools/sk_tool_utils_font.cpp

Issue 488143002: Replace SkTypeface::Style with SkFontStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add expectations, remove whitespace. Created 6 years, 2 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 | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkOSFile.h" 9 #include "SkOSFile.h"
10 #include "SkTestScalerContext.h" 10 #include "SkTestScalerContext.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (fontData->fFontCache) { 56 if (fontData->fFontCache) {
57 font = SkSafeRef(fontData->fFontCache); 57 font = SkSafeRef(fontData->fFontCache);
58 } else { 58 } else {
59 font = SkNEW_ARGS(SkTestFont, (*fontData)); 59 font = SkNEW_ARGS(SkTestFont, (*fontData));
60 SkDEBUGCODE(font->fDebugName = sub->fName); 60 SkDEBUGCODE(font->fDebugName = sub->fName);
61 SkDEBUGCODE(font->fDebugStyle = sub->fStyle); 61 SkDEBUGCODE(font->fDebugStyle = sub->fStyle);
62 fontData->fFontCache = SkSafeRef(font); 62 fontData->fFontCache = SkSafeRef(font);
63 atexit(release_portable_typefaces); 63 atexit(release_portable_typefaces);
64 } 64 }
65 } 65 }
66 return SkNEW_ARGS(SkTestTypeface, (font, style)); 66 return SkNEW_ARGS(SkTestTypeface, (font, SkFontStyle(style)));
67 } 67 }
68 68
69 69
70 SkTypeface* resource_font(const char* name, SkTypeface::Style style) { 70 SkTypeface* resource_font(const char* name, SkTypeface::Style style) {
71 const char* file = NULL; 71 const char* file = NULL;
72 if (name) { 72 if (name) {
73 for (int index = 0; index < gSubFontsCount; ++index) { 73 for (int index = 0; index < gSubFontsCount; ++index) {
74 const SubFont& sub = gSubFonts[index]; 74 const SubFont& sub = gSubFonts[index];
75 if (!strcmp(name, sub.fName) && sub.fStyle == style) { 75 if (!strcmp(name, sub.fName) && sub.fStyle == style) {
76 file = sub.fFile; 76 file = sub.fFile;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 break; 169 break;
170 } 170 }
171 } 171 }
172 fprintf(out, ";\n"); 172 fprintf(out, ";\n");
173 } 173 }
174 fclose(out); 174 fclose(out);
175 } 175 }
176 #endif 176 #endif
177 177
178 } 178 }
OLDNEW
« no previous file with comments | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698