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 "SkFontMgr.h" | 8 #include "SkFontMgr.h" |
9 #include "SkFontStyle.h" | 9 #include "SkFontStyle.h" |
10 #include "SkFontConfigInterface.h" | 10 #include "SkFontConfigInterface.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 bool isFixedWidth = false; | 309 bool isFixedWidth = false; |
310 if (!fScanner.scanFont(stream, 0, NULL, &style, &isFixedWidth)) { | 310 if (!fScanner.scanFont(stream, 0, NULL, &style, &isFixedWidth)) { |
311 return NULL; | 311 return NULL; |
312 } | 312 } |
313 | 313 |
314 SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, strea
m); | 314 SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, strea
m); |
315 return face; | 315 return face; |
316 } | 316 } |
317 | 317 |
318 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERR
IDE { | 318 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const SK_OVERR
IDE { |
319 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); | 319 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); |
320 return stream.get() ? this->createFromStream(stream, ttcIndex) : NULL; | 320 return stream.get() ? this->createFromStream(stream, ttcIndex) : NULL; |
321 } | 321 } |
322 | 322 |
323 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], | 323 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |
324 unsigned styleBits) const SK_OVER
RIDE { | 324 unsigned styleBits) const SK_OVER
RIDE { |
325 FCLocker lock; | 325 FCLocker lock; |
326 return FontConfigTypeface::LegacyCreateTypeface(NULL, familyName, | 326 return FontConfigTypeface::LegacyCreateTypeface(NULL, familyName, |
327 (SkTypeface::Style)styleBits); | 327 (SkTypeface::Style)styleBits); |
328 } | 328 } |
329 }; | 329 }; |
330 | 330 |
331 SkFontMgr* SkFontMgr::Factory() { | 331 SkFontMgr* SkFontMgr::Factory() { |
332 SkFontConfigInterface* fci = RefFCI(); | 332 SkFontConfigInterface* fci = RefFCI(); |
333 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; | 333 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; |
334 } | 334 } |
OLD | NEW |