Changeset 240215 in webkit


Ignore:
Timestamp:
Jan 20, 2019 12:37:30 PM (5 years ago)
Author:
Michael Catanzaro
Message:

Unreviewed, rolling out r238275.

Regressed css3/shapes/shape-outside/shape-image/shape-
image-025.html

Reverted changeset:

"ScalableImageDecoder: don't forcefully decode image data when
querying frame completeness, duration"
https://bugs.webkit.org/show_bug.cgi?id=191354
https://trac.webkit.org/changeset/238275

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r240213 r240215  
     12019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Unreviewed, rolling out r238275.
     4
     5        Regressed css3/shapes/shape-outside/shape-image/shape-
     6        image-025.html
     7
     8        Reverted changeset:
     9
     10        "ScalableImageDecoder: don't forcefully decode image data when
     11        querying frame completeness, duration"
     12        https://bugs.webkit.org/show_bug.cgi?id=191354
     13        https://trac.webkit.org/changeset/238275
     14
    1152019-01-19  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp

    r239549 r240215  
    173173{
    174174    LockHolder lockHolder(m_mutex);
    175     if (index >= m_frameBufferCache.size())
    176         return false;
    177 
    178     auto& frame = m_frameBufferCache[index];
    179     return frame.isComplete();
     175    // FIXME(176089): asking whether enough data has been appended for a decode
     176    // operation to succeed should not require decoding the entire frame.
     177    // This function should be implementable in a way that allows const.
     178    auto* buffer = const_cast<ScalableImageDecoder*>(this)->frameBufferAtIndex(index);
     179    return buffer && buffer->isComplete();
    180180}
    181181
     
    185185    if (m_frameBufferCache.size() <= index)
    186186        return true;
    187 
    188     auto& frame = m_frameBufferCache[index];
    189     if (!frame.isComplete())
    190         return true;
    191     return frame.hasAlpha();
     187    if (m_frameBufferCache[index].isComplete())
     188        return m_frameBufferCache[index].hasAlpha();
     189    return true;
    192190}
    193191
     
    204202{
    205203    LockHolder lockHolder(m_mutex);
    206     if (index >= m_frameBufferCache.size())
     204    // FIXME(176089): asking for the duration of a sub-image should not require decoding
     205    // the entire frame. This function should be implementable in a way that
     206    // allows const.
     207    auto* buffer = const_cast<ScalableImageDecoder*>(this)->frameBufferAtIndex(index);
     208    if (!buffer || buffer->isInvalid())
    207209        return 0_s;
    208 
    209     auto& frame = m_frameBufferCache[index];
    210     if (!frame.isComplete())
    211         return 0_s;
    212 
     210   
    213211    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
    214212    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
    215213    // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082>
    216214    // for more information.
    217     auto duration = frame.duration();
    218     if (duration < 11_ms)
     215    if (buffer->duration() < 11_ms)
    219216        return 100_ms;
    220     return duration;
     217    return buffer->duration();
    221218}
    222219
Note: See TracChangeset for help on using the changeset viewer.