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:
parent
ad802c66c9
commit
7f00acbda6
1
AUTHORS
1
AUTHORS
@ -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>
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user