aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2016-12-05 14:56:30 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-05 20:28:34 +0000
commit45565b676c86d6b4955b8643236880b016772e95 (patch)
treef7e1bf1f7ed42798fdd11c26c97f97c67762a0ad
parentfe647b2d9ae04e94f030e5ee6e0e81e88c533ca9 (diff)
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>
-rw-r--r--third_party/gif/SkGifImageReader.cpp8
-rw-r--r--third_party/gif/SkGifImageReader.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp
index 59e3d6969c..14aa1f17fa 100644
--- a/third_party/gif/SkGifImageReader.cpp
+++ b/third_party/gif/SkGifImageReader.cpp
@@ -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());
diff --git a/third_party/gif/SkGifImageReader.h b/third_party/gif/SkGifImageReader.h
index 67868ae4d7..2843a3538f 100644
--- a/third_party/gif/SkGifImageReader.h
+++ b/third_party/gif/SkGifImageReader.h
@@ -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)