Changeset 222836 in webkit
- Timestamp:
- Oct 4, 2017 2:09:00 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r222835 r222836 1 2017-10-04 Miguel Gomez <magomez@igalia.com> 2 3 [GTK][WPE] Fix playback of GIFs 4 https://bugs.webkit.org/show_bug.cgi?id=176089 5 6 Reviewed by Carlos Garcia Campos. 7 8 Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't 9 need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is 10 called, and the we don't need the lock to avoid crashes in that situation. 11 12 Covered by existent tests. 13 14 * platform/image-decoders/gif/GIFImageDecoder.cpp: 15 (WebCore::GIFImageDecoder::clearFrameBufferCache): 16 (WebCore::GIFImageDecoder::decode): 17 * platform/image-decoders/gif/GIFImageDecoder.h: 18 * platform/image-decoders/gif/GIFImageReader.cpp: 19 (GIFImageReader::decode): 20 1 21 2017-10-04 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 22 -
trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
r222196 r222836 126 126 return; // Nothing to do. 127 127 128 // Lock the decodelock here, as we are going to destroy the GIFImageReader and doing so while129 // there's an ongoing decode will cause a crash.130 LockHolder locker(m_decodeLock);131 132 128 // The "-1" here is tricky. It does not mean that |clearBeforeFrame| is the 133 129 // last frame we wish to preserve, but rather that we never want to clear … … 171 167 j->clear(); 172 168 } 173 174 // When some frames are cleared, the reader is out of sync, since the caller might ask for any frame not175 // necessarily in the order expected by the reader. See https://bugs.webkit.org/show_bug.cgi?id=159089.176 m_reader = nullptr;177 169 } 178 170 … … 303 295 return; 304 296 305 LockHolder locker(m_decodeLock);306 297 if (!m_reader) { 307 298 m_reader = std::make_unique<GIFImageReader>(this); -
trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
r222151 r222836 81 81 mutable RepetitionCount m_repetitionCount { RepetitionCountOnce }; 82 82 std::unique_ptr<GIFImageReader> m_reader; 83 Lock m_decodeLock;84 83 }; 85 84 -
trunk/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
r206481 r222836 364 364 return true; 365 365 366 // Already decoded frames can be deleted from the cache and then they require to be decoded again, so 367 // the haltAtFrame value we receive here may be lower than m_currentDecodingFrame. In this case 368 // we position m_currentDecodingFrame to haltAtFrame and decode from there. 369 // See bug https://bugs.webkit.org/show_bug.cgi?id=176089. 370 m_currentDecodingFrame = std::min(m_currentDecodingFrame, static_cast<size_t>(haltAtFrame)); 371 366 372 while (m_currentDecodingFrame < std::min(m_frames.size(), static_cast<size_t>(haltAtFrame))) { 367 373 bool frameDecoded = false;
Note: See TracChangeset
for help on using the changeset viewer.