Bug 1079653 (Part 2) - Remove DecodeRequest::mBytesToDecode. r=tn

--HG--
extra : rebase_source : 44b8aa4989b504e10854534cb26a2a2567676fa9
This commit is contained in:
Seth Fowler 2014-10-15 13:52:21 -07:00
parent 2185fdbc28
commit 33df9f9433
2 changed files with 5 additions and 10 deletions

View File

@ -3206,11 +3206,6 @@ RasterImage::DecodePool::RequestDecode(RasterImage* aImg)
// If we're currently waiting on a new frame for this image, we can't do any
// decoding.
if (!aImg->mDecoder->NeedsNewFrame()) {
// No matter whether this is currently being decoded, we need to update the
// number of bytes we want it to decode.
aImg->mDecodeRequest->mBytesToDecode =
aImg->mSourceData.Length() - aImg->mDecoder->BytesDecoded();
if (aImg->mDecodeRequest->mRequestStatus == DecodeRequest::REQUEST_PENDING ||
aImg->mDecodeRequest->mRequestStatus == DecodeRequest::REQUEST_ACTIVE) {
// The image is already in our list of images to decode, or currently being
@ -3311,7 +3306,10 @@ RasterImage::DecodePool::DecodeJob::Run()
type = DECODE_TYPE_UNTIL_TIME;
}
DecodePool::Singleton()->DecodeSomeOfImage(mImage, DECODE_ASYNC, type, mRequest->mBytesToDecode);
size_t maxBytes = mImage->mSourceData.Length() -
mImage->mDecoder->BytesDecoded();
DecodePool::Singleton()->DecodeSomeOfImage(mImage, DECODE_ASYNC,
type, maxBytes);
size_t bytesDecoded = mImage->mDecoder->BytesDecoded() - oldByteCount;
@ -3328,7 +3326,7 @@ RasterImage::DecodePool::DecodeJob::Run()
!mImage->mError &&
!mImage->mPendingError &&
!mImage->IsDecodeFinished() &&
bytesDecoded < mRequest->mBytesToDecode &&
bytesDecoded < maxBytes &&
bytesDecoded > 0) {
DecodePool::Singleton()->RequestDecode(mImage);
} else {

View File

@ -329,7 +329,6 @@ private:
{
explicit DecodeRequest(RasterImage* aImage)
: mImage(aImage)
, mBytesToDecode(0)
, mRequestStatus(REQUEST_INACTIVE)
, mAllocatedNewFrame(false)
{
@ -347,8 +346,6 @@ private:
RasterImage* mImage;
size_t mBytesToDecode;
enum DecodeRequestStatus
{
REQUEST_INACTIVE,