Merge "Fix null deref & update compress" into udc-dev am: 900174ef17

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21477341

Change-Id: I88b741e7e7653f9784bfc8c9ec9fc151325b8bec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-02-22 08:01:31 +00:00
committed by Automerger Merge Worker
5 changed files with 2 additions and 2 deletions

View File

@@ -96,8 +96,8 @@ public final class Gainmap implements Parcelable {
throw new RuntimeException("internal error: native gainmap is 0");
}
mGainmapContents = gainmapContents;
mNativePtr = nativeGainmap;
setGainmapContents(gainmapContents);
NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, nativeGainmap);
}

View File

@@ -464,7 +464,7 @@ bool Bitmap::compress(JavaCompressFormat format, int32_t quality, SkWStream* str
SkBitmap baseBitmap = getSkBitmap();
SkBitmap gainmapBitmap = gainmap()->bitmap->getSkBitmap();
SkJpegEncoder::Options options{.fQuality = quality};
return SkJpegGainmapEncoder::EncodeJpegR(stream, baseBitmap.pixmap(), options,
return SkJpegGainmapEncoder::EncodeHDRGM(stream, baseBitmap.pixmap(), options,
gainmapBitmap.pixmap(), options, gainmap()->info);
}
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB