Follow Firefox & Chrome GIF behavior
If a GIF animation has a duration <= 10ms then bump it to
100ms. This isn't correct behavior, but it's one that browsers
have been doing for so long that gifs are now authored to rely
on this behavior
Fixes: 192511662
Test: app in bug
Change-Id: Ia07f12aa15595193ed9e56910929dc6da9754128
diff --git a/libs/hwui/jni/AnimatedImageDrawable.cpp b/libs/hwui/jni/AnimatedImageDrawable.cpp
index 373e893..a7f5aa83 100644
--- a/libs/hwui/jni/AnimatedImageDrawable.cpp
+++ b/libs/hwui/jni/AnimatedImageDrawable.cpp
@@ -97,7 +97,7 @@
bytesUsed += picture->approximateBytesUsed();
}
-
+ SkEncodedImageFormat format = imageDecoder->mCodec->getEncodedFormat();
sk_sp<SkAnimatedImage> animatedImg = SkAnimatedImage::Make(std::move(imageDecoder->mCodec),
info, subset,
std::move(picture));
@@ -108,8 +108,8 @@
bytesUsed += sizeof(animatedImg.get());
- sk_sp<AnimatedImageDrawable> drawable(new AnimatedImageDrawable(std::move(animatedImg),
- bytesUsed));
+ sk_sp<AnimatedImageDrawable> drawable(
+ new AnimatedImageDrawable(std::move(animatedImg), bytesUsed, format));
return reinterpret_cast<jlong>(drawable.release());
}