| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 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 "SkFontConfigInterface.h" | 8 #include "SkFontConfigInterface.h" |
| 9 #include "SkFontConfigTypeface.h" | 9 #include "SkFontConfigTypeface.h" |
| 10 #include "SkFontDescriptor.h" | 10 #include "SkFontDescriptor.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // check if we, in fact, already have this. perhaps fontconfig aliased the | 112 // check if we, in fact, already have this. perhaps fontconfig aliased the |
| 113 // requested name to some other name we actually have... | 113 // requested name to some other name we actually have... |
| 114 rec.fFamilyName = outFamilyName.c_str(); | 114 rec.fFamilyName = outFamilyName.c_str(); |
| 115 rec.fStyle = outStyle; | 115 rec.fStyle = outStyle; |
| 116 face = SkTypefaceCache::FindByProcAndRef(find_proc, &rec); | 116 face = SkTypefaceCache::FindByProcAndRef(find_proc, &rec); |
| 117 if (face) { | 117 if (face) { |
| 118 return face; | 118 return face; |
| 119 } | 119 } |
| 120 | 120 |
| 121 face = SkNEW_ARGS(FontConfigTypeface, (outStyle, indentity, outFamilyName)); | 121 face = FontConfigTypeface::Create(outStyle, indentity, outFamilyName); |
| 122 SkTypefaceCache::Add(face, style); | 122 SkTypefaceCache::Add(face, style); |
| 123 // SkDebugf("add face <%s> <%s> %p [%d]\n", familyName, outFamilyName.c_str()
, face, face->getRefCnt()); | 123 // SkDebugf("add face <%s> <%s> %p [%d]\n", familyName, outFamilyName.c_str()
, face, face->getRefCnt()); |
| 124 return face; | 124 return face; |
| 125 } | 125 } |
| 126 | 126 |
| 127 #ifdef SK_FONTHOST_DOES_NOT_USE_FONTMGR | 127 #ifdef SK_FONTHOST_DOES_NOT_USE_FONTMGR |
| 128 | 128 |
| 129 SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, | 129 SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace, |
| 130 const char familyName[], | 130 const char familyName[], |
| 131 SkTypeface::Style style) { | 131 SkTypeface::Style style) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 *ttcIndex = this->getIdentity().fTTCIndex; | 203 *ttcIndex = this->getIdentity().fTTCIndex; |
| 204 } | 204 } |
| 205 return stream; | 205 return stream; |
| 206 } | 206 } |
| 207 | 207 |
| 208 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc, | 208 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc, |
| 209 bool* isLocalStream) const { | 209 bool* isLocalStream) const { |
| 210 desc->setFamilyName(this->getFamilyName()); | 210 desc->setFamilyName(this->getFamilyName()); |
| 211 *isLocalStream = SkToBool(this->getLocalStream()); | 211 *isLocalStream = SkToBool(this->getLocalStream()); |
| 212 } | 212 } |
| OLD | NEW |