aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/gif
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@chromium.org>2016-10-31 04:45:10 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-31 04:45:11 -0700
commit2f7068aec9906168b3c142b5057e098114376cc9 (patch)
tree1579f6ab486161f976960ca186403bfa64de12f0 /third_party/gif
parent8981c35ed5dfc3b600c69ac02a9e1f0fb3d5c782 (diff)
Treat a GIF with no color table as transparent
When checking to see whether a GIF has transparency to determine its alpha type, treat an empty color table as having alpha, since we will draw it as a transparent image. (This is a separate bug from skbug.com/5883, but the image I used to verify that bug was drawn to 565 as black. The fix is to not support 565 in that case, by changing its recommended alpha type.) BUG=skia:5883 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2461813002 Review-Url: https://codereview.chromium.org/2461813002
Diffstat (limited to 'third_party/gif')
-rw-r--r--third_party/gif/SkGifImageReader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp
index eeaee68c1d..bbf5f9a2f0 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