aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-01-22 06:08:31 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-22 06:08:31 -0800
commit2dca817edb0d741b7d8930009417bf9bd071808d (patch)
tree1d4f4ae993a84972bb984621593e41b54f969c70
parentfaff2c45985a5e0fdb72bdf416d97babecd44833 (diff)
Remove staging SkStream::unref().
SkStream::unref() was added to ease transitioning off of SkStream deriving from SkRefCnt. It is no longer needed, remove it. TBR=reed@google.com Review URL: https://codereview.chromium.org/861413002
-rw-r--r--include/core/SkStream.h8
-rw-r--r--include/utils/win/SkIStream.h6
-rw-r--r--src/utils/win/SkDWriteFontFileStream.cpp2
-rw-r--r--src/utils/win/SkIStream.cpp12
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;
}