diff options
Diffstat (limited to 'src/core/SkStream.cpp')
-rw-r--r-- | src/core/SkStream.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
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; |