OSDN Git Service

don't use animated gifs if gifs only have one frame
authorCary Clark <cary@android.com>
Thu, 13 May 2010 19:31:02 +0000 (15:31 -0400)
committerCary Clark <cary@android.com>
Thu, 13 May 2010 19:31:02 +0000 (15:31 -0400)
commit2e483c130bc3db530caa4b7c4f25b9232464d592
treee53dece6081a5bb8379407c6fe6ad47f1284d795
parent901afcec28e282052ffa6542c21b025cead9b4c0
don't use animated gifs if gifs only have one frame

Gifs use a different decoding mechanism from other images. The
default webkit implementation allocates a bitmap for the gif,
which is serialized when the picture is flattened. A page with
a 25K display list may flatten into a 20M file if GIFs are
included as bitmaps.

GIFs can be written like other image types, as streams; then
the display list flattens to a 140K file. Currently, the
Skia-based images only can handle non-animated types.

When animated gifs was recently enabled, the flattened file
size grew. All gifs were treated as if they could be animated,
and all were decoded into bitmaps with straight memory allocations.

This change uses the stream-allocation mechanism if the GIF
has only one frame, and is therefore not animating.

Change-Id: Ie2360bb6f20515b81bd62761ca97242f33ffb43b
http://b/2650945
WebCore/platform/graphics/android/ImageSourceAndroid.cpp