aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CodecAnimTest.cpp
diff options
context:
space:
mode:
authorGravatar Chris Blume <cblume@google.com>2017-09-27 13:23:41 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-27 21:03:41 +0000
commit0b5e7d16c20f4c5b75377f6722fc1bb57e63e9f3 (patch)
treefd01f46315a9f1c8e6e89e5fc4bf137f096a8946 /tests/CodecAnimTest.cpp
parente56774602c115567d9a330c5918b7dcac9a10ae1 (diff)
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>
Diffstat (limited to 'tests/CodecAnimTest.cpp')
-rw-r--r--tests/CodecAnimTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/CodecAnimTest.cpp b/tests/CodecAnimTest.cpp
index d28da08660..e354ea6cbf 100644
--- a/tests/CodecAnimTest.cpp
+++ b/tests/CodecAnimTest.cpp
@@ -88,16 +88,16 @@ DEF_TEST(Codec_frames, r) {
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 @@ DEF_TEST(Codec_frames, r) {
{ 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