| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |