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

Unified Diff: third_party/gif/SkGifImageReader.cpp

Issue 2461813002: Treat a GIF with no color table as transparent (Closed)
Patch Set: 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 | « no previous file | 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 eeaee68c1d6a059f7aa020e14aff1e6a90a1964f..bbf5f9a2f0f41052eba9049aa0720c12531d657c 100644
--- a/third_party/gif/SkGifImageReader.cpp
+++ b/third_party/gif/SkGifImageReader.cpp
@@ -737,8 +737,10 @@ bool SkGifImageReader::parse(SkGifImageReader::SkGIFParseQuery query)
bool hasTransparentPixel;
if (m_frames.size() == 0) {
// We did not see a Graphics Control Extension, so no transparent
- // pixel was specified.
- hasTransparentPixel = false;
+ // pixel was specified. But if there is no color table, this frame is
+ // still transparent.
+ hasTransparentPixel = !isLocalColormapDefined
+ && m_globalColorMap.numColors() == 0;
} else {
// This means we did see a Graphics Control Extension, which specifies
// the transparent pixel
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698