diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-05 20:50:47 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-05 20:50:47 +0000 |
commit | 90ee4488e9c6b8ec4cb1137250fed43b5919ce2c (patch) | |
tree | adef686be82924a30e3114a8035596b7d1472cd8 | |
parent | 66a58aca8379a33ccc7572a31c74a3334d08b47c (diff) |
rewind at the start of each FontStream api (since we rewinding internally anyway)
Review URL: https://codereview.chromium.org/12465009
git-svn-id: http://skia.googlecode.com/svn/trunk@7997 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkFontStream.cpp | 2 | ||||
-rw-r--r-- | src/core/SkFontStream.h | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core/SkFontStream.cpp b/src/core/SkFontStream.cpp index e7ce370705..b6a5d6b119 100644 --- a/src/core/SkFontStream.cpp +++ b/src/core/SkFontStream.cpp @@ -89,6 +89,8 @@ struct SfntHeader { fDir will be automatically freed when this object is destroyed */ bool init(SkStream* stream) { + stream->rewind(); + size_t offsetToDir; fCount = count_tables(stream, &offsetToDir); if (0 == fCount) { diff --git a/src/core/SkFontStream.h b/src/core/SkFontStream.h index 5324df372b..283aee077f 100644 --- a/src/core/SkFontStream.h +++ b/src/core/SkFontStream.h @@ -14,7 +14,16 @@ class SkStream; class SkFontStream { public: + /** + * Note: the stream is rewound initially, but is returned at an arbitrary + * read offset. + */ static int GetTableTags(SkStream*, SkFontTableTag tags[]); + + /** + * Note: the stream is rewound initially, but is returned at an arbitrary + * read offset. + */ static size_t GetTableData(SkStream*, SkFontTableTag tag, size_t offset, size_t length, void* data); }; |