OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 "SkFontHost.h" | 8 #include "SkFontHost.h" |
9 #include "SkFontHost_FreeType_common.h" | 9 #include "SkFontHost_FreeType_common.h" |
10 #include "SkFontDescriptor.h" | 10 #include "SkFontDescriptor.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool isFixedPitch, const SkString familyName) | 79 bool isFixedPitch, const SkString familyName) |
80 : INHERITED(style, sysFont, isFixedPitch, familyName) | 80 : INHERITED(style, sysFont, isFixedPitch, familyName) |
81 , fStream(SkRef(stream)) | 81 , fStream(SkRef(stream)) |
82 { } | 82 { } |
83 | 83 |
84 virtual const char* getUniqueString() const SK_OVERRIDE { return NULL; } | 84 virtual const char* getUniqueString() const SK_OVERRIDE { return NULL; } |
85 | 85 |
86 protected: | 86 protected: |
87 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { | 87 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { |
88 *ttcIndex = 0; | 88 *ttcIndex = 0; |
89 return SkRef(fStream.get()); | 89 return fStream->duplicate(); |
90 } | 90 } |
91 | 91 |
92 private: | 92 private: |
93 SkAutoTUnref<SkStream> fStream; | 93 SkAutoTUnref<SkStream> fStream; |
94 | 94 |
95 typedef SkTypeface_Custom INHERITED; | 95 typedef SkTypeface_Custom INHERITED; |
96 }; | 96 }; |
97 | 97 |
98 /** The file SkTypeface implementation for the custom font manager. */ | 98 /** The file SkTypeface implementation for the custom font manager. */ |
99 class SkTypeface_File : public SkTypeface_Custom { | 99 class SkTypeface_File : public SkTypeface_Custom { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 399 } |
400 | 400 |
401 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; | 401 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; |
402 SkFontStyleSet_Custom* gDefaultFamily; | 402 SkFontStyleSet_Custom* gDefaultFamily; |
403 SkTypeface* gDefaultNormal; | 403 SkTypeface* gDefaultNormal; |
404 }; | 404 }; |
405 | 405 |
406 SkFontMgr* SkFontMgr::Factory() { | 406 SkFontMgr* SkFontMgr::Factory() { |
407 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); | 407 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); |
408 } | 408 } |
OLD | NEW |