am 4ba4caed
: Merge "Fix SkBitmap::fPixels not being locked correctly"
* commit '4ba4caede125ff602b0d93f577f9054a07791ff7': Fix SkBitmap::fPixels not being locked correctly
This commit is contained in:
committed by
Android Git Automerger
commit
14c0c989d2
@ -298,8 +298,18 @@ static bool Bitmap_compress(JNIEnv* env, jobject clazz, SkBitmap* bitmap,
|
||||
}
|
||||
|
||||
bool success = false;
|
||||
if (NULL != bitmap) {
|
||||
SkAutoLockPixels alp(*bitmap);
|
||||
|
||||
if (NULL == bitmap->getPixels()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkWStream* strm = CreateJavaOutputStreamAdaptor(env, jstream, jstorage);
|
||||
if (NULL != strm) {
|
||||
if (NULL == strm) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkImageEncoder* encoder = SkImageEncoder::Create(fm);
|
||||
if (NULL != encoder) {
|
||||
success = encoder->encodeStream(strm, *bitmap, quality);
|
||||
|
Reference in New Issue
Block a user