mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1079653 (Part 2) - Remove DecodeRequest::mBytesToDecode. r=tn
--HG-- extra : rebase_source : 44b8aa4989b504e10854534cb26a2a2567676fa9
This commit is contained in:
parent
754c9d71fd
commit
bac58c196d
@ -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 {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user