From 04306921f45c91ceec73bb96a427e4c69cf9782c Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Wed, 13 Nov 2013 19:53:46 +0000 Subject: [PATCH] Remove backward compatibility shims from SkStream.h. R=reed@google.com Review URL: https://codereview.chromium.org/68773009 git-svn-id: http://skia.googlecode.com/svn/trunk@12275 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkStream.h | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/include/core/SkStream.h b/include/core/SkStream.h index 69a038cd57..50ed691e5a 100644 --- a/include/core/SkStream.h +++ b/include/core/SkStream.h @@ -60,22 +60,14 @@ public: * @return the actual number bytes that could be skipped. */ size_t skip(size_t size) { - //return this->read(NULL, size); - //TODO: remove this old logic after updating existing implementations - return 0 == size ? 0 : this->read(NULL, size); + return this->read(NULL, size); } /** Returns true when all the bytes in the stream have been read. * This may return true early (when there are no more bytes to be read) * or late (after the first unsuccessful read). - * - * In Progress: do not use until all implementations are updated. - * TODO: after this is implemented everywhere, make pure virtual. */ - virtual bool isAtEnd() const { - SkASSERT(false); - return true; - } + virtual bool isAtEnd() const = 0; int8_t readS8(); int16_t readS16(); @@ -133,11 +125,7 @@ public: /** Returns true if this stream can report it's total length. */ virtual bool hasLength() const { return false; } /** Returns the total length of the stream. If this cannot be done, returns 0. */ - virtual size_t getLength() const { - //return 0; - //TODO: remove the following after everyone is updated. - return ((SkStream*)this)->read(NULL, 0); - } + virtual size_t getLength() const { return 0; } //SkStreamMemory /** Returns the starting address for the data. If this cannot be done, returns NULL. */ @@ -151,11 +139,6 @@ private: /** SkStreamRewindable is a SkStream for which rewind and duplicate are required. */ class SK_API SkStreamRewindable : public SkStream { public: - //TODO: remove the following after everyone is updated (ensures new behavior on new classes). - virtual bool isAtEnd() const SK_OVERRIDE = 0; - //TODO: remove the following after everyone is updated (ensures new behavior on new classes). - virtual size_t getLength() const SK_OVERRIDE { return 0; } - virtual bool rewind() SK_OVERRIDE = 0; virtual SkStreamRewindable* duplicate() const SK_OVERRIDE = 0; };