diff options
author | Mike Reed <reed@google.com> | 2017-09-20 15:37:14 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-20 20:43:50 +0000 |
commit | 0ca21466da7441baf471966be8c628d408752a72 (patch) | |
tree | 2a84d90bc28abcbd73b84570453d9e20971893ac /src/core | |
parent | d4f100dad90ed5beb1b614464d8c4fcb22c0a993 (diff) |
remove dead code for STREAM_API
Bug: skia:
Change-Id: I5c5a65710af443c60a3d13fb309ce31309be7f74
Reviewed-on: https://skia-review.googlesource.com/49460
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkRWBuffer.cpp | 17 | ||||
-rw-r--r-- | src/core/SkStream.cpp | 29 |
2 files changed, 10 insertions, 36 deletions
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp index 8ec2baafac..b90d617b0b 100644 --- a/src/core/SkRWBuffer.cpp +++ b/src/core/SkRWBuffer.cpp @@ -315,10 +315,6 @@ public: return fBuffer->size() == fGlobalOffset; } -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamAsset* duplicate() const override { return new SkROBufferStreamAsset(fBuffer); } -#endif - size_t getPosition() const override { return fGlobalOffset; } @@ -343,23 +339,16 @@ public: return true; } -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamAsset* fork() const override { - SkStreamAsset* clone = this->duplicate(); - clone->seek(this->getPosition()); - return clone; +private: + SkStreamAsset* onDuplicate() const override { + return new SkROBufferStreamAsset(fBuffer); } -#endif -private: -#ifndef SK_SUPPORT_LEGACY_STREAM_API - SkStreamAsset* onDuplicate() const override { return new SkROBufferStreamAsset(fBuffer); } SkStreamAsset* onFork() const override { auto clone = this->duplicate(); clone->seek(this->getPosition()); return clone.release(); } -#endif sk_sp<SkROBuffer> fBuffer; SkROBuffer::Iter fIter; diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp index bc638c249a..2c5e9eba2f 100644 --- a/src/core/SkStream.cpp +++ b/src/core/SkStream.cpp @@ -5,7 +5,6 @@ * found in the LICENSE file. */ - #include "SkStream.h" #include "SkStreamPriv.h" #include "SkData.h" @@ -15,17 +14,8 @@ #include "SkOSFile.h" #include "SkTypes.h" -#ifdef SK_SUPPORT_LEGACY_STREAM_API -#define DUP_NAME duplicate -#define FORK_NAME fork -#else -#define DUP_NAME onDuplicate -#define FORK_NAME onFork -#endif - /////////////////////////////////////////////////////////////////////////////// - int8_t SkStream::readS8() { int8_t value; SkDEBUGCODE(size_t len =) this->read(&value, 1); @@ -224,7 +214,7 @@ bool SkFILEStream::rewind() { return true; } -SkStreamAsset* SkFILEStream::DUP_NAME() const { +SkStreamAsset* SkFILEStream::onDuplicate() const { // TODO: fOriginalOffset instead of 0. return new SkFILEStream(fFILE, fSize, 0, fOriginalOffset); } @@ -242,7 +232,7 @@ bool SkFILEStream::move(long offset) { return this->seek(fOffset + offset); } -SkStreamAsset* SkFILEStream::FORK_NAME() const { +SkStreamAsset* SkFILEStream::onFork() const { return new SkFILEStream(fFILE, fSize, fOffset, fOriginalOffset); } @@ -350,12 +340,7 @@ bool SkMemoryStream::rewind() { return true; } -#ifdef SK_SUPPORT_LEGACY_STREAM_API -SkMemoryStream* SkMemoryStream::duplicate() const -#else -SkMemoryStream* SkMemoryStream::onDuplicate() const -#endif -{ +SkMemoryStream* SkMemoryStream::onDuplicate() const { return new SkMemoryStream(fData); } @@ -374,7 +359,7 @@ bool SkMemoryStream::move(long offset) { return this->seek(fOffset + offset); } -SkMemoryStream* SkMemoryStream::FORK_NAME() const { +SkMemoryStream* SkMemoryStream::onFork() const { std::unique_ptr<SkMemoryStream> that(this->duplicate()); that->seek(fOffset); return that.release(); @@ -746,7 +731,7 @@ public: return true; } - SkBlockMemoryStream* DUP_NAME() const override { + SkBlockMemoryStream* onDuplicate() const override { return new SkBlockMemoryStream(fBlockMemory, fSize); } @@ -775,8 +760,8 @@ public: return seek(fOffset + offset); } - SkBlockMemoryStream* FORK_NAME() const override { - SkBlockMemoryStream* that = this->DUP_NAME(); + SkBlockMemoryStream* onFork() const override { + SkBlockMemoryStream* that = this->onDuplicate(); that->fCurrent = this->fCurrent; that->fOffset = this->fOffset; that->fCurrentOffset = this->fCurrentOffset; |