Gif: zero filling should use memset instead of setRGBA for every pixel
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jul 2013 13:54:45 +0000 (13:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jul 2013 13:54:45 +0000 (13:54 +0000)
commit7cc3b637a480d37463d0d23aec2dc58643600ab9
treeda5d4bd4d4438dce991c2a4671d285621e45b8b8
parentd671b0eb3e3f1182356ce7bda1857fdb16b60418
Gif: zero filling should use memset instead of setRGBA for every pixel
https://bugs.webkit.org/show_bug.cgi?id=118350

Patch by Balazs Kelemen <b.kelemen@samsung.com> on 2013-07-03
Reviewed by Allan Sandfeld Jensen.

No new tests. Actually it is not covered by existing tests. Surprisingly we haven't got pixel
tests for animated images. Given that this patch is pretty trivial I don't think it's worth the
cost to start introducing such tests.
I added a manual test: animated-gif-dispose-background.html.

GIFImageDecoder::initializeFrameBuffer use a loop to fill a subrect with tranparent pixels.
This is extremely ineffecient. The use case for this code path is not frequent on the web
but it's still better to fix it.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageFrame::zeroFillFrameRect):
* platform/image-decoders/ImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::initFrameBuffer):
Fixed indentation in addition.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ManualTests/animated-gif-dispose-background.html [new file with mode: 0644]
ManualTests/resources/dispose-background.gif [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/image-decoders/ImageDecoder.cpp
Source/WebCore/platform/image-decoders/ImageDecoder.h
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp