Treat invalid indices as transparent in gifs
Other browsers (including old Chrome) treat invalid palette indices as
transparent for gifs. And there are gifs in the wild which rely on this.
As an example, if the palette only has 64 entries (0-63) then index 64
is treated as transparent.
BUG=skia:7069
Change-Id: I15e8919a953387506c9ac5945c3ae6a2b90189ab
Reviewed-on: https://skia-review.googlesource.com/51100
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Chris Blume <cblume@google.com>
diff --git a/tests/CodecAnimTest.cpp b/tests/CodecAnimTest.cpp
index d28da08..e354ea6 100644
--- a/tests/CodecAnimTest.cpp
+++ b/tests/CodecAnimTest.cpp
@@ -88,16 +88,16 @@
std::vector<SkCodecAnimation::DisposalMethod> fDisposalMethods;
} gRecs[] = {
{ "required.gif", 7,
- { 0, 1, 1, SkCodec::kNone, 4, 4 },
- { kOpaque, kBinary, kBinary, kOpaque, kOpaque, kOpaque },
+ { 0, 1, 2, 3, 4, 5 },
+ { kOpaque, kBinary, kBinary, kBinary, kBinary, kBinary },
{ 100, 100, 100, 100, 100, 100, 100 },
0,
{ kKeep, kRestoreBG, kKeep, kKeep, kKeep, kRestoreBG, kKeep } },
{ "alphabetAnim.gif", 13,
{ SkCodec::kNone, 0, 0, 0, 0, 5, 6, SkCodec::kNone,
- SkCodec::kNone, SkCodec::kNone, 10, 11 },
+ SkCodec::kNone, 9, 10, 11 },
{ kBinary, kBinary, kBinary, kBinary, kBinary, kBinary,
- kBinary, kBinary, kBinary, kOpaque, kOpaque, kBinary },
+ kBinary, kBinary, kBinary, kBinary, kBinary, kBinary },
{ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 },
0,
{ kKeep, kRestorePrev, kRestorePrev, kRestorePrev, kRestorePrev,
@@ -115,7 +115,7 @@
{ kKeep, kKeep, kRestorePrev, kKeep } },
{ "randPixelsAnim.gif", 13,
// required frames
- { SkCodec::kNone, 1, 2, 3, 4, 3, 6, 7, 7, 7, 9, 9 },
+ { 0, 1, 2, 3, 4, 3, 6, 7, 7, 7, 9, 9 },
{ kBinary, kBinary, kBinary, kBinary, kBinary, kBinary,
kBinary, kBinary, kBinary, kBinary, kBinary, kBinary },
// durations