| OLD | NEW |
| 1 #import <UIKit/UIKit.h> | 1 #import <UIKit/UIKit.h> |
| 2 | 2 |
| 3 #include "SkStream_NSData.h" | 3 #include "SkStream_NSData.h" |
| 4 #include "SkTypeface.h" | 4 #include "SkTypeface.h" |
| 5 #include "SkFontHost.h" | 5 #include "SkFontHost.h" |
| 6 #include "SkThread.h" | 6 #include "SkThread.h" |
| 7 #include "SkTemplates.h" | 7 #include "SkTemplates.h" |
| 8 | 8 |
| 9 enum FontDesign { | 9 enum FontDesign { |
| 10 kUnknown_Design, | 10 kUnknown_Design, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 if (bestIndex >= 0) { | 166 if (bestIndex >= 0) { |
| 167 return ref_and_return(gFonts[bestIndex]); | 167 return ref_and_return(gFonts[bestIndex]); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 return ref_and_return(get_default_font(style)); | 171 return ref_and_return(get_default_font(style)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { | 174 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { |
| 175 SkASSERT(!"SkFontHost::CreateTypeface unimplemented"); | 175 SkDEBUGFAIL("SkFontHost::CreateTypeface unimplemented"); |
| 176 return NULL; | 176 return NULL; |
| 177 } | 177 } |
| 178 | 178 |
| 179 SkTypeface* SkFontHost::CreateTypefaceFromFile(char const*) { | 179 SkTypeface* SkFontHost::CreateTypefaceFromFile(char const*) { |
| 180 // SkASSERT(!"SkFontHost::CreateTypefaceFromFile unimplemented"); | 180 // SkDEBUGFAIL("SkFontHost::CreateTypefaceFromFile unimplemented"); |
| 181 return NULL; | 181 return NULL; |
| 182 } | 182 } |
| 183 | 183 |
| 184 /////////////////////////////////////////////////////////////////////////////// | 184 /////////////////////////////////////////////////////////////////////////////// |
| 185 | 185 |
| 186 SkStream* SkFontHost::OpenStream(uint32_t uniqueID) { | 186 SkStream* SkFontHost::OpenStream(uint32_t uniqueID) { |
| 187 SkTypeface_Stream* tf = find_by_id(uniqueID); | 187 SkTypeface_Stream* tf = find_by_id(uniqueID); |
| 188 SkASSERT(tf); | 188 SkASSERT(tf); |
| 189 return tf->refStream(); | 189 return tf->refStream(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, | 192 size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, |
| 193 int32_t* index) { | 193 int32_t* index) { |
| 194 SkDebugf("SkFontHost::GetFileName unimplemented\n"); | 194 SkDebugf("SkFontHost::GetFileName unimplemented\n"); |
| 195 return 0; | 195 return 0; |
| 196 } | 196 } |
| 197 | 197 |
| 198 /////////////////////////////////////////////////////////////////////////////// | 198 /////////////////////////////////////////////////////////////////////////////// |
| 199 | 199 |
| 200 void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) { | 200 void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) { |
| 201 SkASSERT(!"SkFontHost::Serialize unimplemented"); | 201 SkDEBUGFAIL("SkFontHost::Serialize unimplemented"); |
| 202 } | 202 } |
| 203 | 203 |
| 204 SkTypeface* SkFontHost::Deserialize(SkStream* stream) { | 204 SkTypeface* SkFontHost::Deserialize(SkStream* stream) { |
| 205 int style = stream->readU8(); | 205 int style = stream->readU8(); |
| 206 int len = stream->readPackedUInt(); | 206 int len = stream->readPackedUInt(); |
| 207 const char* name = NULL; | 207 const char* name = NULL; |
| 208 if (len > 0) { | 208 if (len > 0) { |
| 209 SkString str; | 209 SkString str; |
| 210 str.resize(len); | 210 str.resize(len); |
| 211 stream->read(str.writable_str(), len); | 211 stream->read(str.writable_str(), len); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 242 | 242 |
| 243 void SkFontHost::GetGammaTables(const uint8_t* tables[2]) { | 243 void SkFontHost::GetGammaTables(const uint8_t* tables[2]) { |
| 244 tables[0] = NULL; // black gamma (e.g. exp=1.4) | 244 tables[0] = NULL; // black gamma (e.g. exp=1.4) |
| 245 tables[1] = NULL; // white gamma (e.g. exp= 1/1.4) | 245 tables[1] = NULL; // white gamma (e.g. exp= 1/1.4) |
| 246 } | 246 } |
| 247 | 247 |
| 248 // static | 248 // static |
| 249 SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( | 249 SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics( |
| 250 uint32_t fontI
D, | 250 uint32_t fontI
D, |
| 251 SkAdvancedType
faceMetrics::PerGlyphInfo perGlyphInfo) { | 251 SkAdvancedType
faceMetrics::PerGlyphInfo perGlyphInfo) { |
| 252 SkASSERT(!"SkFontHost::GetAdvancedTypefaceMetrics unimplemented"); | 252 SkDEBUGFAIL("SkFontHost::GetAdvancedTypefaceMetrics unimplemented"); |
| 253 return NULL; | 253 return NULL; |
| 254 } | 254 } |
| 255 | 255 |
| 256 void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface*) { | 256 void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface*) { |
| 257 } | 257 } |
| 258 | 258 |
| 259 SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) { | 259 SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) { |
| 260 SkASSERT(!"SkFontHost::CreateScalarContext unimplemented"); | 260 SkDEBUGFAIL("SkFontHost::CreateScalarContext unimplemented"); |
| 261 return NULL; | 261 return NULL; |
| 262 } | 262 } |
| OLD | NEW |