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
parent 7edd4cdb0d
commit 6d790d3506
2 changed files with 4 additions and 1 deletions

View File

@ -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) {

View File

@ -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,