REGRESSION(r215211): [GTK] Lots of image related tests are timing out, causing the...
authormagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 13:19:21 +0000 (13:19 +0000)
committermagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Apr 2017 13:19:21 +0000 (13:19 +0000)
commit8cc86617208a63c9f4542974e2eee10250411b51
treeac3a366dcb548de5f0b55c115c4210130bad0331
parent4ffc2943c180d6befb324b774aabf44f517447e8
REGRESSION(r215211): [GTK] Lots of image related tests are timing out, causing the test bot to exit early
https://bugs.webkit.org/show_bug.cgi?id=170727

Reviewed by Carlos Garcia Campos.

Since r215211 ImageDecoder::isSizeAvailable() calls encodedDataStatus() in the different decoder implementations,
and those implementations force a partial decoding of the image if the size is not available yet. But
ImageDecoder::isSizeAvailable() was already being used inside the decoders assuming that it wasn't going to
force this partial decoding. Due to this, there are some situations where the partial decoding is not
desired but it's happening anyway. For example, the check in setSize(), which causes the partial decoding
to happen again and again because no value is actually set to the animation size (which causes the timouts
in the test bot).

To avoid this, replace all the calls to ImageDecoder::isSizeAvailable() inside the decoders with calls to
ImageDecoder::encodedDataStatus(), which doesn't force the partial decoding.

Covered by existent tests.

* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::setSize):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::decodeAtIndex):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::decode):
(WebCore::PNGImageDecoder::frameBufferAtIndex):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp