diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-11 20:13:36 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-11 20:13:36 +0000 |
commit | ed268bfed3205347a90557c5029f37e90cc01956 (patch) | |
tree | fc337dceafb411264f644af0c47785d98053da6a /src/core/SkFontStream.cpp | |
parent | fe7533eebe777cc66c7f8fa7a03f00572755c5b4 (diff) |
add (mac) test for ttcindex in SkFontStream
git-svn-id: http://skia.googlecode.com/svn/trunk@8073 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkFontStream.cpp')
-rw-r--r-- | src/core/SkFontStream.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/SkFontStream.cpp b/src/core/SkFontStream.cpp index fa56c8549e..98ddba3214 100644 --- a/src/core/SkFontStream.cpp +++ b/src/core/SkFontStream.cpp @@ -120,13 +120,13 @@ struct SfntHeader { } stream->rewind(); - if (stream->skip(offsetToDir) != offsetToDir) { + if (!skip(stream, offsetToDir)) { return false; } size_t size = fCount * sizeof(SkSFNTDirEntry); fDir = reinterpret_cast<SkSFNTDirEntry*>(sk_malloc_throw(size)); - return stream->read(fDir, size) == size; + return read(stream, fDir, size); } int fCount; @@ -139,7 +139,7 @@ int SkFontStream::CountTTCEntries(SkStream* stream) { stream->rewind(); SkSharedTTHeader shared; - if (stream->read(&shared, sizeof(shared)) != sizeof(shared)) { + if (!read(stream, &shared, sizeof(shared))) { return 0; } @@ -148,7 +148,7 @@ int SkFontStream::CountTTCEntries(SkStream* stream) { if (SkSetFourByteTag('t', 't', 'c', 'f') == tag) { return SkEndian_SwapBE32(shared.fCollection.fNumOffsets); } else { - return 0; + return 1; // normal 'sfnt' has 1 dir entry } } @@ -196,10 +196,10 @@ size_t SkFontStream::GetTableData(SkStream* stream, int ttcIndex, // skip the stream to the part of the table we want to copy from stream->rewind(); size_t bytesToSkip = realOffset + offset; - if (stream->skip(bytesToSkip) != bytesToSkip) { + if (skip(stream, bytesToSkip)) { return 0; } - if (stream->read(data, length) != length) { + if (!read(stream, data, length)) { return 0; } } |