Bug 170591

Summary: [GTK] Animations not played properly when using synchronous decoding
Product: WebKit Reporter: Miguel Gomez <magomez>
Component: WebKitGTKAssignee: Miguel Gomez <magomez>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cgarcia, commit-queue, mcatanzaro, sabouhallawa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=170333
Attachments:
Description Flags
Patch none

Description Miguel Gomez 2017-04-07 02:17:36 PDT
For PNG and GIF images, async decoding is used if the file size is bigger than a threshold, otherwise sync decoding is used.

Bug 170333, which happens because async decoding stopped being used, revealed that sync decoding is not working properly.
Comment 1 Miguel Gomez 2017-04-07 02:27:43 PDT
There seems to be an error in ImageFrameCache::destroyDecodedData(). Theoretically this should destroy all the decoded frames except one we want to keep, but what it's actually doing is destroying all the odd ones (including the one we want to keep if it's odd).
Comment 2 Miguel Gomez 2017-04-07 02:36:44 PDT
Created attachment 306481 [details]
Patch
Comment 3 Carlos Garcia Campos 2017-04-07 02:38:18 PDT
Comment on attachment 306481 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306481&action=review

> Source/WebCore/platform/graphics/ImageFrameCache.cpp:101
> -        decodedSize += m_frames[index++].clearImage();
> +        decodedSize += m_frames[index].clearImage();

oh! good catch!
Comment 4 WebKit Commit Bot 2017-04-07 05:52:30 PDT
Comment on attachment 306481 [details]
Patch

Clearing flags on attachment: 306481

Committed r215091: <http://trac.webkit.org/changeset/215091>
Comment 5 WebKit Commit Bot 2017-04-07 05:52:31 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Said Abou-Hallawa 2017-04-13 17:32:24 PDT
<rdar://problem/31617277>