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
diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp
index eeaee68..bbf5f9a 100644
--- a/third_party/gif/SkGifImageReader.cpp
+++ b/third_party/gif/SkGifImageReader.cpp
@@ -737,8 +737,10 @@
                 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