Decoder only returns true on complete success.
Recently we added a way for SkImageDecoder::decode to distinguish between successfully decoding the entire image and only partially decoding the image (see https://codereview.chromium.org/647023006). Only consider a call to decode() a success if the image was completely decoded. This matches pre-L behavior, and lets the caller know that they need to try to decode again. Requires a change to external/skia (I33e6940e247b74b20361ae041f8d36eb600df49f) BUG:17419670 Change-Id: I17ed7288b2359fafaec9551adb16d1d037800eb7
This commit is contained in:
committed by
Leon Scroggins
parent
f23b29ad5a
commit
14494262d3
@@ -315,7 +315,8 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
|
||||
}
|
||||
|
||||
SkBitmap decodingBitmap;
|
||||
if (!decoder->decode(stream, &decodingBitmap, prefColorType, decodeMode)) {
|
||||
if (decoder->decode(stream, &decodingBitmap, prefColorType, decodeMode)
|
||||
!= SkImageDecoder::kSuccess) {
|
||||
return nullObjectReturn("decoder->decode returned false");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user