Bug 1287691 (Part 2) - Yield after each frame in the GIF decoder. r=edwin

This commit is contained in:
Seth Fowler 2016-07-18 23:48:11 -07:00
Родитель 966d0547b7
Коммит 014dc44721
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -475,6 +475,8 @@ nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator, IResumable* aOnResume)
return FinishedGlobalColorTable();
case State::BLOCK_HEADER:
return ReadBlockHeader(aData);
case State::BLOCK_HEADER_AFTER_YIELD:
return Transition::To(State::BLOCK_HEADER, BLOCK_HEADER_LEN);
case State::EXTENSION_HEADER:
return ReadExtensionHeader(aData);
case State::GRAPHIC_CONTROL_EXTENSION:
@ -975,7 +977,7 @@ nsGIFDecoder2::ReadImageDataSubBlock(const char* aData)
if (subBlockLength == 0) {
// We hit the block terminator.
EndImageFrame();
return Transition::To(State::BLOCK_HEADER, BLOCK_HEADER_LEN);
return Transition::ToAfterYield(State::BLOCK_HEADER_AFTER_YIELD);
}
if (mGIFStruct.pixels_remaining == 0) {

Просмотреть файл

@ -80,6 +80,7 @@ private:
GLOBAL_COLOR_TABLE,
FINISHED_GLOBAL_COLOR_TABLE,
BLOCK_HEADER,
BLOCK_HEADER_AFTER_YIELD,
EXTENSION_HEADER,
GRAPHIC_CONTROL_EXTENSION,
APPLICATION_IDENTIFIER,