aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/gif
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2017-08-22 14:13:15 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-22 19:36:48 +0000
commit223ec293ef3cd02bf2a2a8942d55e2490ee16d66 (patch)
tree4d94d60cc5f3bd30f62238d36db633b1b59d8b2b /third_party/gif
parent267641a90cb18a430b0a84910f651e2181744fd3 (diff)
Make haveDecodedRow return void
The method already always returns true, except in a single case after asserting. Change-Id: Icf241a8af04220d459c0782ffd9b74c34c753236 Reviewed-on: https://skia-review.googlesource.com/37161 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'third_party/gif')
-rw-r--r--third_party/gif/SkGifImageReader.cpp13
-rw-r--r--third_party/gif/SkGifImageReader.h2
2 files changed, 6 insertions, 9 deletions
diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp
index e3b225dda7..ed20af017b 100644
--- a/third_party/gif/SkGifImageReader.cpp
+++ b/third_party/gif/SkGifImageReader.cpp
@@ -97,7 +97,7 @@ mailing address.
#define GETINT16(p) ((p)[1]<<8|(p)[0])
// Send the data to the display front-end.
-bool SkGIFLZWContext::outputRow(const unsigned char* rowBegin)
+void SkGIFLZWContext::outputRow(const unsigned char* rowBegin)
{
int drowStart = irow;
int drowEnd = irow;
@@ -144,13 +144,12 @@ bool SkGIFLZWContext::outputRow(const unsigned char* rowBegin)
// Protect against too much image data.
if (drowStart >= m_frameContext->height())
- return true;
+ return;
// CALLBACK: Let the client know we have decoded a row.
const bool writeTransparentPixels = (SkCodec::kNone == m_frameContext->getRequiredFrame());
- if (!m_client->haveDecodedRow(m_frameContext->frameId(), rowBegin,
- drowStart, drowEnd - drowStart + 1, writeTransparentPixels))
- return false;
+ m_client->haveDecodedRow(m_frameContext->frameId(), rowBegin,
+ drowStart, drowEnd - drowStart + 1, writeTransparentPixels);
if (!m_frameContext->interlaced())
irow++;
@@ -194,7 +193,6 @@ bool SkGIFLZWContext::outputRow(const unsigned char* rowBegin)
}
} while (irow > (unsigned) (m_frameContext->height() - 1));
}
- return true;
}
// Perform Lempel-Ziv-Welch decoding.
@@ -287,8 +285,7 @@ bool SkGIFLZWContext::doLZW(const unsigned char* block, size_t bytesInBlock)
// Output as many rows as possible.
unsigned char* rowBegin = rowBuffer.begin();
for (; rowBegin + width <= rowIter; rowBegin += width) {
- if (!outputRow(rowBegin))
- return false;
+ outputRow(rowBegin);
rowsRemaining--;
if (!rowsRemaining)
return true;
diff --git a/third_party/gif/SkGifImageReader.h b/third_party/gif/SkGifImageReader.h
index d87b68f450..69045dd6d1 100644
--- a/third_party/gif/SkGifImageReader.h
+++ b/third_party/gif/SkGifImageReader.h
@@ -110,7 +110,7 @@ public:
{ }
bool prepareToDecode();
- bool outputRow(const unsigned char* rowBegin);
+ void outputRow(const unsigned char* rowBegin);
bool doLZW(const unsigned char* block, size_t bytesInBlock);
bool hasRemainingRows() { return SkToBool(rowsRemaining); }