[GTK][WPE] Fix playback of GIFs
authormagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Oct 2017 09:09:00 +0000 (09:09 +0000)
committermagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Oct 2017 09:09:00 +0000 (09:09 +0000)
commit1bc5ff848152bbb7742cba889334c6e85b606553
treeab133b872d9ed8cbb19e325344314b28616f26e5
parentc78ea6b40f67cdad3deecad1257c0234961d8ff3
[GTK][WPE] Fix playback of GIFs
https://bugs.webkit.org/show_bug.cgi?id=176089

Reviewed by Carlos Garcia Campos.

Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't
need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is
called, and the we don't need the lock to avoid crashes in that situation.

Covered by existent tests.

* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::clearFrameBufferCache):
(WebCore::GIFImageDecoder::decode):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
(GIFImageReader::decode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp