From 0ca21466da7441baf471966be8c628d408752a72 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Wed, 20 Sep 2017 15:37:14 -0400 Subject: remove dead code for STREAM_API Bug: skia: Change-Id: I5c5a65710af443c60a3d13fb309ce31309be7f74 Reviewed-on: https://skia-review.googlesource.com/49460 Reviewed-by: Ben Wagner Commit-Queue: Mike Reed --- include/core/SkStream.h | 59 ++++--------------------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) (limited to 'include/core/SkStream.h') diff --git a/include/core/SkStream.h b/include/core/SkStream.h index 2d7a8c529d..e9e88811f3 100644 --- a/include/core/SkStream.h +++ b/include/core/SkStream.h @@ -101,16 +101,6 @@ public: */ virtual bool rewind() { return false; } -#ifdef SK_SUPPORT_LEGACY_STREAM_API - /** Duplicates this stream. If this cannot be done, returns NULL. - * The returned stream will be positioned at the beginning of its data. - */ - virtual SkStreamRewindable* duplicate() const { return nullptr; } - /** Duplicates this stream. If this cannot be done, returns NULL. - * The returned stream will be positioned the same as this stream. - */ - virtual SkStreamSeekable* fork() const { return nullptr; } -#else /** Duplicates this stream. If this cannot be done, returns NULL. * The returned stream will be positioned at the beginning of its data. */ @@ -123,7 +113,6 @@ public: std::unique_ptr fork() const { return std::unique_ptr(this->onFork()); } -#endif //SkStreamSeekable /** Returns true if this stream can report it's current position. */ @@ -155,52 +144,39 @@ public: virtual const void* getMemoryBase() { return nullptr; } private: -#ifndef SK_SUPPORT_LEGACY_STREAM_API virtual SkStream* onDuplicate() const { return nullptr; } virtual SkStream* onFork() const { return nullptr; } -#endif }; /** SkStreamRewindable is a SkStream for which rewind and duplicate are required. */ class SK_API SkStreamRewindable : public SkStream { public: bool rewind() override = 0; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamRewindable* duplicate() const override = 0; -#else std::unique_ptr duplicate() const { return std::unique_ptr(this->onDuplicate()); } private: SkStreamRewindable* onDuplicate() const override = 0; -#endif }; /** SkStreamSeekable is a SkStreamRewindable for which position, seek, move, and fork are required. */ class SK_API SkStreamSeekable : public SkStreamRewindable { public: -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamSeekable* duplicate() const override = 0; -#else std::unique_ptr duplicate() const { return std::unique_ptr(this->onDuplicate()); } -#endif bool hasPosition() const override { return true; } size_t getPosition() const override = 0; bool seek(size_t position) override = 0; bool move(long offset) override = 0; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamSeekable* fork() const override = 0; -#else + std::unique_ptr fork() const { return std::unique_ptr(this->onFork()); } private: SkStreamSeekable* onDuplicate() const override = 0; SkStreamSeekable* onFork() const override = 0; -#endif }; /** SkStreamAsset is a SkStreamSeekable for which getLength is required. */ @@ -209,10 +185,6 @@ public: bool hasLength() const override { return true; } size_t getLength() const override = 0; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamAsset* duplicate() const override = 0; - SkStreamAsset* fork() const override = 0; -#else std::unique_ptr duplicate() const { return std::unique_ptr(this->onDuplicate()); } @@ -222,7 +194,6 @@ public: private: SkStreamAsset* onDuplicate() const override = 0; SkStreamAsset* onFork() const override = 0; -#endif }; /** SkStreamMemory is a SkStreamAsset for which getMemoryBase is required. */ @@ -230,10 +201,6 @@ class SK_API SkStreamMemory : public SkStreamAsset { public: const void* getMemoryBase() override = 0; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamMemory* duplicate() const override = 0; - SkStreamMemory* fork() const override = 0; -#else std::unique_ptr duplicate() const { return std::unique_ptr(this->onDuplicate()); } @@ -243,7 +210,6 @@ public: private: SkStreamMemory* onDuplicate() const override = 0; SkStreamMemory* onFork() const override = 0; -#endif }; class SK_API SkWStream : SkNoncopyable { @@ -345,24 +311,17 @@ public: bool isAtEnd() const override; bool rewind() override; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamAsset* duplicate() const override; -#else std::unique_ptr duplicate() const { return std::unique_ptr(this->onDuplicate()); } -#endif size_t getPosition() const override; bool seek(size_t position) override; bool move(long offset) override; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkStreamAsset* fork() const override; -#else + std::unique_ptr fork() const { return std::unique_ptr(this->onFork()); } -#endif size_t getLength() const override; @@ -370,10 +329,8 @@ private: explicit SkFILEStream(std::shared_ptr, size_t size, size_t offset); explicit SkFILEStream(std::shared_ptr, size_t size, size_t offset, size_t originalOffset); -#ifndef SK_SUPPORT_LEGACY_STREAM_API SkStreamAsset* onDuplicate() const override; SkStreamAsset* onFork() const override; -#endif std::shared_ptr fFILE; // My own council will I keep on sizes and offsets. @@ -430,34 +387,26 @@ public: size_t peek(void* buffer, size_t size) const override; bool rewind() override; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkMemoryStream* duplicate() const override; -#else + std::unique_ptr duplicate() const { return std::unique_ptr(this->onDuplicate()); } -#endif size_t getPosition() const override; bool seek(size_t position) override; bool move(long offset) override; -#ifdef SK_SUPPORT_LEGACY_STREAM_API - SkMemoryStream* fork() const override; -#else + std::unique_ptr fork() const { return std::unique_ptr(this->onFork()); } -#endif size_t getLength() const override; const void* getMemoryBase() override; private: -#ifndef SK_SUPPORT_LEGACY_STREAM_API SkMemoryStream* onDuplicate() const override; SkMemoryStream* onFork() const override; -#endif sk_sp fData; size_t fOffset; -- cgit v1.2.3