Return cropBitmap

cropBitmap returns 'true' on success and 'false' on failure.
Propagate its return value so that cascading failures can be avoided.

Signed-off-by: Mykola Kondratenko <mykola.kondratenko@sonymobile.com>

BUG=skia:

Review URL: https://codereview.chromium.org/1088093003
This commit is contained in:
zoran.jovanovic 2015-04-15 05:48:54 -07:00 committed by Commit bot
parent ad802c66c9
commit 7f00acbda6
3 changed files with 10 additions and 10 deletions

View File

@ -31,6 +31,7 @@ Samsung <*@samsung.com>
Samsung Open Source Group <*@osg.samsung.com>
Skia <*@skia.org>
Skia Buildbots <skia.buildbots@gmail.com>
Sony Mobile Communications Inc. <*@sonymobile.com>
Steve Singer <steve@ssinger.info>
The Chromium Authors <*@chromium.org>
Thiago Fransosi Farina <thiago.farina@gmail.com>

View File

@ -1125,11 +1125,11 @@ bool SkJPEGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
if (swapOnly) {
bm->swap(bitmap);
} else {
cropBitmap(bm, &bitmap, actualSampleSize, region.x(), region.y(),
region.width(), region.height(), startX, startY);
return true;
}
return true;
return cropBitmap(bm, &bitmap, actualSampleSize, region.x(), region.y(),
region.width(), region.height(), startX, startY);
}
#endif
@ -1184,11 +1184,10 @@ bool SkJPEGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
}
if (swapOnly) {
bm->swap(bitmap);
} else {
cropBitmap(bm, &bitmap, actualSampleSize, region.x(), region.y(),
region.width(), region.height(), startX, startY);
return true;
}
return true;
return cropBitmap(bm, &bitmap, actualSampleSize, region.x(), region.y(),
region.width(), region.height(), startX, startY);
}
#endif

View File

@ -395,8 +395,8 @@ bool SkWEBPImageDecoder::onDecodeSubset(SkBitmap* decodedBitmap,
}
if (!directDecode) {
cropBitmap(decodedBitmap, bitmap, sampleSize, region.x(), region.y(),
region.width(), region.height(), rect.x(), rect.y());
return cropBitmap(decodedBitmap, bitmap, sampleSize, region.x(), region.y(),
region.width(), region.height(), rect.x(), rect.y());
}
return true;
}