Index: src/utils/win/SkDWriteFontFileStream.cpp |
diff --git a/src/utils/win/SkDWriteFontFileStream.cpp b/src/utils/win/SkDWriteFontFileStream.cpp |
index 809ae7bd9a2f2eb669a791f117a177e7753a8a9d..a18760111c0e36239443a8f50d9ea3e59997df81 100644 |
--- a/src/utils/win/SkDWriteFontFileStream.cpp |
+++ b/src/utils/win/SkDWriteFontFileStream.cpp |
@@ -133,7 +133,9 @@ const void* SkDWriteFontFileStream::getMemoryBase() { |
/////////////////////////////////////////////////////////////////////////////// |
// SkIDWriteFontFileStreamWrapper |
-HRESULT SkDWriteFontFileStreamWrapper::Create(SkStream* stream, SkDWriteFontFileStreamWrapper** streamFontFileStream) { |
+HRESULT SkDWriteFontFileStreamWrapper::Create(SkStreamAsset* stream, |
+ SkDWriteFontFileStreamWrapper** streamFontFileStream) |
+{ |
*streamFontFileStream = new SkDWriteFontFileStreamWrapper(stream); |
if (NULL == streamFontFileStream) { |
return E_OUTOFMEMORY; |
@@ -141,7 +143,7 @@ HRESULT SkDWriteFontFileStreamWrapper::Create(SkStream* stream, SkDWriteFontFile |
return S_OK; |
} |
-SkDWriteFontFileStreamWrapper::SkDWriteFontFileStreamWrapper(SkStream* stream) |
+SkDWriteFontFileStreamWrapper::SkDWriteFontFileStreamWrapper(SkStreamAsset* stream) |
: fRefCount(1), fStream(stream) { |
} |
@@ -193,16 +195,13 @@ HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::ReadFileFragment( |
*fragmentContext = NULL; |
} else { |
- //May be called from multiple threads. |
+ // May be called from multiple threads. |
SkAutoMutexAcquire ama(fStreamMutex); |
*fragmentStart = NULL; |
*fragmentContext = NULL; |
- if (!fStream->rewind()) { |
- return E_FAIL; |
- } |
- if (fStream->skip(static_cast<size_t>(fileOffset)) != fileOffset) { |
+ if (!fStream->seek(static_cast<size_t>(fileOffset))) { |
return E_FAIL; |
} |
SkAutoTMalloc<uint8_t> streamData(static_cast<size_t>(fragmentSize)); |