Merge "Null out gainmaps on inBitmap re-use" into udc-dev am: 03aa365559
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22516202 Change-Id: I82db2faa108ab538394852e6d7ab2e8da3fa5a08 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1921,6 +1921,7 @@ public final class Bitmap implements Parcelable {
|
||||
*/
|
||||
public void setGainmap(@Nullable Gainmap gainmap) {
|
||||
checkRecycled("Bitmap is recycled");
|
||||
mGainmap = null;
|
||||
nativeSetGainmap(mNativePtr, gainmap == null ? 0 : gainmap.mNativePtr);
|
||||
}
|
||||
|
||||
|
||||
@@ -482,7 +482,9 @@ public class BitmapFactory {
|
||||
if (opts == null || opts.inBitmap == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Clear out the gainmap since we don't attempt to reuse it and don't want to
|
||||
// accidentally keep it on the re-used bitmap
|
||||
opts.inBitmap.setGainmap(null);
|
||||
return opts.inBitmap.getNativeInstance();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user