diff options
-rw-r--r-- | include/core/SkStream.h | 8 | ||||
-rw-r--r-- | include/utils/win/SkIStream.h | 6 | ||||
-rw-r--r-- | src/utils/win/SkDWriteFontFileStream.cpp | 2 | ||||
-rw-r--r-- | src/utils/win/SkIStream.cpp | 12 |
4 files changed, 10 insertions, 18 deletions
diff --git a/include/core/SkStream.h b/include/core/SkStream.h index 028c5c1a4d..5ea6bf3822 100644 --- a/include/core/SkStream.h +++ b/include/core/SkStream.h @@ -41,14 +41,6 @@ public: virtual ~SkStream() {} /** - * @deprecated - * SkStream is no longer ref counted, but we leave this here for staging. - */ - void unref() { - SkDebugf("SkStream is no longer ref counted!"); - } - - /** * Attempts to open the specified file, and return a stream to it (using * mmap if available). On success, the caller is responsible for deleting. * On failure, returns NULL. diff --git a/include/utils/win/SkIStream.h b/include/utils/win/SkIStream.h index deb3f3b004..e2c2b966fb 100644 --- a/include/utils/win/SkIStream.h +++ b/include/utils/win/SkIStream.h @@ -80,15 +80,15 @@ public: class SkIStream : public SkBaseIStream { private: SkStream *fSkStream; - bool fUnrefOnRelease; + bool fDeleteOnRelease; ULARGE_INTEGER fLocation; - SkIStream(SkStream* stream, bool unrefOnRelease); + SkIStream(SkStream* stream, bool fDeleteOnRelease); virtual ~SkIStream(); public: HRESULT static CreateFromSkStream(SkStream* stream - , bool unrefOnRelease + , bool fDeleteOnRelease , IStream ** ppStream); virtual HRESULT STDMETHODCALLTYPE Read(void* pv, ULONG cb, ULONG* pcbRead); diff --git a/src/utils/win/SkDWriteFontFileStream.cpp b/src/utils/win/SkDWriteFontFileStream.cpp index 5569db5ac1..809ae7bd9a 100644 --- a/src/utils/win/SkDWriteFontFileStream.cpp +++ b/src/utils/win/SkDWriteFontFileStream.cpp @@ -103,7 +103,7 @@ bool SkDWriteFontFileStream::move(long offset) { } SkDWriteFontFileStream* SkDWriteFontFileStream::fork() const { - SkAutoTUnref<SkDWriteFontFileStream> that(this->duplicate()); + SkAutoTDelete<SkDWriteFontFileStream> that(this->duplicate()); that->seek(fPos); return that.detach(); } diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp index 6274e717a2..2e9510cf95 100644 --- a/src/utils/win/SkIStream.cpp +++ b/src/utils/win/SkIStream.cpp @@ -103,29 +103,29 @@ HRESULT STDMETHODCALLTYPE SkBaseIStream::Stat(STATSTG* pStatstg /** * SkIStream */ -SkIStream::SkIStream(SkStream* stream, bool unrefOnRelease) +SkIStream::SkIStream(SkStream* stream, bool deleteOnRelease) : SkBaseIStream() , fSkStream(stream) - , fUnrefOnRelease(unrefOnRelease) + , fDeleteOnRelease(deleteOnRelease) , fLocation() { this->fSkStream->rewind(); } SkIStream::~SkIStream() { - if (this->fSkStream && fUnrefOnRelease) { - this->fSkStream->unref(); + if (this->fSkStream && fDeleteOnRelease) { + delete this->fSkStream; } } HRESULT SkIStream::CreateFromSkStream(SkStream* stream - , bool unrefOnRelease + , bool deleteOnRelease , IStream ** ppStream) { if (NULL == stream) { return E_INVALIDARG; } - *ppStream = new SkIStream(stream, unrefOnRelease); + *ppStream = new SkIStream(stream, deleteOnRelease); return S_OK; } |