what-the-bank/sources/o/C16327nWu.java

68 lines
2.1 KiB
Java

package o;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.util.concurrent.locks.Lock;
/* renamed from: o.nWu, reason: case insensitive filesystem */
/* loaded from: classes.dex */
final class C16327nWu {
private static final sqY d = new rWO() { // from class: o.nWu.5
@Override // o.rWO, o.sqY
public final void EP_(Bitmap bitmap) {
}
};
/* JADX INFO: Access modifiers changed from: package-private */
public static Ezi<Bitmap> EN_(sqY sqy, Drawable drawable, int i, int i2) {
Bitmap bitmap;
Drawable current = drawable.getCurrent();
boolean z = false;
if (current instanceof BitmapDrawable) {
bitmap = ((BitmapDrawable) current).getBitmap();
} else if (current instanceof Animatable) {
bitmap = null;
} else {
bitmap = EO_(sqy, current, i, i2);
z = true;
}
if (!z) {
sqy = d;
}
if (bitmap == null) {
return null;
}
return new EQc(bitmap, sqy);
}
private static Bitmap EO_(sqY sqy, Drawable drawable, int i, int i2) {
if (i == Integer.MIN_VALUE && drawable.getIntrinsicWidth() <= 0) {
return null;
}
if (i2 == Integer.MIN_VALUE && drawable.getIntrinsicHeight() <= 0) {
return null;
}
if (drawable.getIntrinsicWidth() > 0) {
i = drawable.getIntrinsicWidth();
}
if (drawable.getIntrinsicHeight() > 0) {
i2 = drawable.getIntrinsicHeight();
}
Lock d2 = JUv.d();
d2.lock();
Bitmap Ea_ = sqy.Ea_(i, i2, Bitmap.Config.ARGB_8888);
try {
Canvas canvas = new Canvas(Ea_);
drawable.setBounds(0, 0, i, i2);
drawable.draw(canvas);
canvas.setBitmap(null);
return Ea_;
} finally {
d2.unlock();
}
}
}