Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: third_party/gif/SkGifImageReader.cpp

Issue 2436183002: Write transparent pixels more often (SkGifCodec) (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/gif/SkGifImageReader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gif/SkGifImageReader.cpp
diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp
index 228c8ec16e7cacc718cc41b78b3375cdc53b4c23..c40c27203e3e32e630aa4bc0140980642fd0d8a3 100644
--- a/third_party/gif/SkGifImageReader.cpp
+++ b/third_party/gif/SkGifImageReader.cpp
@@ -146,9 +146,11 @@ bool SkGIFLZWContext::outputRow(const unsigned char* rowBegin)
if ((unsigned)drowStart >= m_frameContext->height())
return true;
+ bool writeTransparentPixels = alwaysWriteTransparentPixels ||
+ (m_frameContext->progressiveDisplay() && m_frameContext->interlaced() && ipass > 1);
// CALLBACK: Let the client know we have decoded a row.
if (!m_client->haveDecodedRow(m_frameContext->frameId(), rowBegin,
- drowStart, drowEnd - drowStart + 1, m_frameContext->progressiveDisplay() && m_frameContext->interlaced() && ipass > 1))
+ drowStart, drowEnd - drowStart + 1, writeTransparentPixels))
return false;
if (!m_frameContext->interlaced())
@@ -904,6 +906,8 @@ bool SkGIFLZWContext::prepareToDecode()
datum = bits = 0;
ipass = m_frameContext->interlaced() ? 1 : 0;
irow = 0;
+ alwaysWriteTransparentPixels = !m_frameContext->interlaced()
+ && m_frameContext->getRequiredFrame() == SkCodec::kNone;
// We want to know the longest sequence encodable by a dictionary with
// SK_MAX_DICTIONARY_ENTRIES entries. If we ignore the need to encode the base
« no previous file with comments | « third_party/gif/SkGifImageReader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698