// 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) {
return true;
m_lzwContext.reset(new SkGIFLZWContext(client, this));
- if (!m_lzwContext->prepareToDecode(globalMap)) {
+ if (!m_lzwContext->prepareToDecode()) {
m_lzwContext.reset();
return false;
}
{
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.
}
// FIXME: Move this method to close to doLZW().
-bool SkGIFLZWContext::prepareToDecode(const SkGIFColorMap& globalMap)
+bool SkGIFLZWContext::prepareToDecode()
{
SkASSERT(m_frameContext->isDataSizeDefined() && m_frameContext->isHeaderDefined());
, 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); }
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)