From 3d3a65c488162ef1db0b35adf3235d012b04c88d Mon Sep 17 00:00:00 2001 From: scroggo Date: Mon, 24 Oct 2016 12:28:30 -0700 Subject: Rename GIFImageReader to SkGifImageReader The former could violate One Definition Rule in Google3, since other projects that are based on Chrome/webkit also have GIFImageReader. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2445653004 Review-Url: https://codereview.chromium.org/2445653004 --- src/codec/SkGifCodec.cpp | 14 +++++++------- src/codec/SkGifCodec.h | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/codec/SkGifCodec.cpp b/src/codec/SkGifCodec.cpp index 3f37bc35cc..1c250fcccb 100644 --- a/src/codec/SkGifCodec.cpp +++ b/src/codec/SkGifCodec.cpp @@ -72,8 +72,8 @@ static SkCodec::Result gif_error(const char* msg, SkCodec::Result result = SkCod * Reads enough of the stream to determine the image format */ SkCodec* SkGifCodec::NewFromStream(SkStream* stream) { - std::unique_ptr reader(new GIFImageReader(stream)); - if (!reader->parse(GIFImageReader::GIFSizeQuery)) { + std::unique_ptr reader(new SkGifImageReader(stream)); + if (!reader->parse(SkGifImageReader::GIFSizeQuery)) { // Not enough data to determine the size. return nullptr; } @@ -110,7 +110,7 @@ bool SkGifCodec::onRewind() { } SkGifCodec::SkGifCodec(const SkEncodedInfo& encodedInfo, const SkImageInfo& imageInfo, - GIFImageReader* reader) + SkGifImageReader* reader) : INHERITED(encodedInfo, imageInfo, nullptr) , fReader(reader) , fTmpBuffer(nullptr) @@ -127,7 +127,7 @@ SkGifCodec::SkGifCodec(const SkEncodedInfo& encodedInfo, const SkImageInfo& imag } std::vector SkGifCodec::onGetFrameInfo() { - fReader->parse(GIFImageReader::GIFFrameCountQuery); + fReader->parse(SkGifImageReader::GIFFrameCountQuery); const size_t size = fReader->imagesCount(); std::vector result(size); for (size_t i = 0; i < size; i++) { @@ -184,7 +184,7 @@ SkCodec::Result SkGifCodec::prepareToDecode(const SkImageInfo& dstInfo, SkPMColo kInvalidConversion); } - fReader->parse((GIFImageReader::GIFParseQuery) frameIndex); + fReader->parse((SkGifImageReader::GIFParseQuery) frameIndex); if (frameIndex >= fReader->imagesCount()) { return gif_error("frame index out of range!\n", kIncompleteInput); @@ -269,7 +269,7 @@ SkCodec::Result SkGifCodec::onIncrementalDecode(int* rowsDecoded) { // It is possible the client has appended more data. Parse, if needed. const auto& options = this->options(); const size_t frameIndex = options.fFrameIndex; - fReader->parse((GIFImageReader::GIFParseQuery) frameIndex); + fReader->parse((SkGifImageReader::GIFParseQuery) frameIndex); const bool firstCallToIncrementalDecode = fFirstCallToIncrementalDecode; fFirstCallToIncrementalDecode = false; @@ -357,7 +357,7 @@ SkCodec::Result SkGifCodec::decodeFrame(bool firstAttempt, const Options& opts, } } - // Note: there is a difference between the following call to GIFImageReader::decode + // Note: there is a difference between the following call to SkGifImageReader::decode // returning false and leaving frameDecoded false: // - If the method returns false, there was an error in the stream. We still treat this as // incomplete, since we have already decoded some rows. diff --git a/src/codec/SkGifCodec.h b/src/codec/SkGifCodec.h index 544ba13695..b5f8f7ce0c 100644 --- a/src/codec/SkGifCodec.h +++ b/src/codec/SkGifCodec.h @@ -12,7 +12,7 @@ #include "SkImageInfo.h" #include "SkSwizzler.h" -#include "GIFImageReader.h" +#include "SkGifImageReader.h" /* * @@ -30,7 +30,7 @@ public: */ static SkCodec* NewFromStream(SkStream*); - // Callback for GIFImageReader when a row is available. + // Callback for SkGifImageReader when a row is available. bool haveDecodedRow(size_t frameIndex, const unsigned char* rowBegin, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels); protected: @@ -127,31 +127,31 @@ private: /* * Creates an instance of the decoder * Called only by NewFromStream - * Takes ownership of the GIFImageReader + * Takes ownership of the SkGifImageReader */ - SkGifCodec(const SkEncodedInfo&, const SkImageInfo&, GIFImageReader*); + SkGifCodec(const SkEncodedInfo&, const SkImageInfo&, SkGifImageReader*); - std::unique_ptr fReader; - std::unique_ptr fTmpBuffer; - std::unique_ptr fSwizzler; - sk_sp fCurrColorTable; + std::unique_ptr fReader; + std::unique_ptr fTmpBuffer; + std::unique_ptr fSwizzler; + sk_sp fCurrColorTable; // We may create a dummy table if there is not a Map in the input data. In // that case, we set this value to false, and we can skip a lot of decoding // work (which would not be meaningful anyway). We create a "fake"/"dummy" // one in that case, so the client and the swizzler have something to draw. - bool fCurrColorTableIsReal; + bool fCurrColorTableIsReal; // Whether the background was filled. - bool fFilledBackground; + bool fFilledBackground; // True on the first call to onIncrementalDecode. This value is passed to // decodeFrame. - bool fFirstCallToIncrementalDecode; + bool fFirstCallToIncrementalDecode; - void* fDst; - size_t fDstRowBytes; + void* fDst; + size_t fDstRowBytes; // Updated inside haveDecodedRow when rows are decoded, unless we filled // the background, in which case it is set once and left alone. - int fRowsDecoded; + int fRowsDecoded; typedef SkCodec INHERITED; }; -- cgit v1.2.3