diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-04 18:03:45 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-04 18:03:45 +0000 |
commit | 8a6400ef3ea9950f89629f24455250edf6ffd615 (patch) | |
tree | de77a433dbf63e00f1968a0f347bc09c0e90080f | |
parent | 8d90eeba09484cfc702e82a332c4a7a978a5cfc1 (diff) |
implement (sort of) Serialize/Deserialize
git-svn-id: http://skia.googlecode.com/svn/trunk@1244 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/ports/SkFontHost_mac_coretext.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index 82bde7bccb..e6378777ce 100644 --- a/src/ports/SkFontHost_mac_coretext.cpp +++ b/src/ports/SkFontHost_mac_coretext.cpp @@ -631,13 +631,20 @@ size_t SkFontHost::GetFileName(SkFontID fontID, char path[], size_t length, /////////////////////////////////////////////////////////////////////////////// +#include "SkStream.h" + void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) { - SkASSERT(!"SkFontHost::Serialize unimplemented"); + // hack: need a real name or something from CG + uint32_t fontID = face->uniqueID(); + stream->write(&fontID, 4); } SkTypeface* SkFontHost::Deserialize(SkStream* stream) { - SkASSERT(!"SkFontHost::Deserialize unimplemented"); - return(NULL); + // hack: need a real name or something from CG + SkFontID fontID = stream->readU32(); + SkTypeface* face = SkTypefaceCache::FindByID(fontID); + SkSafeRef(face); + return face; } /////////////////////////////////////////////////////////////////////////////// |