Merge "Remove bitmap::getBitmapAllocationByteCount"

This commit is contained in:
TreeHugger Robot
2019-03-27 19:03:27 +00:00
committed by Android (Google) Code Review
5 changed files with 12 additions and 15 deletions

View File

@@ -436,9 +436,15 @@ public class BitmapFactory {
static void validate(Options opts) {
if (opts == null) return;
if (opts.inBitmap != null && opts.inBitmap.getConfig() == Bitmap.Config.HARDWARE) {
throw new IllegalArgumentException(
"Bitmaps with Config.HARDWARE are always immutable");
if (opts.inBitmap != null) {
if (opts.inBitmap.getConfig() == Bitmap.Config.HARDWARE) {
throw new IllegalArgumentException(
"Bitmaps with Config.HARDWARE are always immutable");
}
if (opts.inBitmap.isRecycled()) {
throw new IllegalArgumentException(
"Cannot reuse a recycled Bitmap");
}
}
if (opts.inMutable && opts.inPreferredConfig == Bitmap.Config.HARDWARE) {