Changeset 214939 in webkit


Ignore:
Timestamp:
Apr 5, 2017 3:09:11 AM (7 years ago)
Author:
magomez@igalia.com
Message:

[GTK+] PNG animations that should run once are not played at all
https://bugs.webkit.org/show_bug.cgi?id=170499

Reviewed by Carlos Garcia Campos.

The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
means 0 for the animations that need to be played once. Change it to return an appropriate value.

Covered by existent tests.

  • platform/image-decoders/png/PNGImageDecoder.cpp:

(WebCore::PNGImageDecoder::repetitionCount):

  • platform/image-decoders/png/PNGImageDecoder.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r214937 r214939  
     12017-04-05  Miguel Gomez  <magomez@igalia.com>
     2
     3        [GTK+] PNG animations that should run once are not played at all
     4        https://bugs.webkit.org/show_bug.cgi?id=170499
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
     9        means 0 for the animations that need to be played once. Change it to return an appropriate value.
     10
     11        Covered by existent tests.
     12
     13        * platform/image-decoders/png/PNGImageDecoder.cpp:
     14        (WebCore::PNGImageDecoder::repetitionCount):
     15        * platform/image-decoders/png/PNGImageDecoder.h:
     16
    1172017-04-05  Andy Estes  <aestes@apple.com>
    218
  • trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp

    r206481 r214939  
    228228}
    229229
     230#if ENABLE(APNG)
     231RepetitionCount PNGImageDecoder::repetitionCount() const
     232{
     233    // APNG format uses 0 to indicate that an animation must play indefinitely. But
     234    // the RepetitionCount enumeration uses RepetitionCountInfinite, so we need to adapt this.
     235    if (!m_playCount)
     236        return RepetitionCountInfinite;
     237
     238    return m_playCount;
     239}
     240#endif
     241
    230242bool PNGImageDecoder::isSizeAvailable()
    231243{
  • trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h

    r206481 r214939  
    4545#if ENABLE(APNG)
    4646        size_t frameCount() const override { return m_frameCount; }
    47         RepetitionCount repetitionCount() const override { return m_playCount-1; }
     47        RepetitionCount repetitionCount() const override;
    4848#endif
    4949        bool isSizeAvailable() override;
Note: See TracChangeset for help on using the changeset viewer.