GIF: Internal cleanup - remove color map parameter
SkGIFFrameContext::decode() and SkGIFLZWContext::prepareToDecode() do not need (or use) the global color map, so stop passing it as a parameter. The parameter was used prior to https://skia-review.googlesource.com/c/4379/ (different issue!), but we overlooked removing it then. Change-Id: I0f477e9db11f7650938d6b868baef69e3b37d86b Reviewed-on: https://skia-review.googlesource.com/5609 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
This commit is contained in:
parent
fe647b2d9a
commit
45565b676c
8
third_party/gif/SkGifImageReader.cpp
vendored
8
third_party/gif/SkGifImageReader.cpp
vendored
@ -360,7 +360,7 @@ sk_sp<SkColorTable> SkGifImageReader::getColorTable(SkColorType colorType, size_
|
||||
// Perform decoding for this frame. frameComplete will be true if the entire frame is decoded.
|
||||
// Returns false if a decoding error occurred. This is a fatal error and causes the SkGifImageReader to set the "decode failed" flag.
|
||||
// Otherwise, either not enough data is available to decode further than before, or the new data has been decoded successfully; returns true in this case.
|
||||
bool SkGIFFrameContext::decode(SkGifCodec* client, const SkGIFColorMap& globalMap, bool* frameComplete)
|
||||
bool SkGIFFrameContext::decode(SkGifCodec* client, bool* frameComplete)
|
||||
{
|
||||
*frameComplete = false;
|
||||
if (!m_lzwContext) {
|
||||
@ -369,7 +369,7 @@ bool SkGIFFrameContext::decode(SkGifCodec* client, const SkGIFColorMap& globalMa
|
||||
return true;
|
||||
|
||||
m_lzwContext.reset(new SkGIFLZWContext(client, this));
|
||||
if (!m_lzwContext->prepareToDecode(globalMap)) {
|
||||
if (!m_lzwContext->prepareToDecode()) {
|
||||
m_lzwContext.reset();
|
||||
return false;
|
||||
}
|
||||
@ -402,7 +402,7 @@ bool SkGifImageReader::decode(size_t frameIndex, bool* frameComplete)
|
||||
{
|
||||
SkGIFFrameContext* currentFrame = m_frames[frameIndex].get();
|
||||
|
||||
return currentFrame->decode(m_client, m_globalColorMap, frameComplete);
|
||||
return currentFrame->decode(m_client, frameComplete);
|
||||
}
|
||||
|
||||
// Parse incoming GIF data stream into internal data structures.
|
||||
@ -901,7 +901,7 @@ void SkGifImageReader::addFrameIfNecessary()
|
||||
}
|
||||
|
||||
// FIXME: Move this method to close to doLZW().
|
||||
bool SkGIFLZWContext::prepareToDecode(const SkGIFColorMap& globalMap)
|
||||
bool SkGIFLZWContext::prepareToDecode()
|
||||
{
|
||||
SkASSERT(m_frameContext->isDataSizeDefined() && m_frameContext->isHeaderDefined());
|
||||
|
||||
|
4
third_party/gif/SkGifImageReader.h
vendored
4
third_party/gif/SkGifImageReader.h
vendored
@ -108,7 +108,7 @@ public:
|
||||
, m_frameContext(frameContext)
|
||||
{ }
|
||||
|
||||
bool prepareToDecode(const SkGIFColorMap& globalMap);
|
||||
bool prepareToDecode();
|
||||
bool outputRow(const unsigned char* rowBegin);
|
||||
bool doLZW(const unsigned char* block, size_t bytesInBlock);
|
||||
bool hasRemainingRows() { return SkToBool(rowsRemaining); }
|
||||
@ -206,7 +206,7 @@ public:
|
||||
m_lzwBlocks.push_back(SkData::MakeWithCopy(data, size));
|
||||
}
|
||||
|
||||
bool decode(SkGifCodec* client, const SkGIFColorMap& globalMap, bool* frameDecoded);
|
||||
bool decode(SkGifCodec* client, bool* frameDecoded);
|
||||
|
||||
int frameId() const { return m_frameId; }
|
||||
void setRect(unsigned x, unsigned y, unsigned width, unsigned height)
|
||||
|
Loading…
Reference in New Issue
Block a user