package sh;

import android.content.Context;
import android.graphics.drawable.Drawable;
import java.security.MessageDigest;

/* loaded from: classes4.dex */
public class o implements jh.l {

    /* renamed from: b, reason: collision with root package name */
    private final jh.l f35748b;

    /* renamed from: c, reason: collision with root package name */
    private final boolean f35749c;

    public o(jh.l lVar, boolean z10) {
        this.f35748b = lVar;
        this.f35749c = z10;
    }

    private lh.v d(Context context, lh.v vVar) {
        return u.f(context.getResources(), vVar);
    }

    @Override // jh.f
    public void a(MessageDigest messageDigest) {
        this.f35748b.a(messageDigest);
    }

    @Override // jh.l
    public lh.v b(Context context, lh.v vVar, int i10, int i11) {
        mh.d f10 = com.bumptech.glide.b.c(context).f();
        Drawable drawable = (Drawable) vVar.get();
        lh.v a10 = n.a(f10, drawable, i10, i11);
        if (a10 != null) {
            lh.v b10 = this.f35748b.b(context, a10, i10, i11);
            if (!b10.equals(a10)) {
                return d(context, b10);
            }
            b10.c();
            return vVar;
        }
        if (!this.f35749c) {
            return vVar;
        }
        throw new IllegalArgumentException("Unable to convert " + drawable + " to a Bitmap");
    }

    public jh.l c() {
        return this;
    }

    @Override // jh.f
    public boolean equals(Object obj) {
        if (obj instanceof o) {
            return this.f35748b.equals(((o) obj).f35748b);
        }
        return false;
    }

    @Override // jh.f
    public int hashCode() {
        return this.f35748b.hashCode();
    }
}
